[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



On 4/27/19 5:35 PM, Mark Cave-Ayland wrote:
>> I set $CDDIR to the source directory which contains core.img? How does the initial
>> bootloader know that it has to boot core.img?
> 
> This is the part which Thomas explained: the offset of core.img *as embedded within
> the ISO filesystem image* and its size are embedded at byte offsets 552 and 560
> respectively from the start of the image. From what I can see boot.S/diskboot.S seek
> to sector 1, read in these values, seek to the start offset and then read the
> relevant number of bytes into memory before finally transferring control.

But how does genisoimage know that it is supposed to place "core.img" there?

This is simply what I cannot wrap my head around it. There is some hidden magic
that knows that it has to put "core.img" there, but the file is never mentioned
anywhere.

FWIW, it also doesn't boot:

{0} ok boot cdrom
Boot device: /virtual-devices@100/channel-devices@200/disk@1  File and args: 
WARNING: Unsupported bootblk image, can not extract fcode

WARNING: Bootblk fcode extraction failed

The file just loaded does not appear to be executable.
{0} ok

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

Current debian-cd patch attached.

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
diff --git a/tools/boot/buster/boot-sparc64 b/tools/boot/buster/boot-sparc64
index 778aee7f..1a383944 100755
--- a/tools/boot/buster/boot-sparc64
+++ b/tools/boot/buster/boot-sparc64
@@ -1,93 +1,78 @@
-#!/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
+BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinux cdrom/debian-cd_info.tar.gz"
 
-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)
+# 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
 
-if [ -n "$ARCHIVE_EXTRACTED_SOURCES" ]; then
-    echo $silo_deb >> $CDDIR/../$N.pkgs_extracted
-    find_pkg_file silo source >> $CDDIR/../$N.pkgs_extracted
-fi
+# 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)
 
-# 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/
+add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-G $CDDIR/../CD1/boot/grub/sparc64-ieee1275/cdboot.img -B ..."
 
-# Sparc64 kernel is so big, that uncompressing it corrupts SILO memory, so
-# uncompress it before hand.
+# Copy kernel and initrd
+mkdir -p $INSTALLDIR
+cp -lf cdrom/vmlinux $INSTALLDIR/
+cp -lf cdrom/initrd.gz $INSTALLDIR/
 
-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
-
-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

Reply to: