Commit 2b6c37af authored by Anton Midyukov's avatar Anton Midyukov

grub, hdt: Add hdt support for grub-pc (memdisk + floppy image)

Note: syslinux --install needed /proc, so: @$(call set,GLOBAL_HSH_PROC,1) See-also: mkimage/doc/README.ru
parent 09d751fc
if [ "$grub_platform" = "pc" ]; then
menuentry "Hardware Info" {
linux16 /boot/memdisk
initrd16 /boot/hdt.img
}
fi
# optimized out use/syslinux due to use/memtest # optimized out use/syslinux due to use/memtest
ifeq (,$(filter-out i586 x86_64,$(ARCH))) ifeq (,$(filter-out i586 x86_64,$(ARCH)))
use/hdt: use/memtest use/hdt: use/syslinux use/memtest
@$(call add_feature) @$(call add_feature)
@$(call add,STAGE1_PACKAGES,pciids) @$(call add,STAGE1_PACKAGES,pciids)
@$(call add,STAGE1_PACKAGES,dosfstools)
@$(call add,SYSLINUX_MODULES,hdt) @$(call add,SYSLINUX_MODULES,hdt)
@$(call add,GRUB_CFG,hdt_bios)
@$(call set,GLOBAL_HSH_PROC,1)
else else
use/hdt: ; @: use/hdt: ; @:
endif endif
#!/bin/sh -efu
[ "$GLOBAL_BOOTLOADER" = grubpcboot ] || exit 0
cd "$WORKDIR"
mkdir -p boot syslinux
cp /usr/lib/syslinux/hdt.c32 "$WORKDIR"/syslinux/
cat > syslinux/syslinux.cfg << EOF
default hdt
label hdt
menu label ^Hardware info
com32 hdt.c32
append quiet
EOF
# floppy disk 720 KiB
dd if=/dev/zero of=boot/hdt.img bs=512 count="1440"
mkfs.fat -n HDT -F 12 boot/hdt.img
mcopy -i boot/hdt.img -s syslinux ::
#dd if=/usr/lib/syslinux/ldlinux.bss of=boot/hdt.img conv=notrunc
syslinux -d /syslinux --install boot/hdt.img
rm -r syslinux
cp /usr/lib/syslinux/memdisk boot
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment