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

document & implement initramfs scripts for ubuntu #250

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

Conversation

lmmarsano
Copy link

I wrote these for myself & figured others would find them useful: scripts for initramfs-tools as documented for Ubuntu.
Adapted from the Arch Linux scripts.
Tested on a VM & my workstation (both UEFI-boot enabled).
Though they might work for Debian, I haven't tested that.

@Antynea
Copy link
Owner

Antynea commented Dec 29, 2022

Wow, thank you for sharing it.

Take a closer look to implement it in the Makefile.

Copy link
Author

@lmmarsano lmmarsano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, thank you for sharing it.

Take a closer look to implement it in the Makefile.

@Antynea Will this do?
I try to follow the established pattern.

Have you looked at kernel option systemd.volatile=overlay?
It appears to do the same for any systemd-managed OS.
Maybe I should open an issue for that.

@lmmarsano lmmarsano force-pushed the feature/ubuntu-init branch from 447a903 to 2b9c1d2 Compare January 15, 2023 19:26
Makefile Outdated Show resolved Hide resolved
@Schievel1
Copy link
Collaborator

thanks for that. I hope you are willing to maintain this in the future, because we as Arch and Gentoo Users can not really. Maybe we can get the guys from Kaisen (@kevinchevreuil) interested in this? Although Kaisen is based on Debian, idk if it is similar to how Ubuntu does things.

provide a hook to require overlayfs module so the file system is available
define a general script to overlay any readonly root filesystem into a non-persistent, writable filesystem
kernel parameters normally identify root filesystem as readonly before boot process remounts them writable, so the readonly parameter does not identify readonly filesystems
the script reduces scope to btrfs for simplicity
as a standard linux util, findmnt is copied & used
arrange commands so executables are checked before file system queries and short-circuit evaluation skips unavailable commands
for robustness, trap on error & exit events
replace panic with failure logging, since panic doesn't appear to break to shell
parse options and subcommands in setup script
update readme
introduce feature flag for mkinitramfs in Makefile
extend install & uninstall targets when feature flag is true
document flag in help target
@lmmarsano lmmarsano force-pushed the feature/ubuntu-init branch from 2b9c1d2 to de6ff16 Compare January 23, 2023 01:02
uninstall recipe should proceed for other distros
@lmmarsano lmmarsano force-pushed the feature/ubuntu-init branch from de6ff16 to c3e2c19 Compare January 23, 2023 01:04
@lmmarsano
Copy link
Author

lmmarsano commented Jan 23, 2023

@Schievel1

thanks for that. I hope you are willing to maintain this in the future, because we as Arch and Gentoo Users can not really. Maybe we can get the guys from Kaisen (@kevinchevreuil) interested in this? Although Kaisen is based on Debian, idk if it is similar to how Ubuntu does things.

I'll probably maintain while I use it.
Judging from the contents of their live server iso, kaisen appears to use initramfs-tools much like ubuntu, so this could work for them, too.
I was under the impression this wasn't officially supported by any distro, and users of particular distros would support it on voluntary basis according to their needs.

@Schievel1
Copy link
Collaborator

Looks good to me now. I am going to merge this later.

@kevinchevreuil
Copy link
Contributor

Hello @lmmarsano and @Schievel1!

Yeah, I had started to develop this feature on Kaisen! Great work @lmmarsano 🤩
I tested on Kaisen and it's okay. But problem. When this script is installed, the /, outside of a snapshot is also in overlay.

I added this:
cat /proc/cmdline | grep grub-btrfs-overlay > /dev/null || exit 0
The grub-btrfs-overlay has added by me as cmdline to fix this problem in my package.
Allows users to disable the overlay easily 😄

@kevinchevreuil
Copy link
Contributor

@Schievel1, don't merge this!

@Schievel1
Copy link
Collaborator

Schievel1 commented Mar 21, 2023

@Schievel1, don't merge this!

@kevinchevreuil could you elaborate a bit more please?
I can not really test this as I am not using any debian based distro.

@danboid

This comment was marked as off-topic.

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

Successfully merging this pull request may close these issues.

5 participants