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

Patch: Set boot options for dbootstrap + CreditCardCD



I added the ability to set options for dbootstrap.

if you set f.e.

BOOTOPS="quiet cdrom bootkbd=qwerty/us"

then the installation process will be less wordy. No longer asks for cd
paths and automatically installs a US keyboard.

I would like to take this further and be able to automatize all of the
installation process with these settings. Probably need to modify
dbootstrap for this.

How can I get this stuff into cvs? 


Index: CONF.sh
===================================================================
RCS file: /cvs/debian-boot/debian-cd/CONF.sh,v
retrieving revision 1.6
diff -u -r1.6 CONF.sh
--- CONF.sh	2000/05/18 22:49:00	1.6
+++ CONF.sh	2000/05/23 19:56:32
@@ -62,7 +62,23 @@
 # partition than your source files.
 # export COPYLINK=1
 
+# Use this to reduce the size of the first CD to a minimum and remove
+# packages already in the base tarball. This is usefull for credit card
+# size cds. You should also set COMPLETE=0 in order to avoid the filling up
+# of the CD.
+#export CCD=1
+
+# The following sets options to be passed to dbootstrap etc during the
+# install
+# cdrom = do not ask for paths. use cdrom paths
+# quiet = reduce dialogs
+# bootkbd = set keyboard do not query user
+
+export BOOTOPTS="cdrom quiet bootkbd=qwerty/us"
+
 # Options
 # export MKISOFS=/usr/bin/mkhybrid
 # export MKISOFS_OPTS="-a -r -T"	#For normal users
 # export MKISOFS_OPTS="-a -r -F -T"	#For symlink farmers
Index: Makefile
===================================================================
RCS file: /cvs/debian-boot/debian-cd/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- Makefile	2000/05/19 14:07:01	1.15
+++ Makefile	2000/05/23 19:56:32
@@ -9,6 +9,7 @@
 # before. For this you can source the CONF.sh 
 # file in your shell
 
+# Modified to support credit card size cds by Christoph Lameter <christoph@lameter.com>, May 18, 2000.
 
 ## DEFAULT VALUES
 
@@ -53,7 +54,7 @@
 HOOK=$(BASEDIR)/tools/$(CODENAME).hook
 endif
 ifndef BOOTDISKS
-BOOTDISKS=$(MIRROR)/dists/$(CODENAME)/main/disks-$(ARCH)
+export BOOTDISKS=$(MIRROR)/dists/$(CODENAME)/main/disks-$(ARCH)
 endif
 
 ## Internal variables  
@@ -162,14 +163,25 @@
 
 # Regenerate the status file with only packages that
 # are of priority standard or higher
+# If a credit card size cd has to be generated then a list of base packages
+# needs to be provided to list2cds and the status file will only consist of base packages
+# The way of determining the base packages might have to be changed due to changes
+# to the way base packages are marked by the debian project --19may2000 clameter
 status: init $(ADIR)/status
 $(ADIR)/status:
 	@echo "Generating a fake status file for apt-get and apt-cache..."
-	@zcat $(MIRROR)/dists/$(CODENAME)/main/binary-$(ARCH)/Packages.gz | \
+	@if [ "$(CCD)" != 0 ]; then \
+	zcat $(MIRROR)/dists/$(CODENAME)/main/binary-$(ARCH)/Packages.gz | \
 	perl -000 -ne 's/^(Package: .*)$$/$$1\nStatus: install ok installed/m; \
+	               print if (/^Section: base/m or /^Priority: required/m);' | \
+	tee $(ADIR)/status | grep "^Package:" | awk '{ print $$2; }' > $(ADIR)/list.base ; \
+	else \
+	zcat $(MIRROR)/dists/$(CODENAME)/main/binary-$(ARCH)/Packages.gz | \
+	perl -000 -ne 's/^(Package: .*)$$/$$1\nStatus: install ok installed/m; \
 	               print if (/^Priority: (required|important|standard)/m or \
-		       /^Section: base/m);' \
-	> $(ADIR)/status
+	               /^Section: base/m);' \
+        > $(ADIR)/status ;\
+	fi;
 	# Updating the apt database
 	@$(apt) update
 	#
@@ -393,8 +405,9 @@
 bin-doc: ok bin-infos $(BDIR)/1/doc
 $(BDIR)/1/doc:
 	@echo "Adding the documentation (bin) ..."
-	@$(addfiles) $(BDIR)/1 $(MIRROR) doc; 
-	@for i in $(BDIR)/*.packages; do \
+	@if [ "$(CCD)" = "" ]; then \
+	$(addfiles) $(BDIR)/1 $(MIRROR) doc; \
+	for i in $(BDIR)/*.packages; do \
 		dir=$${i%%.packages}; \
 		cp -d $(MIRROR)/README* $$dir/; \
 		rm -f $$dir/README $$dir/README.1ST \
@@ -434,7 +447,8 @@
 		if [ -e $(BASEDIR)/data/$(CODENAME)/README.multicd ]; then \
 		  cp $(BASEDIR)/data/$(CODENAME)/README.multicd $$dir/; \
 		fi; \
-	done
+	done; \
+	fi
 
 src-doc: ok src-infos $(SDIR)/1/README.html
 $(SDIR)/1/README.html:
@@ -462,7 +476,9 @@
 installtools: ok bin-doc disks $(BDIR)/1/tools
 $(BDIR)/1/tools:
 	@echo "Adding install tools and documentation ..."
-	@$(addfiles) $(BDIR)/1 $(MIRROR) tools
+	@if [ "$(CCD)" = "" ]; then \
+	$(addfiles) $(BDIR)/1 $(MIRROR) tools; \
+	fi;
 	@mkdir $(BDIR)/1/install
 	@if [ -x "$(BASEDIR)/tools/$(CODENAME)/installtools.sh" ]; then \
 		$(BASEDIR)/tools/$(CODENAME)/installtools.sh; \
@@ -477,7 +493,6 @@
 	@$(addfiles) \
 	  $(BDIR)/1/dists/$(CODENAME)/main/disks-$(ARCH) \
 	  $(BOOTDISKS) .
-	@#Keep only one copy of the disks stuff
 	@cd $(BDIR)/1/dists/$(CODENAME)/main/disks-$(ARCH); \
 	if [ "$(SYMLINK)" != "" ]; then exit 0; fi; \
 	if [ -L current ]; then \
@@ -487,7 +502,12 @@
  		mv .tmp_link $$CURRENT_LINK; \
 	elif [ -d current ]; then \
 		rm -rf [0123456789]*; \
+	fi; \
+	if [ "$(CCD)" != "" ]; then \
+	cd current;rm -rf `find * -type d` md5sum.txt install.bat README.txt linux; \
+	ln -s ../../../../../install images-1.44; \
 	fi;
+	# Remove some stuff to save space for Credit Card CDs.
 
 upgrade: ok bin-infos $(BDIR)/upgrade-stamp
 $(BDIR)/upgrade-stamp:
Index: tools/list2cds
===================================================================
RCS file: /cvs/debian-boot/debian-cd/tools/list2cds,v
retrieving revision 1.5
diff -u -r1.5 list2cds
--- tools/list2cds	2000/05/01 04:59:01	1.5
+++ tools/list2cds	2000/05/23 19:56:32
@@ -24,6 +24,7 @@
 my $adir = "$ENV{'APTTMP'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
 my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
 my $verbose = $ENV{'VERBOSE'} || 0;
+my $ccd = $ENV{'CCD'} || 0;
 
 $| = 1; # Autoflush for debugging
 
@@ -40,6 +41,7 @@
 my %included;
 my %excluded;
 my %packages;
+my %basepackage;
 
 msg(0, "
 ======================================================================
@@ -91,6 +93,19 @@
 	close EXCL;
 }
 
+# read list.base which is generated for credit card size cds and contains
+# a list of packages assumed to be present through the base.tgz file.
+# the debs for the base packages will not be included on the cd but handled
+# to satisfy dependencies. 18-May-2000 clameter
+
+if ($ccd) {
+	open (BASE,"<$adir/list.base") || die "Can't open $adir/list.base : $!\n";
+	while (defined($_=<BASE>)) {
+		chomp;
+		$basepackage{$_}=1;
+	}
+}
+
 # Now exclude more packages because of the non-free and non-us rules
 if (not $nonfree) {
 	foreach (grep { $packages{$_}{"Section"} =~ /non-free/ }
@@ -123,7 +138,7 @@
 close (STATS);
 
 # Browse the list of packages to include
-msg(0, "-- Adding standard, required, important and base packages \n" .
+msg(0, "-- Processing default packages and packages added by apt \n" .
        "   on the first CD ...\n");
 my ($total_size, $cd_size, $size, $cd) = (0, 0, 0, 1);
 my %cds;
@@ -141,10 +156,13 @@
                 next;
 	}
 	next if $excluded{$p};
-	$cd_size += $packages{$p}{"Size"};
-	$total_size += $packages{$p}{"Size"};
 	$included{$p} = 1;
-	add_to_cd (1, [ $p ]);
+	# Omit any packages in base for ccds
+	if (not $ccd or not $basepackage{$p}) {
+	  $cd_size += $packages{$p}{"Size"};
+	  $total_size += $packages{$p}{"Size"};
+	  add_to_cd (1, [ $p ]);
+	}
 }
 close STATUS;
 msg(0, "   Standard system already takes $cd_size bytes on the first CD.\n");
@@ -190,7 +208,8 @@
 	    msg(3, "$_ has already been included.\n");
 	    next;
 	}
-	add_package ($_, 1);
+        # Do not add suggested and recommended packages for ccds
+	add_package ($_, $ccd ? 0 : 1);
 }
 close LIST;
 
Index: tools/boot/potato/boot-i386
===================================================================
RCS file: /cvs/debian-boot/debian-cd/tools/boot/potato/boot-i386,v
retrieving revision 1.8
diff -u -r1.8 boot-i386
--- tools/boot/potato/boot-i386	2000/03/25 15:37:19	1.8
+++ tools/boot/potato/boot-i386	2000/05/23 19:56:32
@@ -7,12 +7,33 @@
 # Heavily hacked by RaphaŽl Hertzog <hertzog@debian.org> for
 # YACS (the new debian-cd in potato)
 # 12MAR00  updated for current i386 bootdisks  --jwest
-#
+# 18MAY00  added conditions for credit card cd. ccds
+#          also do not have a full disks-i386 directory. use $BOOTDISKS
+#          instead. Its also shorter. --clameter
+# 22may00  update to be able to use $BOOTOPTS to set kernel parameters on
+#          boot
 # Do install stuff for i386, including making bootable CDs
 #
 # $1 is the CD number
 # $2 is the temporary CD build dir
 
+
+setbootopts()
+{
+# Set boot options in an image already generated by the boot-floppies
+# package. This requires accessing and modifying the boot floppy image.
+# Parameters
+# $1 image
+# $2 options
+	if [ "$2" == "" ]; then
+		return
+	fi
+	echo "drive u: file=\"$1\"" >~/.mtoolsrc
+	mtype u:syslinux.cfg | sed -e "s%^APPEND %APPEND $2 %" -e 's/^TIMEOUT 0/TIMEOUT 10/' >~/SYSLINUX.CFG
+	mcopy -o ~/SYSLINUX.CFG u:
+	rm ~/SYSLINUX.CFG ~/.mtoolsrc
+}
+
 set -e
 
 N=$1
@@ -30,6 +51,7 @@
 	  cp 1/dists/$CODENAME/main/disks-$ARCH/current/images-2.88/compact/rescue.bin boot2/boot/
 	  echo -n "-J -b boot/rescue.bin -c boot/boot.catalog boot2" \
 		        > 2.mkisofs_opts
+          setbootopts boot2/boot/rescue.bin "$BOOTOPTS"
 	fi
 	exit 0;
 fi
@@ -45,7 +67,7 @@
 
 echo -n "-J -b boot/rescue.bin -c boot/boot.catalog boot1" > 1.mkisofs_opts
 
-(cd $CDDIR/dists/$CODENAME/main/disks-$ARCH/current/ ; \
+(cd $BOOTDISKS/current/ ; \
 	cp images-1.44/resc*.bin  $CDDIR/install ; \
 	cp linux  $CDDIR/install ; \
 	cp images-1.44/root.bin $CDDIR/install )
@@ -63,22 +85,26 @@
 #	gzip -c9 /tmp/root.bin.uncompressed > $CDDIR/install/root.bin ; \
 #	rm /tmp/root.bin.uncompressed  )
 ## end notes
-
-cp $CDDIR/dists/$CODENAME/main/disks-$ARCH/current/images-2.88/rescue.bin boot1/boot
 
+cp $BOOTDISKS/current/images-2.88/rescue.bin boot1/boot
+setbootopts boot1/boot/rescue.bin "$BOOTOPTS"
 
 #Extracting tools for disc 1
 
-cp $CDDIR/dists/$CODENAME/main/disks-$ARCH/current/dosutils/* $CDDIR/install/
+cp $BOOTDISKS/current/dosutils/* $CDDIR/install/
 
-(echo "Tools for DOS :" ; \
-	echo "lodlin/         load Linux kernel from DOS" ;\
-	echo "rawrite2/       rawrite 2.0 : create disks from disk images (*.bin)"; \
-	) |todos > $CDDIR/tools/README.tools
-
 (echo "@ echo off" ; \
 	echo "rem Flush any write-cached disk blocks before we leave DOS. " ; \
 	echo "smartdrv /c" ; \
-	echo "loadlin.exe linux root=/dev/ram ro initrd=root.bin" ; \
+	echo "loadlin.exe linux root=/dev/ram ro initrd=root.bin $BOOTOPTS" ; \
 	) |todos > $CDDIR/install/boot.bat
+
+if [ "$CCD" != "" ]; then
+	exit 0
+fi
+
+(echo "Tools for DOS :" ; \
+	echo "lodlin/         load Linux kernel from DOS" ;\
+	echo "rawrite2/       rawrite 2.0 : create disks from disk images (*.bin)"; \
+	) |todos > $CDDIR/tools/README.tools
 
Index: tools/potato/installtools.sh
===================================================================
RCS file: /cvs/debian-boot/debian-cd/tools/potato/installtools.sh,v
retrieving revision 1.13
diff -u -r1.13 installtools.sh
--- tools/potato/installtools.sh	2000/05/18 22:49:02	1.13
+++ tools/potato/installtools.sh	2000/05/23 19:56:33
@@ -3,9 +3,15 @@
 # Install files in /install and some in /doc
 # 26-dec-99 changes for i386 (2.2.x) bootdisks --jwest
 # 11-mar-00 added sparc to boot-disk documentation test  --jwest
+# 18-may-00 skip this for credit Card size CDs. --clameter
 
 set -e
 
+# If this is a credit card size cd then dont install anything.
+if [ "$CCD" != "" ]; then
+	exit 0
+fi
+
 BDIR=$TDIR/$CODENAME-$ARCH
 
 DOCDIR=doc
@@ -23,4 +29,3 @@
 do
 	ln -s $file
 done
-



Reply to: