From 42f6a32c4d675eafdaf0192a3e9dbb8e1df43e89 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sat, 28 Oct 2017 13:55:16 +0200 Subject: scripts/gutsy: sync from scripts/sid Signed-off-by: Mattia Rizzolo --- scripts/gutsy | 78 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/scripts/gutsy b/scripts/gutsy index f525d8f..36a2f50 100644 --- a/scripts/gutsy +++ b/scripts/gutsy @@ -36,16 +36,21 @@ esac work_out_debs () { required="$(get_debs Priority: required)" - if doing_variant -; then + 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)" elif doing_variant buildd; then - base="$(get_debs Build-Essential: yes)" - elif doing_variant fakechroot || doing_variant minbase; 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 apt-transport-https ca-certificates" @@ -54,6 +59,14 @@ work_out_debs () { } first_stage_install () { + case "$CODENAME" in + etch|etch-m68k|jessie|jessie-kfreebsd|lenny|squeeze|wheezy) ;; + *) + EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" + setup_merged_usr + ;; + esac + extract $required mkdir -p "$TARGET/var/lib/dpkg" @@ -67,26 +80,29 @@ first_stage_install () { fi setup_devices +} + +second_stage_install () { + setup_dynamic_devices x_feign_install () { local pkg="$1" local deb="$(debfor $pkg)" - local ver="$(extract_deb_field "$TARGET/$deb" Version)" + 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 -} -second_stage_install () { x_core_install () { smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") } @@ -120,7 +136,7 @@ second_stage_install () { x_core_install dpkg if [ ! -e "$TARGET/etc/localtime" ]; then - ln -sf /usr/share/zoneinfo/Etc/UTC "$TARGET/etc/localtime" + ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" fi if doing_variant fakechroot; then @@ -147,18 +163,15 @@ second_stage_install () { 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 | - dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 + 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; 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" @@ -171,22 +184,12 @@ echo echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" chmod 755 "$TARGET/sbin/start-stop-daemon" - if [ -x "$TARGET/sbin/initctl" ]; then - mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL" - echo \ -"#!/bin/sh -if [ \"\$1\" = version ]; then exec /sbin/initctl.REAL \"\$@\"; fi -echo -echo \"Warning: Fake initctl called, doing nothing\"" > "$TARGET/sbin/initctl" - chmod 755 "$TARGET/sbin/initctl" - fi - 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 | - dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 + 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 $#)" @@ -207,21 +210,20 @@ echo \"Warning: Fake initctl called, doing nothing\"" > "$TARGET/sbin/initctl" done_predeps="$done_predeps $predep" done - 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 | - dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 + 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..." + 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 | - dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 - - if [ -x "$TARGET/sbin/initctl.REAL" ]; then - mv "$TARGET/sbin/initctl.REAL" "$TARGET/sbin/initctl" + 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" -- cgit v0.12