* Add support for forcing firmware packages onto CD#1:

+ Add "FORCE_FIRMWARE=1" to CONF.sh to turn this on
    + Will pick up on packages in the "firmware" task and install them
    + Will also add sym-links to them in CD1/firmware so that new d-i code
      can find them easily.
    + Will add a short sentence into README.html/README.txt
  * Add top-level control of which checksums are desired for output images
    see the CHECKSUMS setting in CONF.sh
  * Fix some bashisms in tools/apt-selection.
This commit is contained in:
Steve McIntyre 2010-05-27 00:52:25 +00:00
parent 291a366790
commit b9c25ca204
11 changed files with 91 additions and 10 deletions

11
CONF.sh
View File

@ -128,6 +128,11 @@ export CONTRIB=1
# WARNING: Don't use NONFREE and EXTRANONFREE at the same time ! # WARNING: Don't use NONFREE and EXTRANONFREE at the same time !
# export EXTRANONFREE=1 # export EXTRANONFREE=1
# Do I want to force (potentially non-free) firmware packages to be
# placed on disc 1? Will make installation much easier if systems
# contain hardware that depends on this firmware
export FORCE_FIRMWARE=1
# If you have a $MIRROR/dists/$CODENAME/local/binary-$ARCH dir with # If you have a $MIRROR/dists/$CODENAME/local/binary-$ARCH dir with
# local packages that you want to put on the CD set then # local packages that you want to put on the CD set then
# uncomment the following line # uncomment the following line
@ -218,9 +223,13 @@ export NORECOMMENDS=1
# package on the CD. The default is 'true'. # package on the CD. The default is 'true'.
#export NOSUGGESTS=1 #export NOSUGGESTS=1
# Set to 1 to generate MD5 and SHA1 sums for generated images # Set to 1 to generate MD5/SHA1/SHA256/SHA512 sums for generated images
export IMAGESUMS=1 export IMAGESUMS=1
# And define the set of checksum algorithms you want here. Default is
# all of: md5 sha1 sha512 sha256
# export CHECKSUMS="md5 sha1 sha512 sha256"
# We may have to extract files from packages to put them onto the CD # We may have to extract files from packages to put them onto the CD
# (e.g. bootloader files). If you make those packages (and their # (e.g. bootloader files). If you make those packages (and their
# sources) available somewhere, list it here so that README.source # sources) available somewhere, list it here so that README.source

View File

