Skip to content

I just experimented some simplifications for Debian 12 based RPi OS #11

@LeGuipo

Description

@LeGuipo

Hi all,

Almost two years ago, I followed the procedure to the letter (except the infamous "-keysize" parameter) to successfully encrypt my root partition for my Debian 11 based Raspberry Pi OS installation.

Now that I’ve gained more experience with Linux stuff, I decided to be a little more adventurous during my upgrade to Debian 12 based RPi OS. Note that I’ve selected the standard, not lite, not full, official Raspberry Pi image.

So in the hope to help to streamline the procedure, there are my observations :

  1. Only cryptsetup package is needed to be installed, busybox and initramfs-tools are present by default.
  2. RPi OS seems to implement initramfs auto update already with proper parameters upon kernel updates. So it is not necessary to create the /etc/kernel/postinst.d/initramfs-rebuild script.
  3. /etc/initramfs-tools/hooks/luks_hooks on the other hand, has to be created. BTW I installed the optional cryptsetup-initramfs package, that seems to include cryptsetup and also probably fdisk binaries to the initramfs. However, resize2fs is naturally not included.
  4. /etc/initramfs-tools/modules is completely empty by default and need to be populated as described.
  5. Now the creation of initramfs can be done with the simple command sudo update-initramfs -u. It will include all the needed binaries and modules, and create the images with the appropriate filenames and all other components conforming with the distribution’s configuration. Notably, each installed kernel version will keep a dedicated image, and for the comfort of non-qwerty keyboard users like me, the proper keymap will be set for use during initramfs operations and passphrase input during boot.
  6. The file /boot/firmware/config.txt can be left untouched as it already includes the lineauto_initramfs=1
  7. The rest of the procedure is OK except the final initramfs rebuild that has to be dealt again with the command sudo update-initramfs -u.

Voilà :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions