mkosi icon indicating copy to clipboard operation
mkosi copied to clipboard

/boot is cleared even if `Bootable=no`

Open g-arjones opened this issue 4 months ago β€’ 2 comments

mkosi commit the issue has been seen with

main

Used host distribution

Ubuntu 22.04

Used target distribution

Ubuntu 24.04

Linux kernel version used

vmlinuz-6.8.0-47-generic

CPU architectures issue was seen on

x86_64

Unexpected behaviour you saw

The /boot folder is removed from the image even with Bootable=no when an esp partition is defined in mkosi.repart. My goal is to setup the bootloader myself.

Used mkosi config

# mkosi.conf
[Distribution]
Distribution=ubuntu
Release=noble
Repositories=universe

[Build]
ToolsTree=default
ToolsTreeDistribution=ubuntu
ToolsTreeRelease=noble
Incremental=yes

[Content]
RootPassword=1234
Bootable=no
# Bootloader=grub
WithRecommends=no
Packages=
    systemd
    ubuntu-minimal
    grub-efi-amd64
    grub-efi-amd64-bin
    grub-efi-amd64-signed
    linux-generic

[Output]
Format=disk

# mkosi.repart/00-esp.conf
[Partition]
Type=esp
Format=vfat
SizeMinBytes=256M
SizeMaxBytes=256M

# mkosi.repart/10-root.conf
[Partition]
Type=root
Format=ext4
CopyFiles=/
Minimize=guess

mkosi output

β€£ Removing output files of default image…
β€£ Copying cached package manager metadata
β€£ Building default image
β€£  Copying cached trees
β€£  Generating system users
β€£  Generating volatile files
β€£  Applying presets…
Failed to preset unit, unit /buildroot/usr/lib/systemd/system/cryptdisks-early.service is masked.
Failed to preset unit, unit /buildroot/usr/lib/systemd/system/sudo.service is masked.
Failed to preset unit, unit /buildroot/usr/lib/systemd/system/x11-common.service is masked.
Failed to preset unit, unit /buildroot/usr/lib/systemd/system/cryptdisks.service is masked.
Failed to preset unit, unit /buildroot/usr/lib/systemd/system/hwclock.service is masked.
Created symlink /buildroot/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service β†’ /usr/lib/systemd/system/systemd-networkd-wait-online.service.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-machine-id.service β†’ /usr/lib/systemd/system/systemd-pcrlock-machine-id.service.
Created symlink /buildroot/etc/systemd/system/multi-user.target.wants/remote-veritysetup.target β†’ /usr/lib/systemd/system/remote-veritysetup.target.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-network-generator.service β†’ /usr/lib/systemd/system/systemd-network-generator.service.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-firmware-config.service β†’ /usr/lib/systemd/system/systemd-pcrlock-firmware-config.service.
Created symlink /buildroot/etc/systemd/system/sockets.target.wants/systemd-journald-audit.socket β†’ /usr/lib/systemd/system/systemd-journald-audit.socket.
Created symlink /buildroot/etc/systemd/system/systemd-journald.service.wants/systemd-journald-audit.socket β†’ /usr/lib/systemd/system/systemd-journald-audit.socket.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-file-system.service β†’ /usr/lib/systemd/system/systemd-pcrlock-file-system.service.
Created symlink /buildroot/etc/systemd/system/dbus-org.freedesktop.network1.service β†’ /usr/lib/systemd/system/systemd-networkd.service.
Created symlink /buildroot/etc/systemd/system/multi-user.target.wants/systemd-networkd.service β†’ /usr/lib/systemd/system/systemd-networkd.service.
Created symlink /buildroot/etc/systemd/system/sockets.target.wants/systemd-networkd.socket β†’ /usr/lib/systemd/system/systemd-networkd.socket.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-confext.service β†’ /usr/lib/systemd/system/systemd-confext.service.
Unit /buildroot/usr/lib/systemd/system/cryptdisks-early.service is masked, ignoring.
Created symlink /buildroot/etc/systemd/system/sockets.target.wants/systemd-sysext.socket β†’ /usr/lib/systemd/system/systemd-sysext.socket.
Unit /buildroot/usr/lib/systemd/system/sudo.service is masked, ignoring.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-sysext.service β†’ /usr/lib/systemd/system/systemd-sysext.service.
Unit /buildroot/usr/lib/systemd/system/x11-common.service is masked, ignoring.
Created symlink /buildroot/etc/systemd/system/sockets.target.wants/systemd-pcrextend.socket β†’ /usr/lib/systemd/system/systemd-pcrextend.socket.
Created symlink /buildroot/etc/systemd/system/ctrl-alt-del.target β†’ /usr/lib/systemd/system/reboot.target.
Created symlink /buildroot/etc/systemd/system/timers.target.wants/systemd-sysupdate-reboot.timer β†’ /usr/lib/systemd/system/systemd-sysupdate-reboot.timer.
Unit /buildroot/usr/lib/systemd/system/cryptdisks.service is masked, ignoring.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-secureboot-policy.service β†’ /usr/lib/systemd/system/systemd-pcrlock-secureboot-policy.service.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-make-policy.service β†’ /usr/lib/systemd/system/systemd-pcrlock-make-policy.service.
Created symlink /buildroot/etc/systemd/system/timers.target.wants/systemd-sysupdate.timer β†’ /usr/lib/systemd/system/systemd-sysupdate.timer.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-firmware-code.service β†’ /usr/lib/systemd/system/systemd-pcrlock-firmware-code.service.
Unit /buildroot/usr/lib/systemd/system/hwclock.service is masked, ignoring.
Created symlink /buildroot/etc/systemd/system/multi-user.target.wants/remote-cryptsetup.target β†’ /usr/lib/systemd/system/remote-cryptsetup.target.
Created symlink /buildroot/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-secureboot-authority.service β†’ /usr/lib/systemd/system/systemd-pcrlock-secureboot-authority.service.
Created symlink /buildroot/etc/systemd/user/basic.target.wants/systemd-tmpfiles-setup.service β†’ /usr/lib/systemd/user/systemd-tmpfiles-setup.service.
Created symlink /buildroot/etc/systemd/user/timers.target.wants/systemd-tmpfiles-clean.timer β†’ /usr/lib/systemd/user/systemd-tmpfiles-clean.timer.
β€£  Applying first boot settings
/buildroot: /etc/passwd written.
/buildroot: /etc/shadow written.
β€£  Generating hardware database
β€£  Generating disk image
Pre-populating ext4 filesystem of partition 00-root.conf twice to calculate minimal partition size
Populating ext4 filesystem.
Successfully populated ext4 filesystem.
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done                            
Creating filesystem with 268435456 4k blocks and 67108864 inodes
Filesystem UUID: d522e153-6b19-4aef-b95c-9481ccc374e7
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): done
Copying files into the device: done
Writing superblocks and filesystem accounting information: done     

/var/tmp/.#repartf2dd71fa990fd804 successfully formatted as ext4 (label "root-x86-64", uuid d522e153-6b19-4aef-b95c-9481ccc374e7)
Minimal partition size of ext4 filesystem of partition 00-root.conf is 1.6G
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done                            
Creating filesystem with 431784 4k blocks and 107968 inodes
Filesystem UUID: 4a464dbe-53c9-4280-95a0-f47fdabb7fb0
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (8192 blocks): done
Copying files into the device: done
Writing superblocks and filesystem accounting information: done 

/var/tmp/.#repartf2dd71fa990fd804 successfully formatted as ext4 (label "root-x86-64", uuid 4a464dbe-53c9-4280-95a0-f47fdabb7fb0)
Automatically determined minimal disk image size as 1.8G.
Sized '/work/home/arjones/.cache/mkosi/mkosi-workspace-3n864n49/staging/image.raw' to 1.8G.
Applying changes to /work/home/arjones/.cache/mkosi/mkosi-workspace-3n864n49/staging/image.raw.
Copying in '/var/tmp/.#repartf2dd71fa990fd804' (1.6G) on block level into future partition 1.
Copying in of '/var/tmp/.#repartf2dd71fa990fd804' on block level completed.
Block level copying and synchronization of partition 1 complete in 10.415001s (161.9M/s).
Adding new partition 1 to partition table.
Writing new partition table.
All done.
β€£  Formatting ESP/XBOOTLDR partitions
Automatically determined minimal disk image size as 1.8G, current image size is 1.8G.
File '/work/home/arjones/.cache/mkosi/mkosi-workspace-3n864n49/staging/image.raw' already is of requested size or larger, not growing. (1.8G >= 1.8G)
Applying changes to /work/home/arjones/.cache/mkosi/mkosi-workspace-3n864n49/staging/image.raw.
Successfully wiped file system signatures from future partition 0.
Successfully discarded data from future partition 0.
Formatting future partition 0.
mkfs.fat 4.2 (2021-01-31)
WARNING: Number of clusters for 32 bit FAT is less then suggested minimum.
/var/tmp/repart-g108FR successfully formatted as vfat (label "ESP", uuid 4b733c9b)
Successfully formatted future partition 0.
Adding new partition 0 to partition table.
Writing new partition table.
All done.
β€£  /mnt/mkosi-test/mkosi.output/image.raw size is 1.9G, consumes 1.6G.

g-arjones avatar Oct 18 '24 00:10 g-arjones