53 lines
805 B
Bash
53 lines
805 B
Bash
#!/usr/bin/env bash
|
|
|
|
create_grub_cfg()
|
|
{
|
|
local target="$1"
|
|
local grub_cfg
|
|
|
|
grub_cfg="$(cat <<EOF
|
|
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
|
|
}
|
|
EOF
|
|
)"
|
|
|
|
echo "$grub_cfg" > "${target}/grub.cfg"
|
|
}
|
|
|
|
get_grub()
|
|
{
|
|
local version="2.12"
|
|
local url="https://ftp.gnu.org/gnu/grub/grub-${version}.tar.gz"
|
|
|
|
wget "${url}"
|
|
tar -xvf "grub-${version}.tar.gz"
|
|
|
|
(cd "grub-${version}"; ./configure --prefix="${TOOLSDIR}" && make install)
|
|
}
|
|
|
|
create_efi_image()
|
|
{
|
|
echo
|
|
}
|
|
|
|
create_stpdboot_ini()
|
|
{
|
|
local target="$1"
|
|
local stupid_ini="$(cat <<EOF
|
|
CMDLINE=consdev=com0
|
|
MODULE=dummy.mod
|
|
MODULE=dummy2.mod
|
|
EOF
|
|
)"
|
|
|
|
echo "$stupid_ini" > "${target}/stupid.ini"
|
|
}
|