systemd / mkosi

💽 Build Bespoke OS Images
https://mkosi.systemd.io/
1.2k stars 325 forks source link

Syntax error in 'if statement' of /grub/grub.cfg #2974

Closed buentead closed 3 months ago

buentead commented 3 months ago

mkosi commit the issue has been seen with

24.3

Used host distribution

Ubuntu

Used target distribution

Ubuntu

Linux kernel version used

6.8.0-41-generic

CPU architectures issue was seen on

x86_64

Unexpected behaviour you saw

MKOSI generates the image correctly. But when booting the image from USB I see the following error messages, before the login prompt shows up. The OS, however, works correctly. GRUBerrormessage_1

The error messages are coming from /grub/grub.cfg, which I attached as 'MKOSI Output' below. It looks like the 'if statement' causing the issue. When I change the 'if statement' as below, it seems to work. No error messages. if [ "${grub_platform}" == "efi" -o test "${grub_platform}" == "pc" ]; then

Used mkosi config

[Distribution]
Distribution=ubuntu
Release=noble
Repositories=main,universe
Architecture=x86-64

[Output]
Format=disk

[Validation]
#Checksum=true

[Content]
Bootable=true
Bootloader=grub
BiosBootloader=grub
ShimBootloader=signed
KernelCommandLine="quiet"
WithDocs=false
Packages=systemd,systemd-sysv,udev,dbus,linux-image-virtual,linux-tools-virtual
  libblockdev-crypto3,curl,dmidecode,ecryptfs-utils,efibootmgr
  fwupd,fwupd-signed,fuse3,gocryptfs,jq,lshw,lsof,nano,rsync,sudo
  uhubctl,uuid-runtime,libpam-google-authenticator,openssl
  tpm2-tools,tpm2-openssl,tpm2-abrmd,libtss2-tcti-tabrmd0,mokutil
  python3-debconf,python3-software-properties,python3-systemd
  locales,language-pack-de,kbd,keyboard-configuration,console-data
  grub2,grub-pc,os-prober,systemd-repart,grub-efi-amd64-signed,shim-signed
  sbsigntool,secureboot-db,gir1.2-packagekitglib-1.0,packagekit,packagekit-tools
  xz-utils,debianutils,debian-archive-keyring,finalrd
  gdisk,gnupg,gpg,dracut,iso-codes,publicsuffix,shared-mime-info,udisks2,wget

WithNetwork=true

mkosi output

The generated /grub/grub.cfg file:
set timeout=0
if [ "${grub_platform}" = efi ] || [ "${grub_platform}" = pc ]; then
menuentry "ubuntuLive_DEV-6.8.0-41-generic" {
    linux /ubuntuLive_DEV/6.8.0-41-generic/vmlinuz root=PARTUUID=7a4852bb-4f6f-47ac-8fd7-76d59569e9a4 "quiet"
    initrd /ubuntuLive_DEV/initrd /ubuntuLive_DEV/6.8.0-41-generic/kernel-modules.initrd
}
fi
DaanDeMeyer commented 3 months ago

@buentead I deleted both comments since that first comment looked very much like a scam. I'll see if we can fix your issue