Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writeable /etc #7597

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Writeable /etc #7597

wants to merge 2 commits into from

Conversation

antonlacon
Copy link
Contributor

This makes /etc/ writeable via an overlayfs backed by /storage. I'm using it in testing other things (users/groups), but given the number of symbolic links coming out of /etc to /storage or /var, I'm sharing it.

Labeled WIP because although it's functionally complete, storage-dirs.service should probably be replaced by tempfiles.d usage. Maybe move the systemd files from busybox to systemd's package too. Busybox's package was picked because it has the var.mount file too.

Blocked for discussion.

@antonlacon
Copy link
Contributor Author

Replaced storage-dirs.service with a tmpfiles.d method. I'm not aware of how the numbering/naming of the tmpfiles.d files works, so I picked early, but not first.

@kszaq
Copy link
Contributor

kszaq commented Nov 3, 2024

I am using LibreELEC for non-mediacenter purposes and need a writeable rootfs.

I created /flash/mount-storage.sh script that mounts overlayfs:

mount_part "$disk" "/storage" "rw,noatime"

/sysroot/usr/bin/insmod /sysroot/usr/lib/kernel-overlays/base/lib/modules/$(uname -r)/kernel/fs/overlayfs/overlay.ko

/usr/bin/busybox mkdir -p /dev/rom
mount --move /sysroot /dev/rom

/usr/bin/busybox mkdir -p /storage/.overlay/upper
/usr/bin/busybox mkdir -p /storage/.overlay/work
mount -t overlay overlay -o lowerdir=/dev/rom,upperdir=/storage/.overlay/upper,workdir=/storage/.overlay/work /sysroot

For devices booting from SD card the advantage is that if I mess something up, I can simply take out the SD card and remove this file to not mount overlay on next boot.

@antonlacon
Copy link
Contributor Author

I did something similar in busybox's init: ffc98ee It was turned on/off by adding/removing 'rootoverlay' to the kernel's command line. It's been several years since I used it so no idea if it applies cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants