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

credit card patches for debian-cd



The following patch does some modifications to debian-cd. Its not clean
yet. You would probably not be able to burn a regular cd with the patch.

It does generate small CD images (not tested... still transfering to my
home to do a test burn). Generated one with 38M. The credit card cd size
is 50 so I still have a way to go.

To use do:

export CCD=1
export COMPLETE=0

and select a small group of packages that you want to have installed in
addition to the base system. The size of all the standard debs is 100MB
which will never fit on a credit card size cd. A subset will work. Mine
includes apache/postgres and lots of networking tools.

Index: CONF.sh
===================================================================
RCS file: /cvs/debian-boot/debian-cd/CONF.sh,v
retrieving revision 1.5
diff -u -r1.5 CONF.sh
--- CONF.sh	2000/05/01 09:16:59	1.5
+++ CONF.sh	2000/05/19 03:21:31
@@ -21,25 +21,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
@@ -52,7 +52,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 CCD=1
+export COMPLETE=0
+export TASK=tasks/Telemetry
Index: Makefile
===================================================================
RCS file: /cvs/debian-boot/debian-cd/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- Makefile	2000/05/01 04:59:01	1.13
+++ Makefile	2000/05/19 03:21:31
@@ -43,7 +43,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  
@@ -139,9 +139,10 @@
 	@echo "Generating a fake status file for apt-get and apt-cache..."
 	@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);' \
+	               print if /^Section: base/m;' \
 	> $(ADIR)/status
+	@echo "Generating list of base files to reduce size..."
+	@cat $(ADIR)/status | grep "^Package:" | awk '{ print $$2; }' > $(ADIR)/list.base
 	# Updating the apt database
 	@$(apt) update
 	#
@@ -329,7 +330,7 @@
 doc: ok bin-infos $(BDIR)/1/doc
 $(BDIR)/1/doc:
 	@echo "Adding the documentation ..."
-	@$(addfiles) $(BDIR)/1 $(MIRROR) doc; 
+	@if [ "$(CCD)" = "" ]; then $(addfiles) $(BDIR)/1 $(MIRROR) doc; fi; 
 	@for i in $(BDIR)/*.packages; do \
 		dir=$${i%%.packages}; \
 		cp -d $(MIRROR)/README* $$dir/; \
@@ -362,7 +363,10 @@
 installtools: ok doc disks $(BDIR)/1/tools
 $(BDIR)/1/tools:
 	@echo "Adding install tools and documentation ..."
-	@$(addfiles) $(BDIR)/1 $(MIRROR) tools
+	# Do not put tools directory on Credit Card Size CDs
+	@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; \
@@ -387,7 +391,11 @@
  		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; \
 	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 03:21:32
@@ -40,6 +40,7 @@
 my %included;
 my %excluded;
 my %packages;
+my %basepackage;
 
 msg(0, "
 ======================================================================
@@ -91,6 +92,14 @@
 	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 (open (BASE,"<$adir/list.base") ) {
+  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 +132,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 +150,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
+	if (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 +202,8 @@
 	    msg(3, "$_ has already been included.\n");
 	    next;
 	}
-	add_package ($_, 1);
+        # Do not add suggested and recommended packages
+	add_package ($_, 0);
 }
 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 03:21:32
@@ -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.12
diff -u -r1.12 installtools.sh
--- tools/potato/installtools.sh	2000/04/03 22:57:59	1.12
+++ tools/potato/installtools.sh	2000/05/19 03:21:32
@@ -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: