mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Sandy Patterson <apatterson@sightlogix.com>
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] building a separate initramfs
Date: Fri, 4 Jul 2025 17:08:37 +0200	[thread overview]
Message-ID: <aGfudQA5G0PTlw59@pengutronix.de> (raw)
In-Reply-To: <CABCGj3apKOraPrH76DLOv7Z_sWxx4ERMRSaxpGi2zB+wxZyfGA@mail.gmail.com>

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 |



       reply	other threads:[~2025-07-04 15:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABCGj3apKOraPrH76DLOv7Z_sWxx4ERMRSaxpGi2zB+wxZyfGA@mail.gmail.com>
2025-07-04 15:08 ` Michael Olbrich [this message]
2025-07-02 19:59 Sandy Patterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aGfudQA5G0PTlw59@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=apatterson@sightlogix.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox