StupidOS/tools/create-iso

31 lines
555 B
Plaintext
Raw Normal View History

2023-01-17 10:35:11 +00:00
#!/bin/env sh
grub_config=$(cat <<EOF
set timeout=15
set default=0
menuentry "StupidOS" {
echo "verify system integrity"
hashsum --hash sha256 --check /boot/hashfile --prefix /
2024-03-20 09:48:47 +00:00
multiboot /stpdboot.sys
module /vmstupid.sys
2023-01-17 10:35:11 +00:00
boot
}
EOF
)
gen_iso_file() {
mkdir -p "$2/boot/grub"
echo "$grub_config" > "$2/boot/grub/grub.cfg"
2024-03-20 09:48:47 +00:00
sha256sum "$2/vmstupid.sys" > "$2/boot/hashfile"
sha256sum "$2/stpdboot.sys" >> "$2/boot/hashfile"
grub-file --is-x86-multiboot "$2/stpdboot.sys" || exit 1
2023-01-17 10:35:11 +00:00
grub-mkrescue -o $1 $2
}
gen_iso_file "$1" "$2"