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

cbm seg fault in legacy bios mode when /root is encrypted #230

Open
mdhorn opened this issue Mar 26, 2020 · 1 comment
Open

cbm seg fault in legacy bios mode when /root is encrypted #230

mdhorn opened this issue Mar 26, 2020 · 1 comment

Comments

@mdhorn
Copy link
Contributor

mdhorn commented Mar 26, 2020

Describe the bug
When Clear Linux OS is booted in BIOS mode, and run the installer is run with encryption enabled, cbm segfaults:

[DEBUG] cbm (../src/cli/cli.c:L142): No such file: /tmp/install-202773570//etc/kernel/update_efi_vars
[INFO] cbm (../src/bootman/bootman.c:L744): Current running kernel: 5.5.9-918.native
[DEBUG] cbm (../src/lib/probe.c:L261): Root device exists on device-mapper configuration
[DEBUG] cbm (../src/bootman/bootman.c:L140): shim-systemd caps: 0x26, wanted: 0x0c
[DEBUG] cbm (../src/bootloaders/grub2.c:L563): grub2 not found at /tmp/install-202773570/usr/sbin/grub-mkconfig

[DEBUG] cbm (../src/bootman/bootman.c:L140): grub2 caps: 0x00, wanted: 0x0c
[DEBUG] cbm (../src/bootman/bootman.c:L140): syslinux caps: 0x2c, wanted: 0x0c
[DEBUG] cbm (../src/bootman/bootman.c:L157): Legacy boot now selected (syslinux)
[ERROR] cbm (../src/bootloaders/syslinux-common.c:L288): No boot partition found, you need to mark the boot partition with "legacy_.
[FATAL] cbm (../src/bootman/bootman.c:L163): Cannot initialise bootloader syslinux
Segmentation fault (core dumped)

To Reproduce
Steps to reproduce the behavior:

  1. Download my start vm under BIOS script
wget https://gist.githubusercontent.com/mdhorn/8de01006d3303ef2a45d432da2c72e92/raw/04ac62baf7743f9979dba012b52d9d5d916318b6/start_qemu_bios.sh
chmod +x start_qemu_bios.sh
  1. Download the latest Clear Linux OS server installer ISO
    https://clearlinux.org/downloads

  2. Launch the ISO with an 8GB installation virtual disk
    ./start_qemu_bios.sh clear-32690-live-server.iso 8G

  3. Login as root; set a password

  4. Run the installer
    clr-installer

  5. Complete the installation, selecting the Safe Installer w/ encryption

  6. Install fails at clear-boot-manager

  7. See the /root/clr-installer.log

Expected behavior
The installation completes without error, cbm do not seg fault.

Environment (please complete the following information):

  • Clear Linux OS Version: 32600
  • clr-boot-manager Version: 3.2.7

** Block Devices:**

  • List of Block Devices: [lsblk -a --json]
