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

Re: Bug#145318: new version of my previous patch (takes binutils-multiarch into account)



On Sat, May 04, 2002 at 11:37:27AM +0200, Karsten Merker wrote:
> On Fri, May 03, 2002 at 09:40:09PM +0200, Raphael Hertzog wrote:
> > Le Wed, May 01, 2002 at 12:54:32PM +0200, Karsten Merker écrivait:
> 
> > I still have one problem with your patch (ignoring the fact that it
> > needs root rights to be built) :
> 
> I have built a new version of mkdecbootcd which allows delivering
> the needed values on the command line and not letting mkdecbootcd
> use a loop-mounted image. In conjunction with a modified patch
> for debian-cd (based on Flo's hint regarding isoinfo) no root
> access should be needed anymore. I still need to test whether 
> practice meets theory - shall say: whether my changes really 
> work, but this will probably have to wait until tomorrow.

I have completed the test cyle - practice meets theory :-)

> > mkdecbootcd doesn't exist for i386 ... and we need to be able to build
> > all images on i386. Can you provide this program on i386 (ie make a
> > package) ?

At http://people.debian.org/~merker/experimental_packages/mkdecbootcd-0.2/
the new mkdecbootcd version is available for i386. 

The new version of my debian-cd patch, which uses mkdecbootcd V0.2 and
does not require root access anymore, is appended to this mail.

Regards,
Karsten
-- 
#include <standard_disclaimer>
Nach Paragraph 28 Abs. 3 Bundesdatenschutzgesetz widerspreche ich der Nutzung
oder Uebermittlung meiner Daten fuer Werbezwecke oder fuer die Markt- oder
Meinungsforschung.
diff -Nur debian-cd-2.2.14/Makefile debian-cd-2.2.14.patched/Makefile
--- debian-cd-2.2.14/Makefile	Tue Apr 23 23:29:33 2002
+++ debian-cd-2.2.14.patched/Makefile	Wed May  1 10:26:00 2002
@@ -893,10 +893,11 @@
 	 volid=`cat $(CD).volid`; rm -f $(OUT)/$(CODENAME)-$(ARCH)-$(CD).raw; \
 	 $(MKISOFS) $(MKISOFS_OPTS) -V "$$volid" \
 	  -o $(OUT)/$(CODENAME)-$(ARCH)-$(CD).raw $$opts CD$(CD); \
-	 if [ -f $(BASEDIR)/tools/boot/$(CODENAME)/post-boot-$(ARCH) ]; then \
-		$(BASEDIR)/tools/boot/$(CODENAME)/post-boot-$(ARCH) $$n $$dir \
-		 $(OUT)/$(CODENAME)-$(ARCH)-$$n.raw; \
-	 fi
+         if [ -f $(BASEDIR)/tools/boot/$(CODENAME)/post-boot-$(ARCH) ]; then \
+                $(BASEDIR)/tools/boot/$(CODENAME)/post-boot-$(ARCH) $(CD) $(BDIR)/CD$(CD) \
+                 $(OUT)/$(CODENAME)-$(ARCH)-$(CD).raw; \
+         fi
+
 src-image: ok src-md5list $(OUT)
 	@echo "Generating the source iso image n°$(CD) ..."
 	@test -n "$(CD)" || (echo "Give me a CD=<num> parameter !" && false)
diff -Nur debian-cd-2.2.14/tools/boot/woody/boot-mipsel debian-cd-2.2.14.patched/tools/boot/woody/boot-mipsel
--- debian-cd-2.2.14/tools/boot/woody/boot-mipsel	Mon Apr 22 21:45:50 2002
+++ debian-cd-2.2.14.patched/tools/boot/woody/boot-mipsel	Wed May  1 10:46:31 2002
@@ -1,11 +1,50 @@
-#!/bin/sh
-
-# Mipsel doesn't have bootable CD support yet.
+#!/bin/bash
+#
+# boot-mipsel - (C) 2002 by Karsten Merker <merker@debian.org>
 #
-# This file must however exist so that debian-cd doesn't complain about
-# lack of "bootable" support.
+# You may copy, modify and distribute this under the terms of the GNU
+# General Public License as published by the Free Software Foundation; 
+# either version 2 of the License, or (at your option) any later version.
 #
-# -- Raphaël Hertzog
+# Using this script on any architecture other than mipsel requires
+# having binutils-multiarch installed, as it uses objcopy (a part
+# of binutils) which is platform dependent. The binutils-multiarch 
+# package contains an objcopy which is capable of dealing with other 
+# arches' binary formats.
+#
+# $1 is the CD number
+# $2 is the temporary CD build dir
+
+N=$1
+CDROOT=$2
+
+# Strip NONUS part of disk number
+# NN will be 1...N so it can be used as an index
+#
+NN=`echo $N | sed -e 's/_NONUS//'`
+
+cd $CDROOT/..
+
+:> $1.mkisofs_opts
+
+KTYPE[1]="r3k-kn02"
+KTYPE[2]="r4k-kn04"
+KTYPE[3]=""
+KTYPE[4]=""
+KTYPE[5]=""
+KTYPE[6]=""
+KTYPE[7]=""
+KTYPE[8]=""
+
+
+# Only disks 1 and 2 bootable
+if [ $NN != 1 -a $NN != 2 ]; then
+	exit 0
+fi
+
+mkdir -p $CDROOT/cdboot
+
+objcopy -O binary CD1/dists/$CODENAME/main/disks-$ARCH/current/tftpimage-${KTYPE[$NN]} $CDROOT/cdboot/tftpimage-${KTYPE[$NN]}.raw
 
 exit 0
 
diff -Nur debian-cd-2.2.14/tools/boot/woody/post-boot-mipsel debian-cd-2.2.14.patched/tools/boot/woody/post-boot-mipsel
--- debian-cd-2.2.14/tools/boot/woody/post-boot-mipsel	Thu Jan  1 01:00:00 1970
+++ debian-cd-2.2.14.patched/tools/boot/woody/post-boot-mipsel	Fri May  3 16:40:03 2002
@@ -0,0 +1,62 @@
+#!/bin/bash
+#
+# post-boot-mipsel - (C) 2002 by Karsten Merker <merker@debian.org>
+#
+# Do post-image-building tasks for mipsel, to make CDs bootable.
+#
+# You may copy, modify and distribute this under the terms of the GNU
+# General Public License as published by the Free Software Foundation;
+# either version 2 of the License, or (at your option) any later version.
+#
+# Using this script on any architecture other than mipsel requires
+# having binutils-multiarch installed, as it uses objdump (a part
+# of binutils) which is platform dependent. The binutils-multiarch
+# package contains an objdump which is capable of dealing with other
+# arches' binary formats.
+#
+# $1 is the CD number
+# $2 is the temporary CD build dir
+# $3 is the image file
+
+set -e
+
+N=$1
+CDROOT=$2
+CDIMAGE=$3
+
+echo "post-boot-mipsel called"
+echo "pwd=${PWD}, N=$N, CDROOT=${CDROOT}, CDIMAGE=${CDIMAGE}"
+
+
+# Strip NONUS part of disk number
+# NN will be 1...N so it can be used as an index
+#
+NN=`echo $N | sed -e 's/_NONUS//'`
+
+cd $CDROOT/..
+
+# Only disks 1 and 2 bootable
+if [ $NN != 1 -a $NN != 2 ]; then
+        exit 0
+fi
+
+KTYPE[1]="r3k-kn02"
+KTYPE[2]="r4k-kn04"
+KTYPE[3]=""
+KTYPE[4]=""
+KTYPE[5]=""
+KTYPE[6]=""
+KTYPE[7]=""
+KTYPE[8]=""
+
+LINE=$(isoinfo -i ${CDIMAGE} -lR |grep tftpimage-${KTYPE[$NN]}.raw)
+CDSTARTEXTEND=$(echo $LINE | cut -d "[" -f 2 | cut -d "]" -f 1)
+CDNUMBLOCKS=$((($(echo $LINE |tr -s " "| cut -f 5 -d " ") + 2047)/2048))
+KERNEL_ENTRY=$(objdump -f CD1/dists/$CODENAME/main/disks-$ARCH/current/tftpimage-${KTYPE[$NN]} | grep "start address" | cut -f 3 -d " ")
+# echo "LINE=${LINE}"
+# echo "CDSTARTEXTEND=${CDSTARTEXTEND}"
+# echo "CDNUMBLOCKS=${CDNUMBLOCKS}"
+# echo "KERNEL_ENTRY=${KERNEL_ENTRY}"
+mkdecbootcd -m ${CDSTARTEXTEND} ${CDNUMBLOCKS} ${CDIMAGE} ${KERNEL_ENTRY}
+
+exit 0

Reply to: