[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

debian-installer grub-efi test image



Hi!

I have just created the first test image for debian-installer on ia64 with
grub-efi as a bootloader instead of elilo. The changes have not been committed
to git yet but a test image can be found at [1].

Could someone test whether this image does something useful for them?

For anyone interested, the patches for d-i and debian-cd are attached.

Adrian

> [1] https://cdimage.debian.org/cdimage/ports/grub-test/

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
>From 134c589ab28ef5557a3d914a7ed0e4f675940fd5 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@localhost>
Date: Sun, 28 Apr 2019 00:37:40 +0200
Subject: [PATCH] ia64: Switch bootloader for d-i from elilo to grub

---
 build/boot/ia64/elilo.conf     |  31 ---------
 build/boot/ia64/elilo_menu.msg |  24 -------
 build/boot/ia64/general.msg    |  24 -------
 build/boot/ia64/params.msg     |  25 -------
 build/config/ia64.cfg          | 153 +++++++++++++++++++++--------------------
 build/config/ia64/cdrom.cfg    |   8 +--
 build/config/ia64/netboot.cfg  |   9 +--
 debian/control                 |   5 +-
 8 files changed, 89 insertions(+), 190 deletions(-)
 delete mode 100644 build/boot/ia64/elilo.conf
 delete mode 100644 build/boot/ia64/elilo_menu.msg
 delete mode 100644 build/boot/ia64/general.msg
 delete mode 100644 build/boot/ia64/params.msg

diff --git a/build/boot/ia64/elilo.conf b/build/boot/ia64/elilo.conf
deleted file mode 100644
index 9f586b8..0000000
--- a/build/boot/ia64/elilo.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-chooser=textmenu
-default=install
-delay=20
-prompt
-
-message=${SYSDIR}elilo_menu.msg
-f1=${SYSDIR}general.msg
-f2=${SYSDIR}params.msg
-
-relocatable
-
-image=${KERNEL}
-    label=install
-    description="Install"
-    initrd=${INITRD}
-    append="--"
-    read-only
-
-image=${KERNEL}
-    label=expert
-    description="Install [Expert mode]"
-    initrd=${INITRD}
-    append="priority=low --"
-    read-only
-
-image=${KERNEL}
-    label=rescue
-    description="Rescue"
-    initrd=${INITRD}
-    append="rescue/enable=true --"
-    read-only
diff --git a/build/boot/ia64/elilo_menu.msg b/build/boot/ia64/elilo_menu.msg
deleted file mode 100644
index e9e21b2..0000000
--- a/build/boot/ia64/elilo_menu.msg
+++ /dev/null
@@ -1,24 +0,0 @@
- ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß 
-10 
- 7fÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ 74Debian Installer7f ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ7f¿10
- 7f³70 This is the Debian GNU/Linux installation system, built on ${BUILD_DATE}. 7f³10
- 7f³70                                                                            7f³10
- 7f³70 Use the arrow keys to select a menu item and then Enter to select it.      7f³10
- 7f³70 Use the function keys for help. On a serial console, use Ctrl-F and the    7f³10
- 7f³70 function key number instead.                                               7f³10
- 7f³70                                                                            7f³10
- 7f³70 7eBeware that this is an OS installer, and misuse can result in the loss of  7f³10
- 7f³70 7eany data currently on your disks.                                          7f³10
- 7f³70  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ70¿7f  ³10
- 7f³70  ³70                                                                      70³ 7f³10
- 7f³70  ³70                                                                      70³7f  ³10
- 7f³70  ³70                                                                      70³7f  ³10
- 7f³70  ³70                                                                      70³7f  ³10
- 7f³70  ³70                                                                      70³7f  ³10
- 7f³70  ³70                                                                      1e70³ 7f³10
- 7f³70  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ70  7f³10
- 7f³70                                                                            7f³10
- 7f³70 Boot: 35                                                                  70   7f³10
- 7f³70                                                                            7f³10
- 7f³70 Help: [71F170-General]  [71F270-Params]                                            7f³10
- 7fÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ10
diff --git a/build/boot/ia64/general.msg b/build/boot/ia64/general.msg
deleted file mode 100644
index ca8de0b..0000000
--- a/build/boot/ia64/general.msg
+++ /dev/null
@@ -1,24 +0,0 @@
- ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß 
-10 
- 7fÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ 74General Screen7f ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ70¿10
- 7f³70                                                                            ³10
- 7f³70    There are two ways to install Debian from this image.  Expert mode      ³10
- 7f³70    gives you more control over the configuration of the system by          ³10
- 7f³70    giving you the option to change configuration parameters and control    ³10
- 7f³70    which packages are loaded.  Normal mode installs the default set of     ³10
- 7f³70    packages and automatically configures them with the default settings.   ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70    See the Installation Manual or the FAQ for more information; both       ³10
- 7f³70    documents are available at the Debian web site:                         ³10
- 7f³70      http://www.debian.org/                                                ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70    Debian GNU/Linux is Copyright (C) 1993-2014 Software in the Public      ³10
- 7f³70    Interest and others and comes with ABSOLUTELY NO WARRANTY, to the       ³10
- 7f³70    extent permitted by applicable law.                                     ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70                  Press any key to return to main screen                    ³10
- 7f³70                                                                            ³10
- 7fÀ70ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ10
diff --git a/build/boot/ia64/params.msg b/build/boot/ia64/params.msg
deleted file mode 100644
index c386842..0000000
--- a/build/boot/ia64/params.msg
+++ /dev/null
@@ -1,25 +0,0 @@
- ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß 
-10 
- 7fÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ 74Params Screen7f ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ70¿10
- 7f³70                                                                            ³10
- 7f³70   You can enter boot parameters on the Boot: line.                         ³10
- 7f³70                                                                            ³10
- 7f³70   For the serial console                console=ttyS0,9600n8               ³10
- 7f³70                                                                            ³10
- 7f³70   Verbose debugging                     DEBCONF_DEBUG=5                    ³10
- 7f³70   Force static network config           netcfg/disable_dhcp=true           ³10
- 7f³70                                                                            ³10
- 7f³70   Text mode (improves interactivity     DEBIAN_FRONTEND=text               ³10
- 7f³70              for slow consoles)                                            ³10
- 7f³70                                                                            ³10
- 7f³70   Rescue mode                           rescue/enable=true                 ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70                                                                            ³10
- 7f³70                   Press any key to return to main screen                   ³10
- 7f³70                                                                            ³10
- 7fÀ70ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ10
diff --git a/build/config/ia64.cfg b/build/config/ia64.cfg
index 454a662..1a32f80 100644
--- a/build/config/ia64.cfg
+++ b/build/config/ia64.cfg
@@ -1,6 +1,3 @@
-# How big a floppy image should I make? (in kilobytes)
-FLOPPY_SIZE = 32768
-
 MEDIUM_SUPPORTED = cdrom netboot
 
 # The version of the kernel to use.
@@ -12,86 +9,94 @@ DEBIAN_RELEASE = unstable
 
 KEYRING = /usr/share/keyrings/debian-ports-archive-keyring.gpg
 
-INITRD_FS = initramfs
+GRUB_EFI=y
+GRUB_PLATFORM=ia64-efi
+GRUB_EFI_NAME=ia64
 
-# The DOS volume id to use for DOS floppies. This is a 32 bit hexidecimal
-# number.
-DOS_VOLUME_ID = deb00001
-# The DOS volume label to use for DOS floppies. This is a 11 character
-# string.
-DOS_VOLUME_LABEL = "Debian Inst"
+arch_boot_screens:
+arch_tree:
 
+# The font to load in GRUB
+GRUB_FONT = /usr/share/grub/ascii.pf2
 
-arch_tree:
+# Extract GRUB EFI files.
+.PHONY: ia64_grub_efi
+ia64_grub_efi:
+ifeq ($(GRUB_EFI),y)
+	efi-image $(TEMP_GRUB_EFI) $(GRUB_PLATFORM) $(GRUB_EFI_NAME) $(NETBOOT_PATH)
+endif
 
-# Create a bootable floppy image.
-# 1. make a dos filesystem image
-# 2. copy over kernel, initrd
-# 3. copy over elilo files
-.PHONY: arch_boot
-arch_boot:
-	dd if=/dev/zero of=$@.new bs=1k count=$(FLOPPY_SIZE)
-	mkfs.msdos --invariant -i $(DOS_VOLUME_ID) -n $(DOS_VOLUME_LABEL) -C $(TEMP_BOOT) $(FLOPPY_SIZE)
-
-	mmd -i$(TEMP_BOOT) ::/efi
-	mmd -i$(TEMP_BOOT) ::/efi/boot
-	mcopy -i$(TEMP_BOOT) $(TEMP_KERNEL) ::/linux
-	mcopy -i$(TEMP_BOOT) $(TEMP_INITRD) ::/initrd.gz
-	mcopy -i$(TEMP_BOOT) /usr/lib/elilo/elilo.efi ::/efi/boot/bootia64.efi
-	mcopy -i$(TEMP_BOOT) /usr/lib/elilo/elilo.efi ::/elilo.efi
-	
-	cat boot/ia64/elilo.conf \
-	| ramdisk-size-subst $(TEMP_INITRD) \
-	| bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \
-		DEBIAN_VERSION "$(DEBIAN_VERSION)" \
-		BUILD_DATE "$(BUILD_DATE)" \
-		SYSDIR "/efi/boot/" \
-		KERNEL /linux INITRD /initrd.gz \
-	> $(TEMP)/elilo-cd.conf
-	mcopy -i$(TEMP_BOOT) $(TEMP)/elilo-cd.conf ::/elilo.conf
-	mcopy -i$(TEMP_BOOT) $(TEMP)/elilo-cd.conf ::/efi/boot/elilo.conf
-	
-	$(foreach file,$(sort $(wildcard $(TEMP_BOOT_SCREENS)/*.msg)), \
-		mcopy -i$(TEMP_BOOT) $(file) ::/efi/boot/`basename $(file)`; \
-	)
-	echo "elilo linux" | mcopy -i$(TEMP_BOOT) - ::/install.nsh
+# Supply GRUB EFI configuration.
+.PHONY: arch_cd_info_dir
+arch_cd_info_dir: ia64_grub_efi
+	-rm -f $(TEMP_CD_INFO_DIR)/*
+	mkdir -p $(TEMP_CD_INFO_DIR)
 
-arch_boot_screens:
-	-rm -f $(TEMP_BOOT_SCREENS)/*
-	mkdir -p $(TEMP_BOOT_SCREENS)
-	$(foreach SCREEN,$(wildcard boot/ia64/*.msg), \
-		bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \
-			DEBIAN_VERSION "$(DEBIAN_VERSION)" \
-			BUILD_DATE "$(BUILD_DATE)" \
-		 < $(SCREEN) > $(TEMP_BOOT_SCREENS)/`basename $(SCREEN)`\
-	;)
+	if [ "$(GRUB_EFI)" = y ]; then \
+		set -e; \
+		mkdir -p $(TEMP_CD_INFO_DIR)/grub/$(GRUB_PLATFORM); \
+		cp -a $(TEMP_GRUB_EFI)/efi.img $(TEMP_CD_INFO_DIR)/grub/; \
+		grub-gencfg \
+			KERNEL /%install%/vmlinuz \
+			INITRD /%install%/initrd.gz \
+			HEADER boot/$(ARCH)/grub/grub-efi.cfg \
+		> $(TEMP_CD_INFO_DIR)/grub/grub.cfg; \
+		cp -a $(GRUB_FONT) $(TEMP_CD_INFO_DIR)/grub/font.pf2; \
+		cp -a $(TEMP_GRUB_EFI)/boot/grub/$(GRUB_PLATFORM)/* \
+			$(TEMP_CD_INFO_DIR)/grub/$(GRUB_PLATFORM)/; \
+	fi
 
 .PHONY: arch_miniiso
-arch_miniiso: $(TEMP_BOOT)
-	-rm -rf $(TEMP_CD_TREE)/*
-	install -m 644 -D $(TEMP_BOOT) $(TEMP_CD_TREE)/boot/boot.img
+arch_miniiso: ia64_grub_efi
+	-rm -f $(TEMP_CD_TREE)/*
+	mkdir -p $(TEMP_CD_TREE)
 
-	genisoimage -no-emul-boot -J -o $(TEMP_MINIISO) -b boot/boot.img \
-		-c boot/boot.catalog $(TEMP_CD_TREE)
+	ln -f $(TEMP_KERNEL) $(TEMP_CD_TREE)/linux
+	ln -f $(TEMP_INITRD) $(TEMP_CD_TREE)/initrd.gz
+
+	mkdir -p $(TEMP_CD_TREE)/.disk
+	echo "Debian GNU/Linux $(DEBIAN_VERSION) $(ARCH) - netboot mini.iso $(BUILD_DATE)"\
+	> $(TEMP_CD_TREE)/.disk/info
+
+	if [ "$(GRUB_EFI)" = y ]; then \
+		set -e; \
+		mkdir -p $(TEMP_CD_TREE)/boot/grub/$(GRUB_PLATFORM); \
+		cp -a $(TEMP_GRUB_EFI)/efi.img $(TEMP_CD_TREE)/boot/grub/; \
+		grub-gencfg \
+			KERNEL /linux \
+			INITRD /initrd.gz \
+			HEADER boot/$(ARCH)/grub/grub-efi.cfg \
+		> $(TEMP_CD_TREE)/boot/grub/grub.cfg; \
+		cp -a $(GRUB_FONT) $(TEMP_CD_TREE)/boot/grub/font.pf2; \
+		cp -a $(TEMP_GRUB_EFI)/boot/grub/$(GRUB_PLATFORM)/* \
+			$(TEMP_CD_TREE)/boot/grub/$(GRUB_PLATFORM)/; \
+	fi
+
+	if [ "$(GRUB_EFI)" = y ]; then \
+		xorriso -as mkisofs -r -J -c boot.cat \
+			-boot-load-size 4 -boot-info-table \
+			-eltorito-alt-boot \
+			--efi-boot boot/grub/efi.img -no-emul-boot \
+			-o $(TEMP_MINIISO) $(TEMP_CD_TREE); \
+	fi
 
 .PHONY: arch_netboot_dir
-arch_netboot_dir:
+arch_netboot_dir: ia64_grub_efi
 	-rm -f $(TEMP_NETBOOT_DIR)
 	mkdir -p $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)
-	cp $(TEMP_INITRD) $(TEMP_KERNEL) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)
-	
-	cp /usr/lib/elilo/elilo.efi $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)
-	cat boot/ia64/elilo.conf \
-	| ramdisk-size-subst $(TEMP_INITRD) \
-	| bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \
-		DEBIAN_VERSION "$(DEBIAN_VERSION)" \
-		BUILD_DATE "$(BUILD_DATE)" \
-		SYSDIR "$(BOOT_SCREEN_DIR)" \
-		KERNEL vmlinuz INITRD initrd.gz \
-	> $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/elilo.conf
-
-	mkdir -p $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/$(BOOT_SCREEN_DIR)
-	set -e; \
-	$(foreach file,$(wildcard $(TEMP_BOOT_SCREENS)/*.msg), \
-		cp $(file) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/$(BOOT_SCREEN_DIR); \
-	)
+	cp $(TEMP_KERNEL) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/linux
+	cp $(TEMP_INITRD) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/initrd.gz
+
+	if [ "$(GRUB_EFI)" = y ]; then \
+		set -e; \
+		mkdir -p $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/grub/$(GRUB_PLATFORM); \
+		cp -a $(TEMP_GRUB_EFI)/*.efi $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH); \
+		cp -a $(GRUB_FONT) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/grub/font.pf2; \
+		cp -a $(TEMP_GRUB_EFI)/boot/grub/$(GRUB_PLATFORM)/* \
+			$(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/grub/$(GRUB_PLATFORM)/; \
+		grub-gencfg \
+			KERNEL /$(NETBOOT_PATH)/linux \
+			INITRD /$(NETBOOT_PATH)/initrd.gz \
+			HEADER boot/$(ARCH)/grub/grub-efi.cfg \
+		> $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/grub/grub.cfg; \
+	fi
diff --git a/build/config/ia64/cdrom.cfg b/build/config/ia64/cdrom.cfg
index 53bcb64..38547cb 100644
--- a/build/config/ia64/cdrom.cfg
+++ b/build/config/ia64/cdrom.cfg
@@ -1,8 +1,8 @@
 MEDIA_TYPE = CD-ROM
 
-TARGET = $(KERNEL) $(INITRD) $(BOOT)
+TARGET = $(INITRD) $(KERNEL) $(DEBIAN_CD_INFO)
 EXTRANAME = $(MEDIUM)/
 
-MANIFEST-KERNEL = "kernel for use to build a CD"
-MANIFEST-INITRD = "initrd for use to build a CD"
-MANIFEST-BOOT = "CDROM image for Itanium systems"
+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/ia64/netboot.cfg b/build/config/ia64/netboot.cfg
index ecf7668..e38305f 100644
--- a/build/config/ia64/netboot.cfg
+++ b/build/config/ia64/netboot.cfg
@@ -1,11 +1,8 @@
 MEDIA_TYPE = netboot image
 
-NETBOOT_DIR_TARGETS := $(TEMP_INITRD) $(TEMP_KERNEL)
+NETBOOT_DIR_TARGETS = $(TEMP_INITRD) $(TEMP_KERNEL)
 TARGET = $(NETBOOT_DIR) $(NETBOOT_TAR) $(MINIISO)
 EXTRANAME = $(MEDIUM)/
 
-BOOT_SCREEN_DIR = boot-screens/
-
-MANIFEST-NETBOOT_DIR = "netboot directory for tftp server"
-MANIFEST-NETBOOT_TAR = "tarball of netboot directory"
-MANIFEST-MINIISO = "tiny CD image that boots the netboot installer"
+MANIFEST-NETBOOT_DIR = "boot directory for tftp server"
+MANIFEST-NETBOOT_TAR = "tarball of boot directory"
diff --git a/debian/control b/debian/control
index b5e1350..01e6b83 100644
--- a/debian/control
+++ b/debian/control
@@ -57,7 +57,7 @@ Build-Depends:
 #		default.)
 	hfsutils [powerpc],
 #		For making bootable HFS USB sticks for powerpc.
-	dosfstools [i386 m68k amd64 armhf arm64],
+	dosfstools [i386 ia64 m68k amd64 armhf arm64],
 #		For creating FAT filesystems with mkfs.msdos.
 #		Of course i386/amd64 use this for floppies, CDs etc.
 #		m68k uses it for atari floppies
@@ -112,6 +112,7 @@ Build-Depends:
 #	        Signed bootloader components for UEFI Secure Boot
 	grub-efi-arm64-bin [arm64],
 	grub-efi-ia32-bin [i386],
+	grub-efi-ia64-bin [ia64],
 	grub-efi-arm-bin [armhf],
 	grub-common [amd64 arm64 i386], xorriso,
 #		Used to make EFI bootable images
@@ -134,7 +135,7 @@ Build-Depends:
 	tofrodos [i386 amd64 kfreebsd-i386 kfreebsd-amd64],
 #		For todos, used on files that need to be accessible from
 #		DOS.
-	mtools [i386 m68k amd64 armhf arm64 kfreebsd-i386 kfreebsd-amd64 hurd-i386],
+	mtools [i386 ia64 m68k amd64 armhf arm64 kfreebsd-i386 kfreebsd-amd64 hurd-i386],
 #		mcopy is used to put files onto FAT filesystems w/o
 #		mounting them. Note that patches from #900409 and #900410
 #		are required for a reproducible build (available since
-- 
1.8.5.3

>From ab8e7c5fe5b3dcbad0dc0d2a8669fb9d3ce5a958 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Sat, 27 Apr 2019 22:39:31 +0000
Subject: [PATCH] ia64: Switch bootloader for d-i from elilo to grub in
 debian-cd

---
 tools/boot/buster/boot-ia64 | 120 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 96 insertions(+), 24 deletions(-)

diff --git a/tools/boot/buster/boot-ia64 b/tools/boot/buster/boot-ia64
index ba5b1996..67dda5a3 100755
--- a/tools/boot/buster/boot-ia64
+++ b/tools/boot/buster/boot-ia64
@@ -1,6 +1,9 @@
 #!/bin/bash
+
+# Based on boot-x86
 #
-# boot-ia64
+# Do install stuff for arm64, including making bootable CDs
+# Works with debian-installer
 #
 # $1 is the CD number
 # $2 is the temporary CD build dir
@@ -8,10 +11,14 @@
 . $BASEDIR/tools/boot/$DI_CODENAME/common.sh
 
 set -e
+#set -x
+
+# Workaround for #823881:
+export MTOOLS_SKIP_CHECK=1
 
 N=$1
 CDDIR=$2
-INSTALLDIR="install"
+INSTALLDIR="install.a64"
 
 # Common options for all disks
 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
@@ -24,39 +31,104 @@ if [ $N != "1" ]; then
 fi
 
 if [ "$DI_WWW_HOME" = "default" ]; then
-    DI_WWW_HOME="https://d-i.debian.org/daily-images/ia64/daily";
+    DI_WWW_HOME="https://d-i.debian.org/daily-images/arm64/daily";
     try_di_image_cache
 else
     DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,")
 fi
 
+case "$MKISOFS" in
+    *xorriso*)
+        XORRISO_VER=$(xorriso_version)
+        ;;
+    *)
+        echo "ERROR: debian-cd depends on xorriso for making $ARCH bootable CDs."
+        exit 1;
+        ;;
+esac
+
 cd $CDDIR/..
 
-# Download boot images
-for image in boot.img; do
+BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
+
+# Download boot images.
+for image in $BOOT_IMAGES; do
     if [ ! -e "$image" ]; then
-	if [ ! "$DI_WWW_HOME" ];then
-        	if [ ! "$DI_DIR" ];then
-		   DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
-		fi
-		cp "$DI_DIR/cdrom/$image" . || \
-		cp "$DI_DIR/$image" .
-	else
-		$WGET "$DI_WWW_HOME/cdrom/$image" || \
-		$WGET "$DI_WWW_HOME/$image"
-	fi
+        dir=$(dirname $image)
+        mkdir -p $dir
+        if [ -n "$LOCAL"  -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
+            cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
+        elif [ ! "$DI_WWW_HOME" ];then
+            if [ ! "$DI_DIR" ];then
+                DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
+            fi
+            cp "$DI_DIR/$image" "$image"
+        else
+            $WGET "$DI_WWW_HOME/$image" -O "$image"
+        fi
     fi
 done
 
-mkdir -p boot$N/boot
-cp -f boot.img boot$N/boot/
-add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-no-emul-boot"
-add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-b boot/boot.img"
-add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-c boot/boot.catalog"
+mkdir -p $CDDIR/$INSTALLDIR
+cp -lf cdrom/vmlinuz $CDDIR/$INSTALLDIR/
+cp -lf cdrom/initrd.gz $CDDIR/$INSTALLDIR/
+
+# Boot setup including config and help files comes from d-i.
+mkdir -pv $PWD/boot$N
+cat cdrom/debian-cd_info.tar.gz | (cd boot$N/; tar zx)
+
+if [ -d boot$N/grub ] ; then
+    echo "  Adding EFI boot code for $ARCH on CD$N"
+
+    # Move GRUB files to the right place.
+    mkdir -p $CDDIR/EFI/boot
+    mcopy -n -s -i boot$N/grub/efi.img '::efi/*' $CDDIR/EFI
+    mkdir -p $CDDIR/boot/grub
+    mv boot$N/grub/* $CDDIR/boot/grub/
+    rmdir boot$N/grub
+
+    # Stuff the EFI boot files into a FAT filesystem, making it as
+    # small as possible. We end up re-packing like this in case we're
+    # making a multi-arch image
+
+    # First, work out how many blocks we need
+    blocks=$(calculate_efi_image_size $CDDIR)
+
+    # Now make a new image to contain the files
+    rm -f $CDDIR/boot/grub/efi.img
+    mkfs.msdos -v -C "$CDDIR/boot/grub/efi.img" $blocks >/dev/null
 
-bls=$(calc_boot_size "boot$N/boot/boot.img")
-add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-boot-load-size $bls"
-add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
+    # And copy them into place
+    mmd -i "$CDDIR/boot/grub/efi.img" ::efi
+    mcopy -o -s -i "$CDDIR/boot/grub/efi.img" $CDDIR/EFI/* \
+        "::efi"
 
-# done
+    # Ugh - different code here depending on the version of xorriso we've got
+    if [ $XORRISO_VER -le 10202 ] ; then
+        echo "ERROR: debian-cd depends on xorriso > 1.2.2 for making $ARCH bootable CDs."
+        exit 1;
+    elif [ $XORRISO_VER -gt 10202 ] ; then
+        echo "    Using newer EFI support in xorriso $XORRISO_VER"
+
+	# Location of the EFI boot image, and don't emulate a floppy or HD
+        add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-e boot/grub/efi.img -no-emul-boot"
+
+	# Add an *extra* partition on the end for the EFI bits
+	add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-append_partition 2 0xef $CDDIR/boot/grub/efi.img"
+
+	# And force alignment
+	add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-partition_cyl_align all"
+    fi
+
+    # Finally, belt and braces - fix up the %install% entries in grub
+    # in case they're still there
+    sed -i "s,\%install\%,$INSTALLDIR,g" $CDDIR/boot/grub/grub.cfg
+
+    # Substitute custom KERNEL_PARAMS into grub.cfg
+    sed -i "s,/vmlinuz ,/vmlinuz $KERNEL_PARAMS ,g" $CDDIR/boot/grub/grub.cfg
+
+else
+    echo "  No EFI boot code for $ARCH on CD$N"
+fi
 
+# th,th, thats all
-- 
2.11.0


Reply to: