zram for ubuntu; kexec.sh for single distro

This commit is contained in:
Dan
2026-04-26 19:54:23 +02:00
parent 670530ca5e
commit 34de424611
4 changed files with 14 additions and 0 deletions

5
boot/kexec.sh Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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