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

Re: Bug#927892: grub-ieee1275-bin: Please add bootinfo.txt for sparc and sparc64



Okay, so I have managed to build an image now, that's the good news:

> https://people.debian.org/~glaubitz/debian-10.0-sparc64-grub-NETINST-1.iso

The bad news is, it doesn't boot yet:

{0} ok boot cdrom
Boot device: /virtual-devices@100/channel-devices@200/disk@1  File and args: 
ERROR: /virtual-devices@100/channel-devices@200/disk@1: Can't open disk label package


Can't open boot device

{0} ok

With the attached d-i patch, debian-installer builds with GRUB instead of SILO
and produces a sparc64.elf boot image plus a grub.cfg configuration file.

The other patch shows the current modifications to debian-cd.

I assume the only thing that is missing is the correct parameter to mkisofs
so that it builds a bootable image, but I haven't looked that up yet. And we
don't need to create the directory "sparc64-ieee1275", it stays empty anyway
as opposed to ppc64el.

Adrian

-- 
 .''`.  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 95d2e56c80db93aee39761b73ff6099b033e0575 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Wed, 24 Apr 2019 21:59:38 +0200
Subject: [PATCH] sparc64: Switch bootloader for d-i images from silo to
 grub-ieee1275

---
 build/boot/sparc64/debian.txt       | 17 ---------
 build/boot/sparc64/grub-cdrom.cfg   | 40 ++++++++++++++++++++
 build/boot/sparc64/notsupported.txt |  5 ---
 build/boot/sparc64/silo.conf        | 33 ----------------
 build/config/sparc64.cfg            | 58 ++++++++++++++++++++++++++---
 build/config/sparc64/cdrom.cfg      |  9 ++---
 build/config/sparc64/miniiso.cfg    | 30 ---------------
 build/config/sparc64/netboot.cfg    | 19 ++--------
 debian/changelog                    |  3 ++
 debian/control                      |  4 +-
 10 files changed, 105 insertions(+), 113 deletions(-)
 delete mode 100644 build/boot/sparc64/debian.txt
 create mode 100644 build/boot/sparc64/grub-cdrom.cfg
 delete mode 100644 build/boot/sparc64/notsupported.txt
 delete mode 100644 build/boot/sparc64/silo.conf
 delete mode 100644 build/config/sparc64/miniiso.cfg

diff --git a/build/boot/sparc64/debian.txt b/build/boot/sparc64/debian.txt
deleted file mode 100644
index 1bae0c634..000000000
--- a/build/boot/sparc64/debian.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-
-                  Welcome to Debian GNU/Linux ${DEBIAN_VERSION}!
-
-This is a Debian installation ${MEDIA_TYPE}, built on ${BUILD_DATE}.
-Keep it once you have installed your system, as you can boot from it
-to repair the system on your hard disk if that ever becomes necessary.
-
-WARNING: You should completely back up all of your hard disks before
-  proceeding. The installation procedure can completely and irreversibly
-  erase them! If you haven't made backups yet, remove the rescue CD from
-  the drive and press L1-A to get back to the OpenBoot prompt.
-
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted
-by applicable law.
-
-[ ENTER - Boot install ]   [ Type "expert" - Boot into expert mode ]
-                           [ Type "rescue" - Boot into rescue mode ]
diff --git a/build/boot/sparc64/grub-cdrom.cfg b/build/boot/sparc64/grub-cdrom.cfg
new file mode 100644
index 000000000..41af6af63
--- /dev/null
+++ b/build/boot/sparc64/grub-cdrom.cfg
@@ -0,0 +1,40 @@
+set default=2
+set timeout=-1
+
+insmod echo
+insmod gzio
+insmod minicmd
+insmod normal
+
+menuentry "Debian GNU/Linux installer boot menu" {
+	true
+}
+
+menuentry "" {
+	true
+}
+
+function boot_one {
+	echo "Loading ..."
+	linux	${KERNEL} $options --- quiet
+	initrd	${INITRD}
+}
+
+menuentry "Default install" {
+        boot_one
+}
+
+menuentry "Automated install" {
+	set options="auto=true priority=critical"
+	boot_one
+}
+
+menuentry "Expert install" {
+	set options="priority=low"
+	boot_one
+}
+
+menuentry "Rescue mode" {
+	set options="rescue/enable=true"
+	boot_one
+}
diff --git a/build/boot/sparc64/notsupported.txt b/build/boot/sparc64/notsupported.txt
deleted file mode 100644
index 871731fb3..000000000
--- a/build/boot/sparc64/notsupported.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-This subarchitecture is currently not supported by Debian.
-Only 64-bit systems are supported (sparc64).
-
-The last Debian release to support sparc32 (sun4m) was Etch (4.0).
diff --git a/build/boot/sparc64/silo.conf b/build/boot/sparc64/silo.conf
deleted file mode 100644
index 307e1fe09..000000000
--- a/build/boot/sparc64/silo.conf
+++ /dev/null
@@ -1,33 +0,0 @@
-partition=1
-timeout=600
-message=/boot/debian.txt
-default=install
-initrd=/boot/initrd.gz
-read-write
-
-# Standard boot images
-image[sun4u]=/boot/vmlinuz-sparc64
-  label=install
-image[sun4,sun4c,sun4d,sun4m]="cat /boot/notsupported.txt"
-  label=install
-
-# Expert boots
-image[sun4u]=/boot/vmlinuz-sparc64
-  label=expert
-  append="priority=low"
-image[sun4,sun4c,sun4d,sun4m]="cat /boot/notsupported.txt"
-  label=expert
-
-# Rescue boots
-image[sun4u]=/boot/vmlinuz-sparc64
-  label=rescue
-  append="rescue/enable=true"
-image[sun4,sun4c,sun4d,sun4m]="cat /boot/notsupported.txt"
-  label=rescue
-
-# Auto install boots
-image[sun4u]=/boot/vmlinuz-sparc64
-  label=auto
-  append="auto=true priority=critical"
-image[sun4,sun4c,sun4d,sun4m]="cat /boot/notsupported.txt"
-  label=auto
diff --git a/build/config/sparc64.cfg b/build/config/sparc64.cfg
index 521d6ba95..268042839 100644
--- a/build/config/sparc64.cfg
+++ b/build/config/sparc64.cfg
@@ -1,15 +1,61 @@
-MEDIUM_SUPPORTED = cdrom netboot #miniiso
-
-VERSIONED_SYSTEM_MAP = t
+MEDIUM_SUPPORTED = cdrom netboot
 
 KERNELMAJOR = 2.6
-KERNELVERSION = $(LINUX_KERNEL_ABI)-sparc64
-
+BASEVERSION = $(LINUX_KERNEL_ABI)
+KERNELVERSION = $(BASEVERSION)-sparc64
 KERNELNAME = vmlinuz-${KERNELVERSION}
 
-DEBIAN_RELEASE = unstable
+VERSIONED_SYSTEM_MAP = t
 
+DEBIAN_RELEASE = unstable
 KEYRING = /usr/share/keyrings/debian-ports-archive-keyring.gpg
 
+GRUB_CFG_CDROM = boot/sparc64/grub-cdrom.cfg
+
+# GRUB modules
+GRUB_MODULES = echo gzio linux minicmd normal
+GRUB_MODULES_CDROM = iso9660
+
 arch_boot_screens:
 arch_tree:
+
+# Miniature CD image using GRUB, with only an initrd, no udebs or debs.
+.PHONY: arch_miniiso
+arch_miniiso: $(TEMP_INITRD) $(TEMP_KERNEL) $(TREE)
+	-rm -f $(TEMP_CD_TREE)/*
+	mkdir -p $(TEMP_CD_TREE)/boot/grub/sparc64-ieee1275 \
+		 $(TEMP_CD_TREE)/sparc64 \
+		 $(TEMP_CD_TREE)/install
+
+	cp $(TEMP_KERNEL) $(TEMP_CD_TREE)/install/vmlinux
+	cp $(TEMP_INITRD) $(TEMP_CD_TREE)/install/initrd.gz
+
+	bootvars-subst \
+		KERNEL /install/vmlinux \
+		INITRD /install/initrd.gz \
+	< $(GRUB_CFG_CDROM) > $(TEMP_CD_TREE)/boot/grub/grub.cfg
+
+	grub-mkrescue --output=$(TEMP_MINIISO) $(TEMP_CD_TREE)
+
+# genisoimage CD info directory, including GRUB and configuration files.
+.PHONY: arch_cd_info_dir
+arch_cd_info_dir:
+	rm -rf $(TEMP_CD_INFO_DIR)
+	mkdir -p $(TEMP_CD_INFO_DIR)/boot/grub/sparc64-ieee1275 \
+		 $(TEMP_CD_INFO_DIR)/sparc64
+
+	bootvars-subst \
+		KERNEL /install/vmlinux \
+		INITRD /install/initrd.gz \
+	< $(GRUB_CFG_CDROM) > $(TEMP_CD_INFO_DIR)/boot/grub/grub.cfg
+	grub-mkimage -O sparc64-ieee1275-cdcore -p '()/boot/grub' \
+		-o $(TEMP_CD_INFO_DIR)/boot/grub/sparc64.elf \
+		$(GRUB_MODULES) $(GRUB_MODULES_CDROM)
+
+# Netboot files
+.PHONY: arch_netboot_dir
+arch_netboot_dir:
+	-rm -f $(TEMP_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)
diff --git a/build/config/sparc64/cdrom.cfg b/build/config/sparc64/cdrom.cfg
index 22d6aa1d5..38547cbd0 100644
--- a/build/config/sparc64/cdrom.cfg
+++ b/build/config/sparc64/cdrom.cfg
@@ -1,9 +1,8 @@
 MEDIA_TYPE = CD-ROM
 
-TYPE = cdrom
-
-TARGET = $(INITRD) $(KERNEL)
+TARGET = $(INITRD) $(KERNEL) $(DEBIAN_CD_INFO)
 EXTRANAME = $(MEDIUM)/
 
-MANIFEST-INITRD = "initrd for CDROM"
-MANIFEST-KERNEL = "kernel for CDROM"
+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/sparc64/miniiso.cfg b/build/config/sparc64/miniiso.cfg
deleted file mode 100644
index e9114c1b3..000000000
--- a/build/config/sparc64/miniiso.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-MEDIA_TYPE = CD-ROM
- 
-TYPE = netboot
-
-TARGET = $(TEMP_BOOT) $(MINIISO)
-
-MANIFEST-MINIISO = "tiny bootable CD image for pure network install"
- 
-.PHONY: arch_miniiso arch_boot_screens arch_boot
-arch_miniiso:
-	-rm -rf $(TEMP_CD_TREE)/*
-	install -m 644 -D $(TEMP)/initrd.gz $(TEMP_CD_TREE)/boot/initrd.gz
-	install -m 644 -D $(TEMP)/vmlinuz*64 $(TEMP_CD_TREE)/boot/vmlinuz-sparc64
-	install -m 644 /boot/second.b $(TEMP_CD_TREE)/boot
-	install -m 644 $(TEMP_BOOT_SCREENS)/debian.txt $(TEMP_CD_TREE)/boot
-	install -m 644 $(TEMP_BOOT_SCREENS)/notsupported.txt $(TEMP_CD_TREE)/boot
-	install -m 644 boot/sparc/silo.conf $(TEMP_CD_TREE)/boot
- 
-	genisoimage -r -J -o $(TEMP_MINIISO) -G /boot/isofs.b -B ... $(TEMP_CD_TREE)
-
-arch_boot_screens:
-	-rm -f $(TEMP_BOOT_SCREENS)/*
-	mkdir -p $(TEMP_BOOT_SCREENS)
-	bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \
-		DEBIAN_VERSION "$(DEBIAN_VERSION)" \
-		BUILD_DATE "$(BUILD_DATE)" \
-		< boot/sparc/debian.txt > $(TEMP_BOOT_SCREENS)/debian.txt
-	cp boot/sparc/notsupported.txt $(TEMP_BOOT_SCREENS)/notsupported.txt
-
-arch_boot:
diff --git a/build/config/sparc64/netboot.cfg b/build/config/sparc64/netboot.cfg
index 4a7072181..e38305f14 100644
--- a/build/config/sparc64/netboot.cfg
+++ b/build/config/sparc64/netboot.cfg
@@ -1,19 +1,8 @@
 MEDIA_TYPE = netboot image
- 
-TYPE = netboot
 
-TARGET = $(BOOT)
+NETBOOT_DIR_TARGETS = $(TEMP_INITRD) $(TEMP_KERNEL)
+TARGET = $(NETBOOT_DIR) $(NETBOOT_TAR) $(MINIISO)
 EXTRANAME = $(MEDIUM)/
 
-MANIFEST-BOOT = "tftp boot image for sparc64"
-
-TEMP_INITRD_XZ = $(TEMP)/initrd.xz
-
-$(TEMP_INITRD_XZ): $(TEMP_INITRD)
-	# xz options ensure that kernel's decoder can handle the image.
-	zcat $(TEMP_INITRD) | xz --check=crc32 --lzma2=dict=512KiB > $(TEMP_INITRD_XZ)
-
-.PHONY: arch_boot
-arch_boot: $(TEMP_INITRD_XZ)
-	gzip -c $(TEMP)/System.map-$(KERNELVERSION) >$(TEMP)/System.map.gz
-	tftpboot.sh $(TEMP_KERNEL) $(TEMP)/System.map.gz $(TEMP_INITRD_XZ) $(TEMP_BOOT)
+MANIFEST-NETBOOT_DIR = "boot directory for tftp server"
+MANIFEST-NETBOOT_TAR = "tarball of boot directory"
diff --git a/debian/changelog b/debian/changelog
index 263a2c836..3eae9e1ff 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,9 @@ debian-installer (20190411) UNRELEASED; urgency=medium
     debian-ports-archive-keyring-udeb.
   * Add Å?Å? glyphs for the french translation.
 
+  [ John Paul Adrian Glaubitz ]
+  * sparc64: Switch bootloader for d-i images from silo to grub-ieee1275.
+
  -- Cyril Brulebois <kibi@debian.org>  Fri, 19 Apr 2019 22:45:44 +0200
 
 debian-installer (20190410) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index b5e13507c..d38a5a864 100644
--- a/debian/control
+++ b/debian/control
@@ -90,7 +90,7 @@ Build-Depends:
 #		A previous version didn't have netabootwrap.
 	palo [hppa],
 #		Bootloader for hppa machines, to make netboot images.
-	silo [sparc sparc64],
+	silo [sparc],
 #		Using silo is problematic since it needs to run as root,
 #		so images that need it are not built by default, but we
 #		include it for completeness.
@@ -115,7 +115,7 @@ Build-Depends:
 	grub-efi-arm-bin [armhf],
 	grub-common [amd64 arm64 i386], xorriso,
 #		Used to make EFI bootable images
-	grub-ieee1275-bin [ppc64el],
+	grub-ieee1275-bin [ppc64el sparc64],
 #		IEEE1275 bootloader support.
 	u-boot-imx (>= 2019.01+dfsg-3) [armhf],
 	u-boot-omap (>= 2016.09~rc1) [armhf],
-- 
2.20.1

>From dff7b25cddaf54b0e90f20f3576a017c154d5bd6 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@casulana.debian.org>
Date: Wed, 24 Apr 2019 22:01:15 +0000
Subject: [PATCH] sparc64: Switch bootloader to GRUB

---
 tools/boot/buster/boot-sparc64 | 115 ++++++++++++++++++-----------------------
 tools/generate_di+k_list       |   1 -
 2 files changed, 49 insertions(+), 67 deletions(-)

diff --git a/tools/boot/buster/boot-sparc64 b/tools/boot/buster/boot-sparc64
index 778aee7f..b619d836 100755
--- a/tools/boot/buster/boot-sparc64
+++ b/tools/boot/buster/boot-sparc64
@@ -1,93 +1,76 @@
-#!/bin/bash -e
-# 
-# boot-sparc64
+#!/bin/bash
 #
-# Do install stuff for sparc64, including making first CD bootable
+# Do install stuff for sparc64, including making bootable CDs
+# Works with debian-installer
+#
+# $1 is the CD number
+# $2 is the temporary CD build dir
 
 . $BASEDIR/tools/boot/$DI_CODENAME/common.sh
 
 set -e
+#set -x
 
 N=$1
 CDDIR=$2
+INSTALLDIR=$CDDIR/install
+
+# Common mkisofs options when creating CDs
+add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
+add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
+add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-l"
 
 # Exit if this is not CD#1/DVD#1
 if [ $N != "1" ]; then
-    add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
-    add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
-    add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-l"
     exit 0
 fi
 
 if [ "$DI_WWW_HOME" = "default" ]; then
-    DI_WWW_HOME="https://d-i.debian.org/daily-images/sparc64/daily/cdrom/";
+    DI_WWW_HOME="https://d-i.debian.org/daily-images/sparc64/daily";
     try_di_image_cache
 else
     DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,")
 fi
 
-add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-G boot1/boot/isofs.b -B ..."
-add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot1"
-
-inst=boot1
+# case "$MKISOFS" in
+#     *xorriso*)
+#         XORRISO_VER=$(xorriso_version)
+#         ;;
+#     *)
+# 	echo "ERROR: debian-cd now depends on xorriso for making sparc64 bootable CDs."
+# 	exit 1;
+# 	;;
+# esac
 
 cd $CDDIR/..
 
-# Setup directories
-mkdir -p $inst/boot
-
-silo_deb=$(find_pkg_file silo)
-if [ -z "$silo_deb" ]; then
-       echo "ERROR: silo package is required"
-       exit 1
-fi 
-# put the relevant parts of SILO boot loader
-(dpkg --fsys-tarfile $MIRROR/$silo_deb | \
-	tar xf - -C $inst/ ./boot/{isofs,second}.b)
-
-if [ -n "$ARCHIVE_EXTRACTED_SOURCES" ]; then
-    echo $silo_deb >> $CDDIR/../$N.pkgs_extracted
-    find_pkg_file silo source >> $CDDIR/../$N.pkgs_extracted
-fi
+BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinux cdrom/debian-cd_info.tar.gz"
 
-# Some custom etc files
-cp -f -p $BASEDIR/data/${CODENAME}/sparc64/silo.conf $inst/boot/
-if [ -n "$KERNEL_PARAMS" ]; then
-	# Add KERNEL_PARAMS to any existing append line
-	sed -i "/^[[:space:]]*append=\"/ s|append=\"|append=\"$KERNEL_PARAMS |" \
-		$inst/boot/silo.conf
-	# If there is no default append= line, add it
-	if ! grep -q "^append=" $inst/boot/silo.conf; then
-		sed -i "/^default=/ a\append=\"$KERNEL_PARAMS\"" \
-			$inst/boot/silo.conf
-	fi
-fi
-cat $BASEDIR/data/${CODENAME}/sparc64/debian.txt \
- | sed "s/\${MEDIA_TYPE}/CDROM/" \
- | sed "s/\${DEBIAN_VERSION}/${CODENAME}/g" \
- | sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
- > $inst/boot/debian.txt
-cp $BASEDIR/data/${CODENAME}/sparc64/notsupported.txt $inst/boot/
+# Download boot images.
+for image in $BOOT_IMAGES; do
+    if [ ! -e "$image" ]; then
+        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
 
-# Sparc64 kernel is so big, that uncompressing it corrupts SILO memory, so
-# uncompress it before hand.
+# Boot setup including config and help files comes from d-i.
+mkdir -pv $PWD/CD$N
+cat cdrom/debian-cd_info.tar.gz | (cd CD$N/; tar zx)
 
-if [ ! "$DI_WWW_HOME" ];then
-	if [ ! "$DI_DIR" ];then
-	   DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images/cdrom"
-	fi
-else
-	DI_DIR="cdrom"
-	mkdir "./$DI_DIR"
-	$WGET "$DI_WWW_HOME" -O ./$DI_DIR/di.dir
-	sparc64=$(sed -n 's/.*a href="\(vmlinuz-.*-sparc64\)".*/\1/ip' ./$DI_DIR/di.dir)
-	$WGET "$DI_WWW_HOME/$sparc64" -O ./$DI_DIR/vmlinuz-x-sparc64
-	$WGET "$DI_WWW_HOME/initrd.gz" -O ./$DI_DIR/initrd.gz
-fi
+# Copy kernel and initrd
+mkdir -p $INSTALLDIR
+cp -lf cdrom/vmlinux $INSTALLDIR/
+cp -lf cdrom/initrd.gz $INSTALLDIR/
 
-if [ ! -e "$DI_DIR"/initrd.gz ] ; then
-    DI_DIR="$DI_DIR"/cdrom
-fi
-cp "$DI_DIR"/initrd.gz "$inst/boot/initrd.gz"
-#cp "$DI_DIR"/vmlinuz-*-sparc32 "$inst/boot/sparc32"
-zcat "$DI_DIR"/vmlinuz-*-sparc64 > "$inst/boot/sparc64"
+exit 0
diff --git a/tools/generate_di+k_list b/tools/generate_di+k_list
index 3eb3a25f..97390663 100755
--- a/tools/generate_di+k_list
+++ b/tools/generate_di+k_list
@@ -248,7 +248,6 @@ linux-image-sparc64-smp
 initramfs-tools
 grub-ieee1275
 busybox
-silo
 linux-image-sparc64
 linux-image-sparc64-smp
 #endif
-- 
2.11.0


Reply to: