Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 13 additions & 22 deletions features/_usi/image.cc.tar
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ done
touch "$rootfs/tmp/initrd.include/root.img"
mount --bind "$erofs" "$rootfs/tmp/initrd.include/root.img"

initrd="$(mktemp)"

kernel="$(find "$rootfs/boot/" -name 'vmlinuz-*' | sort -V | tail -n 1)"
kernel="$(find "$rootfs/boot/" -name 'vmlinuz-*' -printf '%P\n' | sort -V | tail -n 1)"

chroot "$rootfs" dracut \
--no-hostonly \
Expand All @@ -67,12 +65,6 @@ chroot "$rootfs" dracut \

umount "$rootfs/tmp/initrd.include/root.img"

umount -l "$rootfs/proc"
umount -R "$rootfs/dev"
umount "$rootfs/tmp"

mv "$rootfs/initrd" "$initrd"

case "$BUILDER_ARCH" in
amd64)
uefi_arch=X64
Expand All @@ -82,33 +74,32 @@ case "$BUILDER_ARCH" in
;;
esac

uki="$(mktemp)"

read -r _ cmdline < "$rootfs/etc/kernel/cmdline"

/usr/lib/systemd/ukify build \
--stub "$rootfs/usr/lib/systemd/boot/efi/linux$(tr '[:upper:]' '[:lower:]' <<< "$uefi_arch").efi.stub" \
--linux "$kernel" \
--initrd "$initrd" \
chroot "$rootfs" ukify build \
--stub "/usr/lib/systemd/boot/efi/linux$(tr '[:upper:]' '[:lower:]' <<< "$uefi_arch").efi.stub" \
--linux "/boot/$kernel" \
--initrd "/initrd" \
--uname "${kernel#*-}" \
--cmdline "$cmdline xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
--os-release "@$rootfs/etc/os-release" \
--output "$uki"
--os-release "@/etc/os-release" \
--output "/uki"


esp_dir="$(mktemp -d)"
esp_tar="$(mktemp)"

dest_dir="$(mktemp -d)"

cp "$uki" "$dest_dir"/uki
rm "$uki"
cp "$initrd" "$dest_dir"/initrd
rm "$initrd"
cp "$kernel" "$dest_dir"/vmlinuz
mv "$rootfs/uki" "$dest_dir"/uki
mv "$rootfs/initrd" "$dest_dir"/initrd
cp "$rootfs/boot/$kernel" "$dest_dir"/vmlinuz
cp "$erofs" "$dest_dir"/squashfs

rm "$erofs"
umount -l "$rootfs/proc"
umount -R "$rootfs/dev"
umount "$rootfs/tmp"
umount "$rootfs"
rmdir "$rootfs"

Expand Down
1 change: 1 addition & 0 deletions features/_usi/pkg.include
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ gdisk
binutils
oras
efibootmgr
systemd-ukify