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

[Request for comment] Support for system-level modifications in the image #22

Open
Samsagax opened this issue Oct 24, 2022 · 0 comments

Comments

@Samsagax
Copy link
Contributor

The problem

Currently the system at its base is set up in frzr-bootstrap with some key system components:

  • Partition scheme
  • Bootloader
  • Core generic /etc/fstab

This comes with a couple problems:

  • Impossible to add persistent swap space (to support hibernation, for example)
  • Impossible to change bootloader (that was an issue with some kernels that made impossible to boot UEFI mode with syslinux on AMD hardware)

Current state

The above issues could be worked around on a new installation by modifying bootstrap but that would mean the user needs to reinstall the whole system to apply those changes. Far from ideal and not a solution.

Proposed change

We should prepare frzr-deploy to pick up system scripts from the just installed image (let's call them "migrations") in a special place to be able to make changes in the low-level system. Those scripts are the image responsibility to be safe across different image (prior or post) versions. The scripts are run as root, must check all conditions for applying changes and should be able to revert changes if they fail not to break an installation. Reverting a image version could be supported but is not mandatory.

Example "migration"

Let's assume we want to add a persistent swap support and hibernation resume via a swap file. The script should check:

  • Swap not present and not configured in /etc/fstab
  • Sufficient disk space.

Then the script can create a swap file and enable it:

  • Create a swap directory and file for a new btrfs subvolume.
  • Create the file with appropriate size with dd and mkswap
  • Add line to /etc/fstab for automatic swap mount
  • For hibernation support:
  • The bootloader line should be recreated adding resume and resume_offset kernel parameters
  • Add resume hook in mkinicpio.conf and rebuild (this can be done in the image itself at creation)
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

No branches or pull requests

1 participant