Skip to content

iso: prefer dracut, append splash quiet, take initial snapper snapshot#2

Open
dongioia wants to merge 2 commits into
beryllium-org:mainfrom
dongioia:iso-dracut-plymouth-snapper
Open

iso: prefer dracut, append splash quiet, take initial snapper snapshot#2
dongioia wants to merge 2 commits into
beryllium-org:mainfrom
dongioia:iso-dracut-plymouth-snapper

Conversation

@dongioia
Copy link
Copy Markdown
Contributor

Wires up dracut, Plymouth, and an initial snapper snapshot in the from_iso install flow.

Depends on beryllium-org/Beryllium-ISO#1. The dracut path only fires when the unpacked airootfs has /usr/bin/dracut, so this can land first; ISOs without it fall through to the existing mkinitcpio -P call.

Changes

bakery/iso.py:

  • regenerate_initramfs: if /usr/bin/dracut exists in the target, run dracut --regenerate-all --force and delete the stale initramfs-linux.img left over from the live ISO so GRUB doesn't pick the mkinitcpio image. Otherwise the existing mkinitcpio -P path runs.
  • grub_cfg: new cmdline_append parameter. Reads the current GRUB_CMDLINE_LINUX_DEFAULT, appends the new tokens, dedups so a second run doesn't double up. Used to add splash quiet without clobbering board-specific cmdlines like console=ttyS2,1500000n8 on Rock 5B+.
  • take_initial_snapshot: best-effort. Bails out when snapper isn't installed. Wraps snapper -c root create-config / and the baseline snapper create -d "Initial install" in || true so non-btrfs installs don't error.

bakery/install.py:

  • Calls grub_cfg(cmdline_append="splash quiet", update=False, ...) before grub_install. update=False skips a redundant grub-mkconfig pass since grub_install runs one with the new cmdline anyway.
  • Calls take_initial_snapshot(mnt_dir) after final_setup and before unmount_all, while /.snapshots is still mounted.

Backward compat

  • ISOs without dracut: fall back to mkinitcpio. No change for them.
  • Existing grub_cfg(cmdline=...) callers: unchanged. cmdline still wins over cmdline_append when both are passed.
  • take_initial_snapshot: returns early without snapper. Non-btrfs installs ignored.

Test plan

  • mainline-iso aarch64 once Beryllium-ISO#1 rebuilds: from_iso install on Rock 5B+ btrfs subvol
  • After install: /boot/initramfs-${KVER}.img present, no leftover initramfs-linux.img
  • grep CMDLINE /etc/default/grub shows splash quiet appended after the existing tokens
  • snapper -c root list lists the baseline snapshot
  • First boot: Plymouth splash shows during init, greeter loads
  • Older mkinitcpio-only ISO: install still works the same

…snapper snapshot

The from_iso install flow now runs dracut --regenerate-all on the
target if /usr/bin/dracut is present in the unpacked airootfs and falls
back to mkinitcpio -P otherwise. The stale initramfs-linux.img copied
from the live ISO is removed after dracut runs so GRUB does not pick
the mkinitcpio-built image instead of the dracut output.

grub_cfg() gained a cmdline_append parameter that reads the existing
GRUB_CMDLINE_LINUX_DEFAULT, appends the new tokens, and dedups so
re-running Bakery does not double up. Used right before grub_install
to add splash quiet for Plymouth without losing console=ttyS2 or any
other board-specific cmdline already set in airootfs.

A take_initial_snapshot() helper runs after final_setup. It is a no-op
when snapper is not installed or the root is not btrfs, so non-btrfs
installs and ISOs without snapper in the airootfs are unaffected.
Per bill88t feedback: Beryllium ships dracut-rebuild (one-liner that
calls /usr/share/libalpm/scripts/dracut-install) which handles the
board-specific output naming and grub.d compat that downstream patches
expect. Use it when available, fall back to dracut --regenerate-all
--force on systems without the helper.
@dongioia
Copy link
Copy Markdown
Contributor Author

Thanks. Pushed a follow-up commit (554eee1) that calls dracut-rebuild when present and falls back to dracut --regenerate-all --force otherwise. Two commits on the branch, happy to squash before merge if you prefer.

No rush, ping when you get to it.

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.

1 participant