lsblk -a --json 
{
   "blockdevices": [
      {"name":"loop0", "maj:min":"7:0", "rm":false, "size":"711.7M", "ro":true, "type":"loop", "mountpoint":null},
      {"name":"loop1", "maj:min":"7:1", "rm":false, "size":null, "ro":false, "type":"loop", "mountpoint":null},
      {"name":"loop2", "maj:min":"7:2", "rm":false, "size":null, "ro":false, "type":"loop", "mountpoint":null},
      {"name":"loop3", "maj:min":"7:3", "rm":false, "size":null, "ro":false, "type":"loop", "mountpoint":null},
      {"name":"loop4", "maj:min":"7:4", "rm":false, "size":null, "ro":false, "type":"loop", "mountpoint":null},
      {"name":"loop5", "maj:min":"7:5", "rm":false, "size":null, "ro":false, "type":"loop", "mountpoint":null},
      {"name":"loop6", "maj:min":"7:6", "rm":false, "size":null, "ro":false, "type":"loop", "mountpoint":null},
      {"name":"loop7", "maj:min":"7:7", "rm":false, "size":null, "ro":false, "type":"loop", "mountpoint":null},
      {"name":"sr0", "maj:min":"11:0", "rm":true, "size":"1024M", "ro":false, "type":"rom", "mountpoint":null},
      {"name":"vda", "maj:min":"253:0", "rm":false, "size":"909M", "ro":false, "type":"disk", "mountpoint":null,
         "children": [
            {"name":"vda1", "maj:min":"253:1", "rm":false, "size":"909M", "ro":false, "type":"part", "mountpoint":null},
            {"name":"vda2", "maj:min":"253:2", "rm":false, "size":"100M", "ro":false, "type":"part", "mountpoint":null}
         ]
      },
      {"name":"vdb", "maj:min":"253:16", "rm":false, "size":"8G", "ro":false, "type":"disk", "mountpoint":null,
         "children": [
            {"name":"vdb1", "maj:min":"253:17", "rm":false, "size":"142M", "ro":false, "type":"part", "mountpoint":"/tmp/install-702,
            {"name":"vdb2", "maj:min":"253:18", "rm":false, "size":"244M", "ro":false, "type":"part", "mountpoint":null},
            {"name":"vdb3", "maj:min":"253:19", "rm":false, "size":"7.6G", "ro":false, "type":"part", "mountpoint":null}
         ]
      }
   ]
}
df
Filesystem       1K-blocks  Used Available Use% Mounted on
none                524288  4752    519536   1% /
devtmpfs           1973240     0   1973240   0% /dev
tmpfs              2008916     0   2008916   0% /dev/shm
tmpfs              2008916   336   2008580   1% /run
tmpfs              2008916     0   2008916   0% /sys/fs/cgroup
tmpfs              2008916     0   2008916   0% /tmp
clr_debug_fuse      524288  4752    519536   1% /usr/src/debug
clr_debug_fuse      524288  4752    519536   1% /usr/lib/debug
tmpfs               401780     0    401780   0% /run/user/0
/dev/mapper/root   7798224 35124   7347256   1% /tmp/install-702644904
/dev/vdb1           143155     1    143155   1% /tmp/install-702644904/boot

Additional context
The problem only seems to occur if the root file system is encrypted. I'm guess it has to do with the device for the root file systems being mapped.

@mdhorn
Copy link
Contributor Author

mdhorn commented Apr 25, 2020

Update: This same core dump problem occurs if the root file system is on a Software RAID and you boot legacy mode as well:

NAME                SIZE VENDOR MODEL TRAN TYPE  PARTLABEL  MOUNTPOINT
/dev/loop0           10G                   loop
├─/dev/loop0p1      285M                   part  CLR_BOOT_F /tmp/install-265455965/boot
└─/dev/loop0p2      9.7G                   part  raid
  └─/dev/md127      9.7G                   raid0
    └─/dev/md127p1  9.7G                   part  CLR_ROOT_F /tmp/install-265455965
CBM_FORCE_LEGACY=1 CBM_DEBUG=1 /tmp/install-265455965/usr/bin/clr-boot-manager update --image --path=/tmp/install-265455965
[DEBUG] cbm (../src/cli/cli.c:L142): No such file: /tmp/install-265455965//etc/kernel/update_efi_vars
[INFO] cbm (../src/bootman/bootman.c:L744): Current running kernel: 5.5.6-914.native
[DEBUG] cbm (../src/lib/probe.c:L261): Root device exists on Linux software RAID configuration
[DEBUG] cbm (../src/bootman/bootman.c:L140): shim-systemd caps: 0x26, wanted: 0x0c
[DEBUG] cbm (../src/bootloaders/grub2.c:L563): grub2 not found at /tmp/install-265455965/usr/sbin/grub-mkconfig

[DEBUG] cbm (../src/bootman/bootman.c:L140): grub2 caps: 0x00, wanted: 0x0c
[DEBUG] cbm (../src/bootman/bootman.c:L140): syslinux caps: 0x2c, wanted: 0x0c
[DEBUG] cbm (../src/bootman/bootman.c:L157): Legacy boot now selected (syslinux)
Segmentation fault (core dumped)

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