Mail archive
alpine-user

Re: [alpine-user] Squashfs root filesystem

From: Paul Zillmann <p.zillmann_at_h6g.de>
Date: Fri, 7 Jun 2019 16:27:58 +0200

Hello Lars-Erik,

Am 07.06.19 um 12:40 schrieb Lars-Erik Helander:
> Is it possible to configure boot to run alpine using a read-only mounted squashfs file?

Yes it is, supposing the Kernel and initramfs are not part of the
squashfs file.
Take a look at [1] if the Kernel arguments work for you.

Otherwise you can modify the init script here:
     - mount the fs where the squashfs lies
     - mount the squashfs
     - mount a tmpfs
     - mount an overlayfs as the new root, lower dir would be squashfs,
upper dir is the tmpfs
The scipt is located at /usr/share/mkinitfs/initramfs-init
Important parts at this section is "nlplug-findfs" and "exec
/bin/busybox switch_root" to exit the initramfs into the bootet system.
(You can replace the code in lines 479-490 as present in the linked
repository)

Don't forget do add the squashfs and overlayfs Kernel modules into the
initramfs, then regenerate the initramfs.

You should also take a look into the Alpine Netboot which uses modloop
instead of squashfs.

1: https://git.alpinelinux.org/mkinitfs/tree/initramfs-init.in#n455

- Paul

>
> The mkinit code seems to include some squashfs support, but I can not figure if that could be used for my purpose.
>
> /Lars
>
> Skickat från min iPhone
>
>
> ---
> Unsubscribe: alpine-user+unsubscribe_at_lists.alpinelinux.org
> Help: alpine-user+help_at_lists.alpinelinux.org
> ---
>


---
Unsubscribe:  alpine-user+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-user+help_at_lists.alpinelinux.org
---
Received on Fri Jun 07 2019 - 16:27:58 UTC