Skip to content

Commit 91ab736

Browse files
committed
1 parent 1c89ca0 commit 91ab736

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

bootstrap/roles/appliance-build.bootstrap/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
ansible.builtin.command: bash -c 'rm -rf /etc/apt/sources.list.d/*'
2020
changed_when: true
2121

22+
- name: Turn off all swap now
23+
become: yes
24+
command: swapoff -a
25+
changed_when: false
26+
2227
- name: Configure apt sources
2328
vars:
2429
mirror_url: "{{ lookup('env', 'DELPHIX_PACKAGE_MIRROR_MAIN') }}"

live-build/config/hooks/vm-artifacts/90-raw-disk-image.binary

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,25 @@ for dir in /dev /proc /sys; do
345345
done
346346

347347
#
348-
# Mount /boot/efi and do grub and bootctl install
348+
# Mount ESP and bootctl install
349349
#
350-
EFI_DIR="/mnt/boot/efi"
351-
chroot "$DIRECTORY" mkdir -p $EFI_DIR
352-
chroot "$DIRECTORY" mount /dev/mapper/${LOOPNAME}p2 $EFI_DIR
350+
EFI_DIR=$(chroot "$DIRECTORY" mktemp -d -p "/var/tmp/" -t delphix_efi.XXXXXXX)
351+
chroot "$DIRECTORY" mount -o umask=077 /dev/mapper/${LOOPNAME}p2 $EFI_DIR
352+
353+
ESP=$EFI_DIR
354+
BOOTLOADER_ID="${BOOTLOADER_ID:-systemd}"
355+
echo "[*] Installing systemd-boot to $ESP..."
356+
# 1. Create required directories
357+
chroot "$DIRECTORY" mkdir -p "$ESP/EFI/systemd" "$ESP/EFI/BOOT" "$ESP/loader/entries"
358+
359+
# 2. Copy systemd-boot binaries
360+
chroot "$DIRECTORY" cp /usr/lib/systemd/boot/efi/systemd-bootx64.efi "$ESP/EFI/$BOOTLOADER_ID/"
361+
chroot "$DIRECTORY" cp /usr/lib/systemd/boot/efi/systemd-bootx64.efi "$ESP/EFI/BOOT/BOOTX64.EFI"
353362

354363
# Copy the latest kernel into EFI boot directory
355364
chroot "$DIRECTORY" cp /boot/initrd.img $EFI_DIR
356365
chroot "$DIRECTORY" cp /boot/vmlinuz $EFI_DIR
357-
chroot "$DIRECTORY" bootctl --esp-path=$EFI_DIR install --no-variables
366+
# chroot "$DIRECTORY" bootctl --esp-path=$EFI_DIR install --no-variables
358367

359368
# Use GRUB_CMDLINE_LINUX_DEFAULT boot options
360369
source $DIRECTORY/etc/default/grub.d/override.cfg
@@ -385,6 +394,7 @@ auto-firmware yes
385394
EOF
386395

387396
chroot "$DIRECTORY" umount $EFI_DIR
397+
chroot "$DIRECTORY" rm -r $EFI_DIR
388398

389399
for dir in /dev /proc /sys; do
390400
retry 5 10 umount -R "${DIRECTORY}${dir}"

0 commit comments

Comments
 (0)