Skip to content

resize partition, select keyboard layout and create new user on first boot

When flashing a new image on my SD card I faced two problems:

  • I got my reform with the neo2 keyboard layout and I have no idea where the qwerty keys are so logging in as root and changing the keyboard layout is always a painful experience
  • the root partition does not span the full sd card so I have to remember the correct parted and resize2fs commands to do so and I need another PC to do that because this cannot be done while the filesystem is mounted

This MR is a draft that fixes both issues. It does so by building a initramfs which:

  • grows the root partition and the root filesystem before it gets mounted
  • asks for the user's keyboard layout -- this is layout independent as the number keys are used to select it
  • the keyboard layout is stored systemwide as well as in the sway config of the new user
  • creates a new user and adds it to the sudo group

There is also a systemd service which rebuilds the initramfs on first boot and then reboots into the new system. This rebuilding results in an initramfs which doesn't contain the first boot scripts anymore, so on subsequent boots there will be zero delays as the first boot scripts are not part of it anymore. The systemd service also takes care to delete itself. This is why this service should not go into the reform-tools package but should stay in reform-system-image repo.

What do you think? I'm mainly missing the correct contents for /etc/default/keyboard depending on which layout is selected.

Edited by Johannes Schauer Marin Rodrigues

Merge request reports