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

Clean patches for Credit Card CD



The following patch was tested. It works fine for regular CDs as well as
for credit card CDs. It still uses the same way of determining base
packages. If I find out more about the future of base packages then I will
adapt this. Can I check this 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/19 19:59:50
@@ -31,25 +31,25 @@
 export MIRROR=/ftp/debian
 
 # Comment the following line if you don't have/want non-US
-#export NONUS=/ftp/debian-non-US
+export NONUS=/a/debian-non-US
 
 # Path of the temporary directory
-export TDIR=/ftp/tmp
+export TDIR=$BASEDIR/tmp
 
 # Path where the images will be written
-export OUT=/rack/debian-cd
+export OUT=/a/debian-cd
 
 # Where we keep the temporary apt stuff.
 # This cannot reside on an NFS mount.
-export APTTMP=/ftp/tmp/apt
+export APTTMP=$BASEDIR/apt
 
 # Do I want to have NONFREE
-# export NONFREE=1
+export NONFREE=1
 
 # If you have a $MIRROR/dists/$CODENAME/local/binary-$ARCH dir with 
 # local packages that you want to put on the CD set then
 # uncomment the following line 
-# export LOCAL=1
+export LOCAL=1
 
 # Sparc only : bootdir (location of cd.b and second.b)
 # export BOOTDIR=/boot
@@ -62,7 +62,17 @@
 # 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
+
 # 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
+export COMPLETE=0
+export TASK=tasks/Telemetry
+export EXCLUDE=list.exclude
+ 
\ No newline at end of file
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/19 19:59:50
@@ -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;' | \
+	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/19 19:59:50
@@ -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/19 19:59:50
@@ -7,6 +7,9 @@
 # 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
 #
 # Do install stuff for i386, including making bootable CDs
 #
@@ -45,7 +48,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 )
@@ -64,21 +67,25 @@
 #	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
 
 
 #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" ; \
 	) |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/19 19:59:50
@@ -3,8 +3,14 @@
 # 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
 



Reply to: