You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
708 B

#!/usr/bin/bash
set -e
PARTITION_ROOT=/dev/mapper/ubuntu--vg-ubuntu--lv
DISK=/dev/nvme0n1
mkdir -p /boot/efi/EFI/Linux
update-initramfs -u -k all
LATEST=`ls -t /boot/vmlinuz* | head -1`
VERSION=`file -bL $LATEST | grep -o 'version [^ ]*' | cut -d ' ' -f 2`
objcopy \
--add-section .osrel="/usr/lib/os-release" --change-section-vma .osrel=0x20000 \
--add-section .cmdline="/boot/kernel-command-line.txt" --change-section-vma .cmdline=0x30000 \
--add-section .linux="/boot/vmlinuz-$VERSION" --change-section-vma .linux=0x40000 \
--add-section .initrd="/boot/initrd.img-$VERSION" --change-section-vma .initrd=0x3000000 \
"/usr/lib/systemd/boot/efi/linuxx64.efi.stub" "/boot/efi/EFI/Linux/Linux.efi"