Merge of changes from Steve's development branch to take us to

debian-cd version 3.0.0. Highlights:

  * Support now added for multi-arch CDs/DVDs, including mixed
    binary/source discs. Multi-arch discs should be bootable on those
    multiple arches, modulo boot-sector clashes. Extra support added
    in boot-i386 and boot-amd64 to make the 2 main arches happily
    co-exist.

  * Disc sizing is now much more intelligent - sizes are defined
    depending on the disk type chosen at the start, and discs are now
    filled exactly to those sizes while files are added rather than
    the old up-front guessing method. Equally, the metadata on the
    disc (Packages, Packages.gz, Sources, Sources.gz, md5sums.txt) is
    generated as much as possible while this is happening to make the
    sizing code incredibly accurate. Using this method of disc sizing
    means that customising discs should be much easier/safer - either
    add custom contents at the start and debian-cd will fill the
    remainder of the disc, or afterwards roll back the packages on the
    disc and add extras later.

  * Source is now treated as (almost) just another arch, with most of
    the special casing for source hidden internally. If asking for
    source-only discs, they will simply be built using all the
    available sources. If combined with other arches, the sources will
    automatically be chosen to match the binary packages. Meeting GPL
    requirements was never so easy!

  * Removed lots of old cruft to clean up the codebase:
    + non-US support
    + woody support
    + lots of old support scripts that have been made redundant
    + significantly simpler Makefile, much easier to follow
    + old boot-$ARCH.calc files for estimating boot-file sizes are now
      (obviously) obsolete and therefore gone
This commit is contained in:
Steve McIntyre 2006-12-07 23:09:01 +00:00
parent 5f62118c2c
commit a269a8fd4c
53 changed files with 1606 additions and 3055 deletions

43
CONF.sh
View File

@ -13,7 +13,6 @@ unset LOCALDEBS || true
unset SECURED || true
unset SECURITY || true
unset BOOTDIR || true
unset BOOTDISKS || true
unset SYMLINK || true
unset COPYLINK || true
unset MKISOFS || true
@ -52,6 +51,7 @@ export BASEDIR=`pwd`
# Building etch cd set ...
export CODENAME=etch
export DI_CODENAME=etch
# By default use Debian installer packages from $CODENAME
if [ ! "$DI_CODENAME" ]
@ -85,11 +85,11 @@ if [ "$KERNEL"x = ""x ] ; then
KERNEL=linux
fi
if [ $KERNEL = linux ] ; then
ARCH=$CPU
ARCHES=$CPU
else
ARCH="$KERNEL-$CPU"
ARCHES="$KERNEL-$CPU"
fi
export CPU KERNEL ARCH
export CPU KERNEL ARCHES
# IMPORTANT : The 4 following paths must be on the same partition/device.
# If they aren't then you must set COPYLINK below to 1. This
@ -172,18 +172,17 @@ export VERBOSE_MAKE=1
# the proper official CD run does not work
ATTEMPT_FALLBACK=yes
# Set your disk size here in MB. Used in calculating package and
# source file layouts in build.sh and build_all.sh. Defaults are for
# CD-R, try ~4400 for DVD-R.
export DEFBINSIZE=630
export DEFSRCSIZE=635
# Set the disk type, used later in various places. Soon this will also
# be used to work out the disk size automatically
if [ "$DISKTYPE"x = ""x ] ; then
DISKTYPE=CD
fi
export DISKTYPE
# Set your disk type here. Known types are:
# BC (businesscard): 650 MiB max (should be limited elsewhere,
# should never fill a CD anyway)
# NETINST: 650 MiB max (ditto)
# CD: standard 74-min CD (650 MiB)
# CD700: (semi-)standard 80-min CD (700 MiB)
# DVD: standard 4.7 GB DVD
# CUSTOM: up to you - specify a size to go with it (in 2K blocks)
export DISKTYPE=DVD
#export DISKTYPE=CUSTOM
#export CUSTOMSIZE=XXXX
# We don't want certain packages to take up space on CD1...
#export EXCLUDE="$BASEDIR"/tasks/exclude-$CODENAME
@ -195,11 +194,6 @@ export DISKTYPE
# We also exclude some source packages
#export SRCEXCLUDE="$BASEDIR"/tasks/exclude-src-$CODENAME
# Set this if building source packages CDs should be skipped.
# You won't need source packages on your local mirror in that case.
# (Setting IMAGETARGET is now deprecated, though still supported.)
#export NOSOURCE=1
# Set this if the recommended packages should be skipped when adding
# package on the CD. The default is 'false'.
export NORECOMMENDS=1
@ -217,8 +211,8 @@ export NORECOMMENDS=1
# since they need the actual .iso to make it bootable. For these archs,
# the temp-iso will be generated, but deleted again immediately after the
# jigdo stuff is made; needs temporary space as big as the biggest image.
#export DOJIGDO=2
#
export DOJIGDO=1
# jigdo-file command & options
# Note: building the cache takes hours, so keep it around for the next run
#export JIGDOCMD="/usr/local/bin/jigdo-file --cache=$HOME/jigdo-cache.db"
@ -293,9 +287,6 @@ do
JIGDO_OPTS="$JIGDO_OPTS -jigdo-force-md5 $INCL"
done
# Where to find the boot disks
#export BOOTDISKS=$TOPDIR/ftp/skolelinux/boot-floppies
# File with list of packages to include when fetching modules for the
# first stage installer (debian-installer). One package per line.
# Lines starting with '#' are comments. The package order is

754
Makefile
View File

@ -4,7 +4,10 @@
#
# Copyright 1999 Raphaël Hertzog <hertzog@debian.org>
# See the README file for the license
#
# Significantly modified 2005-2006 Steve McIntyre <93sam@debian.org>
# for multi-arch and mixed bin/src discs
#
# The environment variables must have been set
# before. For this you can source the CONF.sh
# file in your shell
@ -17,37 +20,11 @@ ifndef VERBOSE_MAKE
Q=@
endif
ifndef SIZELIMIT
SIZELIMIT=$(shell echo -n $$[ 610 * 1024 * 1024 ])
SIZELIMIT=2000000000000
endif
ifndef TASK
TASK=$(BASEDIR)/tasks/Debian_$(CODENAME)
endif
ifndef CAPCODENAME
CAPCODENAME:=$(shell perl -e "print ucfirst("$(CODENAME)")")
endif
ifndef BINDISKINFO
export BINDISKINFO="Debian GNU/Linux $(DEBVERSION) \"$(CAPCODENAME)\" - $(OFFICIAL) $(DISKTYPE) $(ARCH) Binary-$$num $(BUILD_DATE)"
endif
ifndef SRCDISKINFO
export SRCDISKINFO="Debian GNU/Linux $(DEBVERSION) \"$(CAPCODENAME)\" - $(OFFICIAL) $(DISKTYPE) Source-$$num $(BUILD_DATE)"
endif
# ND=No-Date versions for README
ifndef BINDISKINFOND
export BINDISKINFOND="Debian GNU/Linux $(DEBVERSION) \"$(CAPCODENAME)\" - $(OFFICIAL) $(DISKTYPE) $(ARCH) Binary-$$num"
endif
ifndef SRCDISKINFOND
export SRCDISKINFOND="Debian GNU/Linux $(DEBVERSION) \"$(CAPCODENAME)\" - $(OFFICIAL) $(DISKTYPE) Source-$$num"
endif
ifndef BINVOLID
ifeq ($(ARCH),powerpc)
BINVOLID="Debian $(DEBVERSION) ppc Bin-$$num"
else
BINVOLID="Debian $(DEBVERSION) $(ARCH) Bin-$$num"
endif
endif
ifndef SRCVOLID
SRCVOLID="Debian $(DEBVERSION) Src-$$num"
endif
ifndef MKISOFS
export MKISOFS=mkisofs
endif
@ -60,53 +37,23 @@ endif
ifndef HOOK
HOOK=$(BASEDIR)/tools/$(CODENAME).hook
endif
ifneq "$(wildcard $(MIRROR)/dists/$(DI_CODENAME)/main/disks-$(ARCH))" ""
ifndef BOOTDISKS
export BOOTDISKS=$(MIRROR)/dists/$(DI_CODENAME)/main/disks-$(ARCH)
endif
endif
ifndef DOJIGDO
export DOJIGDO=0
endif
# Netinst/businesscard CD have different udeb_include and udeb_exclude files
ifndef UDEB_INCLUDE
ifeq ($(INSTALLER_CD),1)
UDEB_INCLUDE=$(BASEDIR)/data/$(DI_CODENAME)/$(ARCH)_businesscard_udeb_include
export ARCHES_NOSRC=$(shell echo $(ARCHES) | sed 's/source//')
ifeq ($(ARCHES),source)
export SOURCEONLY=yes
endif
ifeq ($(INSTALLER_CD),2)
UDEB_INCLUDE=$(BASEDIR)/data/$(DI_CODENAME)/$(ARCH)_netinst_udeb_include
endif
endif
ifndef UDEB_INCLUDE
UDEB_INCLUDE=$(BASEDIR)/data/$(DI_CODENAME)/$(ARCH)_udeb_include
endif
ifndef UDEB_EXCLUDE
ifeq ($(INSTALLER_CD),1)
UDEB_EXCLUDE=$(BASEDIR)/data/$(DI_CODENAME)/businesscard_udeb_exclude
endif
ifeq ($(INSTALLER_CD),2)
UDEB_EXCLUDE=$(BASEDIR)/data/$(DI_CODENAME)/netinst_udeb_exclude
endif
endif
ifndef UDEB_EXCLUDE
UDEB_EXCLUDE=$(BASEDIR)/data/$(DI_CODENAME)/udeb_exclude
ifeq ($(shell echo $(ARCHES) | sed 's/.*source.*/1/'),1)
export INC_SOURCE=yes
endif
## Internal variables
apt=$(BASEDIR)/tools/apt-selection
list2cds=$(BASEDIR)/tools/list2cds
cds2src=$(BASEDIR)/tools/cds2src
master2tasks=$(BASEDIR)/tools/master2tasks
mirrorcheck=$(BASEDIR)/tools/mirror_check
add_packages=$(BASEDIR)/tools/add_packages
add_dirs=$(BASEDIR)/tools/add_dirs
add_bin_doc=$(BASEDIR)/tools/add-bin-doc
scanpackages=$(BASEDIR)/tools/scanpackages
scansources=$(BASEDIR)/tools/scansources
add_files=$(BASEDIR)/tools/add_files
set_mkisofs_opts=$(BASEDIR)/tools/set_mkisofs_opts
strip_nonus_bin=$(BASEDIR)/tools/strip-nonUS-bin
add_secured=$(BASEDIR)/tools/add_secured
md5sum=md5sum
fastsums=$(BASEDIR)/tools/fast_sums
@ -114,23 +61,19 @@ jigdo_cleanup=$(BASEDIR)/tools/jigdo_cleanup
grab_md5=$(BASEDIR)/tools/grab_md5
dedicated-src=$(BASEDIR)/tools/dedicated_source
make_image=$(BASEDIR)/tools/make_image
add_debs=$(BASEDIR)/tools/add_debs
add_source_packages=$(BASEDIR)/tools/add_source_packages
merge_package_lists=$(BASEDIR)/tools/merge_package_lists
update_popcon=$(BASEDIR)/tools/update_popcon
BDIR=$(TDIR)/$(CODENAME)-$(ARCH)
ADIR=$(APTTMP)/$(CODENAME)-$(ARCH)
SDIR=$(TDIR)/$(CODENAME)-src
BDIR=$(TDIR)/$(CODENAME)
ADIR=$(APTTMP)
DB_DIR=$(BDIR)/debootstrap
FIRSTDISKS=CD1
ifdef FORCENONUSONCD1
FIRSTDISKS=CD1 CD1_NONUS
forcenonusoncd1=1
else
forcenonusoncd1=0
endif
# Ensure that debootstrap is in the path.
PATH:=$(PATH):/usr/sbin
export PATH := $(DB_DIR)/usr/sbin:$(PATH)
export DEBOOTSTRAP_DIR := $(DB_DIR)/usr/lib/debootstrap
LATEST_DB := $(shell ls -1tr $(MIRROR)/pool/main/d/debootstrap/debootstrap*all.deb | tail -1)
## DEBUG STUFF ##
@ -166,8 +109,8 @@ endif
ifndef MIRROR
@echo MIRROR undefined -- set up CONF.sh; false
endif
ifndef ARCH
@echo ARCH undefined -- set up CONF.sh; false
ifndef ARCHES
@echo ARCHES undefined -- set up CONF.sh; false
endif
ifndef CODENAME
@echo CODENAME undefined -- set up CONF.sh; false
@ -180,27 +123,30 @@ ifdef EXTRANONFREE
@echo Never use NONFREE and EXTRANONFREE at the same time; false
endif
endif
ifdef FORCENONUSONCD1
ifndef NONUS
@echo If we have FORCENONUSONCD1 set, we must also have NONUS set; false
endif
endif
@if [ $(DISKTYPE) = "NETINST" -o $(DISKTYPE) = "BC" ] ; then \
if [ "$(INC_SOURCE)"x = "yes"x ] ; then \
echo "Including source is not supported on a netinst/bc CD"; \
false; \
fi; \
fi
## INITIALIZATION ##
# Creation of the directories needed
init: ok $(OUT) $(TDIR) $(BDIR) $(SDIR) $(ADIR) unstable-map
init: ok $(OUT) $(TDIR) $(BDIR) $(ADIR) $(BDIR)/DATE $(DB_DIR) unstable-map
$(OUT):
$(Q)mkdir -p $(OUT)
$(TDIR):
$(Q)mkdir -p $(TDIR)
$(BDIR):
$(Q)mkdir -p $(BDIR)
$(SDIR):
$(Q)mkdir -p $(SDIR)
$(ADIR):
$(Q)mkdir -p $(ADIR)
$(Q)mkdir -p $(ADIR)/apt-ftparchive-db
$(BDIR)/DATE:
date '+%Y%m%d' > $(BDIR)/DATE
$(DB_DIR): $(LATEST_DB)
@rm -rf $(DB_DIR)
@dpkg -x $(LATEST_DB) $(DB_DIR)
# Make sure unstable/sid points to testing/etch, as there is no build
# rule for unstable/sid.
unstable-map:
@ -211,86 +157,104 @@ unstable-map:
ln -s etch $(BASEDIR)/tools/boot/sid ; \
fi
## CLEANINGS ##
#################
## CLEAN RULES ##
#################
# CLeans the current arch tree (but not packages selection info)
clean: ok bin-clean src-clean
bin-clean:
# Cleans the current arch tree (but not packages selection info)
clean: ok dir-clean
dir-clean:
$(Q)rm -rf $(BDIR)/CD[1234567890]*
$(Q)rm -rf $(BDIR)/*_NONUS
$(Q)rm -f $(BDIR)/*.filelist*
$(Q)rm -f $(BDIR)/packages-stamp $(BDIR)/bootable-stamp \
$(BDIR)/upgrade-stamp $(BDIR)/secured-stamp $(BDIR)/md5-check
src-clean:
$(Q)rm -rf $(SDIR)/CD[1234567890]*
$(Q)rm -rf $(SDIR)/*_NONUS
$(Q)rm -rf $(SDIR)/sources-stamp $(SDIR)/secured-stamp $(SDIR)/md5-check
$(Q)rm -f $(BDIR)/packages-stamp $(BDIR)/upgrade-stamp $(BDIR)/secured-stamp $(BDIR)/md5-check
# Completely cleans the current arch tree
realclean: distclean
distclean: ok bin-distclean src-distclean
bin-distclean:
$(Q)echo "Cleaning the binary build directory"
$(Q)rm -rf $(BDIR)
distclean: ok clean
$(Q)echo "Cleaning the build directory"
$(Q)rm -rf $(ADIR)
src-distclean:
$(Q)echo "Cleaning the source build directory"
$(Q)rm -rf $(SDIR)
$(Q)rm -rf $(TDIR)
####################
## STATUS and APT ##
####################
# Regenerate the status file with only packages that
# are of priority standard or higher
status: init $(ADIR)/status
$(ADIR)/status:
@echo "Generating a fake status file for apt-get and apt-cache..."
$(Q)if [ "$(INSTALLER_CD)" = "1" -o "$(INSTALLER_CD)" = "2" ];then \
:> $(ADIR)/status ; \
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 ; \
fi
# Updating the apt database
$(Q)$(apt) update
#
# Checking the consistence of the standard system
# If this does fail, then launch make correctstatus
#
$(Q)$(apt) check || $(MAKE) correctstatus
for ARCH in $(ARCHES); do \
mkdir -p $(ADIR)/$(CODENAME)-$$ARCH; \
$(Q)if [ $$ARCH = "source" -o "$(INSTALLER_CD)" = "1" -o "$(INSTALLER_CD)" = "2" ];then \
:> $(ADIR)/$(CODENAME)-$$ARCH/status ; \
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)/$(CODENAME)-$$ARCH/status ; \
fi; \
done;
:> $(ADIR)/status
# Updating the apt database
for ARCH in $(ARCHES); do \
export ARCH=$$ARCH; \
$(Q)$(apt) update; \
done
#
# Checking the consistency of the standard system
# If this does fail, then launch make correctstatus
#
for ARCH in $(ARCHES); do \
export ARCH=$$ARCH; \
$(Q)$(apt) check || $(MAKE) correctstatus; \
done
# Only useful if the standard system is broken
# It tries to build a better status file with apt-get -f install
correctstatus: status apt-update
# You may need to launch correctstatus more than one time
# in order to correct all dependencies
#
# Removing packages from the system :
# You may need to launch correctstatus more than one time
# in order to correct all dependencies
#
# Removing packages from the system :
$(Q)set -e; \
for i in `$(apt) deselected -f install`; do \
echo $$i; \
perl -i -000 -ne "print unless /^Package: \Q$$i\E/m" \
$(ADIR)/status; \
done
#
# Adding packages to the system :
if [ "$(ARCHES)" != "source" ] ; then \
for ARCH in $(ARCHES_NOSRC); do \
export ARCH=$$ARCH; \
for i in `$(apt) deselected -f install`; do \
echo $$ARCH:$$i; \
perl -i -000 -ne "print unless /^Package: \Q$$i\E/m" \
$(ADIR)/$(CODENAME)-$$ARCH/status; \
done; \
done; \
fi
#
# Adding packages to the system :
$(Q)set -e; \
for i in `$(apt) selected -f install`; do \
echo $$i; \
$(apt) cache dumpavail | perl -000 -ne \
"s/^(Package: .*)\$$/\$$1\nStatus: install ok installed/m; \
print if /^Package: \Q$$i\E\s*\$$/m;" \
>> $(ADIR)/status; \
if [ "$(ARCHES)" != "source" ] ; then \
for ARCH in $(ARCHES_NOSRC); do \
export ARCH=$$ARCH; \
for i in `$(apt) selected -f install`; do \
echo $$ARCH:$$i; \
$(apt) cache dumpavail | perl -000 -ne \
"s/^(Package: .*)\$$/\$$1\nStatus: install ok installed/m; \
print if /^Package: \Q$$i\E\s*\$$/m;" \
>> $(ADIR)/$(CODENAME)-$$ARCH/status; \
done; \
done; \
fi
#
# Showing the output of apt-get check :
$(Q)for ARCH in $(ARCHES_NOSRC); do \
ARCH=$$ARCH $(Q)$(apt) check; \
done
#
# Showing the output of apt-get check :
$(Q)$(apt) check
apt-update: status
@echo "Apt-get is updating his files ..."
$(Q)$(apt) update
if [ "$(ARCHES)" != "source" ] ; then \
for ARCH in $(ARCHES); do \
echo "Apt-get is updating his files ..."; \
ARCH=$$ARCH $(Q)$(apt) update; \
done; \
fi
## GENERATING LISTS ##
@ -301,61 +265,30 @@ deletelist: ok
$(Q)-rm $(BDIR)/list
$(Q)-rm $(BDIR)/list.exclude
# Generates the list of packages/files to put on each CD
list: bin-list src-list
packagelists: ok apt-update genlist
# Generate the listing of binary packages
bin-list: ok apt-update genlist $(BDIR)/1.packages
$(BDIR)/1.packages:
@echo "Dispatching the packages on all the CDs ..."
$(Q)$(list2cds) $(BDIR)/list $(SIZELIMIT)
ifdef FORCENONUSONCD1
$(Q)set -e; \
for file in $(BDIR)/*.packages; do \
newfile=$${file%%.packages}_NONUS.packages; \
cp $$file $$newfile; \
$(strip_nonus_bin) $$file $$file.tmp; \
if (cmp -s $$file $$file.tmp) ; then \
rm -f $$file.tmp $$newfile ; \
else \
echo Splitting non-US packages: $$file and $$newfile ; \
mv -f $$file.tmp $$file; \
fi ;\
image-trees: ok genlist
# Use list2cds to do the dependency sorting
$(Q)for ARCH in $(ARCHES_NOSRC); do \
ARCH=$$ARCH $(list2cds) $(BDIR)/list $(SIZELIMIT); \
done
endif
# Generate the listing for sources CDs corresponding to the packages included
# in the binary set
src-list: bin-list $(SDIR)/1.sources
$(SDIR)/1.sources:
@echo "Dispatching the sources on all the CDs ..."
$(Q)$(cds2src) $(SIZELIMIT)
ifdef FORCENONUSONCD1
$(Q)set -e; \
for file in $(SDIR)/*.sources; do \
newfile=$${file%%.sources}_NONUS.sources; \
cp $$file $$newfile; \
grep -v non-US $$file >$$file.tmp; \
if (cmp -s $$file $$file.tmp) ; then \
rm -f $$file.tmp $$newfile ; \
else \
echo Splitting non-US sources: $$file and $$newfile ; \
mv -f $$file.tmp $$file; \
fi ;\
done
endif
if [ "$(SOURCEONLY)"x = "yes"x ] ; then \
awk '{printf("source:%s\n",$$0)}' $(BDIR)/list > $(BDIR)/packages; \
else \
$(merge_package_lists) $(BDIR) $(ADIR) "$(ARCHES)" $(BDIR)/packages; \
fi
make_disc_trees $(BASEDIR) $(MIRROR) $(TDIR) $(CODENAME) "$(ARCHES)"
# Generate the complete listing of packages from the task
# Build a nice list without doubles and without spaces
genlist: ok $(BDIR)/list $(BDIR)/list.exclude
$(BDIR)/list: $(BDIR)/rawlist
@echo "Generating the complete list of packages to be included ..."
@echo "Generating the complete list of packages to be included in $(BDIR)/list..."
$(Q)perl -ne 'chomp; next if /^\s*$$/; \
print "$$_\n" if not $$seen{$$_}; $$seen{$$_}++;' \
$(BDIR)/rawlist \
> $(BDIR)/list
$(BDIR)/list.exclude: $(BDIR)/rawlist-exclude
@echo "Generating the complete list of packages to be removed ..."
$(Q)perl -ne 'chomp; next if /^\s*$$/; \
@ -369,149 +302,60 @@ $(BDIR)/rawlist:
# This is just a temporal solution, list2cds should be a little bit less
# silly so that this is not needed. For more info have a look at
# http://lists.debian.org/debian-cd/2004/debian-cd-200404/msg00093.html
ifneq ($(INSTALLER_CD),1)
ifeq ($(INSTALLER_CD),2)
/bin/echo -e "mawk\nunifont\npptp-linux" >>$(BDIR)/rawlist
else
/bin/echo -e "mawk\nexim4-daemon-light\nunifont\npptp-linux" >>$(BDIR)/rawlist
endif
endif # INSTALLER_CD 1
ifdef FORCENONUSONCD1
$(Q)$(apt) cache dumpavail | \
grep-dctrl -FSection -n -sPackage -e '^(non-US|non-us)' - | \
sort | uniq > $(BDIR)/Debian_$(CODENAME)_nonUS
endif
$(Q)if [ _$(INSTALLER_CD) != _1 ]; then \
mkdir -p $(TDIR); \
debootstrap --arch $(ARCH) --print-debs $(CODENAME) $(TDIR)/debootstrap.tmp file:$(MIRROR) \
| tr ' ' '\n' >>$(BDIR)/rawlist; \
rm -rf $(TDIR)/debootstrap.tmp; \
$(Q)if [ "$(SOURCEONLY)"x != "yes"x ] ; then \
if [ "$(INSTALLER_CD)"x = "1"x ] ; then \
echo >> $(BDIR)/rawlist; \
elif [ "$(INSTALLER_CD)"x = "2"x ] ; then \
echo -e "mawk\nunifont\npptp-linux" >>$(BDIR)/rawlist; \
else \
echo -e "mawk\nexim4-daemon-light\nunifont\npptp-linux" >>$(BDIR)/rawlist; \
fi; \
fi
$(Q)perl -npe 's/\@ARCH\@/$(ARCH)/g' $(TASK) | \
cpp -nostdinc -nostdinc++ -P -undef -D ARCH=$(ARCH) -D ARCH_$(subst -,_,$(ARCH)) \
-U $(ARCH) -U i386 -U linux -U unix \
-DFORCENONUSONCD1=$(forcenonusoncd1) \
-I $(BASEDIR)/tasks -I $(BDIR) - - >> $(BDIR)/rawlist
$(Q)if [ "$(SOURCEONLY)"x != "yes"x ] ; then \
$(Q)if [ _$(INSTALLER_CD) != _1 ]; then \
for ARCH in $(ARCHES_NOSRC); do \
debootstrap --arch $$ARCH --print-debs $(CODENAME) $(TDIR)/debootstrap.tmp file:$(MIRROR) 2>/dev/null \
| tr ' ' '\n' >>$(BDIR)/rawlist; \
rm -rf $(TDIR)/debootstrap.tmp; \
done; \
fi; \
fi
for ARCH in $(ARCHES_NOSRC); do \
ARCHDEFS="$$ARCHDEFS -D ARCH_$(subst -,_,$$ARCH)"; \
ARCHUNDEFS="$$ARCHUNDEFS -U $$ARCH"; \
done; \
$(Q)if [ "$(SOURCEONLY)"x != "yes"x ] ; then \
$(Q)cat $(TASK) | \
cpp -nostdinc -nostdinc++ -P -undef $$ARCHDEFS \
$$ARCHUNDEFS -U i386 -U linux -U unix \
-DFORCENONUSONCD1=0 \
-I $(BASEDIR)/tasks -I $(BDIR) - - >> $(BDIR)/rawlist; \
fi
# If we're *only* doing source, then we need to build a list of all the
# available source packages. Deliberately ignore the tasks too.
$(Q)if [ "$(SOURCEONLY)"x = "yes"x ] ; then \
awk '/^Package:/ {print $$2}' $(ADIR)/$(CODENAME)-source/apt-state/lists/*Sources | \
sort -u > $(BDIR)/rawlist; \
fi
# ls -al $(BDIR)/rawlist
# Build the raw list (cpp output) with doubles and spaces for excluded packages
$(BDIR)/rawlist-exclude:
$(Q)if [ -n "$(EXCLUDE)" ]; then \
for ARCH in $(ARCHES); do \
ARCHDEFS="$$ARCHDEFS -D ARCH_$(subst -,_,$$ARCH)"; \
ARCHUNDEFS="$$ARCHUNDEFS -U $$ARCH"; \
done; \
perl -npe 's/\@ARCH\@/$(ARCH)/g' $(EXCLUDE) | \
cpp -nostdinc -nostdinc++ -P -undef -D ARCH=$(ARCH) -D ARCH_$(subst -,_,$(ARCH)) \
-U $(ARCH) -U i386 -U linux -U unix \
-DFORCENONUSONCD1=$(forcenonusoncd1) \
-I $(BASEDIR)/tasks -I $(BDIR) - - >> $(BDIR)/rawlist-exclude; \
cpp -nostdinc -nostdinc++ -P -undef $$ARCHDEFS \
$$ARCHUNDEFS -U i386 -U linux -U unix \
-DFORCENONUSONCD1=0 \
-I $(BASEDIR)/tasks -I $(BDIR) - - >> $(BDIR)/rawlist-exclude; \
else \
echo > $(BDIR)/rawlist-exclude; \
fi
## DIRECTORIES && PACKAGES && INFOS ##
# Create all the needed directories for installing packages (plus the
# .disk directory)
tree: bin-tree src-tree
bin-tree: ok bin-list $(BDIR)/CD1/debian
$(BDIR)/CD1/debian:
@echo "Adding the required directories to the binary CDs ..."
$(Q)set -e; \
for i in $(BDIR)/*.packages; do \
dir=$${i%%.packages}; \
dir=$${dir##$(BDIR)/}; \
dir=$(BDIR)/CD$$dir; \
mkdir -p $$dir; \
$(add_dirs) $$dir; \
done
src-tree: ok src-list $(SDIR)/CD1/debian
$(SDIR)/CD1/debian:
@echo "Adding the required directories to the source CDs ..."
$(Q)set -e; \
for i in $(SDIR)/*.sources; do \
dir=$${i%%.sources}; \
dir=$${dir##$(SDIR)/}; \
dir=$(SDIR)/CD$$dir; \
mkdir -p $$dir; \
$(add_dirs) $$dir; \
done
# CD labels / volume ids / disk info
infos: bin-infos src-infos
bin-infos: bin-tree $(BDIR)/CD1/.disk/info
$(BDIR)/CD1/.disk/info:
@echo "Generating the binary CD labels and their volume ids ..."
$(Q)set -e; \
nb=`ls -l $(BDIR)/?.packages $(BDIR)/??.packages | wc -l | tr -d " "`; num=0;\
DATE=`date +%Y%m%d`; \
for i in $(BDIR)/*.packages; do \
num=$${i%%.packages}; num=$${num##$(BDIR)/}; \
dir=$(BDIR)/CD$$num; \
echo -n $(BINDISKINFO) | sed 's/_NONUS//g' > $$dir/.disk/info; \
echo -n $(BINDISKINFOND) | sed 's/_NONUS//g' > $(BDIR)/$$num.diskinfo; \
echo '#define DISKNAME ' $(BINDISKINFOND) | sed 's/_NONUS//g' \
> $$dir/README.diskdefines; \
echo '#define TYPE binary' \
>> $$dir/README.diskdefines; \
echo '#define TYPEbinary 1' \
>> $$dir/README.diskdefines; \
echo '#define ARCH ' $(ARCH) \
>> $$dir/README.diskdefines; \
echo '#define ARCH'$(ARCH) ' 1' \
>> $$dir/README.diskdefines; \
echo '#define DISKNUM ' $$num | sed 's/_NONUS//g' \
>> $$dir/README.diskdefines; \
echo '#define DISKNUM'$$num ' 1' | sed 's/_NONUS//g' \
>> $$dir/README.diskdefines; \
echo '#define TOTALNUM ' $$nb \
>> $$dir/README.diskdefines; \
echo '#define TOTALNUM'$$nb ' 1' \
>> $$dir/README.diskdefines; \
echo -n $(BINVOLID) > $(BDIR)/$${num}.volid; \
$(set_mkisofs_opts) bin $$num > $(BDIR)/$${num}.mkisofs_opts; \
done
src-infos: src-tree $(SDIR)/CD1/.disk/info
$(SDIR)/CD1/.disk/info:
@echo "Generating the source CD labels and their volume ids ..."
$(Q)set -e; \
nb=`ls -l $(SDIR)/?.sources $(SDIR)/??.sources | wc -l | tr -d " "`; num=0;\
DATE=`date +%Y%m%d`; \
for i in $(SDIR)/*.sources; do \
num=$${i%%.sources}; num=$${num##$(SDIR)/}; \
dir=$(SDIR)/CD$$num; \
echo -n $(SRCDISKINFO) | sed 's/_NONUS//g' > $$dir/.disk/info; \
echo -n $(SRCDISKINFOND) | sed 's/_NONUS//g' > $(SDIR)/$$num.diskinfo; \
echo '#define DISKNAME ' $(SRCDISKINFOND) | sed 's/_NONUS//g' \
> $$dir/README.diskdefines; \
echo '#define TYPE source' \
>> $$dir/README.diskdefines; \
echo '#define TYPEsource 1' \
>> $$dir/README.diskdefines; \
echo '#define ARCH ' $(ARCH) \
>> $$dir/README.diskdefines; \
echo '#define ARCH'$(ARCH) ' 1' \
>> $$dir/README.diskdefines; \
echo '#define DISKNUM ' $$num | sed 's/_NONUS//g' \
>> $$dir/README.diskdefines; \
echo '#define DISKNUM'$$num ' 1' | sed 's/_NONUS//g' \
>> $$dir/README.diskdefines; \
echo '#define TOTALNUM ' $$nb \
>> $$dir/README.diskdefines; \
echo '#define TOTALNUM'$$nb ' 1' \
>> $$dir/README.diskdefines; \
echo -n $(SRCVOLID) > $(SDIR)/$${num}.volid; \
$(set_mkisofs_opts) src $$num > $(SDIR)/$${num}.mkisofs_opts; \
done
# Adding the deb files to the images
packages: bin-infos bin-list $(BDIR)/packages-stamp
$(BDIR)/packages-stamp:
$(Q)$(add_debs) "$(BDIR)" "$(TDIR)" "$(FIRSTDISKS)" "$(ARCH)" "$(BASE_INCLUDE)" "$(BASE_EXCLUDE)" "$(UDEB_INCLUDE)" "$(UDEB_EXCLUDE)" "$(add_packages)" "$(scanpackages)"
$(Q)touch $(BDIR)/packages-stamp
sources: src-infos src-list $(SDIR)/sources-stamp
$(SDIR)/sources-stamp:
$(Q)$(add_source_packages) "$(SDIR)" "$(add_files)" "$(MIRROR)" "$(LOCAL)" "$(LOCALDEBS)" "$(scansources)"
$(Q)touch $(SDIR)/sources-stamp
## BOOT & DOC & INSTALL ##
# Basic checks
@ -525,137 +369,8 @@ need-complete-mirror:
exit 1; \
fi
# Add everything that is needed to make the CDs bootable
bootable: ok disks installtools $(BDIR)/bootable-stamp
$(BDIR)/bootable-stamp:
@echo "Making the binary CDs bootable ..."
$(Q)set -e; \
for file in $(BDIR)/*.packages; do \
dir=$${file%%.packages}; \
n=$${dir##$(BDIR)/}; \
dir=$(BDIR)/CD$$n; \
if [ -f $(BASEDIR)/tools/boot/$(DI_CODENAME)/boot-$(ARCH) ]; then \
cd $(BDIR); \
echo "Running tools/boot/$(DI_CODENAME)/boot-$(ARCH) $$n $$dir" ; \
$(BASEDIR)/tools/boot/$(DI_CODENAME)/boot-$(ARCH) $$n $$dir; \
else \
if [ "$${IGNORE_MISSING_BOOT_SCRIPT:-0}" = "0" ]; then \
echo "No script to make CDs bootable for $(ARCH) ..."; \
exit 1; \
fi; \
fi; \
done
$(Q)touch $(BDIR)/bootable-stamp
# Add the doc files to the CDs and the Release-Notes and the
# Contents-$(ARCH).gz files
bin-doc: ok bin-infos $(MIRROR)/doc $(BDIR)/CD1/doc
$(BDIR)/CD1/doc:
@echo "Adding the documentation (bin) ..."
$(Q)set -e; \
for DISK in $(FIRSTDISKS) ; do \
$(add_files) $(BDIR)/$$DISK $(MIRROR) doc; \
find $(BDIR)/$$DISK/doc -name "dedication-*" | \
grep -v $DEBVERSION | xargs rm -f; \
find $(BDIR)/$$DISK/doc -name "debian-keyring.tar.gz" | \
xargs rm -f; \
done
@for DISK in $(FIRSTDISKS) ; do \
mkdir $(BDIR)/$$DISK/doc/FAQ/html ; \
cd $(BDIR)/$$DISK/doc/FAQ/html ; \
if [ -e "../debian-faq.en.html.tar.gz" ]; then \
tar xzvf ../debian-faq.en.html.tar.gz ; \
else \
tar xzvf ../debian-faq.html.tar.gz ; \
fi; \
done
$(Q)$(add_bin_doc) # Common stuff for all disks
src-doc: ok src-infos $(SDIR)/CD1/README.html
$(SDIR)/CD1/README.html:
@echo "Adding the documentation (src) ..."
$(Q)set -e; \
for i in $(SDIR)/*.sources; do \
dir=$${i%%.sources}; \
dir=$${dir##$(SDIR)/}; \
dir=$(SDIR)/CD$$dir; \
cp -d $(MIRROR)/README* $$dir/; \
rm -f $$dir/README $$dir/README.html \
$$dir/README.CD-manufacture \
$$dir/README.pgp $$dir/README.mirrors.txt \
$$dir/README.mirrors.html $$dir/README.non-US; \
cpp -traditional -undef -P -C -Wall -nostdinc -I $$dir/ \
-D OMIT_MANUAL="$(OMIT_MANUAL)" \
-D OFFICIAL_VAL=$(OFFICIAL_VAL) \
-D OUTPUTtext $(BASEDIR)/data/$(CODENAME)/README.html.in \
| sed -e 's/%%.//g' > $$dir/README.html ; \
lynx -dump -force_html $$dir/README.html | todos \
> $$dir/README.txt ; \
cpp -traditional -undef -P -C -Wall -nostdinc -I $$dir/ \
-D OMIT_MANUAL="$(OMIT_MANUAL)" \
-D OFFICIAL_VAL=$(OFFICIAL_VAL) \
-D OUTPUThtml $(BASEDIR)/data/$(CODENAME)/README.html.in \
| sed -e 's/%%.//g' > $$dir/README.html ; \
rm -f $$dir/README.diskdefines ; \
mkdir -p $$dir/pics ; \
cp $(BASEDIR)/data/pics/*.* $$dir/pics/ ; \
done
# Add the install stuff on the first CD
installtools: ok bin-doc disks $(MIRROR)/tools $(BDIR)/CD1/tools
$(BDIR)/CD1/tools:
@echo "Adding install tools and documentation ..."
$(Q)set -e; \
for DISK in $(FIRSTDISKS) ; do \
$(add_files) $(BDIR)/$$DISK $(MIRROR) tools ; \
mkdir $(BDIR)/$$DISK/install ; \
if [ -x "$(BASEDIR)/tools/$(CODENAME)/installtools.sh" ]; then \
$(BASEDIR)/tools/$(CODENAME)/installtools.sh $(BDIR)/$$DISK ; \
fi ; \
done
# Add the disks-arch directories if/where needed
disks: ok bin-infos $(BDIR)/CD1/dists/$(DI_CODENAME)/main/disks-$(ARCH)
$(BDIR)/CD1/dists/$(DI_CODENAME)/main/disks-$(ARCH):
ifdef BOOTDISKS
@echo "Adding disks-$(ARCH) stuff ..."
$(Q)set -e; \
for DISK in $(FIRSTDISKS) ; do \
mkdir -p $(BDIR)/$$DISK/dists/$(DI_CODENAME)/main/disks-$(ARCH) ; \
$(add_files) \
$(BDIR)/$$DISK/dists/$(DI_CODENAME)/main/disks-$(ARCH) \
$(BOOTDISKS) . ; \
touch $(BDIR)/$$DISK/.disk/kernel_installable ; \
cd $(BDIR)/$$DISK/dists/$(DI_CODENAME)/main/disks-$(ARCH); \
rm -rf base-images-*; \
if [ "$(SYMLINK)" != "" ]; then exit 0; fi; \
if [ -L current ]; then \
CURRENT_LINK=`readlink current`; \
mv $$CURRENT_LINK .tmp_link; \
rm -rf [0123456789]*; \
mv .tmp_link $$CURRENT_LINK; \
elif [ -d current ]; then \
rm -rf [0123456789]*; \
fi; \
done
endif
upgrade: ok bin-infos $(BDIR)/upgrade-stamp
$(BDIR)/upgrade-stamp:
@echo "Trying to add upgrade* directories ..."
$(Q)if [ -x "$(BASEDIR)/tools/$(CODENAME)/upgrade.sh" ]; then \
$(BASEDIR)/tools/$(CODENAME)/upgrade.sh; \
fi
$(Q)if [ -x "$(BASEDIR)/tools/$(CODENAME)/upgrade-$(ARCH).sh" ]; then \
$(BASEDIR)/tools/$(CODENAME)/upgrade-$(ARCH).sh $(BDIR); \
fi
$(Q)touch $(BDIR)/upgrade-stamp
dedicated-src: ok
$(Q)if [ -e $(BASEDIR)/data/$(CODENAME)/$(ARCH)/extra-sources ]; then \
echo "Adding extra sources for $(ARCH) onto the last binary disc".; \
$(Q)$(dedicated-src) $(BDIR) $(ARCH) $(BASEDIR) $(CODENAME) $(MIRROR); \
fi
# false
## EXTRAS ##
@ -673,65 +388,15 @@ src-extras:
echo "Give me more parameters (DIR, CD and ROOTSRC are required)."; \
false; \
fi
@echo "Adding dirs '$(DIR)' from '$(ROOTSRC)' to '$(SDIR)/CD$(CD)'" ...
$(Q)$(add_files) $(SDIR)/CD$(CD) $(ROOTSRC) $(DIR)
@echo "Adding dirs '$(DIR)' from '$(ROOTSRC)' to '$(BDIR)/CD$(CD)'" ...
$(Q)$(add_files) $(BDIR)/CD$(CD) $(ROOTSRC) $(DIR)
## IMAGE BUILDING ##
# Get some size info about the build dirs
imagesinfo: bin-imagesinfo
bin-imagesinfo: ok
$(Q)for i in $(BDIR)/*.packages; do \
echo `du -sb $${i%%.packages}`; \
done
src-imagesinfo: ok
$(Q)for i in $(SDIR)/*.sources; do \
echo `du -sb $${i%%.sources}`; \
done
# Generate a md5sum.txt file listings all files on the CD
md5list: bin-md5list src-md5list
bin-md5list: ok packages bin-secured $(BDIR)/CD1/md5sum.txt
$(BDIR)/CD1/md5sum.txt:
@echo "Generating md5sum of files from all the binary CDs ..."
$(Q)set -e; \
if [ "$$FASTSUMS" != "1" ] ; then \
for file in $(BDIR)/*.packages; do \
dir=$${file%%.packages}; \
n=$${dir##$(BDIR)/}; \
dir=$(BDIR)/CD$$n; \
test -x "$(HOOK)" && cd $(BDIR) && $(HOOK) $$n before-mkisofs; \
cd $$dir; \
find . -follow -type f | grep -v "\./md5sum" | grep -v \
"dists/stable" | grep -v "dists/frozen" | \
grep -v "dists/unstable" | xargs $(md5sum) > md5sum.txt ; \
done \
else \
$(fastsums) $(BDIR); \
fi
src-md5list: ok sources src-secured $(SDIR)/CD1/md5sum.txt
$(SDIR)/CD1/md5sum.txt:
@echo "Generating md5sum of files from all the source CDs ..."
$(Q)set -e; \
if [ "$$FASTSUMS" != "1" ] ; then \
for file in $(SDIR)/*.sources; do \
dir=$${file%%.sources}; \
dir=$${dir##$(SDIR)/}; \
dir=$(SDIR)/CD$$dir; \
cd $$dir; \
find . -follow -type f | grep -v "\./md5sum" | grep -v \
"dists/stable" | grep -v "dists/frozen" | \
grep -v "dists/unstable" | xargs $(md5sum) > md5sum.txt ; \
done \
else \
$(fastsums) $(SDIR); \
fi
# Generate $CODENAME-secured tree with Packages and Release(.gpg) files
# from the official tree
# Complete the Release file from the normal tree
secured: bin-secured src-secured
secured: bin-secured #src-secured
bin-secured: $(BDIR)/secured-stamp
$(BDIR)/secured-stamp:
@echo "Generating $(CODENAME)-secured on all the binary CDs ..."
@ -745,40 +410,19 @@ $(BDIR)/secured-stamp:
done
$(Q)touch $(BDIR)/secured-stamp
src-secured: $(SDIR)/secured-stamp
$(SDIR)/secured-stamp:
@echo "Generating $(CODENAME)-secured on all the source CDs ..."
$(Q)set -e; \
for file in $(SDIR)/*.sources; do \
dir=$${file%%.sources}; \
dir=$${dir##$(SDIR)/}; \
dir=$(SDIR)/CD$$dir; \
cd $$dir; \
$(add_secured); \
done
$(Q)touch $(SDIR)/secured-stamp
# Generates all the images
images: bin-images src-images
# DOJIGDO actions (for both binaries and source)
# 0 isofile
# 1 isofile + jigdo, cleanup_jigdo
# 2 jigdo, cleanup_jigdo
#
bin-images: ok bin-md5list $(OUT)
$(make_image) "$(BDIR)" "$(ARCH)" "$(OUT)" "$(DOJIGDO)" "$(DEBVERSION)" "$(MIRROR)" "$(MKISOFS)" "$(MKISOFS_OPTS)" "$(JIGDO_OPTS)" "$(jigdo_cleanup)"
src-images: ok src-md5list $(OUT)
$(make_image) "$(SDIR)" "source" "$(OUT)" "$(DOJIGDO)" "$(DEBVERSION)" "$(MIRROR)" "$(MKISOFS)" "$(MKISOFS_OPTS)" "$(JIGDO_OPTS)" "$(jigdo_cleanup)"
images: ok $(OUT)
$(make_image) "$(BDIR)" "$(ARCHES)" "$(OUT)" "$(DOJIGDO)" "$(DEBVERSION)" "$(MIRROR)" "$(MKISOFS)" "$(MKISOFS_OPTS)" "$(JIGDO_OPTS)" "$(jigdo_cleanup)"
check-number-given:
@test -n "$(CD)" || (echo "Give me a CD=<num> parameter !" && false)
# Generate only one image number $(CD)
image: bin-image
bin-image: check-number-given bin-images
src-image: check-number-given src-images
image: check-number-given image
# Calculate the md5sums for the images (if available), or get from templates
imagesums:
@ -786,61 +430,21 @@ imagesums:
## MISC TARGETS ##
tasks: ok $(BASEDIR)/data/$(CODENAME)/master
$(master2tasks)
readme:
sensible-pager $(BASEDIR)/README
conf:
sensible-editor $(BASEDIR)/CONF.sh
mirrorcheck-binary: ok
rm -f $(BDIR)/md5-check
$(Q)$(grab_md5) $(MIRROR) $(ARCH) $(CODENAME) $(DI_CODENAME) $(BDIR)/md5-check
if [ -n "$(NONUS)" ]; then \
$(grab_md5) $(NONUS) $(ARCH) $(CODENAME) $(DI_CODENAME) $(BDIR)/md5-check; \
fi
mirrorcheck: ok
$(Q)$(grab_md5) $(MIRROR) "$(ARCHES)" $(CODENAME) $(DI_CODENAME) $(BDIR)/md5-check
$(Q)if [ -e $(BASEDIR)/data/$(CODENAME)/$(ARCH)/extra-sources ]; then \
echo "Extra dedicated source added; need to grab source MD5 info too"; \
$(Q)$(grab_md5) $(MIRROR) source $(CODENAME) $(BDIR)/md5-check; \
if [ -n "$(NONUS)" ]; then \
$(grab_md5) $(NONUS) source $(CODENAME) $(BDIR)/md5-check; \
fi; \
fi
mirrorcheck-source: ok
rm -f $(SDIR)/md5-check
$(Q)$(grab_md5) $(MIRROR) source $(CODENAME) $(CODENAME) $(SDIR)/md5-check
if [ -n "$(NONUS)" ]; then \
$(grab_md5) $(NONUS) source $(CODENAME) $(CODENAME) $(SDIR)/md5-check; \
$(Q)$(grab_md5) $(MIRROR) source $(CODENAME) $(DI_CODENAME) $(BDIR)/md5-check; \
fi
update-popcon:
rm -f popcon-inst
( \
echo '/*' ; \
echo ' Popularity Contest results' ; \
echo ' See the README for details on updating.' ; \
echo '' ; \
echo ' Last update: $(shell date)' ; \
echo '*/' ; \
echo '' ; \
) > tasks/popularity-contest-$(CODENAME)
wget --output-document popcon-inst \
http://popcon.debian.org/main/by_inst \
http://popcon.debian.org/contrib/by_inst
grep -h '^[^#]' popcon-inst | egrep -v '(Total|-----)' | \
sort -rn -k3,3 -k7,7 -k4,4 | grep -v kernel-source | \
awk '{print $$2}' >> tasks/popularity-contest-$(CODENAME)
rm -f popcon-inst
$(update_popcon) tasks/popularity-contest-$(CODENAME)
# Little trick to simplify things
official_images: bin-official_images src-official_images
bin-official_images: ok bootable upgrade dedicated-src bin-images
src-official_images: ok src-doc src-images
official_images: ok init packagelists image-trees images
$(CODENAME)_status: ok init
@echo "Using the provided status file for $(CODENAME)-$(ARCH) ..."
$(Q)cp $(BASEDIR)/data/$(CODENAME)/status.$(ARCH) $(ADIR)/status \
2>/dev/null || $(MAKE) status || $(MAKE) correctstatus
$(Q)for ARCH in $(ARCHES_NOSRC); do \
echo "Using the provided status file for $(CODENAME)-$$ARCH ..."; \
cp $(BASEDIR)/data/$(CODENAME)/status.$$ARCH $(ADIR)/$(CODENAME)-$$ARCH/status 2>/dev/null || $(MAKE) status || $(MAKE) correctstatus ; \
done

View File

@ -7,16 +7,35 @@ if [ -z "$CF" ] ; then
fi
. $CF
echo "Using defs from $CF" > /tmp/log
if [ -z "$COMPLETE" ] ; then
export COMPLETE=1
fi
if [ -n "$1" ] ; then
export ARCH=$1
if [ -n "$@" ] ; then
export ARCHES="$@"
fi
PATH=$BASEDIR/tools:$PATH
export PATH
if [ "$TASK"x = ""x ] ; then
case "$INSTALLER_CD"x in
"1"x)
TASK=tasks/debian-installer-$CODENAME
unset COMPLETE
;;
"2"x)
TASK=tasks/debian-installer+kernel-$CODENAME
unset COMPLETE
;;
*)
COMPLETE=1
;;
esac
fi
export TASK COMPLETE
make distclean
make ${CODENAME}_status
if [ "$SKIPMIRRORCHECK" = "yes" ]; then
@ -24,57 +43,15 @@ if [ "$SKIPMIRRORCHECK" = "yes" ]; then
else
echo " ... checking your mirror"
RET=""
make mirrorcheck-binary || RET=$?
if [ -z "$RET" ] && [ -z "$NOSOURCE" ]; then
make mirrorcheck-source || RET=$?
fi
make mirrorcheck || RET=$?
if [ "$RET" ]; then
echo "ERROR: Your mirror has a problem, please correct it." >&2
exit 1
fi
fi
echo " ... selecting packages to include"
if [ -e ${MIRROR}/dists/${DI_CODENAME}/main/disks-${ARCH}/current/. ] ; then
disks=`du -sm ${MIRROR}/dists/${DI_CODENAME}/main/disks-${ARCH}/current/. | \
awk '{print $1}'`
else
disks=0
fi
if [ -f $BASEDIR/tools/boot/$DI_CODENAME/boot-$ARCH.calc ]; then
. $BASEDIR/tools/boot/$DI_CODENAME/boot-$ARCH.calc
fi
SIZE_ARGS=''
for CD in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
size=`eval echo '$'"BOOT_SIZE_${CD}"`
[ "$size" = "" ] && size=0
[ $CD = "1" ] && size=$(($size + $disks))
mult=`eval echo '$'"SIZE_MULT_${CD}"`
[ "$mult" = "" ] && mult=100
FULL_SIZE=`echo "($DEFBINSIZE - $size) * 1024 * 1024" | bc`
echo "INFO: Reserving $size MB on CD $CD for boot files. SIZELIMIT=$FULL_SIZE."
if [ $mult != 100 ]; then
echo " INFO: Reserving "$((100-$mult))"% of the CD for extra metadata"
FULL_SIZE=`echo "$FULL_SIZE * $mult" / 100 | bc`
echo " INFO: SIZELIMIT now $FULL_SIZE."
fi
SIZE_ARGS="$SIZE_ARGS SIZELIMIT${CD}=$FULL_SIZE"
done
FULL_SIZE=`echo "($DEFSRCSIZE - $size) * 1024 * 1024" | bc`
LISTTARGET="list"
if [ -n "$NOSOURCE" ] ; then
LISTTARGET="bin-list"
fi
make $LISTTARGET $SIZE_ARGS SRCSIZELIMIT=$FULL_SIZE
# Setting IMAGETARGET directly is deprecated; NOSOURCE is preferred
if [ -z "$IMAGETARGET" ]; then
if [ -n "$NOSOURCE" ] ; then
IMAGETARGET="bin-official_images"
else
IMAGETARGET="official_images"
fi
if [ -z "$IMAGETARGET" ] ; then
IMAGETARGET="official_images"
fi
echo " ... building the images; using target(s) \"$IMAGETARGET\""
make $IMAGETARGET

43
debian/CONF.sh vendored
View File

@ -13,7 +13,6 @@ unset LOCALDEBS || true
unset SECURED || true
unset SECURITY || true
unset BOOTDIR || true
unset BOOTDISKS || true
unset SYMLINK || true
unset COPYLINK || true
unset MKISOFS || true
@ -52,6 +51,7 @@ export BASEDIR=`pwd`
# Building etch cd set ...
export CODENAME=etch
export DI_CODENAME=etch
# By default use Debian installer packages from $CODENAME
if [ ! "$DI_CODENAME" ]
@ -85,11 +85,11 @@ if [ "$KERNEL"x = ""x ] ; then
KERNEL=linux
fi
if [ $KERNEL = linux ] ; then
ARCH=$CPU
ARCHES=$CPU
else
ARCH="$KERNEL-$CPU"
ARCHES="$KERNEL-$CPU"
fi
export CPU KERNEL ARCH
export CPU KERNEL ARCHES
# IMPORTANT : The 4 following paths must be on the same partition/device.
# If they aren't then you must set COPYLINK below to 1. This
@ -172,18 +172,17 @@ export VERBOSE_MAKE=1
# the proper official CD run does not work
ATTEMPT_FALLBACK=yes
# Set your disk size here in MB. Used in calculating package and
# source file layouts in build.sh and build_all.sh. Defaults are for
# CD-R, try ~4400 for DVD-R.
export DEFBINSIZE=630
export DEFSRCSIZE=635
# Set the disk type, used later in various places. Soon this will also
# be used to work out the disk size automatically
if [ "$DISKTYPE"x = ""x ] ; then
DISKTYPE=CD
fi
export DISKTYPE
# Set your disk type here. Known types are:
# BC (businesscard): 650 MiB max (should be limited elsewhere,
# should never fill a CD anyway)
# NETINST: 650 MiB max (ditto)
# CD: standard 74-min CD (650 MiB)
# CD700: (semi-)standard 80-min CD (700 MiB)
# DVD: standard 4.7 GB DVD
# CUSTOM: up to you - specify a size to go with it (in 2K blocks)
export DISKTYPE=DVD
#export DISKTYPE=CUSTOM
#export CUSTOMSIZE=XXXX
# We don't want certain packages to take up space on CD1...
#export EXCLUDE="$BASEDIR"/tasks/exclude-$CODENAME
@ -195,11 +194,6 @@ export DISKTYPE
# We also exclude some source packages
#export SRCEXCLUDE="$BASEDIR"/tasks/exclude-src-$CODENAME
# Set this if building source packages CDs should be skipped.
# You won't need source packages on your local mirror in that case.
# (Setting IMAGETARGET is now deprecated, though still supported.)
#export NOSOURCE=1
# Set this if the recommended packages should be skipped when adding
# package on the CD. The default is 'false'.
export NORECOMMENDS=1
@ -217,8 +211,8 @@ export NORECOMMENDS=1
# since they need the actual .iso to make it bootable. For these archs,
# the temp-iso will be generated, but deleted again immediately after the
# jigdo stuff is made; needs temporary space as big as the biggest image.
#export DOJIGDO=2
#
export DOJIGDO=1
# jigdo-file command & options
# Note: building the cache takes hours, so keep it around for the next run
#export JIGDOCMD="/usr/local/bin/jigdo-file --cache=$HOME/jigdo-cache.db"
@ -293,9 +287,6 @@ do
JIGDO_OPTS="$JIGDO_OPTS -jigdo-force-md5 $INCL"
done
# Where to find the boot disks
#export BOOTDISKS=$TOPDIR/ftp/skolelinux/boot-floppies
# File with list of packages to include when fetching modules for the
# first stage installer (debian-installer). One package per line.
# Lines starting with '#' are comments. The package order is

40
debian/changelog vendored
View File

@ -1,4 +1,39 @@
debian-cd (2.2.26) UNRELEASED; urgency=low
debian-cd (3.0.0) UNRELEASED; urgency=low
* Support now added for multi-arch CDs/DVDs, including mixed
binary/source discs. Multi-arch discs should be bootable on those
multiple arches, modulo boot-sector clashes. Extra support added
in boot-i386 and boot-amd64 to make the 2 main arches happily
co-exist.
* Disc sizing is now much more intelligent - sizes are defined
depending on the disk type chosen at the start, and discs are now
filled exactly to those sizes while files are added rather than
the old up-front guessing method. Equally, the metadata on the
disc (Packages, Packages.gz, Sources, Sources.gz, md5sums.txt) is
generated as much as possible while this is happening to make the
sizing code incredibly accurate. Using this method of disc sizing
means that customising discs should be much easier/safer - either
add custom contents at the start and debian-cd will fill the
remainder of the disc, or afterwards roll back the packages on the
disc and add extras later.
* Source is now treated as (almost) just another arch, with most of
the special casing for source hidden internally. If asking for
source-only discs, they will simply be built using all the
available sources. If combined with other arches, the sources will
automatically be chosen to match the binary packages. Meeting GPL
requirements was never so easy!
* Removed lots of old cruft to clean up the codebase:
+ non-US support
+ woody support
+ lots of old support scripts that have been made redundant
+ significantly simpler Makefile, much easier to follow
+ old boot-$ARCH.calc files for estimating boot-file sizes are now
(obviously) obsolete and therefore gone
Other changes:
[ Petter Reinholdtsen ]
* Update tools/boot/*/boot-amd64 to use the correct isolinux
@ -111,9 +146,6 @@ debian-cd (2.2.26) UNRELEASED; urgency=low
[ Colin Watson ]
* Include prep support on powerpc images again.
[ Frans Pop ]
*
-- Frans Pop <fjp@debian.org> Thu, 7 Dec 2006 02:00:04 +0100
debian-cd (2.2.25) unstable; urgency=low

2
debian/control vendored
View File

@ -10,7 +10,7 @@ XS-Vcs-Svn: svn://svn.debian.org/debian-cd/trunk
Package: debian-cd
Architecture: all
Depends: perl, cpp, libdigest-md5-perl, tofrodos | sysutils, apt (>= 0.3.11.1), make, mkisofs | mkhybrid, lynx, grep-dctrl, apt-utils (>= 0.5.4), debootstrap, bc
Depends: perl, cpp, libdigest-md5-perl, tofrodos | sysutils, apt (>= 0.3.11.1), make, mkisofs | mkhybrid, lynx, grep-dctrl, apt-utils (>= 0.5.4), debootstrap, bc, libcompress-zlib-perl
Recommends: hfsutils, debianutils (>= 1.6), jigdo-file (>= 0.7.0)
Suggests: palo (>= 0.94), binutils-multiarch, netpbm, syslinux
Description: Tools for building (Official) Debian CD set

View File

@ -3,9 +3,10 @@
#set -x
set -e
BDIR=$TDIR/$CODENAME-$ARCH
ADIR=$APTTMP/$CODENAME-$ARCH
SDIR=$TDIR/$CODENAME-src
BDIR=$TDIR/$CODENAME
SDIR=$TDIR/$CODENAME
DISK=$1
ARCHES="$2"
DEBMAINVER="`echo $DEBVERSION | sed -e 's/[ _r].*//'`"
@ -17,79 +18,77 @@ if [ "$OMIT_MANUAL"x = ""x ] ; then
OMIT_MANUAL=0
fi
for i in $BDIR/*.packages; do
dir=${i%%.packages}
DISK=${dir##$BDIR/}
dir=$BDIR/CD$DISK
cp -pdf $MIRROR/README* $dir/
dir=$BDIR/CD$DISK
cp -pdf $MIRROR/README* $dir/
if [ -f $dir/doc/dedication-$DEBMAINVER.txt ]; then
mv $dir/doc/dedication-$DEBMAINVER.txt $dir/dedication.txt
ln -s ../dedication.txt $dir/doc/dedication-$DEBMAINVER.txt
if [ -f $dir/doc/dedication-$DEBMAINVER.txt ]; then
mv $dir/doc/dedication-$DEBMAINVER.txt $dir/dedication.txt
ln -s ../dedication.txt $dir/doc/dedication-$DEBMAINVER.txt
fi
rm -f $dir/README $dir/README.1ST \
$dir/README.CD-manufacture $dir/README.multicd \
$dir/README.pgp $dir/README.non-US ; \
cpp -traditional -undef -P -C -Wall -nostdinc -I$dir \
-D OMIT_MANUAL="$OMIT_MANUAL" \
-D OFFICIAL_VAL=$OFFICIAL_VAL \
-D OMIT_RELEASE_NOTES="$OMIT_RELEASE_NOTES" \
-D OUTPUTtext $BASEDIR/data/$CODENAME/README.html.in \
| sed -e 's/%%.//g' > $dir/README.html
lynx -dump -force_html $dir/README.html | todos \
> $dir/README.txt ; \
cpp -traditional -undef -P -C -Wall -nostdinc -I $dir/ \
-D OMIT_MANUAL="$OMIT_MANUAL" \
-D OFFICIAL_VAL=$OFFICIAL_VAL \
-D OMIT_RELEASE_NOTES="$OMIT_RELEASE_NOTES" \
-D OUTPUThtml $BASEDIR/data/$CODENAME/README.html.in \
| sed -e 's/%%.//g' > $dir/README.html
rm -f $dir/README.diskdefines
mkdir -p $dir/pics
cp -p $BASEDIR/data/pics/*.* $dir/pics/
if [ -e $MIRROR/dists/$CODENAME/main/Release-Notes ] ; then
cp -pf $MIRROR/dists/$CODENAME/main/Release-Notes $dir/
fi
if [ -e $BASEDIR/data/$CODENAME/README.multicd ]; then
cp -pf $BASEDIR/data/$CODENAME/README.multicd $dir/
fi
for ARCH in $ARCHES
do
if [ $ARCH != "source" ] ; then
if [ "$INSTALLER_CD" = "0" ] ; then
if [ -e $MIRROR/dists/$CODENAME/Contents-$ARCH.gz ] ; then
cp -pf $MIRROR/dists/$CODENAME/Contents-$ARCH.gz $dir/dists/$CODENAME/
else
echo "WARNING: there's no Contents-$ARCH.gz file for $CODENAME !"
fi
fi
if [ -n "$NONUS" ] ; then
if [ -e $NONUS/dists/$CODENAME/non-US/Contents-$ARCH.gz ] ; then
cp -pf $NONUS/dists/$CODENAME/non-US/Contents-$ARCH.gz \
$dir/dists/$CODENAME/non-US/
else
echo "WARNING: there's no Content-$ARCH.gz file for $CODENAME/non-US !"
fi
fi
if [ -e $BASEDIR/data/$CODENAME/README.$ARCH ] ; then
cp -pf $BASEDIR/data/$CODENAME/README.$ARCH $dir/
fi
if [ -e $BASEDIR/data/$CODENAME/README.1ST.$ARCH ] ; then
echo "This disc is labelled :" >> $dir/README.1ST
cat $dir/.disk/info >>$dir/README.1ST
echo -e "\n\n" >>$dir/README.1ST
cat $BASEDIR/data/$CODENAME/README.1ST.$ARCH >> $dir/README.1ST
todos $dir/README.1ST
fi
fi
rm -f $dir/README $dir/README.1ST \
$dir/README.CD-manufacture $dir/README.multicd \
$dir/README.pgp $dir/README.non-US ; \
cpp -traditional -undef -P -C -Wall -nostdinc -I$dir \
-D OMIT_MANUAL="$OMIT_MANUAL" \
-D OMIT_RELEASE_NOTES="$OMIT_RELEASE_NOTES" \
-D OFFICIAL_VAL=$OFFICIAL_VAL \
-D OUTPUTtext $BASEDIR/data/$CODENAME/README.html.in \
| sed -e 's/%%.//g' > $dir/README.html
lynx -dump -force_html $dir/README.html | todos \
> $dir/README.txt ; \
cpp -traditional -undef -P -C -Wall -nostdinc -I $dir/ \
-D OMIT_MANUAL="$OMIT_MANUAL" \
-D OMIT_RELEASE_NOTES="$OMIT_RELEASE_NOTES" \
-D OFFICIAL_VAL=$OFFICIAL_VAL \
-D OUTPUThtml $BASEDIR/data/$CODENAME/README.html.in \
| sed -e 's/%%.//g' > $dir/README.html
rm -f $dir/README.diskdefines
mkdir -p $dir/pics
cp -p $BASEDIR/data/pics/*.* $dir/pics/
if [ -e $MIRROR/dists/$CODENAME/main/Release-Notes ]; then
cp -pf $MIRROR/dists/$CODENAME/main/Release-Notes $dir/
fi
if [ "$INSTALLER_CD" = "0" ]; then
if [ -e $MIRROR/dists/$CODENAME/Contents-$ARCH.gz ]; then
cp -pf $MIRROR/dists/$CODENAME/Contents-$ARCH.gz $dir/dists/$CODENAME/
else
echo "WARNING: there's no Contents-$ARCH.gz file for $CODENAME !"
fi
fi
if [ -n "$NONUS" ]
then
if [ -e $NONUS/dists/$CODENAME/non-US/Contents-$ARCH.gz ]; then
cp -pf $NONUS/dists/$CODENAME/non-US/Contents-$ARCH.gz \
$dir/dists/$CODENAME/non-US/
else
echo "WARNING: there's no Content-$ARCH.gz file for $CODENAME/non-US !"
fi
fi
if [ -e $BASEDIR/data/$CODENAME/README.$ARCH ]; then
cp -pf $BASEDIR/data/$CODENAME/README.$ARCH $dir/
fi
if [ -e $BASEDIR/data/$CODENAME/README.1ST.$ARCH ]; then
rm -f $dir/README.1ST
echo "This disc is labelled :" > $dir/README.1ST
cat $dir/.disk/info >>$dir/README.1ST
echo -e "\n\n" >>$dir/README.1ST
cat $BASEDIR/data/$CODENAME/README.1ST.$ARCH > $dir/README.1ST
todos $dir/README.1ST
fi
if [ -e $BASEDIR/data/$CODENAME/README.multicd ]; then
cp -pf $BASEDIR/data/$CODENAME/README.multicd $dir/
fi
done

View File

@ -1,139 +0,0 @@
#!/bin/sh
#
# add_debs
#
# Simple helper script for debian-cd
#
# Split out of the top-level Makefile by SAM 2005/12/10
#
# 1. Check that the lists of packages look valid (e.g. installer
# packages are on CD#1
#
# 2. Add deb files into each CD root
#
# 3. Create Packages files within each CD root
set -e
BDIR=$1
TDIR=$2
FIRSTDISKS=$3
ARCH=$4
BASE_INCLUDE=$5
BASE_EXCLUDE=$6
UDEB_INCLUDE=$7
UDEB_EXCLUDE=$8
ADDPACKAGES=$9
shift
SCANPACKAGES=$9
echo "Current disk usage on the binary CDs (before the debs are added):"
cd $BDIR && du -sm CD[0123456789]*
echo "Adding the selected packages to each CD:"
# Check that all packages required by debootstrap are included
# and create .disk/base_installable if yes
# Also create .disk/base_components
mkdir -p $TDIR
for DISK in $FIRSTDISKS
do
DISK=${DISK##CD}
ok=yes
for p in `debootstrap --arch $ARCH --print-debs $CODENAME $TDIR/debootstrap.tmp file:$MIRROR $DEBOOTSTRAP_SCRIPT`
do
if ! grep -q ^$p$ $BDIR/$DISK.packages ; then
if [ -n "$BASE_EXCLUDE" ] && grep -q ^$p$ $BASE_EXCLUDE ; then
echo "Missing debootstrap-required $p but included in $BASE_EXCLUDE"
continue
fi
ok=no
echo "Missing debootstrap-required $p"
fi
done
rm -rf $TDIR/debootstrap.tmp
if [ "$ok" = "yes" ] ; then
echo "CD$DISK contains all packages needed by debootstrap"
touch $BDIR/CD$DISK/.disk/base_installable
else
echo "CD$DISK missing some packages needed by debootstrap"
fi
echo 'main' > $BDIR/CD$DISK/.disk/base_components
if [ -n "$LOCAL" ] ; then
echo 'local' >> $BDIR/CD$DISK/.disk/base_components
fi
if [ $COMPLETE = 1 ]; then
if [ $DISKTYPE = DVD ]; then
echo "dvd" > $BDIR/CD$DISK/.disk/cd_type
else
echo "full_cd" > $BDIR/CD$DISK/.disk/cd_type
fi
else
echo "not_complete" > $BDIR/CD$DISK/.disk/cd_type
fi
# Sort out the udeb include and exclude files
if [ -n "$UDEB_INCLUDE" ] ; then
if [ -r "$UDEB_INCLUDE" ] ; then
cp -af "$UDEB_INCLUDE" "$BDIR/CD$DISK/.disk/udeb_include"
else
echo "ERROR: Unable to read UDEB_INCLUDE file $UDEB_INCLUDE"
fi
fi
if [ -n "$UDEB_EXCLUDE" ] ; then
if [ -r "$UDEB_EXCLUDE" ] ; then
cp -af "$UDEB_EXCLUDE" "$BDIR/CD$DISK/.disk/udeb_exclude"
else
echo "ERROR: Unable to read UDEB_EXCLUDE file $UDEB_EXCLUDE"
fi
fi
# Ditto the base include and exclude
if [ -n "$BASE_INCLUDE" ] ; then
if [ -r "$BASE_INCLUDE" ] ; then
cp -af "$BASE_INCLUDE" "$BDIR/CD$DISK/.disk/base_include"
else
echo "ERROR: Unable to read BASE_INCLUDE file $BASE_INCLUDE"
fi
fi
if [ -n "$BASE_EXCLUDE" ] ; then
if [ -r "$BASE_EXCLUDE" ] ; then
cp -af "$BASE_EXCLUDE" "$BDIR/CD$DISK/.disk/base_exclude"
else
echo "ERROR: Unable to read BASE_EXCLUDE file $BASE_EXCLUDE"
fi
fi
done
# Copy the debs in place, and generate Packages files as we go
for i in $BDIR/*.packages
do
dir=${i%%.packages}
n=${dir##$BDIR/}
dir=$BDIR/CD$n
echo "$n ... "
# Copy the deb files in; addpackages also creates the Packages
# files as it runs
sort $i | xargs -n 200 -r $ADDPACKAGES $dir
if [ -x "$HOOK" ] ; then
cd $BDIR && $HOOK $n before-scanpackages
fi
# Create the Packages.gz files. Should we also make Packages.bz2?
for file in `find $dir -name Packages`
do
echo " $file.gz"
gzip -9 < $file > $file.gz
done
# Now the Release files; has to be done last, as they contain the
# md5sums of the Packages and Packages.gz files
$SCANPACKAGES $dir
echo "done."
done

View File

@ -1,84 +0,0 @@
#!/bin/sh
# Create the needed directories before putting packages into them
set -e
# There's no difference between NONFREE and EXTRANONFREE for this script
if [ "${EXTRANONFREE:-0}" != "0" ]
then
NONFREE=1
fi
cd $1
if [ ! -e debian ] ; then
ln -sf . debian
fi
if [ ! -d dists/$CODENAME ] ; then
mkdir -p dists/$CODENAME
for name in stable unstable frozen testing; do
ln -sf $CODENAME dists/$name
done
fi
# Commodity link for tools which want local in dists/local/local ...
if [ -n "$LOCAL" ]
then
ln -sf $CODENAME dists/local
fi
if [ ! -d .disk ] ; then
mkdir .disk
fi
mkdir -p dists/$CODENAME/main/binary-$ARCH
mkdir -p dists/$CODENAME/main/source
if [ "${CONTRIB:-0}" != 0 ]; then
mkdir -p dists/$CODENAME/contrib/binary-$ARCH
mkdir -p dists/$CODENAME/contrib/source
fi
if [ "${NONFREE:-0}" != "0" ]; then
mkdir -p dists/$CODENAME/non-free/binary-$ARCH
mkdir -p dists/$CODENAME/non-free/source
fi
if [ -n "$LOCAL" -a -e "${LOCALDEBS:-$MIRROR}/dists/$DI_CODENAME/local/debian-installer" ]; then
mkdir -p dists/$CODENAME/local/debian-installer/binary-$ARCH
fi
if [ -e "$MIRROR/dists/$DI_CODENAME/main/debian-installer" ]; then
mkdir -p dists/$CODENAME/main/debian-installer/binary-$ARCH
fi
if [ -n "$SECURITY" ]; then
mkdir -p dists/$CODENAME/updates/main/binary-$ARCH
mkdir -p dists/$CODENAME/updates/main/source
if [ "${CONTRIB:-0}" != "0" ]; then
mkdir -p dists/$CODENAME/updates/contrib/binary-$ARCH
mkdir -p dists/$CODENAME/updates/contrib/source
fi
if [ "${NONFREE:-0}" != "0" ]; then
mkdir -p dists/$CODENAME/updates/non-free/binary-$ARCH
mkdir -p dists/$CODENAME/updates/non-free/source
fi
fi
if [ -n "$NONUS" ]; then
mkdir -p dists/$CODENAME/non-US/main/binary-$ARCH
mkdir -p dists/$CODENAME/non-US/main/source
if [ "${CONTRIB:-0}" != "0" ]; then
mkdir -p dists/$CODENAME/non-US/contrib/binary-$ARCH
mkdir -p dists/$CODENAME/non-US/contrib/source
fi
if [ "${NONFREE:-0}" != "0" ]; then
mkdir -p dists/$CODENAME/non-US/non-free/binary-$ARCH
mkdir -p dists/$CODENAME/non-US/non-free/source
fi
fi
if [ -n "$LOCAL" ]; then
mkdir -p dists/$CODENAME/local/binary-$ARCH
mkdir -p dists/$CODENAME/local/source
fi

View File

@ -1,8 +1,17 @@
#!/usr/bin/perl -w
use strict;
use Compress::Zlib;
my $dir = shift;
my $dir;
my $rollback = 0;
my $option = shift;
if ($option =~ /--rollback/) {
$rollback = 1;
$dir = shift;
} else {
$dir = $option;
}
if (! -d $dir) {
die "$dir is not a directory ...";
@ -11,23 +20,35 @@ if (! -d $dir) {
my $mirror = $ENV{'MIRROR'} || die "Set the MIRROR var ...\n";
my $localdebs = $ENV{'LOCALDEBS'} || $mirror;
my $security = $ENV{'SECURITY'} || $mirror;
my $nonus = $ENV{'NONUS'} || '';
my $basedir = $ENV{'BASEDIR'} || die "Set the BASEDIR var ...\n";
my $codename = $ENV{'CODENAME'} || die "Set the CODENAME var ...\n";
my $tdir = $ENV{'TDIR'} || die "Set the TDIR var ...\n";
my $total_size = 0;
my $iso_blksize = 2048;
my $pkgname;
my $arch;
open(LOG, ">> $tdir/$codename/log.add_packages")
|| die "Can't write in $tdir/log.add_packages!\n";
sub msg {
my $level = shift;
print LOG @_;
}
require "$basedir/tools/link.pl";
open (LIST, "$basedir/tools/apt-selection cache show @ARGV |")
|| die "Can't fork : $!\n";
my $old_split = $/;
$/ = ''; # Browse by paragraph
my ($p, $file, $arch, $d, $realfile, $source, $section, $name, $pkgfile, $dist, $pdir);
while (defined($_ = <LIST>)) {
m/^Package: (\S+)/m and $p = $1;
m/^Filename: (\S+)/mi and $file = $1;
m/^Architecture: (\S+)/m and $arch = $1;
m/^Section: (\S+)/m and $section = $1;
# From a package name and section, work out the directory where its
# corresponding Packages file should live
sub Packages_dir {
my $file = shift;
my $section = shift;
my ($pdir, $dist);
if ($file =~ /\/main\//) {
$dist = "main";
@ -37,13 +58,35 @@ while (defined($_ = <LIST>)) {
$dist = "non-free";
} elsif ($file =~ /\/local\//) {
$dist = "local";
}
$pdir = "$dir/dists/$codename/$dist";
if ($section eq "debian-installer") {
$pdir = "$dir/dists/$codename/$dist/debian-installer";
}
return $pdir;
}
# Dump the apt-cached data into a Packages file; make the parent dir
# for the Packages file if necesssary
sub add_Packages_entry {
my ($p, $file, $section, $pdir, $pkgfile, $gz);
my $arch = shift;
m/^Package: (\S+)/m and $p = $1;
m/^Section: (\S+)/m and $section = $1;
if ($arch eq "source") {
m/^Directory: (\S+)/mi and $file = $1;
$pdir = Packages_dir($file, $section) . "/source";
$pkgfile = "$pdir/Sources";
} else {
m/^Filename: (\S+)/mi and $file = $1;
$pdir = Packages_dir($file, $section) . "/binary-$arch";
$pkgfile = "$pdir/Packages";
}
$pdir = "$dir/dists/$codename/$dist/binary-$ENV{'ARCH'}";
if ($section eq "debian-installer") {
$pdir = "$dir/dists/$codename/$dist/debian-installer/binary-$ENV{'ARCH'}";
}
$pkgfile = "$pdir/Packages";
msg(0, " Adding $p to $pkgfile(.gz)\n");
if (! -d $pdir) {
system("mkdir -p $pdir");
@ -53,47 +96,199 @@ while (defined($_ = <LIST>)) {
print PFILE $_;
close(PFILE);
$source = ($section =~ /non-US/i) ? $nonus : $mirror;
# This is a hack to allow the local debs to be located elsewhere.
$source=$localdebs if $file=~m:local/:;
$source=$security if $file=~m:updates/:;
# If arch=all and filename points to binary-all then create
# a symbolic link in binary-$ARCH or if arch=all and filename is a
# symbolic link we suppose that the link points to
# .../binary-all/... and we reproduce a similar setup on the CD
if ($arch eq "all" and (-l "$source/$file" or
$file =~ m#/binary-all/#)) {
$file =~ s#/binary-all/#/binary-$ENV{'ARCH'}/#g;
# Check that the directory where the link will be created does
# exist
$pdir = "$dir/$file";
$pdir =~ s#[^/]+$##g;
if (! -d $pdir)
{
system("mkdir -p $pdir");
}
# Create the symlink from binary-$arch to binary-all
if ($section =~ /non-US/ || $file =~ /updates/ ) {
$file =~ m#/([^/]+)$# and $name = $1;
symlink ("../binary-all/$name", "$dir/$file") ||
die "Can't symlink $dir/$file to ../binary-all/$name: $!";
} else {
$file =~ m#/([^/]+/[^/]+)$# and $name = $1;
symlink ("../../binary-all/$name", "$dir/$file") ||
die "Can't symlink $dir/$file to ../../binary-all/$name: $!";
}
$file =~ s#/binary-$ENV{'ARCH'}/#/binary-all/#g;
}
# And we put the file in the CD tree (with a (hard) link)
$realfile = real_file ("$source/$file");
good_link ($realfile, "$dir/$file");
$gz = gzopen("$pkgfile.gz", "ab9") or die "Failed to open $pkgfile.gz: $gzerrno\n";
$gz->gzwrite($_) or die "Failed to write $pkgfile.gz: $gzerrno\n";
$gz->gzclose();
}
close LIST or die "Something went wrong with apt-cache : $@ ($!)\n";
sub add_md5_entry {
my $arch = shift;
my ($pdir, $file, $md5);
my $md5file = "$dir/md5sum.txt";
open(MD5FILE, ">>$md5file");
if ($arch eq "source") {
m/^Directory: (\S+)/mi and $pdir = $1;
m/^ (\S+) (\S+) ((\S+).*dsc)/m and print MD5FILE "$1 ./$pdir/$3\n";
m/^ (\S+) (\S+) ((\S+).*tar.gz)/m and print MD5FILE "$1 ./$pdir/$3\n";
m/^ (\S+) (\S+) ((\S+).*diff.gz)/m and print MD5FILE "$1 ./$pdir/$3\n";
} else {
m/^Filename: (\S+)/m and $file = $1;
m/^MD5sum: (\S+)/m and print MD5FILE "$1 ./$file\n";
}
close(MD5FILE);
}
# Roll back the results of add_Packages_entry()
sub remove_Packages_entry {
my ($p, $file, $section, $pdir, $pkgfile, $tmp_pkgfile, $match, $gz);
my $arch = shift;
m/^Package: (\S+)/m and $p = $1;
m/^Section: (\S+)/m and $section = $1;
if ($arch eq "source") {
m/^Directory: (\S+)/mi and $file = $1;
$pdir = Packages_dir($file, $section) . "/source";
$pkgfile = "$pdir/Sources";
} else {
m/^Filename: (\S+)/mi and $file = $1;
$pdir = Packages_dir($file, $section) . "/binary-$arch";
$pkgfile = "$pdir/Packages";
}
$tmp_pkgfile = "$pkgfile" . ".rollback";
msg(0, " Removing $p from $pkgfile\n");
open(IFILE, "<$pkgfile");
open(OFILE, ">>$tmp_pkgfile");
$gz = gzopen("$pkgfile.gz", "wb9");
while (defined($match = <IFILE>)) {
if (! ($match =~ /^Package: $p$/m)) {
print OFILE $match;
$gz->gzwrite($match) or die "Failed to write $pkgfile.gz: $gzerrno\n";
}
}
$gz->gzclose();
close(IFILE);
close(OFILE);
rename $tmp_pkgfile, $pkgfile;
}
sub remove_md5_entry {
my $arch = shift;
my ($pdir, $file, $md5, $match, $present);
my $md5file = "$dir/md5sum.txt";
my $tmp_md5file = "$dir/md5sum.txt.tmp";
my @fileslist;
$/ = $old_split; # Browse by line again
if ($arch eq "source") {
m/^Directory: (\S+)/mi and $pdir = $1;
m/^ (\S+) (\S+) ((\S+).*dsc)/m and push(@fileslist, "$1 ./$pdir/$3");
m/^ (\S+) (\S+) ((\S+).*diff.gz)/m and push(@fileslist, "$1 ./$pdir/$3");
m/^ (\S+) (\S+) ((\S+).*tar.gz)/m and push(@fileslist, "$1 ./$pdir/$3");
} else {
m/^Filename: (\S+)/m and $file = $1;
m/^MD5Sum: (\S+)/mi and push(@fileslist, "$1 ./$file");
}
open(IFILE, "<$md5file");
open(OFILE, ">>$tmp_md5file");
while (defined($match = <IFILE>)) {
$present = 0;
foreach my $entry (@fileslist) {
if (($match =~ /$entry$/m)) {
$present++;
}
}
if (!$present) {
print OFILE $match;
}
}
close(IFILE);
close(OFILE);
$/ = ''; # Browse by paragraph again
rename $tmp_md5file, $md5file;
}
sub get_file_size {
my $realfile = shift;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($realfile);
$size = 1 + int(($size + $iso_blksize - 1) / $iso_blksize);
return $size;
}
my ($p, @files, $d, $realfile, $source, $section, $name, $pkgfile, $pdir);
foreach my $package (@ARGV) {
$pkgname = $package;
$pkgname =~ s/^.*://;
$arch = $package;
$arch =~ s/:.*$//g;
$ENV{'ARCH'} = $arch;
if ($arch eq "source") {
open (LIST, "$basedir/tools/apt-selection cache showsrc $pkgname |")
|| die "Can't fork : $!\n";
} else {
open (LIST, "$basedir/tools/apt-selection cache show $pkgname |")
|| die "Can't fork : $!\n";
}
while (defined($_ = <LIST>)) {
undef @files;
msg(0, "Looking at $package: arch $arch, package $pkgname\n");
m/^Package: (\S+)/m and $p = $1;
m/^Section: (\S+)/m and $section = $1;
$source = $mirror;
if ($arch eq "source") {
m/^Directory: (\S+)/m and $pdir = $1;
$source=$localdebs if $pdir=~m:local/:;
$source=$security if $pdir=~m:updates/:;
m/^ (\S+) (\S+) ((\S+).*dsc)/m and push(@files, "$pdir/$3");
m/^ (\S+) (\S+) ((\S+).*diff.gz)/m and push(@files, "$pdir/$3");
m/^ (\S+) (\S+) ((\S+).*tar.gz)/m and push(@files, "$pdir/$3");
} else {
m/^Filename: (\S+)/mi and push(@files, $1);
$source=$localdebs if $1=~m:local/:;
$source=$security if $1=~m:updates/:;
}
if ($rollback) {
# Remove the Packages entry/entries for the specified package
remove_Packages_entry($arch, $_);
remove_md5_entry($arch, $_);
foreach my $file (@files) {
# Count how big the file is we're removing, for checking if the disc is full
$realfile = real_file ("$source/$file");
$total_size -= get_file_size($realfile);
# Remove the link
unlink ("$dir/$file") or die "Failed to remove $dir/$file\n";
msg(0, " Rollback: removing $dir/$file\n");
}
} else {
add_Packages_entry($arch, $_);
add_md5_entry($arch, $_);
foreach my $file (@files) {
# And put the file in the CD tree (with a (hard) link)
$realfile = real_file ("$source/$file");
if (! -e "$dir/$file") {
# Count how big the file is, for checking if the disc
# is full. ONLY do this if the file is not already
# linked in - consider binary-all packages on a
# multi-arch disc
$total_size += get_file_size($realfile);
good_link ($realfile, "$dir/$file");
msg(0, " Linked $dir/$file\n");
} else {
msg(0, " $dir/$file already linked in\n");
}
}
}
}
close LIST or die "Something went wrong with apt-cache : $@ ($!)\n";
}
msg(0, " size $total_size\n");
print "$total_size\n";
close LOG

View File

@ -1,59 +0,0 @@
#!/bin/sh
#
# add_source_packages
#
# Simple helper script for debian-cd
#
# Split out of the top-level Makefile by SAM 2005/12/10
#
# 1. Add source files into each CD root
#
# 2. Create Sources files within each CD root
set -e
SDIR=$1
ADD_FILES=$2
MIRROR=$3
LOCAL=$4
LOCALDEBS=$5
SCANSOURCES=$6
export TDIR
echo "Adding the selected sources to each CD under $TDIR"
for i in $SDIR/*.sources
do
dir=${i%%.sources}
n=${dir##$SDIR/}
dir=$SDIR/CD$n
echo -n "$n ... "
echo -n "main ... "
grep -vE "(non-US/|/local/)" $i > $i.main || true
if [ -s $i.main ] ; then
cat $i.main | xargs $ADD_FILES $dir $MIRROR
fi
if [ -n "$LOCAL" ] ; then
echo -n "local ... "
grep "/local/" $i > $i.local || true
if [ -s $i.local ] ; then
if [ -n "$LOCALDEBS" ] ; then
cat $i.local | xargs $ADD_FILES $dir $LOCALDEBS
else
cat $i.local | xargs $ADD_FILES $dir $MIRROR
fi
fi
fi
if [ -n "$NONUS" ] ; then
echo -n "non-US ... "
grep "non-US/" $i > $i.nonus || true
if [ -s $i.nonus ] ; then
cat $i.nonus | xargs $ADD_FILES $dir $NONUS
fi
fi
$SCANSOURCES $dir
echo "done."
done

View File

@ -21,12 +21,18 @@ if [ -z "$CODENAME" -o -z "$ARCH" -o -z "$APTTMP" ]; then
fi
fi
if [ $ARCH = "source" ] ; then
ADEB="deb-src"
else
ADEB="deb"
fi
options=" -q -o Dir::State::status=$APTTMP/$CODENAME-$ARCH/status \
-o Dir::State=$APTTMP/$CODENAME-$ARCH/apt-state/ \
-o Dir::Cache=$APTTMP/$CODENAME-$ARCH/apt-cache/ \
-o Dir::Etc=$APTTMP/$CODENAME-$ARCH/apt/ \
-o APT::Cache::AllVersions=0 \
-o APT::Architecture=$ARCH "
-o Dir::State=$APTTMP/$CODENAME-$ARCH/apt-state/ \
-o Dir::Cache=$APTTMP/$CODENAME-$ARCH/apt-cache/ \
-o Dir::Etc=$APTTMP/$CODENAME-$ARCH/apt/ \
-o APT::Cache::AllVersions=0 \
-o APT::Architecture=$ARCH "
sections=main
if [ "${NONFREE:-0}" != "0" -o "${EXTRANONFREE:-0}" != "0" ]; then
@ -47,31 +53,33 @@ if [ ! -d "$APTTMP/$CODENAME-$ARCH/apt" ]; then
mkdir -p "$APTTMP/$CODENAME-$ARCH/apt"
fi
if [ ! -e "$APTTMP/$CODENAME-$ARCH/apt/sources.list" ]; then
# Generating a correct sources.list file
echo "deb file:$MIRROR $CODENAME $sections" \
echo "$ADEB file:$MIRROR $CODENAME $sections" \
> $APTTMP/$CODENAME-$ARCH/apt/sources.list
if [ -n "$NONUS" ]; then
echo "deb file:$NONUS $CODENAME/non-US $sections" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi
# Local packages ...
if [ -n "$LOCAL" ]; then
echo "deb file:${LOCALDEBS:-$MIRROR} $CODENAME local" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
echo "$ADEB file:${LOCALDEBS:-$MIRROR} $CODENAME local" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi
# Security mirror ...
if [ -n "$SECURITY" ]; then
echo "deb file:${SECURITY:-$MIRROR} $CODENAME/updates $sections" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi
# Security mirror ...
if [ -n "$SECURITY" ]; then
echo "$ADEB file:${SECURITY:-$MIRROR} $CODENAME/updates $sections" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi
# Debian-installer
if [ -e "$MIRROR/dists/$DI_CODENAME/main/debian-installer" ]; then
echo "deb file:$MIRROR $DI_CODENAME main/debian-installer" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi
if [ -n "$LOCAL" -a -e "${LOCALDEBS:-$MIRROR}/dists/$DI_CODENAME/local/debian-installer" ]; then
echo "deb file:${LOCALDEBS:-$MIRROR} $DI_CODENAME local/debian-installer" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
if [ $ARCH != source ] ; then
if [ -e "$MIRROR/dists/$DI_CODENAME/main/debian-installer" ]; then
echo "$ADEB file:$MIRROR $DI_CODENAME main/debian-installer" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi
if [ -n "$LOCAL" -a -e "${LOCALDEBS:-$MIRROR}/dists/$DI_CODENAME/local/debian-installer" ]; then
echo "$ADEB file:${LOCALDEBS:-$MIRROR} $DI_CODENAME local/debian-installer" \
>> $APTTMP/$CODENAME-$ARCH/apt/sources.list
fi
fi
fi
@ -90,8 +98,8 @@ elif [ "$1" = "deselected" ]; then
apt-get $options -s $@ > $temp
num=$?
#if [ $num -ne 0 ]; then
#echo ": Param: apt-selection deselected $@" >&2;
#exit $num;
#echo ": Param: apt-selection deselected $@" >&2;
#exit $num;
#fi
perl -ne 'print "$1\n" if /^Remv (\S+).*/' $temp | sort
elif [ "$1" = "selected" ]; then
@ -107,4 +115,3 @@ else
apt-get $options -s $@
exit $?
fi

View File

@ -78,31 +78,24 @@ if [ $NN = 1 ]; then
mkdir -p boot$N/etc
cat <<EOF > boot$N/etc/aboot.conf
0:boot/vmlinuz ramdisk_size=20480 initrd=/boot/initrd.gz root=/dev/ram devfs=mount,dall
1:boot/vmlinuz ramdisk_size=20480 initrd=/boot/initrd.gz root=/dev/ram devfs=mount,dall console=ttyS0
2:boot/vmlinuz ramdisk_size=20480 initrd=/boot/initrd.gz root=/dev/ram devfs=mount,dall console=ttyS1
0:boot/vmlinuz ramdisk_size=16384 initrd=/boot/initrd.gz root=/dev/ram devfs=mount,dall
1:boot/vmlinuz ramdisk_size=16384 initrd=/boot/initrd.gz root=/dev/ram devfs=mount,dall console=ttyS0
2:boot/vmlinuz ramdisk_size=16384 initrd=/boot/initrd.gz root=/dev/ram devfs=mount,dall console=ttyS1
EOF
mkdir -p boot$N/milo
# XXX: we need to build milo first.
#cp linload.exe ldmilo.exe boot$N/milo
#cp -f $(ls MILO/milo_*.bin | sed 's,\(.*\)milo_\(.*\).bin,\1\2,') \
# boot$N/milo/
# XXX: populate the install directory as well, if we want floppies.
#cp -lf *.img $CDDIR/install
#cp -lf floppy-initrd.gz $CDDIR/install
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $N.mkisofs_opts "-l"
add_mkisofs_opt $N.mkisofs_opts "-alpha-boot boot/bootlx"
add_mkisofs_opt $N.mkisofs_dirs "boot$N"
# write final lines to mkisofs_opts
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $N.mkisofs_opts "-l"
add_mkisofs_opt $N.mkisofs_opts "-alpha-boot boot/bootlx"
add_mkisofs_opt $N.mkisofs_dirs "boot$N"
else
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $N.mkisofs_opts "-l"
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $N.mkisofs_opts "-l"
fi
#install_languages $CDDIR

View File

@ -1,20 +0,0 @@
BOOT_SIZE_1=28
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_20=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -9,13 +9,14 @@
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
set -e
#set -x
N=$1
CDDIR=$2
BOOTDIR=
echo "DI_WWW_HOME is $DI_WWW_HOME"
echo "DI_DIR is $DI_DIR"
#echo "DI_WWW_HOME is $DI_WWW_HOME"
#echo "DI_DIR is $DI_DIR"
if [ "$DI_WWW_HOME" = "default" ];then
DI_WWW_HOME="http://people.debian.org/~aba/d-i/images/daily"
@ -46,7 +47,6 @@ fi
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
# Download boot images.
for image in $BOOT_IMAGES; do
if [ ! -e "$image" ]; then
@ -58,7 +58,7 @@ for image in $BOOT_IMAGES; do
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
echo "Copying images from $DI_DIR"
# echo "Copying images from $DI_DIR"
cp "$DI_DIR/$image" "$image"
else
wget "$DI_WWW_HOME/$image" -O "$image"
@ -66,11 +66,10 @@ for image in $BOOT_IMAGES; do
fi
done
echo "Using ISOLINUX boot-disks image on CD$N"
mkdir -p boot$N/isolinux
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/isolinux/
cp -lf cdrom/vmlinuz $CDDIR/install/
cp -lf cdrom/initrd.gz $CDDIR/install/
echo " Using ISOLINUX boot-disks image on CD$N"
mkdir -p boot$N/isolinux boot$N/isolinux-amd64 $CDDIR/install.amd
cp -lf cdrom/vmlinuz $CDDIR/install.amd/
cp -lf cdrom/initrd.gz $CDDIR/install.amd/
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
@ -83,9 +82,9 @@ add_mkisofs_opt $N.mkisofs_opts "-boot-info-table"
syslinux_files () {
type=$1
mv boot$N/isolinux/f3.txt.$type boot$N/isolinux/f3.txt
mv boot$N/isolinux/f4.txt.$type boot$N/isolinux/f4.txt
mv boot$N/isolinux/isolinux.cfg.$type boot$N/isolinux/isolinux.cfg
mv boot$N/isolinux-amd64/f3.txt.$type boot$N/isolinux-amd64/f3.txt
mv boot$N/isolinux-amd64/f4.txt.$type boot$N/isolinux-amd64/f4.txt
mv boot$N/isolinux-amd64/isolinux.cfg.$type boot$N/isolinux-amd64/isolinux.cfg
}
extra_image () {
@ -104,44 +103,71 @@ extra_image () {
fi
fi
if [ ! -d $CDDIR/install/$dir ]; then
mkdir -p $CDDIR/install/$dir
if [ ! -d $CDDIR/install.amd/$dir ]; then
mkdir -p $CDDIR/install.amd/$dir
fi
cp -a "$image" $CDDIR/install/$dir/
cp -a "$image" $CDDIR/install.amd/$dir/
}
# Include Smart Boot Manager image for people where isolinux fails
gzip -dc $BASEDIR/data/$DI_CODENAME/sbm.bin.gz > $CDDIR/install/sbm.bin
# Keep the original file timestamp
touch -r $BASEDIR/data/$DI_CODENAME/sbm.bin.gz $CDDIR/install/sbm.bin
cp -p $BASEDIR/data/$DI_CODENAME/README.sbm $CDDIR/install/
cp -p $BASEDIR/data/$DI_CODENAME/README.sbm $CDDIR/install
# Isolinux setup including config and help files comes from d-i.
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
if [ -e boot$N/isolinux/f3.txt.withgtk ]; then
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux-amd64/; tar zx)
if [ -e boot$N/isolinux-amd64/f3.txt.withgtk ]; then
extra_image gtk/initrd.gz
syslinux_files withgtk
fi
rm -f boot$N/isolinux/isolinux.cfg.with* 2>/dev/null || true
rm -f boot$N/isolinux-amd64/isolinux.cfg.with* 2>/dev/null || true
sed -i "s|/install/|/install.amd/|" boot$N/isolinux-amd64/isolinux.cfg
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/isolinux/
if [ -n "$KERNEL_PARAMS" ]; then
# Substitute custom kernel params into the isolinux config
# file.
sed -i "s|append |append $KERNEL_PARAMS |" boot$N/isolinux-amd64/isolinux.cfg
fi
if [ -n "$ISOLINUX_DEFAULT" ]; then
sed -i "s/^DEFAULT .*$/DEFAULT $ISOLINUX_DEFAULT/" boot$N/isolinux-amd64/isolinux.cfg
fi
# If the isolinux dir already exists, then we also have i386 and
# should merge. Otherwise, simply rename isolinux-amd64 into place
if [ -e boot$N/isolinux/isolinux.cfg ] ; then
for file in boot$N/isolinux/f3.txt* boot$N/isolinux/f4.txt*
do
cat $file | awk '
NR==3 { next }
NR==5 { printf " (i386 is default; prepend 'amd64-' to use an amd64 kernel instead)\n" }
/.*/ { print $0 }' > $file.tmp
mv $file.tmp $file
done
cat boot$N/isolinux-amd64/isolinux.cfg | awk '
/^LABEL/ { printf("LABEL amd64-%s\n", $2) }
/kernel/ { print $0 }
/append/ { print $0 }' >> boot$N/isolinux/isolinux.cfg
else
mv -f boot$N/isolinux-amd64/* boot$N/isolinux
fi
rm -rf boot$N/isolinux-amd64
if [ "$SPLASHPNG" ] ; then
# Insert our own splash screen. Color index 0 is
# background, and index 7 is foreground. Set to black and
# white respecively
pngtopnm < $SPLASHPNG | ppmquant 16 | \
ppmtolss16 "#ffffff=7" "#000000=0" > boot$N/isolinux/splash.rle
fi
if [ -n "$KERNEL_PARAMS" ]; then
# Substitute custom kernel params into the isolinux config
# file.
sed -i "s|append |append $KERNEL_PARAMS |" boot$N/isolinux/isolinux.cfg
fi
if [ -n "$ISOLINUX_DEFAULT" ]; then
sed -i "s/^DEFAULT .*$/DEFAULT $ISOLINUX_DEFAULT/" boot$N/isolinux/isolinux.cfg
ppmtolss16 "#ffffff=7" "#000000=0" > boot$N/isolinux-amd64/splash.rle
fi
rm -rf cdrom
sed -i "s|built on|built $BUILD_DATE; d-i|" boot$N/isolinux/f1.txt
# Add autorun if we have README.html

View File

@ -1,21 +0,0 @@
BOOT_SIZE_1=20
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_20=2
BOOT_SIZE_21=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -1,19 +0,0 @@
BOOT_SIZE_1=26
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -52,6 +52,7 @@ install_languages "$CDROOT"
K32=$(ls $CDROOT/install/vmlinux-*-parisc|head -1 | sed 's?^.*/install/?install/?g')
K64=$(ls $CDROOT/install/vmlinux-*-parisc64|head -1 | sed 's?^.*/install/?install/?g')
RSIZE=$(expr $(zcat "$CDROOT/install/initrd.gz" | wc --bytes) / 1024)
add_mkisofs_opt $1.mkisofs_opts "-hppa-cmdline '0/vmlinux,root=/dev/ram,initrd=0/ramdisk,ramdisk_size=$RSIZE'"
add_mkisofs_opt $1.mkisofs_opts "-hppa-kernel-32 $K32"

View File

@ -1,20 +0,0 @@
BOOT_SIZE_1=35
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_20=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -70,7 +70,7 @@ for image in $BOOT_IMAGES; do
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
echo "Copying images from $DI_DIR"
# echo "Copying images from $DI_DIR"
cp "$DI_DIR/$image" "$image"
else
wget "$DI_WWW_HOME/$image" -O "$image"
@ -97,32 +97,31 @@ for image in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
done
if [ "$NN" = "1" ]; then
echo " Using ISOLINUX boot-disks image on CD$N"
mkdir -p boot$N/isolinux
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/isolinux/
cp -lf cdrom/vmlinuz $CDDIR/install/
cp -lf cdrom/initrd.gz $CDDIR/install/
echo " Using ISOLINUX boot-disks image on CD$N"
mkdir -p boot$N/isolinux $CDDIR/install.386
cp -lf cdrom/vmlinuz $CDDIR/install.386/
cp -lf cdrom/initrd.gz $CDDIR/install.386/
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $N.mkisofs_opts "-b isolinux/isolinux.bin"
add_mkisofs_opt $N.mkisofs_opts "-c isolinux/boot.cat"
add_mkisofs_opt $N.mkisofs_opts "-no-emul-boot"
add_mkisofs_opt $N.mkisofs_opts "-boot-load-size 4"
add_mkisofs_opt $N.mkisofs_opts "-boot-info-table"
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $N.mkisofs_opts "-b isolinux/isolinux.bin"
add_mkisofs_opt $N.mkisofs_opts "-c isolinux/boot.cat"
add_mkisofs_opt $N.mkisofs_opts "-no-emul-boot"
add_mkisofs_opt $N.mkisofs_opts "-boot-load-size 4"
add_mkisofs_opt $N.mkisofs_opts "-boot-info-table"
else
if [ -n "$THISTYPE" ]; then
echo " Using $THISTYPE boot-disks image on CD$N"
mkdir -p boot$N/boot
cp $THISTYPE/boot.img boot$N/boot/
echo " Using $THISTYPE boot-disks image on CD$N"
mkdir -p boot$N/boot
cp $THISTYPE/boot.img boot$N/boot/
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $N.mkisofs_opts "-b boot/boot.img"
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $N.mkisofs_opts "-b boot/boot.img"
else
mkdir boot$N
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
mkdir boot$N
add_mkisofs_opt $N.mkisofs_opts "-J"
add_mkisofs_opt $N.mkisofs_opts "-cache-inodes"
fi
fi
@ -150,8 +149,8 @@ extra_image () {
fi
fi
if [ ! -d $CDDIR/install/$dir ]; then
mkdir -p $CDDIR/install/$dir
if [ ! -d $CDDIR/install.386/$dir ]; then
mkdir -p $CDDIR/install.386/$dir
fi
cp -a "$image" $CDDIR/install/$dir/
}
@ -198,6 +197,28 @@ if [ "$NN" = "1" ]; then
ppmtolss16 "#ffffff=7" "#000000=0" > boot$N/isolinux/splash.rle
fi
sed -i "s|/install/|/install.386/|" boot$N/isolinux/isolinux.cfg
if [ -e boot$N/isolinux-amd64/isolinux.cfg ] ; then
for file in boot$N/isolinux/f3.txt* boot$N/isolinux/f4.txt*
do
cat $file | awk '
NR==3 { next }
NR==5 { printf " (i386 is default; prepend 'amd64-' to use an amd64 kernel instead)\n" }
/.*/ { print $0 }' > $file.tmp
mv $file.tmp $file
done
cat boot$N/isolinux-amd64/isolinux.cfg | awk '
/^LABEL/ { printf("LABEL amd64-%s\n", $2) }
/kernel/ { print $0 }
/append/ { print $0 }' >> boot$N/isolinux/isolinux.cfg
rm -rf boot$N/isolinux-amd64
fi
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/isolinux/
if [ -n "$KERNEL_PARAMS" ]; then
# Substitute custom kernel params into the isolinux config
# file.
@ -211,6 +232,8 @@ if [ "$NN" = "1" ]; then
fi
rm -rf cdrom
# Add autorun if we have README.html
if [ -f $CDDIR/README.html ]; then

View File

@ -1,21 +0,0 @@
BOOT_SIZE_1=41
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_20=2
BOOT_SIZE_21=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -1,21 +0,0 @@
BOOT_SIZE_1=54
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_20=2
BOOT_SIZE_21=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -1,36 +0,0 @@
BOOT_SIZE_1=31
SIZE_MULT_1=97
BOOT_SIZE_10=2
SIZE_MULT_10=97
BOOT_SIZE_11=2
SIZE_MULT_11=97
BOOT_SIZE_12=2
SIZE_MULT_12=97
BOOT_SIZE_13=2
SIZE_MULT_13=97
BOOT_SIZE_14=2
SIZE_MULT_14=97
BOOT_SIZE_15=2
SIZE_MULT_15=97
BOOT_SIZE_16=2
SIZE_MULT_16=97
BOOT_SIZE_17=2
SIZE_MULT_17=97
BOOT_SIZE_18=2
SIZE_MULT_18=97
BOOT_SIZE_2=2
SIZE_MULT_2=97
BOOT_SIZE_3=2
SIZE_MULT_3=97
BOOT_SIZE_4=2
SIZE_MULT_4=97
BOOT_SIZE_5=2
SIZE_MULT_5=97
BOOT_SIZE_6=2
SIZE_MULT_6=97
BOOT_SIZE_7=2
SIZE_MULT_7=97
BOOT_SIZE_8=2
SIZE_MULT_8=97
BOOT_SIZE_9=2
SIZE_MULT_9=97

View File

@ -1,19 +0,0 @@
BOOT_SIZE_1=13
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -1,19 +0,0 @@
BOOT_SIZE_1=31
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -9,7 +9,7 @@
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
set -e
set -x
#set -x
N=$1
CDDIR=$2
@ -27,9 +27,12 @@ fi
cd $CDDIR/..
if [ $N != 1 -a $N != 1_NONUS ]; then
exit 0
fi
# Only disk 1* bootable
#if [ $N != 1 -a $N != 1_NONUS ]; then
# # we don't need HFS cruft on anything but CD 1
# :> $N.mkisofs_opts
# exit 0
#fi
install_languages $CDDIR
@ -47,24 +50,9 @@ add_mkisofs_opt $N.mkisofs_opts "-hfs-bless CD$N/install"
add_mkisofs_opt $N.mkisofs_opts "-hfs-volid Debian/PowerPC_${CODENAME}"
# Recommended size for a HFS Catalog is 4 megas per giga, defaults to 4 megas
if [ -n "$SIZELIMIT1" ];then
if [ "$SIZELIMIT1" -gt 1000000000 ];then
let newsize="$SIZELIMIT1"/256
add_mkisofs_opt $N.mkisofs_opts "-hfs-parms MAX_XTCSIZE=$newsize"
fi
else
if [ -n "$SIZELIMIT" ];then
if [ "$SIZELIMIT" -gt 1000000000 ];then
let newsize="$SIZELIMIT"/256
add_mkisofs_opt $N.mkisofs_opts "-hfs-parms MAX_XTCSIZE=$newsize"
fi
else
if [ -n "$DEFBINSIZE" ] && [ "$DEFBINSIZE" -gt 1000 ];then
let newsize="$DEFBINSIZE"*4096
add_mkisofs_opt $N.mkisofs_opts "-hfs-parms MAX_XTCSIZE=$newsize"
fi
fi
fi
# MAXDISKBLOCKS is measured in 2K blocks
newsize=`echo "$MAXDISKBLOCKS * 2048 / 256" | bc`
add_mkisofs_opt $N.mkisofs_opts "-hfs-parms MAX_XTCSIZE=$newsize"
cd $INSTALLDIR
# Extract yaboot from the archive

View File

@ -1,22 +0,0 @@
BOOT_SIZE_1=52
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_20=2
BOOT_SIZE_21=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2
SIZE_MULT_1=96

View File

@ -1,19 +0,0 @@
BOOT_SIZE_1=32
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -1,20 +0,0 @@
BOOT_SIZE_1=30
BOOT_SIZE_10=2
BOOT_SIZE_11=2
BOOT_SIZE_12=2
BOOT_SIZE_13=2
BOOT_SIZE_14=2
BOOT_SIZE_15=2
BOOT_SIZE_16=2
BOOT_SIZE_17=2
BOOT_SIZE_18=2
BOOT_SIZE_19=2
BOOT_SIZE_2=2
BOOT_SIZE_20=2
BOOT_SIZE_3=2
BOOT_SIZE_4=2
BOOT_SIZE_5=2
BOOT_SIZE_6=2
BOOT_SIZE_7=2
BOOT_SIZE_8=2
BOOT_SIZE_9=2

View File

@ -1,21 +0,0 @@
#!/bin/bash
#
# post-boot-alpha, by David Huggins-Daines <dhd@linuxcare.com>
#
# You may copy, modify and distribute this under the terms of the GNU
# General Public License, included herein by reference. See COPYING.
#
# Do post-image-building tasks for alpha to make CDs bootable
set -ev
N=$1
CDROOT=$2
CDIMAGE=$3
# Only disk 1 is bootable
if [ $N != 1 -a $N != 1_NONUS ]; then
exit 0
fi
isomarkboot $CDIMAGE boot/bootlx

View File

@ -1,33 +0,0 @@
#!/bin/bash
#
# post-boot-hppa
#
# Do post-image-building tasks for hppa, to make CDs bootable.
#
# $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
cd $CDROOT/..
# Only disk 1* bootable
if [ $N != 1 -a $N != 1_NONUS ]; then
exit 0
fi
K32=$(ls $CDROOT/install/vmlinux-*-parisc|head -1)
K64=$(ls $CDROOT/install/vmlinux-*-parisc64|head -1)
RSIZE=$(expr $(zcat "$CDROOT/install/initrd.gz" | wc --bytes) / 1024)
/sbin/palo \
--commandline="0/vmlinux root=/dev/ram initrd=0/ramdisk ramdisk_size=$RSIZE" \
--recoverykernel="$K32" \
--recoverykernel="$K64" \
--bootloader="$CDROOT/install/iplboot" \
--ramdisk="$CDROOT/install/initrd.gz" \
--init-cdrom=$CDIMAGE --configfile=/dev/null

View File

@ -1,35 +0,0 @@
#!/bin/bash
#
# post-boot-mips
#
# Do post-image-building tasks for mips, to make CDs bootable.
#
# $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
cd $CDROOT/..
# Only disk 1* bootable
if [ $N != 1 -a $N != 1_NONUS ]; then
exit 0
fi
for sub in r4k-ip22 r5k-ip22; do
_start=$(isoinfo -i $CDIMAGE -lR |grep -A 10 'Directory listing of /install' |grep ${sub}-boot.img |awk '{print $10 * 4}')
_size=$(isoinfo -i $CDIMAGE -lR |grep -A 10 'Directory listing of /install' |grep ${sub}-boot.img |awk '{OFMT="%.0f"; print int(($5 + 2047) / 2048) * 2048}')
_bootfiles="${_bootfiles} ${sub}:${_start},${_size}"
done
_start=$(isoinfo -i $CDIMAGE -lR |grep -A 10 'Directory listing of /install' |grep $r4k-ip22-boot.img |awk '{print $10 * 4}')
_size=$(isoinfo -i $CDIMAGE -lR |grep -A 10 'Directory listing of /install' |grep $r4k-ip22-boot.img |awk '{OFMT="%.0f"; print int(($5 + 2047) / 2048) * 2048}')
_bootfiles="${_bootfiles} sashARCS:${_start},${_size}"
echo Bootfiles: ${_bootfiles}
genisovh $CDIMAGE ${_bootfiles}

View File

@ -1,46 +0,0 @@
#!/bin/bash
#
# post-boot-mipsel - (C) 2002 by Karsten Merker <merker@debian.org>
#
# Do post-image-building tasks for mipsel, to make CDs bootable.
# requires delo >= 0.8
#
# 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 disk 1 bootable
if [ $NN != 1 ]; then
exit 0
fi
"$DELOROOT"/sbin/delo -r "$CDIMAGE" -d
exit 0

View File

@ -1,52 +0,0 @@
#!/bin/sh
# This script tries to get good estimations into the .calc files at
# boot/$CODENAME/boot-$ARCH.calc, so you can use it whenever you want to
# update these .calc files with more recent estimations.
# It uses info taken from the temporary dir of a previous build for $ARCH,
# $CODENAME. This doesn't need to be a full build, you can get the needed
# stuff by running a build.sh with something like:
# IMAGETARGET="ok bootable upgrade bin-infos bin-list"
# Temporary directory of the previous build.
BDIR="$TDIR/$CODENAME-$ARCH"
#Get info from older build if it exists
if [ -d "$BDIR" ];
then
echo Estimated sizes:
rm -f "boot/$CODENAME/boot-$ARCH.calc"
for i in `du -sm "$BDIR"/CD[0123456789]* |
sed -n 's/^\([0-9]\+\).*CD\([0-9]\+\)/\2=\1/p'`
do
#space used by boot images in megs (this has an error of up to a mega)
if [ -d "$BDIR/boot${i%=*}" ]
then
imgdu=`du -sm "$BDIR/boot${i%=*}" |
sed -n 's/^\([0-9]\+\).*/\1/p'`
else
imgdu=1
fi
#add it all up and write it to the .calc file
echo BOOT_SIZE_${i%=*}=${i#*=}+$imgdu
echo BOOT_SIZE_${i%=*}=$((${i#*=}+$imgdu)) >> "boot/$CODENAME/boot-$ARCH.calc"
case "$ARCH" in
m68k) echo SIZE_MULT_${i%=*}=97 >> "boot/$CODENAME/boot-$ARCH.calc";;
esac
done
fi
#Use different corrections depending on the size of the ISO
if [ -n "$SIZELIMIT1" ] && [ "$SIZELIMIT1" -gt 1000000000 ] ||
[ -n "$SIZELIMIT" ] && [ "$SIZELIMIT" -gt 1000000000 ] ||
[ -n "$DEFBINSIZE" ] && [ "$DEFBINSIZE" -gt 1000 ]
then
case "$ARCH" in
powerpc) echo SIZE_MULT_1=92 >> "boot/$CODENAME/boot-$ARCH.calc";;
esac
else
case "$ARCH" in
powerpc) echo SIZE_MULT_1=96 >> "boot/$CODENAME/boot-$ARCH.calc";;
esac
fi

View File

@ -1,318 +0,0 @@
#!/usr/bin/perl -w
#
# Copyright 1999 Raphaël Hertzog <hertzog@debian.org>
# See the README file for the license.
#
# This script will dispatch the source packages on different CD.
# It will include all the sources corresponding to the binary
# packages that are included in the binary CDs.
#
# In general, I'll follow the same rules than list2cds ...
use strict;
my $deflimit = $ENV{'SRCSIZELIMIT'} || $ENV{'SIZELIMIT'} || shift || 629145600;
my $limit = $ENV{'SRCSIZELIMIT1'} || $deflimit;
my $nonfree = $ENV{'NONFREE'} || 0;
my $extranonfree = $ENV{'EXTRANONFREE'} || 0;
my $nonus = $ENV{'NONUS'} || 0;
my $forcenonusoncd1 = $ENV{'FORCENONUSONCD1'} || 0;
my $contrib = $ENV{'CONTRIB'} || 0;
my $complete = $ENV{'COMPLETE'} || 0;
my $local = $ENV{'LOCAL'} || 0;
my $bdir = "$ENV{'TDIR'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
my $sdir = "$ENV{'TDIR'}/$ENV{'CODENAME'}-src";
my $verbose = $ENV{'VERBOSE'} || 0;
my $mirror = $ENV{'MIRROR'};
my $localdebs = $ENV{'LOCALDEBS'} || $mirror;
my $codename = $ENV{'CODENAME'};
$| = 1;
open(LOG, ">$sdir/log.cds2src") || die "Can't write in $sdir/log.cds2src !\n";
sub msg {
my $level= shift;
if ($verbose >= $level) {
print @_;
}
print LOG @_;
}
my %bin2src;
my %sources;
my %included;
my %excluded;
my @nonuslist=();
my %includesrc;
# Get the information from the good Sources.gz files
my @SOURCES = ("$mirror/dists/$codename/main/source/Sources.gz");
if ($contrib) {
push @SOURCES, "$mirror/dists/$codename/contrib/source/Sources.gz";
}
if ($nonus) {
push @SOURCES, "$nonus/dists/$codename/non-US/main/source/Sources.gz";
if ($contrib) {
push @SOURCES,
"$nonus/dists/$codename/non-US/contrib/source/Sources.gz";
}
}
if ($nonfree or $extranonfree) {
push @SOURCES, "$mirror/dists/$codename/non-free/source/Sources.gz";
if ($nonus) {
push @SOURCES,
"$nonus/dists/$codename/non-US/non-free/source/Sources.gz";
}
}
if ($local and -e "$localdebs/dists/$codename/local/source/Sources.gz")
{
push @SOURCES, "$localdebs/dists/$codename/local/source/Sources.gz";
}
foreach (@SOURCES) {
die "File `$_' cannot be found ..." if not -f;
}
my $oldrs = $/;
$/ = '';
my ($re, $p, $bin, $file, $size);
open (SOURCES, "zcat @SOURCES |") || die "Can't fork: $!\n";
while (defined($_ = <SOURCES>)) {
# General information about the source package
next if not m/^Package: (\S+)\s*$/m;
$p = $1;
$included{$p} = 0;
$sources{$p}{"Package"} = $p;
foreach $re (qw/Binary Version Section Directory/) {
(m/^$re: (.*?)\s*$/m and $sources{$p}{$re} = $1)
|| msg(1, "Header field '$re' missing for source '$p'\n");
}
# Avoid a perl warning for sources packages without section header
if (! exists $sources{$p}{"Section"})
{
$sources{$p}{"Section"} = "No section";
}
# Generate the list of non-free source packages to exclude
if ((! $nonfree) and ($sources{$p}{"Section"} =~ /non-free/))
{
$excluded{$p} = "nonfree";
} else {
$excluded{$p} = 0;
}
# Generate the list of non-US source packages
if (($sources{$p}{"Directory"} =~ /non-US/))
{
push @nonuslist, $p;
}
# Match between source & binary packages
foreach $bin (split (/,\s+/, $sources{$p}{"Binary"})) {
$bin2src{$bin} = $p;
}
$sources{$p}{"Files"} = [];
# Get the file list with the size
if (not m/^Files:\s*\n/mgc) {
msg(0,"ERROR: Cannot found Files field ...\n");
}
while (m/\G^\s+([\da-fA-F]+)\s+(\d+)\s+(\S+)\s*\n/mgc) {
$file = $3; $size = $2;
$file = "$sources{$p}{'Directory'}/$file";
push @{$sources{$p}{"Files"}}, [ $file, $size ];
}
if (not @{$sources{$p}{"Files"}}) {
msg(0, "ERROR: Source package $p has no files ...\n");
}
}
$/ = $oldrs;
# Get the list of excluded packages
my $exclude = $ENV{'SRCEXCLUDE'} || "sorry-no-srcexclude";
if (-e $exclude) {
open (EXCL, "< $exclude") || die "Can't open $exclude : $!\n";
while (defined($_=<EXCL>)) {
chomp;
if (not exists $sources{$_}) {
msg(1, "INIT: Source '$_' is in srcexcluded but " .
"doesn't exist. Ignored.\n");
next;
}
$excluded{$_} = 'user choice';
}
close EXCL;
}
# Get the list of included packages
my @list = ();
my $i = 1;
my $infile;
while (-e "$bdir/$i.packages") {
my $nonusfile = sprintf("%s/%d_NONUS.packages", $bdir, $i);
if(-e "$nonusfile") {
$infile = $nonusfile;
} else {
$infile = "$bdir/$i.packages";
}
print "Using package file $infile\n";
open (LIST, "< $infile") || die "Can't open $infile ...\n";
while (defined($_ = <LIST>)) {
chomp;
push @list, $_;
}
close LIST;
$i++;
}
msg(0, "ERROR: No source packages for the CD !\n") if not @list;
# Calculate what files go on which CD
my (%cds);
my ($cd, $cd_size, $total_size, $src) = (1, 0, 0);
# Add non-US stuff to CD#1 first if we have been asked to...
# "complete" means also add non-US sources that don't have binary packages...
if($forcenonusoncd1) {
if(!$complete) {
foreach (@list) {
if(not exists $bin2src{$_}) {
next;
}
$includesrc{$bin2src{$_}} = 1;
}
}
foreach $src (@nonuslist)
{
if (! ($complete or $includesrc{$src}))
{
msg(1, "Non-US source package $src doesn't need to be included !\n");
next;
}
msg(1, "Asked to add non-US source $src to source CD#1\n");
if (not exists $included{$src}) {
msg(0, "ERROR: Non-US source `$src' does not exist ... (ignored)\n");
next;
}
if ($excluded{$src}) {
msg(1, "...but not doing so - $excluded{$src}\n");
next;
}
next if $included{$src};
add_src ($src);
}
}
# And then the rest
foreach $p (@list) {
if (not exists $bin2src{$p}) {
msg(1, "WARNING: Package `$p' has no sources ... (ignored)\n");
next;
}
$src = $bin2src{$p};
if (not exists $included{$src}) {
msg(0, "ERROR: Source `$src' does not exist ... (ignored)\n");
next;
}
next if $excluded{$src};
next if $included{$src};
add_src ($src);
}
# And now any remaining sources that don't have binary packages
if ($complete) {
msg(0, "Now we'll add the sources not yet included ...\n");
foreach $p (sort { ($sources{$a}{"Section"} cmp $sources{$b}{"Section"})
|| ($a cmp $b) }
grep { not ($included{$_} or $excluded{$_}) } keys %sources)
{
add_src ($p);
}
}
msg(0, "CD $cd will only be filled with $cd_size bytes ...\n");
# Now generate the extra non-free CD
if ($extranonfree and (! $nonfree))
{
my ($p, @toinclude);
# Finally accept non-free packages
foreach $p (grep { $excluded{$_} eq "nonfree" } (keys %sources))
{
$excluded{$p} = 0;
push @toinclude, $p;
}
# Start a new CD
$cd++;
$cd_size = 0;
$limit = $ENV{"SRCSIZELIMIT$cd"} || $deflimit;
msg(0, "Limit for non-free source CD $cd is $limit.\n");
# Include non-free source packages
foreach $p (@toinclude)
{
add_src ($p);
}
msg(0, "CD $cd will only be filled with $cd_size bytes ...\n");
}
# Now write the lists down
foreach (sort {$a <=> $b} keys %cds) {
my $count = 0;
open(CDLIST, "> $sdir/$_.sources")
|| die "Can't write in $sdir/$_.sources: $!\n";
foreach (@{$cds{$_}}) {
print CDLIST "$_\n";
$count++;
}
close CDLIST;
msg(0, "CD $_ will have $count files from source packages.\n");
}
close LOG;
## END OF MAIN
sub add_src {
my $src = shift;
my @files = ();
$size = 0;
msg(2, "+ Trying to add $src ...\n");
foreach (@{$sources{$src}{"Files"}}) {
$size += $_->[1];
push @files, $_->[0];
}
if ($cd_size + $size > $limit) {
msg(0, "Source CD $cd filled with $cd_size bytes ...",
" (limit was $limit)\n");
$cd++;
$cd_size = 0;
# New limit
$limit = $ENV{"SRCSIZELIMIT$cd"} || $deflimit;
msg(1, "Limit for CD $cd is $limit\n");
}
$cd_size += $size;
$total_size += $size;
add_to_cd ($cd, \@files);
msg(1, " size: $size\n");
$included{$src} = $cd;
}
sub add_to_cd {
my $cd = shift;
my $tab = shift;
$cds{$cd} = [] if not ref $cds{$cd};
msg(1, "Adding to CD $cd : @{$tab}\n");
push (@{$cds{$cd}}, @{$tab});
}

View File

@ -9,47 +9,65 @@ fi
# The location of the tree for CD#1, passed in
DIR=$1
ARCHES="$2"
NUM_ARCHES=`echo $ARCHES | wc -w`
if [ "$OMIT_MANUAL" != 1 ]; then
DOCDIR=doc
MANTDIR=$TDIR/installguide
MANTDIR=$TDIR/installguide
INSTALLGUIDE=$(zcat $MIRROR/dists/etch/main/binary-$ARCH//Packages.gz | \
sed -n "s/Filename: \(pool\/main\/i\/installation-guide\/installation-guide-$ARCH.*deb\)$/\1/p")
if [ -f "$MIRROR/$INSTALLGUIDE" ]; then
rm -rf $MANTDIR
# Extract documentation from package
dpkg -x $MIRROR/$INSTALLGUIDE $MANTDIR || true
if [ -d $MANTDIR/usr/share/doc/installation-guide-$ARCH/ ]; then
cd $MANTDIR/usr/share/doc/installation-guide-$ARCH
rm -f changelog* copyright
gunzip *.gz || true
mkdir -p $DIR/$DOCDIR/manual
if ! cp -a * $DIR/$DOCDIR/manual; then
echo "ERROR: Unable to copy installer documentation to CD."
for ARCH in $ARCHES
do
if [ $ARCH != source ] ; then
if [ $NUM_ARCHES = 1 ] ; then
INSTALLDIR=$DIR/$DOCDIR/manual
else
INSTALLDIR=$DIR/$DOCDIR/manual/$ARCH
fi
else
echo "ERROR: installlation-guide package not unpacked correctly."
DOCS=$MIRROR/dists/$DI_CODENAME/main/installer-$ARCH/current/$DOCDIR
INSTALLGUIDE=$(zcat $MIRROR/dists/etch/main/binary-$ARCH//Packages.gz | \
sed -n "s/Filename: \(pool\/main\/i\/installation-guide\/installation-guide-$ARCH.*deb\)$/\1/p")
if [ -f "$MIRROR/$INSTALLGUIDE" ]; then
rm -rf $MANTDIR
# Extract documentation from package
dpkg -x $MIRROR/$INSTALLGUIDE $MANTDIR || true
if [ -d $MANTDIR/usr/share/doc/installation-guide-$ARCH/ ]; then
cd $MANTDIR/usr/share/doc/installation-guide-$ARCH
rm -f changelog* copyright
gunzip *.gz || true
mkdir -p $INSTALLDIR
if ! cp -a * $INSTALLDIR; then
echo "ERROR: Unable to copy installer documentation to CD."
fi
else
echo "ERROR: installation-guide package not unpacked correctly."
fi
else
echo "ERROR: package installation-guide-$ARCH not found."
fi
fi
else
echo "ERROR: package installlation-guide-$ARCH not found."
fi
done
fi
if [ "$OMIT_RELEASE_NOTES" != 1 ]; then
RN=$DIR/doc/release-notes
mkdir -p $RN
cd $RN
echo "Downloading most recent release notes"
wget $RELEASE_NOTES_LOCATION/release-notes-$ARCH.tar.gz
if [ -e release-notes-$ARCH.tar.gz ] ; then
tar xzvf release-notes-$ARCH.tar.gz
rm -f release-notes-$ARCH.tar.gz
rm -f */*.ps
else
echo "No release notes found at $RELEASE_NOTES_LOCATION/release-notes-$ARCH.tar.gz"
fi
for ARCH in $ARCHES
do
if [ $ARCH != source ] ; then
RN=$DIR/doc/release-notes
mkdir -p $RN
cd $RN
echo "Downloading most recent release notes for $ARCH"
wget $RELEASE_NOTES_LOCATION/release-notes-$ARCH.tar.gz
if [ -e release-notes-$ARCH.tar.gz ] ; then
tar xzvf release-notes-$ARCH.tar.gz
rm -f release-notes-$ARCH.tar.gz
rm -f */*.ps
else
echo "No release notes found at $RELEASE_NOTES_LOCATION/release-notes-$ARCH.tar.gz"
fi
fi
done
fi

View File

@ -1,66 +0,0 @@
#! /usr/bin/perl -w
# Copyright (c) 2002 Philip Hands <phil@hands.com>
# See the README file for the license
# This script creates the md5sums files, using the precalculated md5sums
# from the main archive
# First arg = the build directory
use strict;
use Digest::MD5;
# We load the md5sums of all the files in the pool dir, we don't want to use
# the others because the files on the cds can be different (like README.html)
my %md5 ;
my $BDIR = shift @ARGV ;
foreach my $sumsfile ($BDIR . "/indices/md5sums", $BDIR . "/indices-non-US/md5sums") {
if (open(MD5SUMS, $sumsfile)) {
while (<MD5SUMS>) {
chomp;
my ( $sum, $name ) = split(' ') ;
if ($name =~ /^pool/) {
# printf "[%s] [%s]\n", $sum, $name ;
$md5{$name} = $sum ;
}
}
close(MD5SUMS);
} else {
warn "Couldn't open file: $sumsfile";
}
}
#foreach my $f (keys(%md5)) {
# printf "[%s] [%s]\n", $f, $md5{$f} ;
#}
foreach my $dir (<$BDIR/CD*>) {
chdir $dir ;
open(FILES, "find . -follow \\( -path '*dists/stable*' \\
-o -path '*dists/frozen*' \\
-o -path '*dists/unstable*' \\) -prune \\
-o -type f ! -path '\./md5sum*' -print|" ) || die ;
open(MD5OUT, ">md5sum.txt") || die "Couldn't open file for writing: md5sum.txt, in $dir" ;
while(<FILES>) {
chomp;
s(^\./)() ;
if (!defined($md5{$_})) {
open(FILE, $_) or die "Can't open '$_': $!";
binmode(FILE);
# printf STDERR "md5-ing %s", $_ ;
#$md5{$_} = Digest::MD5->new->addfile(*FILE)->hexdigest ;
printf MD5OUT "%s ./%s\n",
Digest::MD5->new->addfile(*FILE)->hexdigest, $_;
# FIXME:
# the ./ in the printf above is only there to keep byte-for-byte compatibility
# with the find . output used before -- It should probably be removed
#
# printf STDERR ".\n" ;
close(FILE) ;
} else {
printf MD5OUT "%s ./%s\n", $md5{$_}, $_;
}
}
close(MD5OUT);
die "$dir/md5sum.txt is empty!\n" unless (-s "md5sum.txt");
}

View File

@ -1,107 +0,0 @@
#!/usr/bin/perl
#
# Author: Petter Reinholdtsen <pere@hungry.com>
# Date: 2001-11-20
#
# Parse logfile from Debian debian-cd build, and report how much each package
# added to the CD size.
use warnings;
use strict;
use Text::Format; # From debian package libtext-format-perl
use Getopt::Std;
my %opts;
getopts('cm:t', \%opts);
my $logfile = ($ARGV[0] ||
"$ENV{TDIR}/$ENV{CODENAME}-$ENV{ARCH}/log.list2cds");
my $cdlimit = ($ARGV[1] || 1) + 1;
open(LOG, $logfile) || die "Unable to open $logfile";
my $text = Text::Format->new(leftMargin => 16,
rightMargin => 0,
firstIndent => 0);
my $markerstep = $opts{m} || 0;
my $pkg;
my @order;
my %cdsize;
my %size;
my %deps;
my $curcd = 1;
my $curcdsize;
my $cursize;
my @excluded;
my $nextmarker = $markerstep;
while (<LOG>) {
chomp;
if (/^\+ Trying to add (.+)\.\.\./) {
}
if (/^ (.+) has been refused because of user choice/) {
push @excluded, $1;
}
if (/^Can\'t add (.+) \.\.\. one of the package needed has been refused/) {
my $txt = "REJECT $1 (" . join(" ", @excluded). ")";
$size{$txt} = 0;
$cdsize{$txt} = $curcdsize;
push(@order, $txt);
@excluded = ();
}
if (/ \$cd_size = (\d+), \$size = (\d+)/) {
$curcdsize = $1;
$cursize = $2;
if ($markerstep) {
while ($curcdsize > $nextmarker) {
my $txt = sprintf("<=============== CD $curcd fill level passing %d KiB",
$nextmarker / 1024);
$size{$txt} = 0;
$cdsize{$txt} = $curcdsize;
push(@order, $txt);
$nextmarker += $markerstep;
}
}
}
if (/^ Adding (.+) to CD \d+/) {
my ($pkg, $deplist) = split(/\s+/, $1, 2);
$cdsize{$pkg} = $curcdsize;
$size{$pkg} = $cursize;
push @order, $pkg;
$deps{$pkg} = $deplist;
}
if (/Limit for CD (.+) is/) {
last if $cdlimit == $1;
$curcd = $1;
my $txt = "<=============== start of CD $1";
$size{$txt} = 0;
$cdsize{$txt} = 0;
push @order, $txt;
$nextmarker = $markerstep;
}
# Add delimiter
if (/Standard system already takes (.\d+)/) {
my $txt = "<=============== end of standard pkgs";
$size{$txt} = 0;
$cdsize{$txt} = $1;
push @order, $txt;
}
}
close(LOG);
if ($opts{'c'}) {
print " +size cdsize pkgname\n";
} else {
print " +size pkgname\n";
$text->leftMargin(8);
}
print "-----------------------\n";
for $pkg (@order) {
if ($opts{'c'}) {
printf "%7d %7d %s\n", $size{$pkg} / 1024, $cdsize{$pkg} / 1024, $pkg;
} else {
printf "%7d %s\n", $size{$pkg} / 1024, $pkg;
}
print $text->format($deps{$pkg}) if ($opts{'t'} && $deps{$pkg});
}

View File

@ -1,44 +0,0 @@
#! /bin/sh
# Copyright 2003 Richard Atterer (atterer@d.o)
# See the README file for the license
# This script is called by the Makefile to create .jigdo and .template
# files for images. The image data is either supplied in a file or on
# stdin.
image="$1" # Input image data, either a filename or "-" for stdin
jigdo="$2" # Name of output .jigdo file
template="$3" # Name of output .template file
merge="$4" # Name of file to include in output .jigdo, created by jigdo_header
opts="--label Debian=$MIRROR"
if test -n "$NONUS"; then
opts="$opts --label Non-US=$NONUS"
fi
if test -n "$JIGDOFALLBACKPATH"; then
matchexec='--match-exec=mkdir -p "$JIGDOFALLBACKPATH/$LABEL/$MATCHPATH" && ln -f "$FILE" "$JIGDOFALLBACKPATH/$LABEL/$MATCHPATH$LEAF"'
else
matchexec="--"
fi
echo $JIGDOCMD make-template \
--force \
--files-from="$TDIR/jigdofilelist" \
--image="$image" --jigdo="$jigdo" --template="$template" \
--merge="$merge" \
--no-servers-section \
--report=noprogress \
$opts \
"$matchexec"
$JIGDOCMD make-template \
--force \
--files-from="$TDIR/jigdofilelist" \
--image="$image" --jigdo="$jigdo" --template="$template" \
--merge="$merge" \
--no-servers-section \
--report=noprogress \
$opts \
"$matchexec"

View File

@ -1,45 +0,0 @@
#! /bin/sh
# Copyright 2003 Richard Atterer (atterer@d.o)
# See the README file for the license
# This script is called by the Makefile to output to stdout data which
# is to be included in the .jigdo file for each CD/DVD. The data is
# read by jigdo-file. jigdo-file adds some further lines (a [Jigdo]
# section and a [Parts] section) before writing everything to the
# final .jigdo output file.
iso="$1" # Output .iso file
template="$2" # URL for .template file, can be relative URL
discinfo="$3" # "Debian GNU/Linux 3.0 r1 "Woody" - Unofficial i386 Binary-1"
# Output image section with info about the file
echo "[Image]"
echo "Filename=$iso"
echo "Template=$template"
echo "Template-MD5Sum=" # jigdo-file will append the checksum later
echo "ShortInfo='$discinfo'"
echo "Info='Generated on `date -R`'"
# If some include URLs were specified, add them here. Typically, this
# will be used to fetch an up-to-date list of Debian servers.
if test -n "$JIGDOINCLUDEURLS"; then
echo
for url in $JIGDOINCLUDEURLS; do
echo "[Include $url]"
done
fi
# If some fallbacks were specified, output a servers section with the
# URLs. The entries of the variable are expected to be already of the
# form "Label=http://some.url/"
if test -n "$JIGDOFALLBACKURLS"; then
echo
echo "[Servers]"
for url in $JIGDOFALLBACKURLS; do
# The --try-last switch assigns a lower priority to the URL,
# so it will only be used if other server entries (without the
# --try-last) have already been tried without success.
echo "$url --try-last"
done
fi

View File

@ -9,34 +9,37 @@ my $link_copy = $ENV{'COPYLINK'} || 0;
sub good_link ($$) {
my ($src, $dest) = @_;
# Check if the destination directory does exist
my $ddir = $dest;
$ddir =~ s#/?[^/]+$##g;
if ($ddir eq "")
{
$ddir = ".";
}
if (! -d $ddir) # Create it if not
{
system("mkdir -p $ddir");
}
# Link the files
if ($symlink_farm) {
print "Symlink: $dest => $src\n" if ($link_verbose >= 3);
if (not symlink ($src, $dest)) {
print STDERR "Symlink from $src to $dest failed: $!\n";
if (! -e $dest) {
# Check if the destination directory does exist
my $ddir = $dest;
$ddir =~ s#/?[^/]+$##g;
if ($ddir eq "")
{
$ddir = ".";
}
} elsif ($link_copy) {
print "Copy: $dest => $src\n" if ($link_verbose >= 3);
if (system("cp -ap $src $dest")) {
my $err_num = $? >> 8;
my $sig_num = $? & 127;
print STDERR "Copy from $src to $dest failed: cp exited with error code $err_num, signal $sig_num\n";
if (! -d $ddir) # Create it if not
{
system("mkdir -p $ddir");
}
} else {
print "Hardlink: $dest => $src\n" if ($link_verbose >= 3);
if (not link ($src, $dest)) {
print STDERR "Link from $src to $dest failed: $!\n";
# Link the files
if ($symlink_farm) {
print "Symlink: $dest => $src\n" if ($link_verbose >= 3);
if (not symlink ($src, $dest)) {
print STDERR "Symlink from $src to $dest failed: $!\n";
}
} elsif ($link_copy) {
print "Copy: $dest => $src\n" if ($link_verbose >= 3);
if (system("cp -ap $src $dest")) {
my $err_num = $? >> 8;
my $sig_num = $? & 127;
print STDERR "Copy from $src to $dest failed: cp exited with error code $err_num, signal $sig_num\n";
}
} else {
print "Hardlink: $dest => $src\n" if ($link_verbose >= 3);
if (not link ($src, $dest)) {
print STDERR "Link from $src to $dest failed: $!\n";
}
}
}
}

View File

@ -27,12 +27,14 @@ my $maxcds = $ENV{'MAXCDS'} || 0;
my $apt = "$ENV{'BASEDIR'}/tools/apt-selection";
my $adir = "$ENV{'APTTMP'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
my $arch = "$ENV{'ARCH'}";
my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}";
my $verbose = $ENV{'VERBOSE'} || 0;
$| = 1; # Autoflush for debugging
open(LOG, ">$dir/log.list2cds") || die "Can't write in $dir/log.list2cds !\n";
open(LOG, ">$dir/log.list2cds.$arch")
|| die "Can't write in $dir/log.list2cds.$arch !\n";
sub msg {
my $level = shift;
@ -48,8 +50,10 @@ my %packages;
msg(0, "======================================================================
Here are the settings you've chosen for making the list:
Architecture: $arch
List of prefered packages: $list
Exclude file: $exclude
Output file: $dir/packages.$arch
");
msg(0, "Complete selected packages with all the rest: "); msg(0, yesno($complete)."\n");
msg(0, "Include non-free packages: "); msg(0, yesno($nonfree)."\n");
@ -122,8 +126,8 @@ Number of excluded: $count_excl of @{ [scalar(keys %excluded)] }
");
open(STATS, "> $dir/stats.excluded")
|| die "Can't write in stats.excluded: $!\n";
open(STATS, "> $dir/stats.excluded.$arch")
|| die "Can't write in stats.excluded.$arch: $!\n";
foreach (keys %excluded) {
print STATS "$_ => $excluded{$_}\n";
}
@ -162,7 +166,7 @@ while (@list) {
msg(0, "-- Adding standard, required, important and base packages \n" .
" on the first CD ...\n");
# Automatically include packages listed in the status file
open(STATUS, "< $adir/status") || die "Can't open status file : $!\n";
open(STATUS, "< $adir/status") || die "Can't open status file $adir/status: $!\n";
while (defined($_ = <STATUS>)) {
next if not m/^Package: (\S+)/;
$p = $1;
@ -281,7 +285,7 @@ if ($extranonfree and (! $nonfree))
}
# Remove old files
foreach (glob("$dir/*.packages")) {
foreach (glob("$dir/*.packages*")) {
unlink $_;
}
@ -295,10 +299,10 @@ foreach (sort { $a <=> $b } keys %cds) {
$numcds++;
my $count = 0;
open(CDLIST, "> $dir/$_.packages")
|| die "Can't write in $dir/$_.packages: $!\n";
open(CDLIST, "> $dir/packages.$arch")
|| die "Can't write in $dir/$_.packages.$arch: $!\n";
foreach (@{$cds{$_}}) {
print CDLIST "$_\n";
print CDLIST "$arch:$_\n";
$count++;
}
close CDLIST;

226
tools/make_disc_trees Executable file
View File

@ -0,0 +1,226 @@
#!/bin/sh
#
# make_disc_trees
#
# From the list of packages we have, lay out the CD trees
set -e
BASEDIR=$1
MIRROR=$2
TDIR=$3
CODENAME=$4
ARCHES=$5
LIST=$TDIR/list
LIST_EX=$TDIR/list.exclude
DISKNUM=1
MAX_DONE=0
BDIR=$TDIR/$CODENAME
LOG=$BDIR/make_disc_tree.log
MiB=1048576
MB=1000000
BLOCKSIZE=2048
# Calculate the maximum number of 2K blocks in the output images
case $DISKTYPE in
BC)
MAXDISKBLOCKS=`echo "680 * $MB / $BLOCKSIZE" | bc`
DISKDESC="businesscard"
;;
NETINST)
MAXDISKBLOCKS=`echo "680 * $MB / $BLOCKSIZE" | bc`
DISKDESC="netinst"
;;
CD)
MAXDISKBLOCKS=`echo "680 * $MB / $BLOCKSIZE" | bc`
DISKDESC="650MiB CD"
;;
CD700)
MAXDISKBLOCKS=`echo "737 * $MB / $BLOCKSIZE" | bc`
DISKDESC="700MiB CD"
;;
DVD)
MAXDISKBLOCKS=`echo "4700 * $MB / $BLOCKSIZE" | bc`
DISKDESC="4.7GB DVD"
;;
CUSTOM)
MAXDISKBLOCKS=$CUSTOMSIZE
DISKDESC="User-supplied size"
;;
esac
export MAXDISKBLOCKS DISKDESC
# Cope with HFS-hybrid disks using extra space for the HFS metadata
case "$ARCHES" in
*m68k*|*powerpc*) SIZE_CHECK_PERCENT="90 / 100";;
*) SIZE_CHECK_PERCENT="95 / 100";;
esac
# How full should we let the disc get before we stop estimating and
# start running mkisofs?
SIZE_SWAP_CHECK=`echo "$MAXDISKBLOCKS * $SIZE_CHECK_PERCENT" | bc`
PKGS_THIS_CD=0
PKGS_DONE=0
SIZE=0
OVERFLOWPKG=""
MKISOFS_CHECK="mkisofs -r -print-size -quiet"
#############################################
#
# Local helper functions
#
#############################################
check_base_installable () {
ARCH=$1
CDDIR=$2
ok=0
for p in `debootstrap --arch $ARCH --print-debs $CODENAME $TDIR/debootstrap.tmp file:$MIRROR $DEBOOTSTRAP_SCRIPT 2>/dev/null`
do
if ! grep -q "^Package: $p$" $CDDIR/dists/$CODENAME/main/binary-$ARCH/Packages ; then
if [ -n "$BASE_EXCLUDE" ] && grep -q ^$p$ $BASE_EXCLUDE ; then
echo "Missing debootstrap-required $p but included in $BASE_EXCLUDE" >> $LOG
continue
fi
ok=$(($ok + 1))
echo "Missing debootstrap-required $p" >> $LOG
fi
done
rm -rf $TDIR/debootstrap.tmp
echo $ok
}
finish_disc () {
CDDIR=$1
NOT=$2
if [ $DISKNUM = 1 ] ; then
for ARCH in $ARCHES_NOSRC
do
echo " Checking base is installable for $ARCH"
ARCHOK=`check_base_installable $ARCH $CDDIR`
if [ $ARCHOK -gt 0 ] ; then
echo " $ARCH is missing $ARCHOK files needed for debootstrap, look in $LOG for the list"
fi
ok=$(($ok + $ARCHOK))
done
if [ $ok = 0 ] ; then
touch $CDDIR/.disk/base_installable
echo " all files needed for debootstrap"
else
echo " $ok files missing for debootstrap, not creating base_installable"
fi
echo "$ok files missing for debootstrap" >> $LOG
fi
echo " Finishing off md5sum.txt"
cd $CDDIR
# Just md5 the bits we won't have seen already
find ./.disk ./dists -type f | xargs md5sum >> md5sum.txt
# And sort; it should make things faster for people checking
# the md5sums, as ISO9660 dirs are sorted alphabetically
LANG=C sort -uk2 md5sum.txt > md5sum.txt.tmp
mv -f md5sum.txt.tmp md5sum.txt
cd $BDIR
SIZE=`$SIZE_CHECK $CDDIR`
BYTES=`echo "$SIZE * 2048" | bc`
echo "CD #$DISKNUM $NOT filled with $PKGS_THIS_CD packages, $SIZE blocks, $BYTES bytes" >> $LOG
echo " CD #$DISKNUM $NOT filled with $PKGS_THIS_CD packages, $SIZE blocks, $BYTES bytes"
date >> $LOG
}
cd $BDIR
# Size calculation is slightly complicated:
#
# 1. At the start, ask mkisofs for a size so far (including all the
# stuff in the initial tree like docs and boot stuff
#
# 2. After that, add_packages will tell us the sizes of the files it
# has added. This will not include directories / metadata so is
# only a rough guess, but it's a _cheap_ guess
#
# 3. Once we get >90% of the max size we've been configured with,
# start asking mkisofs after each package addition. This will
# be slow, but we want to be exact at the end
echo "Starting to lay out packages into $DISKTYPE ($DISKDESC) images: $MAXDISKBLOCKS 2K-blocks maximum per image"
for PKG in `cat $BDIR/packages` # | head -2000`
do
CDDIR=$BDIR/CD${DISKNUM}
if [ ! -d $CDDIR ] ; then
if [ $DISKNUM -gt $MAXCDS ] ; then
echo "Disk #$DISKNUM is beyond the configured MAXCDS of $MAXCDS; exiting now..."
MAX_DONE=1
break
fi
echo "Starting new disc $DISKNUM at "`date` >> $LOG
start_new_disc $BASEDIR $MIRROR $TDIR $CODENAME "$ARCHES" $DISKNUM
echo " Starting the md5sum.txt file"
# Grab all the early stuff, apart from dirs that will change later
cd $CDDIR && \
find . -type f | grep -v -e ^\./\.disk -e ^\./dists | \
xargs md5sum > md5sum.txt && \
cd $BDIR
echo " Placing packages into image $DISKNUM"
MKISOFS_OPTS=`cat $BDIR/$DISKNUM.mkisofs_opts` || true
MKISOFS_DIRS=`cat $BDIR/$DISKNUM.mkisofs_dirs` || true
SIZE_CHECK="$MKISOFS_CHECK $MKISOFS_OPTS $MKISOFS_DIRS"
SIZE=`$SIZE_CHECK $CDDIR`
echo "CD #$DISKNUM: size is $SIZE before starting to add packages" >> $LOG
if [ "$OVERFLOWPKG"x != ""x ] ; then
echo "Starting with the package that failed on the last disc: $OVERFLOWPKG" >> $LOG
GUESS_SIZE=`add_packages $CDDIR $OVERFLOWPKG`
SIZE=$(($SIZE + $GUESS_SIZE))
echo "CD #$DISKNUM: GUESS_TOTAL is $SIZE after adding $OVERFLOWPKG" >> $LOG
OVERFLOWPKG=""
PKGS_THIS_CD=1
PKGS_DONE=$(($PKGS_DONE + 1))
fi
fi
GUESS_SIZE=`add_packages $CDDIR $PKG`
SIZE=$(($SIZE + $GUESS_SIZE))
echo "CD #$DISKNUM: GUESS_TOTAL is $SIZE after adding $PKG" >> $LOG
if [ $SIZE -gt $SIZE_SWAP_CHECK ] ; then
SIZE=`$SIZE_CHECK $CDDIR`
echo "CD #$DISKNUM: Real current size is $SIZE blocks after adding $PKG" >> $LOG
fi
if [ $SIZE -gt $MAXDISKBLOCKS ] ; then
echo "CD #$DISKNUM over-full. Rollback!" >> $LOG
GUESS_SIZE=`add_packages --rollback $CDDIR $PKG`
SIZE=`$SIZE_CHECK $CDDIR`
echo "CD #$DISKNUM: Real current size is $SIZE blocks after rolling back $PKG" >> $LOG
finish_disc $CDDIR ""
# Put this package first on the next disc
OVERFLOWPKG=$PKG
# And reset, to start the next disc
SIZE=0
DISKNUM=$(($DISKNUM + 1))
else
PKGS_THIS_CD=$(($PKGS_THIS_CD + 1))
PKGS_DONE=$(($PKGS_DONE + 1))
fi
done
if [ "$MAX_DONE" = 0 ] ; then
finish_disc $CDDIR "(not)"
fi
echo "Finished: $PKGS_DONE packages placed" >> $LOG
echo "Finished: $PKGS_DONE packages placed"
BYTES=`echo "$SIZE * 2048" | bc`
date >> $LOG

View File

@ -7,7 +7,7 @@
set -e
DIR=$1
ARCH=$2
ARCHES="$2"
OUT=$3
DOJIGDO=$4
DEBVERSION=$5
@ -18,11 +18,13 @@ JIGDO_OPTS=$9
shift
JIGDO_CLEANUP=$9
NUM_ARCHES=`echo $ARCHES | wc -w`
if [ "$CD"x = ""x ] ; then
echo "Generating the $ARCH iso/jigdo images ..."
echo "Generating the $ARCHES iso/jigdo images ..."
FILES=$DIR/*.volid
else
echo "Generating $ARCH iso/jigdo image number $CD ..."
echo "Generating $ARCHES iso/jigdo image number $CD ..."
FILES=$DIR/$CD.volid
fi
@ -35,16 +37,16 @@ do
cd $dir/..
opts=`cat $DIR/$n.mkisofs_opts`
opts=`cat $DIR/$n.mkisofs_opts` || true
dirs=`cat $DIR/$n.mkisofs_dirs` || true
volid=`cat $DIR/$n.volid`
relname=`echo $DEBVERSION | sed -e 's/[. ]//g'`
DISKINFO=`cat $DIR/$n.diskinfo`
if [ $ARCH = "source" ] ; then
OUTFILE="${CDNAME:-debian}-$relname-$ARCH-$DISKTYPE-$n"
if [ $NUM_ARCHES = 1 ] ; then
OUTFILE="${CDNAME:-debian}-$relname-$ARCHES-$DISKTYPE-$n"
else
OUTFILE="${CDNAME:-debian}-$relname-$ARCH-$DISKTYPE-binary-$n"
OUTFILE="${CDNAME:-debian}-$relname-MULTI-$DISKTYPE-$n"
fi
# Clean up any old files
@ -57,14 +59,14 @@ do
case $DOJIGDO in
0) # No jigdo files, just straight ISO
echo $MKISOFS $MKISOFS_OPTS -V \'"$volid"\' -o $OUT/$OUTFILE.iso $opts $dirs CD$n
echo $MKISOFS $MKISOFS_OPTS -V \'"$volid"\' -o $OUT/$OUTFILE.iso $opts $dirs CD$n > CD$n/.disk/mkisofs
echo $MKISOFS $MKISOFS_OPTS -V "$volid" -o $OUT/$OUTFILE.iso $opts $dirs CD$n
echo $MKISOFS $MKISOFS_OPTS -V "$volid" -o $OUT/$OUTFILE.iso $opts $dirs CD$n > CD$n/.disk/mkisofs
$MKISOFS $MKISOFS_OPTS -V "$volid" -o $OUT/$OUTFILE.iso $opts $dirs CD$n
;;
1) # jigdo files _and_ ISO
echo $MKISOFS $MKISOFS_OPTS -V \'"$volid"\' \
echo $MKISOFS $MKISOFS_OPTS -V "$volid" \
-o $OUT/$OUTFILE.iso \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
@ -72,7 +74,7 @@ do
-jigdo-exclude boot$n \
-md5-list $DIR/md5-check \
$JIGDO_OPTS $opts $dirs CD$n
echo $MKISOFS $MKISOFS_OPTS -V \'"$volid"\' \
echo $MKISOFS $MKISOFS_OPTS -V "$volid" \
-o $OUT/$OUTFILE.iso \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
@ -91,7 +93,7 @@ do
;;
2) # jigdo only, no ISO
echo $MKISOFS $MKISOFS_OPTS -V \'"$volid"\' \
echo $MKISOFS $MKISOFS_OPTS -V "$volid" \
-o /dev/null \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
@ -99,7 +101,7 @@ do
-jigdo-exclude boot$n \
-md5-list $DIR/md5-check \
$JIGDO_OPTS $opts $dirs CD$n
echo $MKISOFS $MKISOFS_OPTS -V \'"$volid"\' \
echo $MKISOFS $MKISOFS_OPTS -V "$volid" \
-o /dev/null \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \

View File

@ -1,99 +0,0 @@
#!/usr/bin/perl -w
# Copyright 1999 Raphaël Hertzog <hertzog@debian.org>
# See the README file for the license
#
# This script will automatically generate files in the tasks dir
# from the tasks & profiles from the boot disks (for the initial
# install). The tasks will be placed in arch-specific directories
# since they may differ.
# Configuration
my $codename = $ENV{'CODENAME'};
my $basedir = $ENV{'BASEDIR'};
my @archs = qw(alpha arm i386 m68k powerpc sparc);
my $master = "$basedir/data/$codename/master";
# Creating master.* files
chdir $ENV{'TDIR'};
system "slice $master";
# Loop over all archs
my $arch;
foreach $arch (@archs) {
my (%tasks, %profiles);
open (MASTER, "<master.$arch") ||
die "Can't open file master.$arch : $!\n";
# Getting rid of first lines
while (defined($_ = <MASTER>)) {
last if /^--- Tasks:/
}
# Reading the tasks names
while (defined($_ = <MASTER>)) {
if (/^(\S+):/) {
$tasks{$1} = [];
}
last if /^--- Profiles:/;
}
# Reading the profiles names
while (defined($_ = <MASTER>)) {
if (/^(\S+):/) {
$profiles{$1} = [];
}
last if /^--- Packages:/;
}
# Affecting the packages to tasks & profiles
my ($package, $t, $p);
while (defined($_ = <MASTER>)) {
next if /^\s*$/;
next if not /^(\S+): Tasks: (.*),?\s*Profiles: (.*)\s*$/;
$package = $1;
$t = $2; $p = $3;
$t =~ s/\s//g; $p =~ s/\s//g;
foreach (split(/,/, $t)) {
push(@{$tasks{$_}}, $package) if ($_);
}
foreach (split(/,/, $p)) {
push(@{$profiles{$_}}, $package) if ($_);
}
}
close MASTER;
# We have all the datas
# Create tasks and profiles
if (! -d "$basedir/tasks/$codename/$arch") {
mkdir "$basedir/tasks/$codename", 0775;
mkdir "$basedir/tasks/$codename/$arch", 0775;
}
foreach $t (keys %tasks) {
open (TASK, "> $basedir/tasks/$codename/$arch/Task_$t")
|| die "Cannot write Task_$t : $!\n";
foreach (@{$tasks{$t}}) {
print TASK "$_\n" if not m/^#/;
}
close TASK;
}
foreach $p (keys %profiles) {
open (PROF, "> $basedir/tasks/$codename/$arch/Profile_$p") ||
die "Cannot write Profile_$p : $!\n";
foreach (@{$profiles{$p}}) {
print PROF "$_\n" if not m/^#/;
}
close PROF;
}
# Create Task_ALL and Profile_ALL
open (TASKALL, "> $basedir/tasks/$codename/$arch/Task_ALL") ||
die "Couldn't create Task_ALL : $!\n";
foreach (keys %tasks) {
print TASKALL "#include <$codename/$arch/Task_$_>\n";
}
close TASKALL;
open (PROFALL, "> $basedir/tasks/$codename/$arch/Profile_ALL") ||
die "Couldn't create Profile_ALL : $!\n";
foreach (keys %profiles) {
print PROFALL "#include <$codename/$arch/Profile_$_>\n";
}
close PROFALL;
# END
unlink "master.$arch";
}

129
tools/merge_package_lists Executable file
View File

@ -0,0 +1,129 @@
#!/bin/sh
#
# merge_package_lists
#
# Quick, hacky script to merge the package lists for multiple arches
# together, with 2 priorities:
#
# 1. keep the ordering of the original files wherever possible
# 2. collect together instances of the same package on multiple arches
#
# expects multiple files containing lines of the form, one arch per file
#
# <arch>:<pkgname>
#
# and will output similar
#
# The files MUST be passed by filename rather than simply piped in,
# otherwise the ordering constraint will be lost
#
# Things also get quite complicated here due to considering
# source. Depending on how things are being run:
#
# 1. If we're not doing source, life is easy - simply interleave the
# binary packages
# 2. If we're *only* doing source, then we won't be called at all -
# the Makefile will just dump the sources directly into "packages"
# without needing our help
# 3. If we're doing mixed source/binary discs, then we have to work
# quite hard here. We generate the list of sources from the
# binaries given to us. For each binary, we will attempt to place
# its source *first* onto the disc so we can make nice GPL-compliant
# media. However, we also need to check whether or not that source
# has already been placed due to an *earlier* binary package (a
# different binary built from the same source, or the same for
# another arch). To allow us to so that, we need to parse the Sources
# files first to build up the src<->bin relationship. Ick... :-/
#
# An added bit of grot: to make sure that sources are placed first, we
# *temporarily* call the source architecture "aaaaaaaaaaaaaaaaaa" to force
# it to sort first, then replace it woth "source" again later. *grin*
#
# Steve McIntyre <steve@einval.com> 2006, GPL v2
BDIR=$1
ADIR=$2
ARCHES="$3"
OUT="$4"
case "$ARCHES" in
*source*) source=yes;;
*) source=no;;
esac
for ARCH in $ARCHES_NOSRC
do
list="$list $BDIR/packages.$ARCH"
done
echo "# Starting merge at "`date` >> $BDIR/list.mid
if [ $source = "yes" ] ; then
echo "DONEDONE" > $BDIR/DONE
awk '
# First parse the Sources files
/^Package:/ {
srcname=$2
srcs_done++
}
/^Binary:/ {
bins=$0
gsub("^Binary:","",bins)
gsub(",","",bins)
nb=split(bins, binarray)
for (i=1; i <= nb; i++) {
bin2src[binarray[i]] = srcname
bins_done++
}
}
# Done reading the Sources
/^DONEDONE/ {
parsed=1
printf("# Parsed Sources files: %d sources producing %d binaries\n", srcs_done, bins_done)
next
}
# Now start placing source packages, depending on the order of the binary packages
/.*/ {
if (parsed) {
split($0,fields,":")
arch=fields[1]
pkg=fields[2]
if (!included[bin2src[pkg]]) {
print "# Adding source " bin2src[pkg] " because of " pkg
included[bin2src[pkg]] = pkg
printf("%d:aaaaaaaaaaaaaaaaaa:%s\n", FNR, pkg)
} else {
print "# Not adding pkg " pkg " source (" bin2src[pkg] "), already added due to " included[bin2src[pkg]]
}
printf("%d:%s\n", FNR, $0)
}
} ' $ADIR/$CODENAME-source/apt-state/lists/*Sources $BDIR/DONE $list | sort -nk 1 -t : >> $BDIR/list.mid
else
awk '{printf("%d:%s\n", FNR, $0)}' $list | sort -nk 1 -t : >> $BDIR/list.mid
fi
echo "# Ending merge pass 1 at "`date` >> $BDIR/list.mid
# We now have all the files stuck together, with line numbers
# prepended to allow us to shuffle them properly. Remove any comments
# logged from the awk code above, then sort and remove the line numbers
# again
grep -v ^# $BDIR/list.mid | awk -F : '
{
if (!($3 in add))
{
pkgname[number_packages++] = $3
}
gsub("aaaaaaaaaaaaaaaaaa", "source", $2) # Undo the source sorting hack
add[$3] = add[$3] $2 ":" $3 " "
}
END {
for (i = 0; i < number_packages; i++)
{
gsub(" $", "", add[pkgname[i]])
gsub(" ", "\n", add[pkgname[i]])
print add[pkgname[i]]
}
}' > $OUT
echo "# Ending merge pass 2 at "`date` >> $BDIR/list.mid

View File

@ -1,69 +0,0 @@
#!/usr/bin/perl -w
use Digest::MD5;
my $mirror = shift || $ENV{'MIRROR'};
my $nonus = shift || $ENV{'NONUS'};
my $security = shift || $ENV{'SECURITY'};
my ($p, $filename, $size, $md5sum, $file) = ('', '', 0, '', '');
my $ok = 1;
my ($ctx, $digest);
$/=''; # Browse paragraph by paragraph
while (defined($_ = <>)) {
# Get the infos about a package
m/^Package: (\S+)/mi and $p = $1;
m/^Size: (\d+)/mi and $size = $1;
m/^Filename: (\S+)/mi and $filename = $1;
m/^MD5sum: (\S+)/mi and $md5sum = $1;
next if not $p;
$file = ( ( -e "$mirror/$filename" ) ? "$mirror/$filename" :
( exists $ENV{LOCALDEBS} && -e "$ENV{LOCALDEBS}/$filename" ) ? "$ENV{LOCALDEBS}/$filename" :
( -e "$nonus/$filename" ) ? "$nonus/$filename" :
"$security/$filename" );
# Check if the file exists
if (! -e $file) {
print STDERR "File $filename can't be found ...\n";
$ok = 0;
next;
}
# Check for the size
if (-s _ != $size) {
print STDERR "The size doesn't match for $file.\n";
print STDERR "It's `@{ [ -s _ ]}' instead of `$size'.\n";
$ok = 0;
}
# Compute the MD5sum
open(FILE, "< $file") || die "Can't open $file : $!\n";
$ctx = Digest::MD5->new;
$ctx->addfile(*FILE);
$digest = $ctx->hexdigest;
undef $ctx;
close FILE;
# Check the MD5sum
if ($digest ne $md5sum) {
print STDERR "MD5sum does not match for $file ...\n";
print STDERR "It's `$digest' instead of `$md5sum'.\n";
$ok = 0;
}
}
if ($ok) {
exit 0;
} else {
print STDERR <<EOF;
The mirror has some problems. Please correct them before trying to build
Debian CDs. To do so you could sync your mirror from one of the primary
mirror sites listed on the Debian web pages.
EOF
exit 1;
}

View File

@ -1,124 +0,0 @@
#! /bin/sh
if [ "$1" = "" ] ; then
echo ""
echo 'Usage: pi-makelist cdimage.iso > cdimage.list'
echo ""
echo "Will print on stdout the ordered list of files in the ISO 9660 image."
echo ""
echo 'Copyright (C) 1999 J.A. Bezemer <costar@panic.et.tudelft.nl>'
echo "Released under GNU GPL NO WARRANTY AT ALL USE AT YOUR OWN RISK"
echo ""
exit
fi
# In my testing situation, isoinfo was in . but . wasn't in the PATH.
PATH="$PATH":.
export PATH
# We need a tempfile. tempfile(1) is in debianutils >= 1.6
# You can also insert some fixed name here, but then you can run
# only one pi-makelist at a time.
TEMPF=`tempfile --prefix pimkl --mode 644`
# The rest is one long pipe. The best way to find out why it works is
# to comment out all but the first command, and then remove one hash
# each run.
isoinfo -i "$1" -R -l -f \
| grep -B 1 '^-' \
| grep -v '^--$' \
| (
while read ThisFile; do
read ThisInfoLine
echo "$ThisInfoLine" ["$ThisFile"]
done
) \
| tr ']' '[' \
| cut -d '[' -f 2,4 \
| sort \
| cut -d '[' -f 2 \
| grep -v \
-e '/Packages' \
-e '/Sources' \
-e 'TRANS\.TBL$' \
-e '^/md5sum\.txt$' \
-e '/Release-Notes$' \
-e '^/README\.1ST$' \
-e '^/README\.multicd$' \
-e '^/\.disk/' \
-e '^/boot/' \
-e '^/tools/.*/' \
-e '^/tools/README\.tools$' \
-e '\.info$' \
-e '\.m68k$' \
-e '^/m68k-faq/' \
-e '^/m68k-tools/' \
-e '^/extras/' \
-e '^/dedication\.txt$' \
-e '^/README\.html$' \
-e '^/README\.txt$' \
-e '^/pics/' \
-e '^/milo/' \
-e '^/apb/' \
-e '^/linux$' \
-e '^/bin/' \
-e '^/etc/' \
-e '^/lib/' \
-e '^/release_notes$' \
-e '^/sbin/' \
-e '^/tmp/' \
-e '^/usr/' \
> "$TEMPF"
# Temporarily block the pipe, since we need to inspect it's contents
# Some magic to determine the architecture and codename
# (Doesn't work for source CDs, but isn't needed there, either)
L=` \
grep '/dists/.*/binary-' \
< "$TEMPF" \
| grep -v '/binary-all/' \
| head -1 \
| sed -e 's|/dists/\([^/]*\)/.*/binary-\([^/]*\)/.*|\1:\2|' \
`
ARCH=`echo "$L" | cut -d ':' -f 2`
CODENAME=`echo "$L" | cut -d ':' -f 1`
#echo Arch: "$ARCH" Codename: "$CODENAME"
# Now the rest of the pipe
sed -e 's|^/upgrade/|/dists/'"$CODENAME"'/main/upgrade-'"$ARCH"'/|' \
< "$TEMPF" \
| (
if [ x"$ARCH" = xm68k ] ; then
sed -e 's|^/install/|/dists/'"$CODENAME"'/main/disks-'"$ARCH"'/current/|'
else
grep -v '^/install'
fi
) \
| (
# See if it's really non-US
# If not, then also delete non-US/{Contents,Release} etc.
if grep -q '^/dists/.*/non-US/.*\.d[es][bc]$' "$TEMPF" ; then
cat
else
grep -v '^/dists/.*/non-US/'
fi
) \
| grep -v '/disks-.*/index\.html$'
# Remove tempfile
rm -f "$TEMPF"
# Packages[.cd][.gz] are usually not the same as those on FTP. Same with
# Sources[.gz].
# And the /tools are only zipped on FTP.
# /xxx.info is only on the m68k CDs and not on FTP.
# *.m68k is not on FTP; m68k-faq and -tools are not on the Debian FTPs.

View File

@ -1,231 +0,0 @@
#! /usr/bin/perl -w
# $Id$
# Copyright (c) 2002 Philip Hands <phil@hands.com>
# See the README file for the license
# This script creates the md5sums files, using the precalculated md5sums
# from the main archive
#
# First arg = the version directory name to target
#
# subsequent optional arguments are the architectures to publish
# If omited, the script will use all the directories in the $OUT
# directory as the architectures to publish.
#
# For example:
# ./tools/publish_cds 3.0-pre2 i386 src m68k
#
use strict;
use MIME::Base64;
use File::Copy;
use Compress::Zlib ;
my $cd_version = shift @ARGV || die "Usage: $0 <cd_version> [<arch> ...]\n" ;
my %conf;
my %jigdosums;
sub jigsum_to_md5sum ($) {
my $str = shift;
$str =~ tr%-_%+/% ; # convert to normal base64
$str =~ tr|A-Za-z0-9+=/||cd; # remove non-base64 chars
$str =~ tr|A-Za-z0-9+/| -_|; # convert to uuencoded format
return unpack('H32', join'',
map( unpack("u", chr(32 + length($_)*3/4). $_),
$str =~ /(.{1,60})/gs));
}
sub mkdirs ($);
sub mkdirs ($) {
my $path = shift;
return 1 if (-d $path) ;
if ($path =~ m|^(.*)/[^/]*$|) {
mkdirs($1);
}
mkdir($path);
}
sub md5sum_file($) {
open(FILE, $_) or die "Can't open '$_': $!";
binmode(FILE);
my ($retval) = Digest::MD5->new->addfile(*FILE)->hexdigest ;
close(FILE) ;
return($retval);
}
# Pick up settings from CONF.sh
open(SHELL, "sh -x CONF.sh 2>&1|") || die;
while(<SHELL>) {
chomp;
next unless (/^[+] export (.*)$/);
next unless ($1 =~ /^'([^=]+)=(.*)'$/ || $1 =~ /^([^=]+)=(.*)$/) ;
$conf{$1} = $2;
}
close(SHELL) ;
my $from_dir = $conf{'OUT'} ;
my $mirror_dir = $conf{'MIRROR'} ;
my $nonus_dir = $conf{'NONUS'} ;
my $tdir = $conf{'TDIR'} ;
my $publish_url = $conf{'PUBLISH_URL'} ;
my $publish_nonus_url = $conf{'PUBLISH_NONUS_URL'} ;
my $publish_path = $conf{'PUBLISH_PATH'} ;
my $to_dir = $publish_path . "/" . $cd_version . "/" ;
my $fallback_url = $publish_url . "/$cd_version/snapshot/" ;
my $fallback_nonus_url = $publish_nonus_url . "/$cd_version/snapshot/" ;
my @archs ;
if ($#ARGV >= 0) {
foreach (@ARGV) {
push @archs, $from_dir . "/" . $_ ;
}
} else {
@archs = <$from_dir/*> ;
}
for my $arch (@archs) {
my $bad_images ;
my $to_arch = $arch ;
$to_arch =~ s|^$from_dir|$to_dir/jigdo| ;
$to_arch =~ s%/src$%/source% ;
mkdirs($to_arch) || die "failed to create $to_arch" ;
open(MD5OUT, ">$to_arch/MD5SUMS");
for my $jigdo (<$arch/*.jigdo>) {
my ($http, $filename, $size, $md5) ;
$jigdo =~ m|/([^-/]*)-([^-/]*)-([^-/]*)\.jigdo$| ;
my ($distname) = $1 ;
my ($archname) = $2 ;
my ($diskname) = $3 ;
my ($archdesc) = $archname ;
$archdesc =~ s/src/source/ ;
# find out the image name
open (JIGDO, $jigdo) || die;
printf "Opening %s\n", $jigdo ;
my ($newjigdo) = $jigdo ;
$newjigdo =~ s|^.*/([^/]*)$|$to_arch/$1| ;
my $jigdo_gz = gzopen($newjigdo, "wb") ||
die "ERROR: failed to open $newjigdo ($!)";
my $section = "" ;
while(<JIGDO>) {
chomp;
if (/^\[(.*)\]$/) {
die "ERROR: don't know how to handle multi-image jigdo files"
if ($section eq "Image" && $1 eq "Image") ;
$section = $1;
$jigdo_gz->gzwrite($_ . "\n") ;
next ;
}
if ($section eq "Image") {
if (/^Filename=(.*)$/) { $filename = $1 ; }
if (/^Template=(.*)$/) {
$_ = "Template=$publish_url/$cd_version/jigdo/$archdesc/$distname-$archname-$diskname.template" ;
}
}
elsif ($section eq "Parts") {
if (/^([^=]*)=(.*)$/) {
my $jigsum = $1 ;
my $file = $2 ;
if (defined($jigdosums{$file})) {
die "sums don't match for $file" if ($jigdosums{$file} ne $jigsum);
} else {
$jigdosums{$file} = $jigsum ;
}
# and now we make the hardlink snapshot,
# and check that all the md5's match
my $frompath = $file ;
my $tsubdir = "$distname-$archname/CD$diskname" ;
$frompath =~ s|^Debian:|$tdir/$tsubdir/| ;
$frompath =~ s|^Non-US:|$tdir/$tsubdir/| ;
if (!-f $frompath) {
#print STDERR "WARNING: $frompath is not a file," ;
# if it's missing, let's grab it from the mirror
$frompath = $file ;
$frompath =~ s|^Debian:|$mirror_dir/| ;
$frompath =~ s|^Non-US:|$nonus_dir/| ;
#print STDERR "lets try $frompath\n" ;
}
my $topath = $file ;
$topath =~ s|^Debian:|$to_dir/snapshot/| ;
$topath =~ s|^Non-US:|$to_dir/snapshot/| ;
$topath =~ m|^(.*)/[^/]*$| ;
mkdirs($1) ;
if (-f $frompath) {
if (!-f $topath) {
link ($frompath, $topath) ||
die "ERROR: linking $frompath to $topath";
} else {
use File::Compare;
my ($f_dev,$f_ino) = lstat($frompath) ;
my ($t_dev,$t_ino) = lstat($topath) ;
if ((($f_dev != $t_dev) || ($f_ino != $t_ino)) &&
compare($frompath,$topath) != 0) {
die "ERROR: $frompath != $topath" ;
}
}
} else {
print STDERR "ERROR: $frompath is not a file\n" ;
}
}
}
$jigdo_gz->gzwrite($_ . "\n") ;
}
$jigdo_gz->gzwrite(sprintf "\n[Servers]\nDebian=%s\nNon-US=%s\n",
$fallback_url, $fallback_nonus_url);
$jigdo_gz->gzclose() ;
close(JIGDO);
# get the checksum & size from the template
my $template = $jigdo ;
$template =~ s/.jigdo$/.template/ ;
open (TPL, "jigdo-file ls --template $template|") || die;
while (<TPL>) {
chomp;
next unless (/^image-info\s+(\S+)\s+(\S*)\s+(\S+)$/) ;
$size = $1 ;
$md5 = jigsum_to_md5sum($2);
}
if (!defined($md5)) {
$bad_images++ ;
print STDERR "ERROR: md5 not available from $template\n";
next;
}
print STDERR "WARNING: image too small ($size in $template)\n"
if ($size < 10000000) ;
if ($size >= 680000000) {
print STDERR "ERROR: image too big ($size in $template)\n" ;
#exit 1 ;
}
printf MD5OUT "%032s %s\n", $md5, $filename;
close(TPL) ;
copy($template, $to_arch) ||
die "ERROR copying $template to $to_arch ($!)" ;
}
close(MD5OUT);
unlink ("$to_arch/MD5SUMS") if ($bad_images) ;
}

View File

@ -1,133 +0,0 @@
#!/bin/sh
# Copyright 1999 Raphaël Hertzog <hertzog@debian.org>
# See the README file for the license
# This script will create the Release files
# First arg = directory of the CD
#set -e
BDIR=$TDIR/$CODENAME-$ARCH
PREFIX=`echo $2 | sed "s?$BDIR/CD?$BDIR/?"`
SECTIONS="main"
SECTIONSNONUS="non-US/main"
if [ "${NONFREE:-0}" != "0" -o "${EXTRANONFREE:-0}" != "0" ] ; then
SECTIONS="${SECTIONS} non-free"
SECTIONSNONUS="${SECTIONSNONUS} non-US/non-free"
fi
if [ "${CONTRIB:-0}" != "0" ] ; then
SECTIONS="${SECTIONS} contrib"
SECTIONSNONUS="${SECTIONSNONUS} non-US/contrib"
fi
if [ -n "$LOCAL" ] ; then
SECTIONS="$SECTIONS local"
fi
cd "$1"
# these two lines can be inserted below the "Architectures" line below,
# to sort out broken Release files just after the testing --> stable
# transition
# sed -e "s/^Suite: .*$/Suite: stable/" | \
# sed -e "s/^Description: .*$/Description: Debian $DEBVERSION/" | \
if [ -e "$MIRROR/dists/$CODENAME/Release" ] ; then
# Strip the MD5Sum and SHA1 fields
# Update some other information as well
sed -e "s/^Architectures: .*$/Architectures: $ARCH/" \
$MIRROR/dists/$CODENAME/Release | \
sed -e "s|^Components: .*$|Components: $SECTIONS|" | \
perl -ne 'if (/^(MD5Sum|SHA1):/i) { $f=1; next }
if ($f) {
unless (/^ /) { print; $f=0 }
} else { print }' > dists/$CODENAME/Release
else
echo "ERROR: Release file ($MIRROR/dists/$CODENAME/Release) is missing !"
exit 1
fi
if [ -n "$NONUS" ] ; then
if [ -e "$NONUS/dists/$CODENAME/non-US/Release" ] ; then
# Strip the MD5Sum and SHA1 fields
# Update some other information as well
sed -e "/^ /d" -e "s/^Architectures: .*$/Architectures: $ARCH/" \
$NONUS/dists/$CODENAME/non-US/Release | \
sed -e "s|^Components: .*$|Components: $SECTIONSNONUS|" | \
perl -ne 'if (/^(MD5Sum|SHA1):/i) { $f=1; next }
if ($f) {
unless (/^ /) { print; $f=0 }
} else { print }' > dists/$CODENAME/non-US/Release
else
echo -n "ERROR: Release file ($NONUS/dists/$CODENAME/non-US/Release)"
echo " is missing !"
exit 1
fi
fi
# Copying release files
for SECT in $SECTIONS
do
# Install the release files
if [ -e "$MIRROR/dists/$CODENAME/$SECT/binary-$ARCH/Release" ] ; then
cp $MIRROR/dists/$CODENAME/$SECT/binary-$ARCH/Release \
dists/$CODENAME/$SECT/binary-$ARCH/
fi
if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/$SECT/binary-$ARCH/Release" ] ; then
cp $NONUS/dists/$CODENAME/non-US/$SECT/binary-$ARCH/Release \
dists/$CODENAME/non-US/$SECT/binary-$ARCH/
fi
done
if [ -n "$LOCALDEBS" -a -n "$LOCAL" ] ; then
if [ -e $LOCALDEBS/dists/$CODENAME/local/binary-$ARCH/Release ] ; then
cp $LOCALDEBS/dists/$CODENAME/local/binary-$ARCH/Release \
dists/$CODENAME/local/binary-$ARCH/
fi
fi
if [ -e "$MIRROR/dists/$DI_CODENAME/main/debian-installer/binary-$ARCH/Release" ] ; then
cp $MIRROR/dists/$DI_CODENAME/main/debian-installer/binary-$ARCH/Release \
dists/$CODENAME/main/debian-installer/binary-$ARCH/
fi
# Generating Packages files is now done in add_debs; we no longer use
# apt-ftparchive
# Creating the indices directory
if [ ! -d "$BDIR/indices" ]; then
mkdir $BDIR/indices
cp $MIRROR/indices/* $BDIR/indices/
if [ -n "$LOCALDEBS" -a -d $LOCALDEBS/indices ]; then
cp $LOCALDEBS/indices/* $BDIR/indices/
fi
gunzip -f $BDIR/indices/*.gz
for SECT in $SECTIONS; do
touch $BDIR/indices/override.$CODENAME.$SECT
touch $BDIR/indices/override.$EXTRA_CODENAME.extra.$SECT
touch $BDIR/indices/override.$CODENAME.$SECT.src
done
if [ -e "$MIRROR/dists/$DI_CODENAME/main/debian-installer" ]; then
touch $BDIR/indices/override.$CODENAME.main.debian-installer
fi
if [ -n "$LOCAL" -a -e "${LOCALDEBS:-$MIRROR}/dists/$DI_CODENAME/local/debian-installer" ]; then
touch $BDIR/indices/override.$CODENAME.local.debian-installer
touch $BDIR/indices/override.$EXTRA_CODENAME.extra.local
touch $BDIR/indices/override.$CODENAME.local.src
fi
fi
if [ -n "$NONUS" -a ! -d "$BDIR/indices-non-US" ]; then
mkdir $BDIR/indices-non-US
cp $NONUS/indices-non-US/* $BDIR/indices-non-US/
gunzip -f $BDIR/indices-non-US/*.gz
for SECT in `echo $SECTIONSNONUS | sed -e 's#non-US/##g'`; do
touch $BDIR/indices-non-US/override.$CODENAME.$SECT
touch $BDIR/indices-non-US/override.$EXTRA_CODENAME.extra.$SECT
touch $BDIR/indices-non-US/override.$CODENAME.$SECT.src
done
fi
exit 0

354
tools/start_new_disc Executable file
View File

@ -0,0 +1,354 @@
#!/bin/bash
#
# start_new_disc
#
# Start a new temporary disc tree, including all the basic metadata
# needed
set -e
#set -x
BASEDIR=$1
MIRROR=$2
TDIR=$3
CODENAME=$4
ARCHES="$5"
DISKNUM=$6
SOURCEDISK=0
BINARYDISK=0
BDIR=$TDIR/$CODENAME
CDDIR=$BDIR/CD${DISKNUM}
DATE=`cat $BDIR/DATE`
DI_DATA_DIR=$BASEDIR/data/$DI_CODENAME
CAPCODENAME=`perl -e "print ucfirst("$CODENAME")"`
NUM_ARCHES=`echo $ARCHES | wc -w`
if [ $NUM_ARCHES = 1 ] ; then
case $ARCHES in
source)
SOURCEDISK=1
export DISKINFO="Debian GNU/Linux $DEBVERSION \"$CAPCODENAME\" - $OFFICIAL $DISKTYPE Source-$DISKNUM"
export VOLID="Debian $DEBVERSION Src-$DISKNUM"
export SOURCEONLY=yes
;;
*)
BINARYDISK=1
export DISKINFO="Debian GNU/Linux $DEBVERSION \"$CAPCODENAME\" - $OFFICIAL $ARCHES $DISKTYPE Binary-$DISKNUM"
if [ $ARCHES = powerpc ] ; then
export VOLID="Debian $DEBVERSION ppc Bin-$DISKNUM"
else
export VOLID="Debian $DEBVERSION $ARCHES Bin-$DISKNUM"
fi
export ARCHDEF=$ARCHES
;;
esac
else
BINARYDISK=1
case "$ARCHES" in
*source*) SOURCEDISK=1;;
esac
export ARCHDEF=`echo $ARCHES | sed 's? ?/?g'`
export DISKINFO="Debian GNU/Linux $DEBVERSION \"$CAPCODENAME\" - $OFFICIAL Multi-architecture $ARCHDEF $DISKTYPE #$DISKNUM"
export VOLID="Debian $DEBVERSION M-A $DISKNUM"
fi
echo "Starting new $ARCHDEF $DISKTYPE $DISKNUM at $CDDIR"
mkdir -p $CDDIR
echo " Adding the required directories"
if [ ! -e $CDDIR/debian ] ; then
ln -sf . $CDDIR/debian
fi
if [ ! -d $CDDIR/dists/$CODENAME ] ; then
mkdir -p $CDDIR/dists/$CODENAME
for name in stable unstable frozen testing; do
ln -sf $CODENAME $CDDIR/dists/$name
done
fi
# Commodity link for tools which want local in dists/local/local ...
if [ -n "$LOCAL" ]
then
ln -sf $CODENAME $CDDIR/dists/local
fi
if [ ! -d $CDDIR/.disk ] ; then
mkdir $CDDIR/.disk
fi
echo " Generating the image label and volume id"
echo -n $DISKINFO > $CDDIR/.disk/info
echo -n "$DISKINFO ($DATE)" > $BDIR/$DISKNUM.diskinfo
echo '#define DISKNAME ' $DISKINFO > $CDDIR/README.diskdefines
echo '#define ARCH ' $ARCHDEF >> $CDDIR/README.diskdefines
for ARCH in $ARCHES
do
echo '#define ARCH'$ARCH ' 1' >> $CDDIR/README.diskdefines
done
echo '#define DISKNUM ' $DISKNUM >> $CDDIR/README.diskdefines
echo '#define DISKNUM'$DISKNUM ' 1' >> $CDDIR/README.diskdefines
echo -n $VOLID > $BDIR/$DISKNUM.volid
if [ $BINARYDISK = 1 ] ; then
echo '#define TYPEbinary 1' >> $CDDIR/README.diskdefines
set_mkisofs_opts bin $DISKNUM >> $BDIR/$DISKNUM.mkisofs_opts
fi
if [ $SOURCEDISK = 1 ] ; then
echo '#define TYPEsource 1' >> $CDDIR/README.diskdefines
set_mkisofs_opts src $DISKNUM >> $BDIR/$DISKNUM.mkisofs_opts
fi
if [ $DISKNUM = 1 ] ; then
if [ ! -e $MIRROR/tools ] || [ ! -e $MIRROR/doc ] ; then
echo "You need a Debian mirror with the doc, tools and"
echo "indices directories ! "
exit 1
fi
# Add install stuff
if [ "$SOURCEONLY"x != "yes"x ] ; then
echo " Adding tools to CD1"
add_files $CDDIR $MIRROR tools
fi
echo " Adding .disk/base_components"
echo "main" > $CDDIR/.disk/base_components
if [ -n "$LOCAL" ] ; then
echo "local" > $CDDIR/.disk/base_components
fi
echo " Adding .disk/cd_type"
if [ $COMPLETE = 1 ]; then
if [ $DISKTYPE = DVD ]; then
echo "dvd" > $BDIR/CD$DISK/.disk/cd_type
else
echo "full_cd" > $BDIR/CD$DISK/.disk/cd_type
fi
else
echo "not_complete" > $BDIR/CD$DISK/.disk/cd_type
fi
echo " Adding udeb/base includes/excludes"
for ARCH in $ARCHES
do
if [ $ARCH != source ] ; then
# Netinst/businesscard CD have different
# udeb_include and udeb_exclude files
if [ -z "$UDEB_INCLUDE" ] ; then
case "$INSTALLER_CD"x in
"1"x)
UDEB_INCLUDE=$DI_DATA_DIR/"$ARCH"_businesscard_udeb_include;;
"2"x)
UDEB_INCLUDE=$DI_DATA_DIR/"$ARCH"_netinst_udeb_include;;
*)
UDEB_INCLUDE=$DI_DATA_DIR/"$ARCH"_udeb_include;;
esac
fi
if [ -z "$UDEB_EXCLUDE" ] ; then
case "$INSTALLER_CD"x in
"1"x)
UDEB_EXCLUDE=$DI_DATA_DIR/"$ARCH"_businesscard_udeb_exclude;;
"2"x)
UDEB_EXCLUDE=$DI_DATA_DIR/"$ARCH"_netinst_udeb_exclude;;
*)
UDEB_EXCLUDE=$DI_DATA_DIR/"$ARCH"_udeb_exclude;;
esac
fi
# Sort out the udeb include and exclude files
if [ -n "$UDEB_INCLUDE" ] ; then
if [ -r "$UDEB_INCLUDE" ] ; then
cat "$UDEB_INCLUDE" >> "$CDDIR/.disk/udeb_include"
else
echo "ERROR: Unable to read UDEB_INCLUDE file $UDEB_INCLUDE"
fi
fi
if [ -n "$UDEB_EXCLUDE" ] ; then
if [ -r "$UDEB_EXCLUDE" ] ; then
cat "$UDEB_EXCLUDE" >> "$CDDIR/.disk/udeb_exclude"
else
echo "ERROR: Unable to read UDEB_EXCLUDE file $UDEB_EXCLUDE"
fi
fi
# Ditto the base include and exclude
if [ -n "$BASE_INCLUDE" ] ; then
if [ -r "$BASE_INCLUDE" ] ; then
cat "$BASE_INCLUDE" >> "$CDDIR/.disk/base_include"
else
echo "ERROR: Unable to read BASE_INCLUDE file $BASE_INCLUDE"
fi
fi
if [ -n "$BASE_EXCLUDE" ] ; then
if [ -r "$BASE_EXCLUDE" ] ; then
cat "$BASE_EXCLUDE" >> "$CDDIR/.disk/base_exclude"
else
echo "ERROR: Unable to read BASE_EXCLUDE file $BASE_EXCLUDE"
fi
fi
fi
done
echo " Adding docs to CD1"
add_files $CDDIR $MIRROR doc
find $CDDIR/doc -name "dedication-*" | grep -v $DEBVERSION | xargs rm -f
find $CDDIR/doc -name "debian-keyring.tar.gz" | xargs rm -f
if [ ! -e $CDDIR/doc/FAQ/html ] ; then
echo " Extracting FAQ on CD1"
mkdir $CDDIR/doc/FAQ/html
cd $CDDIR/doc/FAQ/html
if [ -e "../debian-faq.en.html.tar.gz" ] ; then
tar xzvf ../debian-faq.en.html.tar.gz
else
tar xzvf ../debian-faq.html.tar.gz
fi
fi
for ARCH in $ARCHES
do
if [ -e $MIRROR/dists/$DI_CODENAME/main/disks-$ARCH ] ; then
echo " Adding disks-$ARCH stuff ..."
mkdir -p $CDDIR/dists/$DI_CODENAME/main/disks-$ARCH
add_files $CDDIR/dists/$DI_CODENAME/main/disks-$ARCH $MIRROR/dists/$DI_CODENAME/main/disks-$ARCH .
touch $CDDIR/.disk/kernel_installable
cd $CDDIR/dists/$DI_CODENAME/main/disks-$ARCH
rm -rf base-images-*
if [ -L current ] ; then
CURRENT_LINK=`readlink current`
mv $CURRENT_LINK .tmp_link
rm -rf [0123456789]*
mv .tmp_link $CURRENT_LINK
elif [ -d current ] ; then
rm -rf [0123456789]*
fi
fi
done
fi
# Common stuff for all disks
if [ "$SOURCEONLY"x = "yes"x ] ; then
echo -n "-J " >> $BDIR/$DISKNUM.mkisofs_opts
> $BDIR/$DISKNUM.mkisofs_dirs
else
echo " Adding common docs on binary CD#$DISKNUM"
add-bin-doc $DISKNUM "$ARCHES"
# Installtools
mkdir $CDDIR/install
if [ -x "$BASEDIR/tools/$CODENAME/installtools.sh" ] ; then
echo " Adding installtools"
$BASEDIR/tools/$CODENAME/installtools.sh $CDDIR "$ARCHES"
fi
fi
echo " Adding Release files"
# Release files
cd $CDDIR
SECTIONS="main"
if [ "${NONFREE:-0}" != "0" -o "${EXTRANONFREE:-0}" != "0" ] ; then
SECTIONS="${SECTIONS} non-free"
fi
if [ "${CONTRIB:-0}" != "0" ] ; then
SECTIONS="${SECTIONS} contrib"
fi
if [ -n "$LOCAL" ] ; then
SECTIONS="$SECTIONS local"
fi
# these two lines can be inserted below the "Architectures" line below,
# to sort out broken Release files just after the testing --> stable
# transition
# sed -e "s/^Suite: .*$/Suite: stable/" | \
# sed -e "s/^Description: .*$/Description: Debian $DEBVERSION/" | \
if [ -e "$MIRROR/dists/$CODENAME/Release" ] ; then
# Strip the MD5Sum and SHA1 fields
# Update some other information as well
sed -e "s/^Architectures: .*$/Architectures: $ARCHES/" \
$MIRROR/dists/$CODENAME/Release | \
sed -e "s|^Components: .*$|Components: $SECTIONS|" | \
perl -ne 'if (/^(MD5Sum|SHA1):/i) { $f=1; next }
if ($f) {
unless (/^ /) { print; $f=0 }
} else { print }' > dists/$CODENAME/Release
else
echo "ERROR: Release file ($MIRROR/dists/$CODENAME/Release) is missing !"
exit 1
fi
# Copying individual release files
for ARCH in $ARCHES
do
for SECT in $SECTIONS
do
# Install the release files
if [ -e "$MIRROR/dists/$CODENAME/$SECT/binary-$ARCH/Release" ] ; then
mkdir -p dists/$CODENAME/$SECT/binary-$ARCH
cp $MIRROR/dists/$CODENAME/$SECT/binary-$ARCH/Release \
dists/$CODENAME/$SECT/binary-$ARCH/
fi
if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/$SECT/binary-$ARCH/Release" ] ; then
mkdir -p dists/$CODENAME/non-US/$SECT/binary-$ARCH
cp $NONUS/dists/$CODENAME/non-US/$SECT/binary-$ARCH/Release \
dists/$CODENAME/non-US/$SECT/binary-$ARCH/
fi
done
if [ -n "$LOCALDEBS" -a -n "$LOCAL" ] ; then
if [ -e $LOCALDEBS/dists/$CODENAME/local/binary-$ARCH/Release ] ; then
mkdir -p dists/$CODENAME/local/binary-$ARCH
cp $LOCALDEBS/dists/$CODENAME/local/binary-$ARCH/Release \
dists/$CODENAME/local/binary-$ARCH/
fi
fi
if [ -e "$MIRROR/dists/$DI_CODENAME/main/debian-installer/binary-$ARCH/Release" ] ; then
mkdir -p dists/$CODENAME/main/debian-installer/binary-$ARCH
cp $MIRROR/dists/$DI_CODENAME/main/debian-installer/binary-$ARCH/Release \
dists/$CODENAME/main/debian-installer/binary-$ARCH/
fi
done
# Upgrade packages / kernels
if [ "$SOURCEONLY"x != "yes"x ] ; then
echo " Trying to add upgrade* directories"
if [ -x "$BASEDIR/tools/$CODENAME/upgrade.sh" ] ; then
$BASEDIR/tools/$CODENAME/upgrade.sh
fi
fi
for ARCH in $ARCHES
do
export ARCH=$ARCH
if [ $ARCH != source ] ; then
if [ -x "$BASEDIR/tools/$CODENAME/upgrade-$ARCH.sh" ] ; then
$BASEDIR/tools/$CODENAME/upgrade-$ARCH.sh $DISKNUM $CDDIR
fi
echo " (Optionally) making the image bootable for $ARCH"
if [ -f $BASEDIR/tools/boot/$DI_CODENAME/boot-$ARCH ] ; then
cd $TDIR
echo " Running tools/boot/$DI_CODENAME/boot-$ARCH $DISKNUM $CDDIR"
$BASEDIR/tools/boot/$DI_CODENAME/boot-$ARCH $DISKNUM $CDDIR || true # FIXME!
else
if [ "${IGNORE_MISSING_BOOT_SCRIPT:-0}" = "0" ] ; then
echo " No script to make CDs bootable for $ARCH"
echo " We've not been asked to ignore this. Aborting."
exit 1
fi
fi
fi
done
exit 0

View File

@ -1,76 +0,0 @@
#!/usr/bin/perl -w
#
# Copyright 2000 Steve McIntyre <stevem@chiark.greenend.org.uk>
# See the README file for the license
#
# This script takes 2 arguments on input - the filename of a packages list and
# the output filename
#
# The job of this script is to remove all non-US packages from that packages
# list.
use strict;
my $infile = shift;
my $outfile = shift;
my $apt = "$ENV{'BASEDIR'}/tools/apt-selection";
my $adir = "$ENV{'APTTMP'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
my $verbose = $ENV{'VERBOSE'} || 0;
my $nonuslist = "$dir/non-US.list";
$| = 1; # Autoflush for debugging
open(LOG, ">>$dir/log.strip-nonUS-bin")
|| die "Can't write in $dir/log.strip-nonUS-bin !\n";
sub msg {
my $level = shift;
if ($verbose >= $level) {
print @_;
}
print LOG @_;
}
msg(2, "$infile\n");
my %packages;
# Get the informations on all packages
my $oldrs = $/;
$/ = '';
open(AVAIL, "$apt cache dumpavail |") || die "Can't fork : $!\n";
my ($p, $re);
while (defined($_=<AVAIL>)) {
next if not m/^Package: (\S+)\s*$/m;
$p = $1;
if( m/^(Section|Filename): \S*non-US\S*\s*$/mi )
{
$packages{$p}{"nonus"} = 1;
} else {
$packages{$p}{"nonus"} = 0;
}
}
close AVAIL or die "apt-cache failed : $@ ($!)\n";
$/ = $oldrs;
# Now for each package in the specified package list, check it against
# our database. If it's non-US lose it.
open (INLIST, "< $infile")
|| die "Can't open starting list $infile\n";
open (OUTLIST, "> $outfile")
|| die "Can't open starting list $outfile\n";
while(defined($_=<INLIST>)) {
chomp;
if($packages{$_}{"nonus"}) {
msg(2, "Removing non-US package $_\n");
} else {
msg(2, "Keeping package $_\n");
print OUTLIST "$_\n";
}
}
close INLIST;
close OUTLIST;
close LOG;

26
tools/update_popcon Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh
#
# update_popcon
#
# Simple helper script to update our popularity-contest generated task
# list from the data available at popcon.debian.org
DATE=`date`
OUT=$1
rm -f $OUT
echo "/*" >> $OUT
echo " Popularity Contest results" >> $OUT
echo " See the README for details on updating." >> $OUT
echo "" >> $OUT
echo " Last update: $DATE" >> $OUT
echo "*/" >> $OUT
echo "" >> $OUT
wget --output-document - \
http://popcon.debian.org/main/by_inst \
http://popcon.debian.org/contrib/by_inst | \
grep -h '^[^#]'| egrep -v '(Total|-----)' | \
sort -rn -k3,3 -k7,7 -k4,4 | grep -v kernel-source | \
awk '{print $$2}' >> $OUT