diff --git a/include/bootstrap/debian/debootstrap/debootstrap b/include/bootstrap/debian/debootstrap/debootstrap index c63caf4..37ea311 100644 --- a/include/bootstrap/debian/debootstrap/debootstrap +++ b/include/bootstrap/debian/debootstrap/debootstrap @@ -1,7 +1,7 @@ #!/bin/sh set -e -VERSION='1.0.114-meefik' +VERSION='1.0.126-meefik' unset TMP TEMP TMPDIR || true @@ -22,6 +22,7 @@ fi exec 4>&1 LANG=C +EXTRA_SUITES="" USE_COMPONENTS=main KEYRING="" DISABLE_KEYRING="" @@ -45,6 +46,7 @@ CERTIFICATE="" CHECKCERTIF="" PRIVATEKEY="" CACHE_DIR="" +INRELEASE_PATH="" DEF_MIRROR="http://deb.debian.org/debian" DEF_HTTPS_MIRROR="https://deb.debian.org/debian" @@ -96,6 +98,8 @@ usage() --include=A,B,C adds specified names to the list of base packages --exclude=A,B,C removes specified packages from the list + --extra-suites=A,B,C also use packages from the listed suites of the + archive --components=A,B,C use packages from the listed components of the archive --variant=X use variant X of the bootstrap scripts @@ -123,6 +127,10 @@ usage() --private-key=file read the private key from file --certificate=file use the client certificate stored in file (PEM) --no-check-certificate do not check certificate against certificate authorities + + --inrelease-path determine the path to the InRelease file of the main + archive relative to the normal position of an InRelease + file EOF } @@ -305,6 +313,18 @@ if [ $# != 0 ] ; then export VERBOSE shift 1 ;; + --extra-suites|--extra-suites=?*) + if [ "$1" = "--extra-suites" ] && [ -n "$2" ]; then + EXTRA_SUITES="$2" + shift 2 + elif [ "$1" != "${1#--extra-suites=}" ]; then + EXTRA_SUITES="${1#--extra-suites=}" + shift 1 + else + error 1 NEEDARG "option requires an argument %s" "$1" + fi + EXTRA_SUITES="$(echo "$EXTRA_SUITES" | tr , " ")" + ;; --components|--components=?*) if [ "$1" = "--components" ] && [ -n "$2" ]; then USE_COMPONENTS="$2" @@ -384,10 +404,10 @@ if [ $# != 0 ] ; then CERTIFICATE="--certificate=$2" shift 2 elif [ "$1" != "${1#--certificate=}" ]; then - CERTIFICATE="--certificate=${1#--certificate=}" + CERTIFICATE="--certificate=${1#--certificate=}" shift 1 else - error 1 NEEDARG "option requires an argument %s" "$1" + error 1 NEEDARG "option requires an argument %s" "$1" fi ;; --private-key|--private-key=?*) @@ -395,16 +415,27 @@ if [ $# != 0 ] ; then PRIVATEKEY="--private-key=$2" shift 2 elif [ "$1" != "${1#--private-key=}" ]; then - PRIVATEKEY="--private-key=${1#--private-key=}" + PRIVATEKEY="--private-key=${1#--private-key=}" shift 1 else - error 1 NEEDARG "option requires an argument %s" "$1" + error 1 NEEDARG "option requires an argument %s" "$1" fi ;; --no-check-certificate) CHECKCERTIF="--no-check-certificate" shift ;; + --inrelease-path|--inrelease-path=?*) + if [ "$1" = "--inrelease-path" ] && [ -n "$2" ]; then + INRELEASE_PATH="$2" + shift 2 + elif [ "$1" != "${1#--inrelease-path=}" ]; then + INRELEASE_PATH=${1#--inrelease-path=} + shift 1 + else + error 1 NEEDARG "option requires an argument %s" "$1" + fi + ;; -*) error 1 BADARG "unrecognized or invalid option %s" "$1" ;; @@ -419,7 +450,10 @@ fi # do auto proxy discovery AUTOPROXY="" if ! doing_variant fakechroot && command -v apt-config >/dev/null; then - eval "$(apt-config shell AUTOPROXY Acquire::http::ProxyAutoDetect)" + eval "$(apt-config shell AUTOPROXY Acquire::http::Proxy-Auto-Detect)" + if [ -z "$AUTOPROXY" ]; then + eval "$(apt-config shell AUTOPROXY Acquire::http::ProxyAutoDetect)" + fi if [ -z "$http_proxy" ] && [ -x "$AUTOPROXY" ]; then http_proxy="$($AUTOPROXY)" if [ -n "$http_proxy" ]; then @@ -438,6 +472,9 @@ fi if [ "$SECOND_STAGE_ONLY" = "true" ]; then SUITE=$(cat "$DEBOOTSTRAP_DIR/suite") + if [ -e "$DEBOOTSTRAP_DIR/extra-suites" ]; then + EXTRA_SUITES=$(cat "$DEBOOTSTRAP_DIR/extra-suites") + fi ARCH=$(cat "$DEBOOTSTRAP_DIR/arch") USER_MIRROR=$(cat "$DEBOOTSTRAP_DIR/mirror") if [ -e "$DEBOOTSTRAP_DIR/variant" ]; then @@ -558,7 +595,7 @@ if ! in_path "sha${SHA_SIZE}sum" && ! in_path "sha${SHA_SIZE}"; then fi DEBOOTSTRAP_CHECKSUM_FIELD="SHA$SHA_SIZE" -export ARCH SUITE TARGET CHROOT_CMD SHA_SIZE DEBOOTSTRAP_CHECKSUM_FIELD +export ARCH SUITE EXTRA_SUITES TARGET CHROOT_CMD SHA_SIZE DEBOOTSTRAP_CHECKSUM_FIELD if [ ! -e "$SCRIPT" ]; then error 1 NOSCRIPT "No such script: %s" "$SCRIPT" @@ -719,6 +756,8 @@ if am_doing_phase save_variables; then echo "$ARCH" >"$TARGET/debootstrap/arch" echo "$SUITE" >"$TARGET/debootstrap/suite" echo "$USER_MIRROR" >"$TARGET/debootstrap/mirror" + [ "" = "$EXTRA_SUITES" ] || + echo "$EXTRA_SUITES" >"$TARGET/debootstrap/extra-suites" [ "" = "$VARIANT" ] || echo "$VARIANT" >"$TARGET/debootstrap/variant" echo "$required" >"$TARGET/debootstrap/required" @@ -754,6 +793,8 @@ if am_doing_phase first_stage; then cp "$DEBOOTSTRAP_DIR"/scripts/*-common "$TARGET/debootstrap/" echo "$ARCH" >"$TARGET/debootstrap/arch" echo "$SUITE" >"$TARGET/debootstrap/suite" + [ "" = "$EXTRA_SUITES" ] || + echo "$EXTRA_SUITES" >"$TARGET/debootstrap/extra-suites" echo "$USER_MIRROR" >"$TARGET/debootstrap/mirror" [ "" = "$VARIANT" ] || echo "$VARIANT" >"$TARGET/debootstrap/variant" @@ -808,7 +849,7 @@ fi if am_doing_phase kill_target; then if [ "$KEEP_DEBOOTSTRAP_DIR" != true ]; then - info KILLTARGET "Deleting target directory" + info KILLTARGET "Deleting target directory" rm -rf "$TARGET" fi fi diff --git a/include/bootstrap/debian/debootstrap/functions b/include/bootstrap/debian/debootstrap/functions index d06ed12..1ffa040 100644 --- a/include/bootstrap/debian/debootstrap/functions +++ b/include/bootstrap/debian/debootstrap/functions @@ -7,6 +7,7 @@ smallyes() { in_path () { local OLD_IFS="$IFS" + local dir IFS=":" for dir in $PATH; do if [ -x "$dir/$1" ]; then @@ -22,7 +23,7 @@ in_path () { error () { # - local err name fmt + local err name fmt x err="$1" name="$2" fmt="$3" @@ -39,7 +40,7 @@ error () { warning () { # - local name fmt + local name fmt x name="$1" fmt="$2" shift; shift @@ -54,7 +55,7 @@ warning () { info () { # - local name fmt + local name fmt x name="$1" fmt="$2" shift; shift @@ -93,7 +94,7 @@ wgetprogress () { ret=$({ { wget $@ 2>&1 >/dev/null || echo $? >&2; } | "$PKGDETAILS" "WGET%" "$PROGRESS_NOW" "$PROGRESS_NEXT" "$PROGRESS_END" >&3; } 2>&1) : ${ret:=0} else - wget $QSWITCH $@ + wget ${QSWITCH:+"$QSWITCH"} "$@" ret=$? fi return $ret @@ -101,7 +102,7 @@ wgetprogress () { progress () { # - local now end name fmt + local now end name fmt x now="$1" end="$2" name="$3" @@ -239,6 +240,7 @@ doing_variant () { SUPPORTED_VARIANTS="-" variants () { + local v SUPPORTED_VARIANTS="$*" for v in $*; do if doing_variant "$v"; then return 0; fi @@ -248,8 +250,8 @@ variants () { ########################################################### option handling check_conflicting_option () { - if [ "$set_what_to_do" = --foreign ] && [ "${1%%=*}" = --unpack-tarball ] || \ - [ "${set_what_to_do%%=*}" = "--unpack-tarball" ] && [ "$1" == --foreign ]; then + if ( [ "$set_what_to_do" = --foreign ] && [ "${1%%=*}" = --unpack-tarball ] ) || \ + ( [ "${set_what_to_do%%=*}" = "--unpack-tarball" ] && [ "$1" = --foreign ] ); then LOOSEN_CONFLICTING_RESTRICTION="true" elif [ -n "$set_what_to_do" ]; then error 1 ARG_CONFLICTING "$set_what_to_do is specified with $1, please use only one of those options." @@ -320,6 +322,7 @@ get () { local dest_base local nocache="" local byhash="" + local a from_base="$1"; shift dest_base="$1"; shift if [ "$1" = "nocache" ]; then @@ -390,7 +393,7 @@ get () { fi if [ ! -e "$dest2" ]; then if [ -z "$from2" ] || ! just_get "$from2" "$dest2"; then - if ! just_get "$from" "$dest2"; then continue 2; fi + if ! just_get "$from" "$dest2"; then continue 1; fi fi fi if [ "$checksum" != "" ]; then @@ -425,17 +428,9 @@ just_get () { mkdir -p "${dest%/*}" if [ "${from#null:}" != "$from" ]; then error 1 NOTPREDL "%s was not pre-downloaded" "${from#null:}" - elif [ "${from#http://}" != "$from" ] || [ "${from#ftp://}" != "$from" ]; then - # http/ftp mirror - if wgetprogress -O "$dest" "$from"; then - return 0 - else - rm -f "$dest" - return 1 - fi - elif [ "${from#https://}" != "$from" ] ; then - # http/ftp mirror - if wgetprogress "$CHECKCERTIF" "$CERTIFICATE" "$PRIVATEKEY" -O "$dest" "$from"; then + elif [ "${from#http://}" != "$from" ] || [ "${from#https://}" != "$from" ] || [ "${from#ftp://}" != "$from" ]; then + # http/https/ftp mirror + if wgetprogress ${CHECKCERTIF:+"$CHECKCERTIF"} ${CERTIFICATE:+"$CERTIFICATE"} ${PRIVATEKEY:+"$PRIVATEKEY"} -O "$dest" "$from"; then return 0 else rm -f "$dest" @@ -525,6 +520,7 @@ get_release_checksum () { } extract_release_components () { + local c local reldest="$1"; shift TMPCOMPONENTS="$(sed -n 's/Components: *//p' "$reldest")" for c in $TMPCOMPONENTS ; do @@ -545,14 +541,21 @@ extract_release_components () { CODENAME="" validate_suite () { - local reldest suite + local reldest suite s reldest="$1" CODENAME=$(sed -n "s/^Codename: *//p" "$reldest") suite=$(sed -n "s/^Suite: *//p" "$reldest") - if [ "$SUITE" != "$suite" ] && [ "$SUITE" != "$CODENAME" ]; then + for s in $SUITE $EXTRA_SUITES; do + if [ "$s" = "$suite" ] || [ "$s" = "$CODENAME" ]; then + return 0 + fi + done + if [ "$EXTRA_SUITES" = "" ]; then error 1 WRONGSUITE "Asked to install suite %s, but got %s (codename: %s) from mirror" "$SUITE" "$suite" "$CODENAME" + else + error 1 WRONGSUITE "Asked to install suites %s %s, but got %s (codename: %s) from mirror" "$SUITE" "$EXTRA_SUITES" "$suite" "$CODENAME" fi } @@ -601,29 +604,36 @@ split_inline_sig () { } download_release_sig () { - local m1 inreldest reldest relsigdest + local m1 suite inreldest reldest relsigdest m1="$1" - inreldest="$2" - reldest="$3" - relsigdest="$4" + suite="$2" + inreldest="$3" + reldest="$4" + relsigdest="$5" progress 0 100 DOWNREL "Downloading Release file" progress_next 100 - if get "$m1/dists/$SUITE/InRelease" "$inreldest" nocache; then + if [ -n "$INRELEASE_PATH" ]; then + get "$m1/dists/$suite/$INRELEASE_PATH" "$inreldest" nocache || + error 1 NOGETREL "Failed getting release file %s" \ + "$m1/dists/$suite/$INRELEASE_PATH" + split_inline_sig "$inreldest" "$reldest" "$relsigdest" + progress 100 100 DOWNREL "Downloading Release file" + elif get "$m1/dists/$suite/InRelease" "$inreldest" nocache; then split_inline_sig "$inreldest" "$reldest" "$relsigdest" progress 100 100 DOWNREL "Downloading Release file" else - get "$m1/dists/$SUITE/Release" "$reldest" nocache || - error 1 NOGETREL "Failed getting release file %s" "$m1/dists/$SUITE/Release" + get "$m1/dists/$suite/Release" "$reldest" nocache || + error 1 NOGETREL "Failed getting release file %s" "$m1/dists/$suite/Release" progress 100 100 DOWNREL "Downloading Release file" fi if [ -n "$KEYRING" ] && [ -z "$DISABLE_KEYRING" ]; then progress 0 100 DOWNRELSIG "Downloading Release file signature" if ! [ -f "$relsigdest" ]; then progress_next 50 - get "$m1/dists/$SUITE/Release.gpg" "$relsigdest" nocache || + get "$m1/dists/$suite/Release.gpg" "$relsigdest" nocache || error 1 NOGETRELSIG "Failed getting release signature file %s" \ - "$m1/dists/$SUITE/Release.gpg" + "$m1/dists/$suite/Release.gpg" progress 50 100 DOWNRELSIG "Downloading Release file signature" fi @@ -639,82 +649,84 @@ download_release_sig () { download_release_indices () { local m1 inreldest reldest relsigdest totalpkgs \ subpath xzi bz2i gzi normi i ext \ - donepkgs pkgdest acquirebyhash + donepkgs pkgdest acquirebyhash s c m m1="${MIRRORS%% *}" - inreldest="$TARGET/$($DLDEST rel "$SUITE" "$m1" "dists/$SUITE/InRelease")" - reldest="$TARGET/$($DLDEST rel "$SUITE" "$m1" "dists/$SUITE/Release")" - relsigdest="$TARGET/$($DLDEST rel "$SUITE" "$m1" "dists/$SUITE/Release.gpg")" - - download_release_sig "$m1" "$inreldest" "$reldest" "$relsigdest" - - validate_suite "$reldest" - - extract_release_components "$reldest" - - acquirebyhash=$(grep "^Acquire-By-Hash: yes$" "$reldest" || true) - totalpkgs=0 - for c in $COMPONENTS; do - subpath="$c/binary-$ARCH/Packages" - xzi="$(get_release_checksum "$reldest" "$subpath.xz")" - bz2i="$(get_release_checksum "$reldest" "$subpath.bz2")" - gzi="$(get_release_checksum "$reldest" "$subpath.gz")" - normi="$(get_release_checksum "$reldest" "$subpath")" - if [ "$normi" != "" ]; then - i="$normi" - elif in_path bunzip2 && [ "$bz2i" != "" ]; then - i="$bz2i" - elif in_path unxz && [ "$xzi" != "" ]; then - i="$xzi" - elif in_path gunzip && [ "$gzi" != "" ]; then - i="$gzi" - fi - if [ "$i" != "" ]; then - totalpkgs=$(( $totalpkgs + ${i#* } )) - else - mv "$reldest" "$reldest.malformed" - error 1 MISSINGRELENTRY "Invalid Release file, no entry for %s" "$subpath" - fi - done + for s in $SUITE $EXTRA_SUITES; do + inreldest="$TARGET/$($DLDEST rel "$s" "$m1" "dists/$s/InRelease")" + reldest="$TARGET/$($DLDEST rel "$s" "$m1" "dists/$s/Release")" + relsigdest="$TARGET/$($DLDEST rel "$s" "$m1" "dists/$s/Release.gpg")" - donepkgs=0 - progress 0 $totalpkgs DOWNPKGS "Downloading Packages files" - for c in $COMPONENTS; do - subpath="$c/binary-$ARCH/Packages" - path="dists/$SUITE/$subpath" - xzi="$(get_release_checksum "$reldest" "$subpath.xz")" - bz2i="$(get_release_checksum "$reldest" "$subpath.bz2")" - gzi="$(get_release_checksum "$reldest" "$subpath.gz")" - normi="$(get_release_checksum "$reldest" "$subpath")" - ext="" - if [ "$acquirebyhash" != "" ]; then - ext="$ext byhash" - fi - if [ "$normi" != "" ]; then - ext="$ext $normi ." - i="$normi" - fi - if in_path unxz && [ "$xzi" != "" ]; then - ext="$ext $xzi xz" - i="${i:-$xzi}" - fi - if in_path bunzip2 && [ "$bz2i" != "" ]; then - ext="$ext $bz2i bz2" - i="${i:-$bz2i}" - fi - if in_path gunzip && [ "$gzi" != "" ]; then - ext="$ext $gzi gz" - i="${i:-$gzi}" - fi - progress_next $(($donepkgs + ${i#* })) - for m in $MIRRORS; do - pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m" "$path")" - if get "$m/$path" "$pkgdest" $ext; then break; fi + download_release_sig "$m1" "$s" "$inreldest" "$reldest" "$relsigdest" + + validate_suite "$reldest" + + extract_release_components "$reldest" + + acquirebyhash=$(grep "^Acquire-By-Hash: yes$" "$reldest" || true) + totalpkgs=0 + for c in $COMPONENTS; do + subpath="$c/binary-$ARCH/Packages" + xzi="$(get_release_checksum "$reldest" "$subpath.xz")" + bz2i="$(get_release_checksum "$reldest" "$subpath.bz2")" + gzi="$(get_release_checksum "$reldest" "$subpath.gz")" + normi="$(get_release_checksum "$reldest" "$subpath")" + if [ "$normi" != "" ]; then + i="$normi" + elif in_path bunzip2 && [ "$bz2i" != "" ]; then + i="$bz2i" + elif in_path unxz && [ "$xzi" != "" ]; then + i="$xzi" + elif in_path gunzip && [ "$gzi" != "" ]; then + i="$gzi" + fi + if [ "$i" != "" ]; then + totalpkgs=$(( $totalpkgs + ${i#* } )) + else + mv "$reldest" "$reldest.malformed" + error 1 MISSINGRELENTRY "Invalid Release file, no entry for %s" "$subpath" + fi + done + + donepkgs=0 + progress 0 $totalpkgs DOWNPKGS "Downloading Packages files" + for c in $COMPONENTS; do + subpath="$c/binary-$ARCH/Packages" + path="dists/$s/$subpath" + xzi="$(get_release_checksum "$reldest" "$subpath.xz")" + bz2i="$(get_release_checksum "$reldest" "$subpath.bz2")" + gzi="$(get_release_checksum "$reldest" "$subpath.gz")" + normi="$(get_release_checksum "$reldest" "$subpath")" + ext="" + if [ "$acquirebyhash" != "" ]; then + ext="$ext byhash" + fi + if [ "$normi" != "" ]; then + ext="$ext $normi ." + i="$normi" + fi + if in_path unxz && [ "$xzi" != "" ]; then + ext="$ext $xzi xz" + i="${i:-$xzi}" + fi + if in_path bunzip2 && [ "$bz2i" != "" ]; then + ext="$ext $bz2i bz2" + i="${i:-$bz2i}" + fi + if in_path gunzip && [ "$gzi" != "" ]; then + ext="$ext $gzi gz" + i="${i:-$gzi}" + fi + progress_next $(($donepkgs + ${i#* })) + for m in $MIRRORS; do + pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m" "$path")" + if get "$m/$path" "$pkgdest" $ext; then break; fi + done + if [ ! -f "$pkgdest" ]; then + error 1 COULDNTDL "Couldn't download %s" "$m/$path" + fi + donepkgs=$(($donepkgs + ${i#* })) + progress $donepkgs $totalpkgs DOWNPKGS "Downloading Packages files" done - if [ ! -f "$pkgdest" ]; then - error 1 COULDNTDL "Couldn't download %s" "$m/$path" - fi - donepkgs=$(($donepkgs + ${i#* })) - progress $donepkgs $totalpkgs DOWNPKGS "Downloading Packages files" done } @@ -776,7 +788,8 @@ download_debs () { } download_release () { - local m1 numdebs countdebs totaldebs leftoverdebs path pkgdest dloaddebs + local m1 numdebs countdebs totaldebs leftoverdebs path pkgdest \ + dloaddebs s c m m1="${MIRRORS%% *}" numdebs="$#" @@ -791,24 +804,26 @@ download_release () { leftoverdebs=$(printf "$leftoverdebs"|tr ' ' '\n'|sort -u|tr '\n' ' ') numdebs=$(printf "$leftoverdebs"|wc -w) - for c in $COMPONENTS; do - if [ "$countdebs" -ge "$numdebs" ]; then break; fi + for s in $SUITE $EXTRA_SUITES; do + for c in $COMPONENTS; do + if [ "$countdebs" -ge "$numdebs" ]; then break; fi - path="dists/$SUITE/$c/binary-$ARCH/Packages" - pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")" - if [ ! -e "$pkgdest" ]; then continue; fi + path="dists/$s/$c/binary-$ARCH/Packages" + pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m1" "$path")" + if [ ! -e "$pkgdest" ]; then continue; fi - info CHECKINGSIZES "Checking component %s on %s..." "$c" "$m1" + info CHECKINGSIZES "Checking component %s on %s..." "$c" "$m1" - leftoverdebs="$(get_package_sizes "$m1" "$pkgdest" $leftoverdebs)" + leftoverdebs="$(get_package_sizes "$m1" "$pkgdest" $leftoverdebs)" - countdebs=$(($countdebs + ${leftoverdebs%% *})) - leftoverdebs=${leftoverdebs#* } + countdebs=$(($countdebs + ${leftoverdebs%% *})) + leftoverdebs=${leftoverdebs#* } - totaldebs=${leftoverdebs%% *} - leftoverdebs=${leftoverdebs#* } + totaldebs=${leftoverdebs%% *} + leftoverdebs=${leftoverdebs#* } - progress "$countdebs" "$numdebs" SIZEDEBS "Finding package sizes" + progress "$countdebs" "$numdebs" SIZEDEBS "Finding package sizes" + done done if [ "$countdebs" -ne "$numdebs" ]; then @@ -821,15 +836,18 @@ download_release () { :>"$TARGET/debootstrap/debpaths" pkgs_to_get="$*" - for c in $COMPONENTS; do - path="dists/$SUITE/$c/binary-$ARCH/Packages" - for m in $MIRRORS; do - pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m" "$path")" - if [ ! -e "$pkgdest" ]; then continue; fi - pkgs_to_get="$(download_debs "$m" "$pkgdest" $pkgs_to_get 5>&1 1>&6)" + for s in $SUITE $EXTRA_SUITES; do + for c in $COMPONENTS; do + path="dists/$s/$c/binary-$ARCH/Packages" + for m in $MIRRORS; do + pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m" "$path")" + if [ ! -e "$pkgdest" ]; then continue; fi + pkgs_to_get="$(download_debs "$m" "$pkgdest" $pkgs_to_get 5>&1 1>&6)" + if [ -z "$pkgs_to_get" ]; then break; fi + done 6>&1 + if [ -z "$pkgs_to_get" ]; then break; fi + done if [ -z "$pkgs_to_get" ]; then break; fi - done 6>&1 - if [ -z "$pkgs_to_get" ]; then break; fi done progress "$dloaddebs" "$totaldebs" DOWNDEBS "Downloading packages" if [ "$pkgs_to_get" != "" ]; then @@ -838,7 +856,7 @@ download_release () { } download_main_indices () { - local m1 comp path pkgdest + local m1 comp path pkgdest m s c m1="${MIRRORS%% *}" comp="${USE_COMPONENTS}" progress 0 100 DOWNMAINPKGS "Downloading Packages file" @@ -849,67 +867,78 @@ download_main_indices () { export COMPONENTS for m in $MIRRORS; do - for c in $COMPONENTS; do - path="dists/$SUITE/$c/binary-$ARCH/Packages" - pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m" "$path")" - if in_path gunzip && get "$m/${path}.gz" "${pkgdest}.gz"; then - rm -f "$pkgdest" - gunzip "$pkgdest.gz" - elif get "$m/$path" "$pkgdest"; then - true - fi - done + for s in $SUITE $EXTRA_SUITES; do + for c in $COMPONENTS; do + path="dists/$s/$c/binary-$ARCH/Packages" + pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m" "$path")" + if in_path gunzip && get "$m/${path}.gz" "${pkgdest}.gz"; then + rm -f "$pkgdest" + gunzip "$pkgdest.gz" + elif get "$m/$path" "$pkgdest"; then + true + fi + done + done done progress 100 100 DOWNMAINPKGS "Downloading Packages file" } download_main () { - local m1 path pkgdest debdest + local m1 path pkgdest debdest p s c m m1="${MIRRORS%% *}" :>"$TARGET/debootstrap/debpaths" for p in "$@"; do - for c in $COMPONENTS; do - local details="" - for m in $MIRRORS; do - path="dists/$SUITE/$c/binary-$ARCH/Packages" - pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m" "$path")" - if [ ! -e "$pkgdest" ]; then continue; fi - details="$($PKGDETAILS PKGS "$m" "$pkgdest" "$p")" - if [ "$details" = "$p -" ]; then - details="" - continue - fi - size="${details##* }"; details="${details% *}" - checksum="${details##* }"; details="${details% *}" - debdest="$($DLDEST deb $details)" - if get "$m/${details##* }" "$TARGET/$debdest" "$checksum" "$size"; then - echo >>"$TARGET/debootstrap/debpaths" "$p $debdest" - details="done" + for s in $SUITE $EXTRA_SUITES; do + for c in $COMPONENTS; do + local details="" + for m in $MIRRORS; do + path="dists/$s/$c/binary-$ARCH/Packages" + pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m" "$path")" + if [ ! -e "$pkgdest" ]; then continue; fi + details="$($PKGDETAILS PKGS "$m" "$pkgdest" "$p")" + if [ "$details" = "$p -" ]; then + details="" + continue + fi + size="${details##* }"; details="${details% *}" + checksum="${details##* }"; details="${details% *}" + debdest="$($DLDEST deb $details)" + if get "$m/${details##* }" "$TARGET/$debdest" "$checksum" "$size"; then + echo >>"$TARGET/debootstrap/debpaths" "$p $debdest" + details="done" + break + else + details="" + fi + done + if [ "$details" != "" ]; then + break + fi + done + if [ "$details" != "" ]; then break fi done - if [ "$details" != "" ]; then - break + if [ "$details" != "done" ]; then + error 1 COULDNTDL "Couldn't download %s" "$p" fi - done - if [ "$details" != "done" ]; then - error 1 COULDNTDL "Couldn't download %s" "$p" - fi done } ###################################################### deb choosing support get_debs () { - local field m1 c path pkgdest + local field m1 s c path pkgdest field="$1" shift for m1 in $MIRRORS; do - for c in $COMPONENTS; do - path="dists/$SUITE/$c/binary-$ARCH/Packages" - pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")" - echo "$("$PKGDETAILS" FIELD "$field" "$m1" "$pkgdest" "$@" | sed 's/ .*//')" + for s in $SUITE $EXTRA_SUITES; do + for c in $COMPONENTS; do + path="dists/$s/$c/binary-$ARCH/Packages" + pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m1" "$path")" + echo "$("$PKGDETAILS" FIELD "$field" "$m1" "$pkgdest" "$@" | sed 's/ .*//')" + done done done } @@ -944,6 +973,7 @@ extract_ar_deb_field () { case "$tarball" in control.tar.gz) cat_cmd=zcat ;; control.tar.xz) cat_cmd=xzcat ;; + control.tar.zst) cat_cmd=zstdcat ;; control.tar) cat_cmd=cat ;; *) error 1 UNKNOWNCONTROLCOMP "Unknown compression type for %s in %s" "$tarball" "$pkg" ;; esac @@ -966,6 +996,7 @@ extract_ar_deb_data () { data.tar.gz) cat_cmd=zcat ;; data.tar.bz2) cat_cmd=bzcat ;; data.tar.xz) cat_cmd=xzcat ;; + data.tar.zst) cat_cmd=zstdcat ;; data.tar) cat_cmd=cat ;; *) error 1 UNKNOWNDATACOMP "Unknown compression type for %s in %s" "$tarball" "$pkg" ;; esac @@ -979,6 +1010,7 @@ extract_ar_deb_data () { valid_extractor () { local extractor="$1" + local E for E in $EXTRACTORS_SUPPORTED; do if [ "$extractor" = "$E" ]; then @@ -1015,7 +1047,7 @@ choose_extractor () { extract () { ( cd "$TARGET" || exit 1 - local p cat_cmd + local p cat_cmd pkg p=0 for pkg in $(debfor "$@"); do p=$(($p + 1)) @@ -1076,15 +1108,18 @@ conditional_cp () { setup_apt_sources () { + local m s c mkdir -p "$TARGET/etc/apt" for m in "$@"; do - local cs c path pkgdest - for c in ${COMPONENTS:-$USE_COMPONENTS}; do - path="dists/$SUITE/$c/binary-$ARCH/Packages" - pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m" "$path")" - if [ -e "$pkgdest" ]; then cs="$cs $c"; fi + for s in $SUITE $EXTRA_SUITES; do + local cs c path pkgdest + for c in ${COMPONENTS:-$USE_COMPONENTS}; do + path="dists/$s/$c/binary-$ARCH/Packages" + pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m" "$path")" + if [ -e "$pkgdest" ]; then cs="$cs $c"; fi + done + if [ "$cs" != "" ]; then echo "deb $m $s$cs"; fi done - if [ "$cs" != "" ]; then echo "deb $m $SUITE$cs"; fi done > "$TARGET/etc/apt/sources.list" } @@ -1141,7 +1176,7 @@ setup_merged_usr() { if [ "$MERGED_USR" = "no" ]; then return 0; fi - local link_dir + local link_dir="" case $ARCH in hurd-*) return 0 ;; amd64) link_dir="lib32 lib64 libx32" ;; @@ -1328,19 +1363,24 @@ resolve_deps () { local PKGS="$*" local ALLPKGS="$PKGS"; local ALLPKGS2=""; + local s c while [ "$PKGS" != "" ]; do local NEWPKGS="" - for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; do - local path="dists/$SUITE/$c/binary-$ARCH/Packages" - local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")" - NEWPKGS="$NEWPKGS $("$PKGDETAILS" GETDEPS "$pkgdest" $PKGS)" + for s in $SUITE $EXTRA_SUITES; do + for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; do + local path="dists/$s/$c/binary-$ARCH/Packages" + local pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m1" "$path")" + NEWPKGS="$NEWPKGS $("$PKGDETAILS" GETDEPS "$pkgdest" $PKGS)" + done done PKGS=$(echo "$PKGS $NEWPKGS" | tr ' ' '\n' | sort | uniq) local REALPKGS="" - for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; do - local path="dists/$SUITE/$c/binary-$ARCH/Packages" - local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")" - REALPKGS="$REALPKGS $("$PKGDETAILS" PKGS REAL "$pkgdest" $PKGS | sed -n 's/ .*REAL.*$//p')" + for s in $SUITE $EXTRA_SUITES; do + for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; do + local path="dists/$s/$c/binary-$ARCH/Packages" + local pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m1" "$path")" + REALPKGS="$REALPKGS $("$PKGDETAILS" PKGS REAL "$pkgdest" $PKGS | sed -n 's/ .*REAL.*$//p')" + done done PKGS="$REALPKGS" ALLPKGS2=$(echo "$PKGS $ALLPKGS" | tr ' ' '\n' | sort | uniq) @@ -1354,12 +1394,16 @@ setup_available () { local m1 c path pkgdest pkg m1="${MIRRORS%% *}" - for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; do - path="dists/$SUITE/$c/binary-$ARCH/Packages" - pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")" - # XXX: What if a package is in more than one component? - # -- cjwatson 2009-07-29 - "$PKGDETAILS" STANZAS "$pkgdest" "$@" + for s in $SUITE $EXTRA_SUITES; do + for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; do + path="dists/$s/$c/binary-$ARCH/Packages" + pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m1" "$path")" + # XXX: What if a package is in more than one component? + # -- cjwatson 2009-07-29 + # XXX: ...or suite? + # -- jrtc27 2019-06-11 + "$PKGDETAILS" STANZAS "$pkgdest" "$@" + done done >"$TARGET/var/lib/dpkg/available" for pkg; do diff --git a/include/bootstrap/debian/debootstrap/scripts/amber b/include/bootstrap/debian/debootstrap/scripts/amber new file mode 100644 index 0000000..724135a --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/amber @@ -0,0 +1,225 @@ + +# For PureOS "amber" +# PureOS: https://www.pureos.net/ +# Contact: https://tracker.pureos.net/ + +mirror_style release +download_style apt +finddebs_style from-indices +variants - buildd fakechroot minbase +keyring /usr/share/keyrings/pureos-archive-keyring.gpg +default_mirror https://repo.pureos.net/pureos/ + +if doing_variant fakechroot; then + test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" +fi + +case $ARCH in + alpha|ia64) LIBC="libc6.1" ;; + kfreebsd-*) LIBC="libc0.1" ;; + hurd-*) LIBC="libc0.3" ;; + *) LIBC="libc6" ;; +esac + +work_out_debs () { + required="$(get_debs Priority: required)" + + if doing_variant - || doing_variant fakechroot; then + #required="$required $(get_debs Priority: important)" + # ^^ should be getting debconf here somehow maybe + base="$(get_debs Priority: important)" + + # we want the PureOS minimal dependency set to be installed + base="$base pureos-minimal" + elif doing_variant buildd; then + base="apt build-essential" + elif doing_variant minbase; then + base="apt" + fi + + if doing_variant fakechroot; then + # ldd.fake needs binutils + required="$required binutils" + fi + + case $MIRRORS in + https://*) + base="$base ca-certificates" + ;; + esac +} + +first_stage_install () { + MERGED_USR="yes" + EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" + + setup_merged_usr + extract $required + + mkdir -p "$TARGET/var/lib/dpkg" + : >"$TARGET/var/lib/dpkg/status" + : >"$TARGET/var/lib/dpkg/available" + + setup_etc + if [ ! -e "$TARGET/etc/fstab" ]; then + echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" + chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" + fi + + setup_devices +} + +second_stage_install () { + setup_dynamic_devices + + x_feign_install () { + local pkg="$1" + local deb="$(debfor $pkg)" + local ver="$(in_target dpkg-deb -f "$deb" Version)" + + mkdir -p "$TARGET/var/lib/dpkg/info" + + echo \ +"Package: $pkg +Version: $ver +Maintainer: unknown +Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" + + touch "$TARGET/var/lib/dpkg/info/${pkg}.list" + } + + x_feign_install dpkg + + x_core_install () { + smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") + } + + p () { + baseprog="$(($baseprog + ${1:-1}))" + } + + if doing_variant fakechroot; then + setup_proc_fakechroot + else + setup_proc + in_target /sbin/ldconfig + fi + + DEBIAN_FRONTEND=noninteractive + DEBCONF_NONINTERACTIVE_SEEN=true + export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN + + baseprog=0 + bases=7 + + p; progress $baseprog $bases INSTCORE "Installing core packages" #1 + info INSTCORE "Installing core packages..." + + p; progress $baseprog $bases INSTCORE "Installing core packages" #2 + ln -sf mawk "$TARGET/usr/bin/awk" + x_core_install base-passwd + x_core_install base-files + p; progress $baseprog $bases INSTCORE "Installing core packages" #3 + x_core_install dpkg + + if [ ! -e "$TARGET/etc/localtime" ]; then + ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" + fi + + if doing_variant fakechroot; then + install_fakechroot_tools + fi + + p; progress $baseprog $bases INSTCORE "Installing core packages" #4 + x_core_install $LIBC + + p; progress $baseprog $bases INSTCORE "Installing core packages" #5 + x_core_install perl-base + + p; progress $baseprog $bases INSTCORE "Installing core packages" #6 + rm "$TARGET/usr/bin/awk" + x_core_install mawk + + p; progress $baseprog $bases INSTCORE "Installing core packages" #7 + if doing_variant -; then + x_core_install debconf + fi + + baseprog=0 + bases=$(set -- $required; echo $#) + + info UNPACKREQ "Unpacking required packages..." + + exec 7>&1 + + smallyes '' | + (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ + dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | + dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING + + info CONFREQ "Configuring required packages..." + + if doing_variant fakechroot && [ -e "$TARGET/var/lib/dpkg/info/initscripts.postinst" ] + then + # fix initscripts postinst (no mounting possible, and wrong if condition) + sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst" + fi + + echo \ +"#!/bin/sh +exit 101" > "$TARGET/usr/sbin/policy-rc.d" + chmod 755 "$TARGET/usr/sbin/policy-rc.d" + + mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" + echo \ +"#!/bin/sh +echo +echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" + chmod 755 "$TARGET/sbin/start-stop-daemon" + + setup_dselect_method apt + + smallyes '' | + (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ + dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) | + dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING + + baseprog=0 + bases="$(set -- $base; echo $#)" + + info UNPACKBASE "Unpacking the base system..." + + setup_available $required $base + done_predeps= + while predep=$(get_next_predep); do + # We have to resolve dependencies of pre-dependencies manually because + # dpkg --predep-package doesn't handle this. + predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") + # XXX: progress is tricky due to how dpkg_progress works + # -- cjwatson 2009-07-29 + p; smallyes '' | + in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) + base=$(without "$base" "$predep") + done_predeps="$done_predeps $predep" + done + + if [ -n "$base" ]; then + smallyes '' | + (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ + dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | + dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING + + info CONFBASE "Configuring the base system..." + + smallyes '' | + (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ + dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | + dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING + fi + + mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" + rm -f "$TARGET/usr/sbin/policy-rc.d" + + progress $bases $bases CONFBASE "Configuring base system" + info BASESUCCESS "Base system installed successfully." +} diff --git a/include/bootstrap/debian/debootstrap/scripts/ascii b/include/bootstrap/debian/debootstrap/scripts/ascii new file mode 120000 index 0000000..9a63c96 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/ascii @@ -0,0 +1 @@ +sid \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/beowulf b/include/bootstrap/debian/debootstrap/scripts/beowulf new file mode 120000 index 0000000..9a63c96 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/beowulf @@ -0,0 +1 @@ +sid \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/ceres b/include/bootstrap/debian/debootstrap/scripts/ceres new file mode 120000 index 0000000..9a63c96 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/ceres @@ -0,0 +1 @@ +sid \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/debian-common b/include/bootstrap/debian/debootstrap/scripts/debian-common index a2acd36..436d74b 100644 --- a/include/bootstrap/debian/debootstrap/scripts/debian-common +++ b/include/bootstrap/debian/debootstrap/scripts/debian-common @@ -29,16 +29,23 @@ work_out_debs () { case $MIRRORS in https://*) - base="$base apt-transport-https ca-certificates" + case "$CODENAME" in + # apt-transport-https exists from lenny to stretch + lenny|squeeze|wheezy|jessie*|stretch) + base="$base apt-transport-https ca-certificates" + ;; + *) + base="$base ca-certificates" + ;; + esac ;; esac } first_stage_install () { + # Set up correct EXTRACT_DEB_TAR_OPTIONS case "$CODENAME" in - # "merged-usr" blacklist for past releases etch*|lenny|squeeze|wheezy|jessie*) - [ -z "$MERGED_USR" ] && MERGED_USR="no" ;; *) # see https://bugs.debian.org/838388 @@ -46,10 +53,17 @@ first_stage_install () { ;; esac - if [ "$CODENAME" = "stretch" ] && [ -z "$MERGED_USR" ]; then - MERGED_USR="no" - fi - + case "$CODENAME" in + # If not specified, default to split-usr on older releases + etch*|lenny|squeeze|wheezy|jessie*|stretch|ascii|buster|beowulf|bullseye) + [ -z "$MERGED_USR" ] && MERGED_USR="no" + ;; + # Always use merged-usr on bookworm+ and its derivatives + *) + MERGED_USR="yes" + ;; + esac + setup_merged_usr extract $required diff --git a/include/bootstrap/debian/debootstrap/scripts/eoan b/include/bootstrap/debian/debootstrap/scripts/eoan new file mode 120000 index 0000000..3840936 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/eoan @@ -0,0 +1 @@ +gutsy \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/focal b/include/bootstrap/debian/debootstrap/scripts/focal new file mode 120000 index 0000000..3840936 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/focal @@ -0,0 +1 @@ +gutsy \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/groovy b/include/bootstrap/debian/debootstrap/scripts/groovy new file mode 120000 index 0000000..3840936 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/groovy @@ -0,0 +1 @@ +gutsy \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/gutsy b/include/bootstrap/debian/debootstrap/scripts/gutsy index 8056106..c5d4c85 100644 --- a/include/bootstrap/debian/debootstrap/scripts/gutsy +++ b/include/bootstrap/debian/debootstrap/scripts/gutsy @@ -40,6 +40,18 @@ case $ARCH in *) LIBC="libc6" ;; esac +case $SUITE in + gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic|disco|eoan|focal|groovy|hirsute) ;; + *) + # impish+ will use zstd compression, check if supported + dpkg_zstd="$(dpkg-deb --help 2>/dev/null | grep ' zstd,' || :)" + if [ -z "$EXTRACTOR_OVERRIDE" ] && [ -z "$dpkg_zstd" ]; then + info CHOSENEXTRACTOR "%s uses zstd compression, setting --extractor=ar option" "$SUITE" + export EXTRACTOR_OVERRIDE=ar + fi + ;; +esac + work_out_debs () { required="$(get_debs Priority: required)" @@ -60,9 +72,40 @@ work_out_debs () { case $MIRRORS in https://*) - base="$base apt-transport-https ca-certificates" + case "$CODENAME" in + gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty) + base="$base apt-transport-https ca-certificates" + ;; + *) + base="$base ca-certificates" + ;; + esac ;; esac + + # do not install usrmerge in fresh bootstraps + # but do print it for germinate to accept it into minimal + if [ "$WHAT_TO_DO" = "finddebs printdebs kill_target" ]; then + case "$CODENAME" in + # "merged-usr" blacklist for past releases + gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic|disco|eoan|focal|groovy) + ;; + hirsute) + # keep hirsute buildd chroots split-usr to allow for escape hatch + if ! doing_variant buildd; then + if [ -z "$MERGED_USR" ] || [ "$MERGED_USR" = "yes" ]; then + base="$base usrmerge" + fi + fi + ;; + *) + # all future series post hirsute use merged-usr in buildd chroots too + if [ -z "$MERGED_USR" ] || [ "$MERGED_USR" = "yes" ]; then + base="$base usrmerge" + fi + ;; + esac + fi } first_stage_install () { @@ -71,7 +114,25 @@ first_stage_install () { gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic) [ -z "$MERGED_USR" ] && MERGED_USR="no" ;; + disco|eoan|focal|groovy) + # see https://bugs.debian.org/838388 + EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" + ;; + hirsute) + # keep hirsute buildd chroots split-usr to allow for escape hatch + if [ -z "$MERGED_USR" ]; then + if doing_variant buildd; then + MERGED_USR="no" + else + MERGED_USR="yes" + fi + fi + # see https://bugs.debian.org/838388 + EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" + ;; *) + # all future series post hirsute use merged-usr in buildd chroots too + [ -z "$MERGED_USR" ] && MERGED_USR="yes" # see https://bugs.debian.org/838388 EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" ;; diff --git a/include/bootstrap/debian/debootstrap/scripts/hirsute b/include/bootstrap/debian/debootstrap/scripts/hirsute new file mode 120000 index 0000000..4c4810d --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/hirsute @@ -0,0 +1 @@ +groovy \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/impish b/include/bootstrap/debian/debootstrap/scripts/impish new file mode 120000 index 0000000..3840936 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/impish @@ -0,0 +1 @@ +gutsy \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/jammy b/include/bootstrap/debian/debootstrap/scripts/jammy new file mode 120000 index 0000000..3840936 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/jammy @@ -0,0 +1 @@ +gutsy \ No newline at end of file diff --git a/include/bootstrap/debian/debootstrap/scripts/trixie b/include/bootstrap/debian/debootstrap/scripts/trixie new file mode 120000 index 0000000..9a63c96 --- /dev/null +++ b/include/bootstrap/debian/debootstrap/scripts/trixie @@ -0,0 +1 @@ +sid \ No newline at end of file