mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* Re: [ptxdist] building a separate initramfs
       [not found] <CABCGj3apKOraPrH76DLOv7Z_sWxx4ERMRSaxpGi2zB+wxZyfGA@mail.gmail.com>
@ 2025-07-04 15:08 ` Michael Olbrich
  2025-07-18 12:47   ` Sandy Patterson
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2025-07-04 15:08 UTC (permalink / raw)
  To: Sandy Patterson; +Cc: ptxdist

Hi,

On Wed, Jul 02, 2025 at 08:14:40AM -0400, Sandy Patterson wrote:
> I'm having trouble figuring out how to build an initramfs from a second
> userspace set of packages.
> 
> Basically I want to run an encrypted and verified rootfs. I have a solution
> for another board which uses an initramfs that sets up the keys/root hashes
> and does a pivot_root. But in order to get this into ptxdist I had to
> precompile all the binaries for the ramdisk and make a custom rule to build
> it. I was hoping to find how others do this or get some pointers before I
> go and replicate that again.
> 
> Or perhaps ptxdist has another solution already built for encrypting a root
> and maintaining trust?

There is no finished solution right now.

You can use the regular glibc, busybox, etc. packages and combine it with
some custom /init script or binary. Just create a new cpio image with an
explicit 'IMAGE_<NAME>_PKGS = glibc busybox ... myinit'. That's pretty
simple but the resulting initramfs will be pretty big.

Create a musl package and new packages for various components for the
initramfs. Fill the initramfs with that.

What I'm currently working on is rsinit[1]. The idea is to implement the
whole initramfs in a minimal rust binary. But that very much work in
progress. Right now, it has support for a dm-verity rootfs but no
encryption.
My plan is to have a default binary that handles all the common cases. And
for custom stuff, import the create in your own binary and use the building
blocks. But it's not ready for that yet.


In all cases: Packages that should be in the initramfs but not the regular
rootfs should use "EXTRA_PACKAGES-$(PTXCONF_...)" instead of
"PACKAGES-$(PTXCONF_...)".

Regards,
Michael

[1] https://github.com/michaelolbrich/rsinit

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] building a separate initramfs
  2025-07-04 15:08 ` [ptxdist] building a separate initramfs Michael Olbrich
@ 2025-07-18 12:47   ` Sandy Patterson
  0 siblings, 0 replies; 3+ messages in thread
From: Sandy Patterson @ 2025-07-18 12:47 UTC (permalink / raw)
  To: Michael Olbrich; +Cc: ptxdist

Thanks so much Michael, it seems my email filters needed some work!

That got me going. I was able to make a basic rootfs using "glibc
busybox usr-rootfs" which creates a 3.2M uncompressed cpio on our
architecture. I'm not sure how resource constrained you are, but we
have plenty of disk on our system.

I tried to work out how to improve the documentation. However, now
that I understand it I'm not sure how I would. I had trouble
understanding _multi_image_individual_root_filesystems and didn't
initially realize that section 1 describes two rules, an extra
package, and an image modification.

Anyway, thanks again,
Sandy



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ptxdist] building a separate initramfs
@ 2025-07-02 19:59 Sandy Patterson
  0 siblings, 0 replies; 3+ messages in thread
From: Sandy Patterson @ 2025-07-02 19:59 UTC (permalink / raw)
  To: ptxdist

Hi,

I'm having trouble figuring out how to build an initramfs from a
second userspace set of packages.

Basically I want to run an encrypted and verified rootfs. I have a
solution for another board which uses an initramfs that sets up the
keys/root hashes and does a pivot_root. But in order to get this into
ptxdist I had to precompile all the binaries for the ramdisk and make
a custom rule to build it. I was hoping to find how others do this or
get some pointers before I go and replicate that again.

Or perhaps ptxdist has another solution already built for encrypting a
root and maintaining trust?

Best,
Sandy Patterson



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-18 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CABCGj3apKOraPrH76DLOv7Z_sWxx4ERMRSaxpGi2zB+wxZyfGA@mail.gmail.com>
2025-07-04 15:08 ` [ptxdist] building a separate initramfs Michael Olbrich
2025-07-18 12:47   ` Sandy Patterson
2025-07-02 19:59 Sandy Patterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox