From ae88d31463d251ab64ea3d4fbd929af1d1381994 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 7 Mar 2011 23:52:41 +0000 Subject: [PATCH] Add hurd-i386 cdrom and pxe support. --- ...grub-hurd-i386.cfg => grub-hurd-cdrom.cfg} | 0 build/boot/hurd/grub-hurd-pxe.cfg | 69 +++++++++++++++++++ build/config/hurd-i386.cfg | 5 +- build/config/hurd-i386/cdrom.cfg | 8 +++ build/config/hurd-i386/netboot.cfg | 3 +- build/config/hurd.cfg | 61 +++++++++++++++- build/pkg-lists/cdrom/hurd-i386.cfg | 16 +++++ debian/changelog | 3 +- 8 files changed, 158 insertions(+), 7 deletions(-) rename build/boot/hurd/{grub-hurd-i386.cfg => grub-hurd-cdrom.cfg} (100%) create mode 100644 build/boot/hurd/grub-hurd-pxe.cfg create mode 100644 build/config/hurd-i386/cdrom.cfg create mode 100644 build/pkg-lists/cdrom/hurd-i386.cfg diff --git a/build/boot/hurd/grub-hurd-i386.cfg b/build/boot/hurd/grub-hurd-cdrom.cfg similarity index 100% rename from build/boot/hurd/grub-hurd-i386.cfg rename to build/boot/hurd/grub-hurd-cdrom.cfg diff --git a/build/boot/hurd/grub-hurd-pxe.cfg b/build/boot/hurd/grub-hurd-pxe.cfg new file mode 100644 index 000000000..91454f87f --- /dev/null +++ b/build/boot/hurd/grub-hurd-pxe.cfg @@ -0,0 +1,69 @@ +set timeout=-1 + +if loadfont $prefix/font.pf2 ; then + set gfxmode=640x480 + insmod vbe + insmod gfxterm + terminal_output gfxterm +fi + +insmod png +if background_image $prefix/splash.png ; then + set color_normal=white/black + set color_highlight=black/white +else + set menu_color_normal=cyan/blue + set menu_color_highlight=white/blue +fi + +menuentry "Default install" { + echo "Loading ..." + multiboot $prefix/gnumach.gz root=gunzip:device:rd0 TERM=mach-color + module --nounzip /boot/initrd.gz initrd '$(ramdisk-create)' + module $prefix/ext2fs.static ext2fs \ + --multiboot-command-line='${kernel-command-line}' \ + --host-priv-port='${host-port}' \ + --device-master-port='${device-port}' \ + --exec-server-task='${exec-task}' -T typed '${root}' \ + '$(task-create)' '$(task-resume)' + module $prefix/ld.so.1 exec /hurd/exec '$(exec-task=task-create)' +} + +menuentry "Pseudo-graphical install" { + echo "Loading ..." + multiboot $prefix/gnumach.gz root=gunzip:device:rd0 + module --nounzip /boot/initrd.gz initrd '$(ramdisk-create)' + module $prefix/ext2fs.static ext2fs \ + --multiboot-command-line='${kernel-command-line}' \ + --host-priv-port='${host-port}' \ + --device-master-port='${device-port}' \ + --exec-server-task='${exec-task}' -T typed '${root}' \ + '$(task-create)' '$(task-resume)' + module $prefix/ld.so.1 exec /hurd/exec '$(exec-task=task-create)' +} + +menuentry "Automated install" { + echo "Loading ..." + multiboot $prefix/gnumach.gz root=gunzip:device:rd0 auto=true priority=critical TERM=mach-color + module --nounzip /boot/initrd.gz initrd '$(ramdisk-create)' + module $prefix/ext2fs.static ext2fs \ + --multiboot-command-line='${kernel-command-line}' \ + --host-priv-port='${host-port}' \ + --device-master-port='${device-port}' \ + --exec-server-task='${exec-task}' -T typed '${root}' \ + '$(task-create)' '$(task-resume)' + module $prefix/ld.so.1 exec /hurd/exec '$(exec-task=task-create)' +} + +menuentry "Expert install" { + echo "Loading ..." + multiboot $prefix/gnumach.gz root=gunzip:device:rd0 priority=low TERM=mach-color + module --nounzip /boot/initrd.gz initrd '$(ramdisk-create)' + module $prefix/ext2fs.static ext2fs \ + --multiboot-command-line='${kernel-command-line}' \ + --host-priv-port='${host-port}' \ + --device-master-port='${device-port}' \ + --exec-server-task='${exec-task}' -T typed '${root}' \ + '$(task-create)' '$(task-resume)' + module $prefix/ld.so.1 exec /hurd/exec '$(exec-task=task-create)' +} diff --git a/build/config/hurd-i386.cfg b/build/config/hurd-i386.cfg index ba476c07f..3f1bf00de 100644 --- a/build/config/hurd-i386.cfg +++ b/build/config/hurd-i386.cfg @@ -1,4 +1,4 @@ -MEDIUM_SUPPORTED = netboot netboot-xen +MEDIUM_SUPPORTED = cdrom netboot netboot-xen MEDIUM_SUPPORTED_EXTRA = monolithic # The version of the kernel to use. @@ -12,7 +12,4 @@ KERNELIMAGEVERSION = $(KERNELVERSION) # The codename of the Debian release that should be installed by default. DEBIAN_RELEASE = unstable -# GRUB configuration file -GRUB_CFG=boot/hurd/grub-hurd-i386.cfg - include config/hurd.cfg diff --git a/build/config/hurd-i386/cdrom.cfg b/build/config/hurd-i386/cdrom.cfg new file mode 100644 index 000000000..38547cbd0 --- /dev/null +++ b/build/config/hurd-i386/cdrom.cfg @@ -0,0 +1,8 @@ +MEDIA_TYPE = CD-ROM + +TARGET = $(INITRD) $(KERNEL) $(DEBIAN_CD_INFO) +EXTRANAME = $(MEDIUM)/ + +MANIFEST-KERNEL = "kernel for use with mkisofs to build a CD" +MANIFEST-INITRD = "initrd for use with mkisofs to build a CD" +MANIFEST-DEBIAN_CD_INFO = "mkisofs config files for CD" diff --git a/build/config/hurd-i386/netboot.cfg b/build/config/hurd-i386/netboot.cfg index efa6fab79..77735b753 100644 --- a/build/config/hurd-i386/netboot.cfg +++ b/build/config/hurd-i386/netboot.cfg @@ -1,6 +1,7 @@ MEDIA_TYPE = netboot image -NETBOOT_DIR_TARGETS = pkg-lists/kernel-module-udebs $(TEMP_INITRD) $(TEMP_KERNEL) +NETBOOT_DIR_TARGETS = $(TEMP_INITRD) $(TEMP_KERNEL) +NETBOOT_DIR_LINKS = grub2pxe TARGET = $(NETBOOT_DIR) $(NETBOOT_TAR) $(MINIISO) EXTRANAME = $(MEDIUM)/ diff --git a/build/config/hurd.cfg b/build/config/hurd.cfg index 95e4f7c94..30bfcfbe1 100644 --- a/build/config/hurd.cfg +++ b/build/config/hurd.cfg @@ -25,6 +25,16 @@ SPLASH_PNG=boot/common/pics/spacefun-grub.png # The font to load in GRUB GRUB_FONT=/usr/share/grub/ascii.pf2 +# GRUB configuration files +GRUB_CFG_CDROM=boot/hurd/grub-hurd-cdrom.cfg +GRUB_CFG_PXE=boot/hurd/grub-hurd-pxe.cfg + +# GRUB modules +GRUB_MODDIR=/usr/lib/grub/i386-pc +GRUB_MODULES=cpuid echo gfxterm minicmd normal png vbe +GRUB_MODULES_PXE=pxe pxecmd +GRUB_MODULES_CDROM=biosdisk chain iso9660 + # Location for Xen example configuration. XENCFG = $(SOME_DEST)/$(EXTRANAME)xm-debian.cfg @@ -36,6 +46,29 @@ MKLIBS = mklibs-copy arch_boot_screens: arch_tree: +# genisoimage CD info directory, including grub and configuration files +# Note that the configuration is extensively manipulated by debian-cd to +# support all the available CD/DVD variants. +.PHONY: arch_cd_info_dir +arch_cd_info_dir: + -rm -f $(TEMP_CD_INFO_DIR)/* + mkdir -p $(TEMP_CD_INFO_DIR) + + mkdir -p $(TEMP_CD_INFO_DIR)/boot/grub + sed -e "s/@ARCH@/$(ARCH)/g" $(GRUB_CFG_CDROM) \ + > $(TEMP_CD_INFO_DIR)/boot/grub/grub.cfg + if [ -n "$(GRUB_FONT)" ] ; then \ + cp $(GRUB_FONT) $(TEMP_CD_INFO_DIR)/boot/grub/font.pf2; \ + fi + if [ -n "$(SPLASH_PNG)" ]; then \ + cp $(SPLASH_PNG) $(TEMP_CD_INFO_DIR)/boot/grub/splash.png; \ + fi + + grub-mkimage -O i386-pc -o $(TEMP_CD_INFO_DIR)/boot/grub/core.img $(GRUB_MODULES) $(GRUB_MODULES_CDROM) + cat $(GRUB_MODDIR)/cdboot.img $(TEMP_CD_INFO_DIR)/boot/grub/core.img \ + > $(TEMP_CD_INFO_DIR)/boot/grub/grub_eltorito + rm $(TEMP_CD_INFO_DIR)/boot/grub/core.img + # Miniature CD image using GRUB, with only an initrd, no udebs or debs. .PHONY: arch_miniiso arch_miniiso: $(TEMP_INITRD) $(TEMP_KERNEL) $(TREE) @@ -46,7 +79,8 @@ arch_miniiso: $(TEMP_INITRD) $(TEMP_KERNEL) $(TREE) cp $(TEMP_KERNEL) $(TEMP_CD_TREE)/boot/kernel/ cp /lib/ld.so.1 $(TEMP_CD_TREE)/boot/kernel/ cp $(TEMP_INITRD) $(TEMP_CD_TREE)/boot/initrd.gz - cp $(GRUB_CFG) $(TEMP_CD_TREE)/boot/grub/grub.cfg + sed -e "s/@ARCH@/$(ARCH)/g" $(GRUB_CFG_CDROM) \ + > $(TEMP_CD_TREE)/boot/grub/grub.cfg if [ -n "$(GRUB_FONT)" ] ; then \ cp $(GRUB_FONT) $(TEMP_CD_TREE)/boot/grub/font.pf2; \ fi @@ -63,6 +97,31 @@ arch_netboot_dir: mkdir -p $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH) cp $(TEMP_INITRD) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH) cp $(TEMP_KERNEL) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH) + + sed -e "s/@ARCH@/$(ARCH)/g" $(GRUB_CFG_PXE) \ + > $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/grub.cfg + if [ -n "$(GRUB_FONT)" ] ; then \ + cp $(GRUB_FONT) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/font.pf2; \ + fi + if [ -n "$(SPLASH_PNG)" ]; then \ + cp $(SPLASH_PNG) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/splash.png; \ + fi + + # Generate grub2pxe + grub-mkimage -O i386-pc --prefix="(pxe)/$(NETBOOT_PATH)" \ + -o $(TEMP_NETBOOT_DIR)/core.img \ + $(GRUB_MODULES) $(GRUB_MODULES_PXE) + # workaround a gPXE bug + sed -i -e 's/\x02\xb0\xad\x1b/\x03\xb0\xad\x1b/' $(TEMP_NETBOOT_DIR)/core.img + cat $(GRUB_MODDIR)/pxeboot.img $(TEMP_NETBOOT_DIR)/core.img \ + > $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/grub2pxe + rm $(TEMP_NETBOOT_DIR)/core.img + + # This symlink is not strictly required, but it allows more usual + # dhcp server setups to work without modification. + rm -f $(TEMP_NETBOOT_DIR)/grub2pxe + ln -sf $(NETBOOT_PATH)/grub2pxe $(TEMP_NETBOOT_DIR)/grub2pxe + .PHONY: xen_config xen_config: $(TEMP_INITRD) diff --git a/build/pkg-lists/cdrom/hurd-i386.cfg b/build/pkg-lists/cdrom/hurd-i386.cfg new file mode 100644 index 000000000..2b8a9a950 --- /dev/null +++ b/build/pkg-lists/cdrom/hurd-i386.cfg @@ -0,0 +1,16 @@ +# These are broken and/or irrelevant on Hurd for now +clock-setup - +partman-auto-raid - +partman-ext3 - +partman-jfs - +partman-md - +partman-xfs - +partman-btrfs - +# FIXME: ufsutils-udeb is uninstallable +partman-ufs - +rescue-mode - +libbsd0-udeb - +rdate-udeb - +tzsetup-udeb - + +bogl-bterm-udeb - diff --git a/debian/changelog b/debian/changelog index d196096a5..36edc3143 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,7 +10,8 @@ debian-installer (2011xxxx) UNRELEASED; urgency=low * Stick gnumach kernel versioning to Debian style. * Add hurd-i386 Xen netboot image support * Hack hurd-i386 netboot image size to have some room for downloaded udebs. - * Enable netcfg, now having working DHCP support. + * Enable netcfg on hurd-i386, now having working DHCP support. + * Add hurd-i386 cdrom and pxe support, inspired from kfreebsd. [ Joey Hess ] * Initial changes to target wheezy.