What is "modloop" option in Alpine?

I'm trying to understand what is the difference of making Alpine installation medium as read-only type (LiveCD) and as a standard disk mode (where the OS state can be saved). I've seen the modloop option when the author of this article () configured loader entries for UEFI boot mode:

Contents of loader/entries/alpine.conf
title Alpine Linux
linux /boot/vmlinuz-hardened
initrd /boot/initramfs-hardened
options modloop=/boot/modloop-hardened modules=loop,squashfs,sd-mod,usb-storage quiet

And the question is how options listed in this stanza modloop=/boot/modloop-hardened modules=loop,squashfs,sd-mod are related to each other and what do they mean?

2

1 Answer

The modloop= option specifies a SquashFS filesystem that gets mounted to /.modloop by the init file /etc/init.d/modloop and symlinked from /lib/modules (or possibly union-mounted with the overlay - see the modloop init script for details). It contains the full kernel module tree for the built kernel, not the more limited set included in the initramfs / initrd.

You might find these helpful to explore:

  • unsquashfs -l /boot/modloop-hardened (to explore what will get mounted to /.modloop)
  • gzip -dc /boot/initramfs-hardened | cpio -it (to explore the initramfs contents)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like