From 34de424611ffada9a0077d0650f2320a11b1e80e Mon Sep 17 00:00:00 2001 From: Dan Date: Sun, 26 Apr 2026 19:54:23 +0200 Subject: [PATCH] zram for ubuntu; kexec.sh for single distro --- boot/kexec.sh | 5 +++++ distros/ubuntu/image.yaml | 4 ++++ distros/ubuntu2604/image.yaml | 4 ++++ docker/image-builder/entrypoint.sh | 1 + 4 files changed, 14 insertions(+) create mode 100644 boot/kexec.sh diff --git a/boot/kexec.sh b/boot/kexec.sh new file mode 100644 index 0000000..cf740f2 --- /dev/null +++ b/boot/kexec.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -e +BOOT=/boot/efi +kexec -l "$BOOT/bzImage" --initrd="$BOOT/initrd.img" --command-line="$(cat $BOOT/cmdline.txt)" +kexec -e diff --git a/distros/ubuntu/image.yaml b/distros/ubuntu/image.yaml index d084f16..e8ade7b 100644 --- a/distros/ubuntu/image.yaml +++ b/distros/ubuntu/image.yaml @@ -46,6 +46,7 @@ packages: - fonts-liberation - fonts-dejavu - fontconfig + - systemd-zram-generator action: install files: @@ -131,6 +132,9 @@ actions: sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config systemctl enable ssh + # zram swap: half of RAM, zstd compressed + printf '[zram0]\nzram-size = ram / 2\ncompression-algorithm = zstd\n' > /etc/systemd/zram-generator.conf + - trigger: post-files action: |- #!/bin/bash diff --git a/distros/ubuntu2604/image.yaml b/distros/ubuntu2604/image.yaml index e6b106b..14cc806 100644 --- a/distros/ubuntu2604/image.yaml +++ b/distros/ubuntu2604/image.yaml @@ -46,6 +46,7 @@ packages: - fonts-liberation - fonts-dejavu - fontconfig + - systemd-zram-generator action: install files: @@ -112,6 +113,9 @@ actions: sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config systemctl enable ssh + # zram swap: half of RAM, zstd compressed + printf '[zram0]\nzram-size = ram / 2\ncompression-algorithm = zstd\n' > /etc/systemd/zram-generator.conf + - trigger: post-files action: |- #!/bin/bash diff --git a/docker/image-builder/entrypoint.sh b/docker/image-builder/entrypoint.sh index bb896e9..3514e6c 100755 --- a/docker/image-builder/entrypoint.sh +++ b/docker/image-builder/entrypoint.sh @@ -158,6 +158,7 @@ echo "=== Assembling boot partition ===" mv /tmp/usb_root/boot/efi/* /tmp/usb_efi/ 2>/dev/null || true sed "s|__DISTRO__|$ROOT_LABEL|" /repo/boot/cmdline.txt > /tmp/usb_efi/cmdline.txt cp /repo/boot/vram.txt /tmp/usb_efi/ +cp /repo/boot/kexec.sh /tmp/usb_efi/ sync umount /tmp/usb_root /tmp/usb_efi