LukeShortCloud / winesapOS

winesapOS - Game with Linux anywhere, no installation required!
GNU General Public License v3.0
871 stars 31 forks source link

[install][tests] Container builds do not boot #826

Closed LukeShortCloud closed 3 months ago

LukeShortCloud commented 3 months ago

At some point, we added a hack to tests to allow CI to work. Container builds used to work when using genfstab -L (genfstab -t LABEL) but recently that stopped. I also tired genfstab -t PARTUUID and it also does not work. Now, it silently fails to generate a /etc/fstab with labels and reverts back to device names. This leads to unbootable systems as it tries to use a /dev/loop0 device for the root file system.

LukeShortCloud commented 3 months ago

I found the fundamental problem. Recently, genfstab from arch-install-scripts switched to using lsblk for finding labels, UUIDs, etc. lsblk does not work within a container and is well documented. However, similar commands such as blkid work.

Some suggestions were that this was related to udev support. I tried this workaround and it did not help:

sudo docker run --rm -v $(pwd):/workdir -v /dev:/dev -v /run/udev/control:/run/udev/control --net=host --privileged=true winesapos-img-builder:latest /bin/bash -x /workdir/scripts/winesapos-build.sh

https://stackoverflow.com/questions/49687378/how-to-get-hosts-udev-events-from-a-docker-container

LukeShortCloud commented 3 months ago

We have all of the information to manually build the /etc/fstab ourselves. I think that is the best path forward since genfstab will no longer work for container builds.

LukeShortCloud commented 3 months ago

/etc/fstab from a container build of the minimal image (which does NOT have a 5th partition for exFAT cross-platform storage):

/dev/loop5p4            /           btrfs       rw,noatime,nodiratime,compress-force=zstd:1,discard,space_cache=v2,subvolid=5,subvol=/  0 0
/dev/loop5p4            /home       btrfs       rw,noatime,nodiratime,compress-force=zstd:1,discard,space_cache=v2,subvolid=256,subvol=/home    0 0
/dev/loop5p4            /swap       btrfs       rw,noatime,nodiratime,compress-force=zstd:1,discard,space_cache=v2,subvolid=257,subvol=/swap    0 0
/dev/loop5p3            /boot       ext4        rw,relatime 0 2
/dev/loop5p2            /boot/efi   vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 2
/dev/mapper/buildvg-swap    none        swap        defaults    0 0

From a virtual machine build:

LABEL=winesapos-root            /           btrfs       rw,noatime,nodiratime,compress-force=zstd:1,discard,space_cache=v2,subvolid=5,subvol=/  0 0
LABEL=winesapos-root            /home       btrfs       rw,noatime,nodiratime,compress-force=zstd:1,discard,space_cache=v2,subvolid=256,subvol=/home    0 0
LABEL=winesapos-root            /swap       btrfs       rw,noatime,nodiratime,compress-force=zstd:1,discard,space_cache=v2,subvolid=257,subvol=/swap    0 0
LABEL=winesapos-boot            /boot       ext4        rw,relatime 0 2
LABEL=WOS-EFI           /boot/efi   vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 2