StupidOS/releasetools/image.functions

55 lines
827 B
Plaintext
Raw Permalink Normal View History

2024-06-05 15:15:00 +00:00
#!/usr/bin/env bash
2024-05-28 04:54:10 +00:00
create_grub_cfg()
{
2024-06-05 15:15:00 +00:00
local target="$1"
local grub_cfg
grub_cfg="$(cat <<EOF
2024-05-28 04:54:10 +00:00
set timeout=15
set default=0
menuentry "StupidOS" {
echo "verify system integrity"
hashsum --hash sha256 --check /boot/hashfile --prefix /
multiboot /stpdldr.sys
module /vmstupid.sys
boot
}
2024-06-05 15:15:00 +00:00
EOF
)"
2024-07-05 06:16:40 +00:00
echo "$grub_cfg" > "${target}/grub.cfg"
2024-05-28 04:54:10 +00:00
}
2024-06-05 15:15:00 +00:00
get_grub()
{
2024-07-05 06:16:40 +00:00
local version="2.12"
local url="https://ftp.gnu.org/gnu/grub/grub-${version}.tar.gz"
wget "${url}"
tar -xvf "grub-${version}.tar.gz"
2024-07-05 06:35:20 +00:00
(cd "grub-${version}" || exit; ./configure --prefix="${TOOLSDIR}" && make install)
2024-06-05 15:15:00 +00:00
}
2024-05-28 04:54:10 +00:00
2024-06-05 15:15:00 +00:00
create_efi_image()
{
echo
}
2024-05-28 04:54:10 +00:00
2024-07-05 06:16:40 +00:00
create_stpdboot_ini()
{
local target="$1"
2024-07-05 06:35:20 +00:00
local stupid_ini
stupid_ini="$(cat <<EOF
2024-07-05 06:16:40 +00:00
CMDLINE=consdev=com0
MODULE=dummy.mod
MODULE=dummy2.mod
EOF
)"
echo "$stupid_ini" > "${target}/stupid.ini"
}