@ -123,6 +123,8 @@ ifneq ($(ARCHES),source)
$(Q)mkdir -p $(TASKDIR) $(Q)mkdir -p $(TASKDIR)
$(Q)echo "- copying task files from 'tasks/$(DI_CODENAME)/'" $(Q)echo "- copying task files from 'tasks/$(DI_CODENAME)/'"
$(Q)cp -r $(BASEDIR)/tasks/$(CODENAME)/* $(TASKDIR) $(Q)cp -r $(BASEDIR)/tasks/$(CODENAME)/* $(TASKDIR)
$(Q)echo "- copying firwmare task file from 'tasks/firmware'"
$(Q)cp -r $(BASEDIR)/tasks/firmware $(TASKDIR)
$(Q)echo "- task.languages: using 'tasks/$(DI_CODENAME)/$(TASK_LANGLIST)'" $(Q)echo "- task.languages: using 'tasks/$(DI_CODENAME)/$(TASK_LANGLIST)'"
$(Q)cp $(BASEDIR)/tasks/$(DI_CODENAME)/$(TASK_LANGLIST) \ $(Q)cp $(BASEDIR)/tasks/$(DI_CODENAME)/$(TASK_LANGLIST) \
$(TASKDIR)/task.languages $(TASKDIR)/task.languages
@ -314,6 +316,9 @@ $(BDIR)/rawlist:
for VARIANT in $(VARIANTS); do \ for VARIANT in $(VARIANTS); do \
VARIANTDEFS="$$VARIANTDEFS -D VARIANT_$$VARIANT"; \ VARIANTDEFS="$$VARIANTDEFS -D VARIANT_$$VARIANT"; \
done; \ done; \
if [ "$(FORCE_FIRMWARE)"x != "0"x ] ; then \
ARCHDEFS="$$ARCHDEFS -DFORCE_FIRMWARE"; \
fi; \
if [ "$(SOURCEONLY)"x != "yes"x ] ; then \ if [ "$(SOURCEONLY)"x != "yes"x ] ; then \
cat $(TASKDIR)/$(TASK) | \ cat $(TASKDIR)/$(TASK) | \
cpp -nostdinc -nostdinc++ -P -undef $$ARCHDEFS $$VARIANTDEFS\ cpp -nostdinc -nostdinc++ -P -undef $$ARCHDEFS $$VARIANTDEFS\

View File

@ -208,6 +208,13 @@
# if TYPEsource # if TYPEsource
This set includes the source code of programs in the Debian OS.</p> This set includes the source code of programs in the Debian OS.</p>
# endif # endif
# if FORCE_FIRMWARE == 1
# if DISKNUM == 1
<p>This disc includes non-free firmware files to make installation easier on some
systems. See <a href="http://wiki.debian.org/Firmware">http://wiki.debian.org/Firmware</a>
for more details.</p>
# endif
# endif
#else #else
</p> </p>
# include <unoffextrascd.html.in> # include <unoffextrascd.html.in>

11
debian/CONF.sh vendored
View File

@ -128,6 +128,11 @@ export CONTRIB=1
# WARNING: Don't use NONFREE and EXTRANONFREE at the same time ! # WARNING: Don't use NONFREE and EXTRANONFREE at the same time !
# export EXTRANONFREE=1 # export EXTRANONFREE=1
# Do I want to force (potentially non-free) firmware packages to be
# placed on disc 1? Will make installation much easier if systems
# contain hardware that depends on this firmware
export FORCE_FIRMWARE=1
# If you have a $MIRROR/dists/$CODENAME/local/binary-$ARCH dir with # If you have a $MIRROR/dists/$CODENAME/local/binary-$ARCH dir with
# local packages that you want to put on the CD set then # local packages that you want to put on the CD set then
# uncomment the following line # uncomment the following line
@ -218,9 +223,13 @@ export NORECOMMENDS=1
# package on the CD. The default is 'true'. # package on the CD. The default is 'true'.
#export NOSUGGESTS=1 #export NOSUGGESTS=1
# Set to 1 to generate MD5 and SHA1 sums for generated images # Set to 1 to generate MD5/SHA1/SHA256/SHA512 sums for generated images
export IMAGESUMS=1 export IMAGESUMS=1
# And define the set of checksum algorithms you want here. Default is
# all of: md5 sha1 sha512 sha256
# export CHECKSUMS="md5 sha1 sha512 sha256"
# We may have to extract files from packages to put them onto the CD # We may have to extract files from packages to put them onto the CD
# (e.g. bootloader files). If you make those packages (and their # (e.g. bootloader files). If you make those packages (and their
# sources) available somewhere, list it here so that README.source # sources) available somewhere, list it here so that README.source

9
debian/changelog vendored
View File

@ -17,6 +17,15 @@ debian-cd (3.1.4) UNRELEASED; urgency=low
[ Steve McIntyre ] [ Steve McIntyre ]
* Rename log.add_packages to add_packages.log * Rename log.add_packages to add_packages.log
* Add dependency on dpkg-dev for dpkg-architecture. Closes: #574879 * Add dependency on dpkg-dev for dpkg-architecture. Closes: #574879
* Add support for forcing firmware packages onto CD#1:
+ Add "FORCE_FIRMWARE=1" to CONF.sh to turn this on
+ Will pick up on packages in the "firmware" task and install them
+ Will also add sym-links to them in CD1/firmware so that new d-i code
can find them easily.
+ Will add a short sentence into README.html/README.txt
* Add top-level control of which checksums are desired for output images
see the CHECKSUMS setting in CONF.sh
* Fix some bashisms in tools/apt-selection.
-- Steve McIntyre <93sam@debian.org> Tue, 27 Feb 2010 12:24:29 +0100 -- Steve McIntyre <93sam@debian.org> Tue, 27 Feb 2010 12:24:29 +0100

View File

@ -46,6 +46,7 @@ rm -f $dir/README $dir/README.1ST \
rm -f $dir/README.html rm -f $dir/README.html
cpp -traditional -undef -P -C -Wall -nostdinc -I$dir \ cpp -traditional -undef -P -C -Wall -nostdinc -I$dir \
-D DISKTYPE$DISKTYPE \ -D DISKTYPE$DISKTYPE \
-D FORCE_FIRMWARE="$FORCE_FIRMWARE" \
-D COMPLETE="$COMPLETE" \ -D COMPLETE="$COMPLETE" \
-D OMIT_MANUAL="$OMIT_MANUAL" \ -D OMIT_MANUAL="$OMIT_MANUAL" \
-D OFFICIAL_VAL=$OFFICIAL_VAL \ -D OFFICIAL_VAL=$OFFICIAL_VAL \
@ -59,6 +60,7 @@ lynx -dump -force_html $dir/README.html | todos \
cpp -traditional -undef -P -C -Wall -nostdinc -I $dir/ \ cpp -traditional -undef -P -C -Wall -nostdinc -I $dir/ \
-D DISKTYPE$DISKTYPE \ -D DISKTYPE$DISKTYPE \
-D FORCE_FIRMWARE="$FORCE_FIRMWARE" \
-D OMIT_MANUAL="$OMIT_MANUAL" \ -D OMIT_MANUAL="$OMIT_MANUAL" \
-D OFFICIAL_VAL=$OFFICIAL_VAL \ -D OFFICIAL_VAL=$OFFICIAL_VAL \
-D OMIT_RELEASE_NOTES="$OMIT_RELEASE_NOTES" \ -D OMIT_RELEASE_NOTES="$OMIT_RELEASE_NOTES" \

View File

@ -8,11 +8,11 @@
# set -e # set -e
# Get the configuration information if necessary # Get the configuration information if necessary
if [ -z "$CODENAME" -o -z "$ARCH" -o -z "$APTTMP" ]; then if [ -z "$CODENAME" ] || [ -z "$ARCH" ] || [ -z "$APTTMP" ]; then
if [ -e CONF.sh ]; then if [ -e CONF.sh ]; then
. CONF.sh . CONF.sh
else else
echo "Please set the good environment variables before " echo "Please set up environment variables before "
echo "launching this program ..." echo "launching this program ..."
echo "Current values are :" echo "Current values are :"
echo "CODENAME=$CODENAME" echo "CODENAME=$CODENAME"
@ -35,7 +35,7 @@ options=" -q -o Dir::State::status=$APTTMP/$CODENAME-$ARCH/status \
-o APT::Architecture=$ARCH " -o APT::Architecture=$ARCH "
sections=main sections=main
if [ "${NONFREE:-0}" != "0" -o "${EXTRANONFREE:-0}" != "0" ]; then if [ "${NONFREE:-0}" != "0" ] || [ "${EXTRANONFREE:-0}" != "0" ] || [ "${FORCE_FIRMWARE:-0}" != "0" ]; then
sections="$sections non-free" sections="$sections non-free"
fi fi
if [ "${CONTRIB:-0}" != "0" ]; then if [ "${CONTRIB:-0}" != "0" ]; then
@ -84,7 +84,7 @@ if [ ! -e "$APTTMP/$CODENAME-$ARCH/apt/sources.list" ]; then
echo "$ADEB file:$MIRROR $DI_CODENAME main/debian-installer" \ echo "$ADEB file:$MIRROR $DI_CODENAME main/debian-installer" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list >> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi fi
if [ -n "$LOCAL" -a -e "${LOCALDEBS:-$MIRROR}/dists/$DI_CODENAME/local/debian-installer" ]; then if [ -n "$LOCAL" ] && [ -e "${LOCALDEBS:-$MIRROR}/dists/$DI_CODENAME/local/debian-installer" ]; then
echo "$ADEB file:${LOCALDEBS:-$MIRROR} $DI_CODENAME local/debian-installer" \ echo "$ADEB file:${LOCALDEBS:-$MIRROR} $DI_CODENAME local/debian-installer" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list >> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi fi
@ -94,7 +94,7 @@ fi
temp=$APTTMP/$CODENAME-$ARCH/temp.apt-selection temp=$APTTMP/$CODENAME-$ARCH/temp.apt-selection
# Launch the command # Launch the command
if [ "$1" = "update" -o "$1" = "check" ]; then if [ "$1" = "update" ] || [ "$1" = "check" ]; then
apt-get $options $@ apt-get $options $@
exit $? exit $?
elif [ "$1" = "cache" ]; then elif [ "$1" = "cache" ]; then

View File

@ -91,6 +91,11 @@ bpalogin
*/ */
multipath-tools-boot multipath-tools-boot
/* add the list of firmware packages here too if required */
#ifdef FORCE_FIRMWARE
# include <firmware>
#endif
#ifdef ARCH_i386 #ifdef ARCH_i386
initramfs-tools initramfs-tools
busybox busybox

View File

@ -6,7 +6,9 @@ if [ "$2"x != ""x ] ; then
EXT="$2" EXT="$2"
fi fi
if [ "$CHECKSUMS"x = ""x ] ; then
CHECKSUMS="sha1 md5 sha512 sha256" CHECKSUMS="sha1 md5 sha512 sha256"
fi
for SUM in $CHECKSUMS; do for SUM in $CHECKSUMS; do
UPSUM=`echo $SUM | tr 'a-z' 'A-Z'` UPSUM=`echo $SUM | tr 'a-z' 'A-Z'`

View File

@ -8,6 +8,7 @@ use strict;
use Digest::MD5; use Digest::MD5;
use File::stat; use File::stat;
use File::Find; use File::Find;
use File::Basename;
use Compress::Zlib; use Compress::Zlib;
my %pkginfo; my %pkginfo;
@ -17,6 +18,7 @@ my $mkisofs_opts = "";
my $mkisofs_dirs = ""; my $mkisofs_dirs = "";
my (@arches, @arches_nosrc, @overflowlist, @pkgs_added); my (@arches, @arches_nosrc, @overflowlist, @pkgs_added);
my (@exclude_packages, @unexclude_packages, @excluded_package_list); my (@exclude_packages, @unexclude_packages, @excluded_package_list);
my %firmware_package;
undef @pkgs_added; undef @pkgs_added;
undef @exclude_packages; undef @exclude_packages;
@ -163,6 +165,15 @@ if ($archlist =~ /m68k/ || $archlist =~ /powerpc/) {
print "Starting to lay out packages into $disktype ($diskdesc) images: $maxdiskblocks 2K-blocks maximum per image\n"; print "Starting to lay out packages into $disktype ($diskdesc) images: $maxdiskblocks 2K-blocks maximum per image\n";
if (-e "$bdir/firmware-packages") {
open(FWLIST, "$bdir/firmware-packages") or die "Unable to read firmware-packages file!\n";
while (defined (my $pkg = <FWLIST>)) {
chomp $pkg;
$firmware_package{$pkg} = 1;
}
close(FWLIST);
}
open(INLIST, "$bdir/packages") or die "No packages file!\n"; open(INLIST, "$bdir/packages") or die "No packages file!\n";
while (defined (my $pkg = <INLIST>)) { while (defined (my $pkg = <INLIST>)) {
chomp $pkg; chomp $pkg;
@ -1075,6 +1086,14 @@ sub add_packages {
$total_blocks += get_file_blocks($realfile); $total_blocks += get_file_blocks($realfile);
$total_blocks += good_link ($realfile, "$dir/$file"); $total_blocks += good_link ($realfile, "$dir/$file");
msg_ap(0, " Linked $dir/$file\n"); msg_ap(0, " Linked $dir/$file\n");
if ($firmware_package{$pkgname}) {
msg_ap(0, "Symlink fw package $pkgname into /firmware\n");
if (! -d "$dir/firmware") {
mkdir "$dir/firmware" or die "symlink failed $!\n";
}
symlink("../$file", "$dir/firmware/" . basename($file));
msg_ap(0, "Symlink ../$file $dir/firmware/.\n");
}
} else { } else {
msg_ap(0, " $dir/$file already linked in\n"); msg_ap(0, " $dir/$file already linked in\n");
} }

View File

@ -18,6 +18,7 @@ my $list = shift;
my $nonfree = $ENV{'NONFREE'} || 0; my $nonfree = $ENV{'NONFREE'} || 0;
my $extranonfree = $ENV{'EXTRANONFREE'} || 0; my $extranonfree = $ENV{'EXTRANONFREE'} || 0;
my $force_firmware = $ENV{'FORCE_FIRMWARE'} || 0;
my $local = $ENV{'LOCAL'} || 0; my $local = $ENV{'LOCAL'} || 0;
my $complete = $ENV{'COMPLETE'} || 0; my $complete = $ENV{'COMPLETE'} || 0;
my $norecommends = $ENV{'NORECOMMENDS'} || 0; my $norecommends = $ENV{'NORECOMMENDS'} || 0;
@ -60,6 +61,8 @@ msg(1, "Complete selected packages with all the rest: ");
msg(1, yesno($complete)."\n"); msg(1, yesno($complete)."\n");
msg(1, "Include non-free packages: "); msg(1, "Include non-free packages: ");
msg(1, yesno($nonfree)."\n"); msg(1, yesno($nonfree)."\n");
msg(1, "Force inclusion of firmware packages: ");
msg(1, yesno($force_firmware)."\n");
msg(1, "====================================================================== msg(1, "======================================================================
"); ");
@ -81,6 +84,7 @@ while (defined($_=<AVAIL>)) {
$packages{$p}{"Suggests"} = []; $packages{$p}{"Suggests"} = [];
$packages{$p}{"Recommends"} = []; $packages{$p}{"Recommends"} = [];
$packages{$p}{"IsUdeb"} = ($packages{$p}{"Filename"} =~ /.udeb$/) ? 1 : 0; $packages{$p}{"IsUdeb"} = ($packages{$p}{"Filename"} =~ /.udeb$/) ? 1 : 0;
$packages{$p}{"IsFirmware"} = ($packages{$p}{"Filename"} =~ /(firmware|microcode)/) ? 1 : 0;
if ($packages{$p}{"Section"} =~ /contrib\//) { if ($packages{$p}{"Section"} =~ /contrib\//) {
$packages{$p}{"Component"} = "contrib"; $packages{$p}{"Component"} = "contrib";
} elsif ($packages{$p}{"Section"} =~ /non-free\//) { } elsif ($packages{$p}{"Section"} =~ /non-free\//) {
@ -103,10 +107,14 @@ my $count_excl = 0;
if (not $nonfree) { if (not $nonfree) {
foreach (grep { $packages{$_}{"Section"} =~ /non-free/ } foreach (grep { $packages{$_}{"Section"} =~ /non-free/ }
(keys %packages)) { (keys %packages)) {
if ($force_firmware and $packages{$_}{"IsFirmware"}) {
msg(1, "force_firmware: keeping non-free package $_\n");
} else {
$excluded{$_} = 'nonfree'; $excluded{$_} = 'nonfree';
$count_excl++; $count_excl++;
} }
} }
}
msg(1, "Statistics: msg(1, "Statistics:
Number of packages: @{ [scalar(keys %packages)] } Number of packages: @{ [scalar(keys %packages)] }
@ -292,13 +300,19 @@ foreach (glob("$dir/*.packages*")) {
my $count = 0; my $count = 0;
open(CDLIST, "> $dir/packages.$arch") open(CDLIST, "> $dir/packages.$arch")
|| die "Can't write in $dir/$_.packages.$arch: $!\n"; || die "Can't write in $dir/$_.packages.$arch: $!\n";
open(FWLIST, ">> $dir/firmware-packages")
|| die "Can't write in $dir/firmware-packages: $!\n";
foreach (@output) { foreach (@output) {
my $component = $packages{$_}{"Component"}; my $component = $packages{$_}{"Component"};
my $size = $packages{$_}{"Size"}; my $size = $packages{$_}{"Size"};
print CDLIST "$arch:$component:$_:$size\n"; print CDLIST "$arch:$component:$_:$size\n";
if ($packages{$_}{"IsFirmware"}) {
print FWLIST "$_\n";
}
$count++; $count++;
} }
close CDLIST; close CDLIST;
close FWLIST;
msg(0, "Done: processed/sorted $count packages, total size $output_size bytes.\n"); msg(0, "Done: processed/sorted $count packages, total size $output_size bytes.\n");
close LOG; close LOG;