diff --git a/CONF.sh b/CONF.sh index 4913aef6..244a512b 100644 --- a/CONF.sh +++ b/CONF.sh @@ -157,8 +157,25 @@ export FORCE_FIRMWARE=1 # export LOCAL=1 # If your local packages are not under $MIRROR, but somewhere else, -# you can uncomment this line and edit to to point to a directory -# containing dists/$CODENAME/local/binary-$ARCH +# you can uncomment this line and edit it to point to a directory +# containing: +# - dists/$CODENAME/local/binary-$ARCH/*.deb +# - dists/$CODENAME/local/debian-installer/binary-$ARCH/*.udeb +# +# Some metadata must exist for those packages to be considered: +# - dists/$CODENAME/local/binary-$ARCH/Packages.(gz|xz) +# - dists/$CODENAME/local/debian-installer/binary-$ARCH/Packages.(gz|xz) +# +# and apt will likely want a top-level Release file as well, and +# possibly uncompressed Packages files as well in each directory: +# - dists/$CODENAME/Release +# - dists/$CODENAME/local/binary-$ARCH/Packages +# - dists/$CODENAME/local/debian-installer/binary-$ARCH/Packages +# +# At least that's what was observed while updating easy-build.sh (which +# has an UPDATE_LOCAL=1 setting, controlling whether to run Packages-gen) +# for year 2023, good luck! -- kibi +# # export LOCALDEBS=/home/joey/debian/va/debian # Where to find the security patches. This directory should be the diff --git a/tools/Packages-gen b/tools/Packages-gen index 7fc9f120..dcd7387a 100755 --- a/tools/Packages-gen +++ b/tools/Packages-gen @@ -33,7 +33,10 @@ else fi [ -d $repo ] || mkdir -p $repo echo Creating Packages file for $repo... -apt-ftparchive packages $repo > $repo/Packages +# Important: generate both uncompressed Packages (see below) and compressed +# Packages.gz (so that the usual Packages.gz/Packages.xz search finds it)! +apt-ftparchive packages $repo | pigz -9nm > $repo/Packages.gz +zcat $repo/Packages.gz > $repo/Packages # Fun fact, at least when building bookworm images on bullseye: # - a missing Release file is fine, but maybe downloads follow; diff --git a/tools/make_disc_trees.pl b/tools/make_disc_trees.pl index 3c090c8a..f666c7a6 100755 --- a/tools/make_disc_trees.pl +++ b/tools/make_disc_trees.pl @@ -860,6 +860,17 @@ sub finish_disc { my $hook; my $error = 0; + # Fix possible inconsistency (LOCAL enabled, no packages getting included in the + # local component, breaking debootstrap which is passed --components=main,local): + if (! -d "$cddir/dists/$codename/local") { + my $base_components = "$cddir/.disk/base_components"; + my @components = read_file($base_components); + if (grep { $_ eq "local\n" } @components) { + print " Removing local from base_components (no such component under $codename)\n"; + write_file($base_components, grep { $_ ne "local\n" } @components); + } + } + if (defined($ENV{'DISC_FINISH_HOOK'})) { $hook = $ENV{'DISC_FINISH_HOOK'}; print " Calling disc_finish hook: $hook\n"; @@ -985,9 +996,13 @@ sub Packages_dir { $pdir = "$dir/dists/$codename-backports/$component"; } if ($section and $section eq "debian-installer") { - $pdir = "$dir/dists/$codename/$component/debian-installer"; # Don't attempt to put d-i components into backports, as d-i # won't look for them there. + # + # Also, merge local udebs into main, as d-i uses a single + # Packages file anyway: + my $dstcomponent = $component ne 'local' ? $component : 'main'; + $pdir = "$dir/dists/$codename/$dstcomponent/debian-installer"; } return $pdir; } diff --git a/tools/start_new_disc b/tools/start_new_disc index 2da3d2c0..e047dcdc 100755 --- a/tools/start_new_disc +++ b/tools/start_new_disc @@ -134,12 +134,6 @@ if [ "$BACKPORTS"x != ""x ] ; then fi 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 @@ -182,6 +176,7 @@ if [ $DISKNUM = 1 ] ; then echo " Adding .disk/base_components" echo "main" > $CDDIR/.disk/base_components if [ -n "$LOCAL" ] ; then + # This might be reverted by finish_disc in the end: echo "local" >> $CDDIR/.disk/base_components fi