Skip to content

Commit

Permalink
enable apt diag messages
Browse files Browse the repository at this point in the history
Signed-off-by: You-Sheng Yang <[email protected]>
  • Loading branch information
vicamo committed May 6, 2024
1 parent 04029e9 commit 38ed01f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions examples/debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ debuerreotype-debian-sources-list "${sourcesListArgs[@]}" --snapshot "$rootfsDir

debuerreotype-minimizing-config "$rootfsDir"

debuerreotype-apt-get "$rootfsDir" update -qq
debuerreotype-apt-get "$rootfsDir" update -q

if dpkg --compare-versions "$aptVersion" '>=' '1.1~'; then
debuerreotype-apt-get "$rootfsDir" full-upgrade -yqq
debuerreotype-apt-get "$rootfsDir" full-upgrade -yq
else
debuerreotype-apt-get "$rootfsDir" dist-upgrade -yqq
debuerreotype-apt-get "$rootfsDir" dist-upgrade -yq
fi

if dpkg --compare-versions "$aptVersion" '>=' '0.7.14~'; then
Expand All @@ -277,7 +277,7 @@ epoch2021="$(date --date '2021-01-01 00:00:00' +%s)"
if [ "$epoch" -lt "$epoch2021" ] || { isDebianBusterOrOlder="$([ -f "$rootfsDir/etc/os-release" ] && source "$rootfsDir/etc/os-release" && [ -n "${VERSION_ID:-}" ] && [ "${VERSION_ID%%.*}" -le 10 ] && echo 1)" && [ -n "$isDebianBusterOrOlder" ]; }; then
# prefer iproute2 if it exists
iproute=iproute2
if ! debuerreotype-apt-get "$rootfsDir" install -qq -s iproute2 &> /dev/null; then
if ! debuerreotype-apt-get "$rootfsDir" install -q -s iproute2 &> /dev/null; then
# poor wheezy
iproute=iproute
fi
Expand Down
8 changes: 4 additions & 4 deletions examples/raspbian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ debuerreotype-init "${initArgs[@]}" "$rootfsDir" "$suite" "$mirror"
debuerreotype-minimizing-config "$rootfsDir"

# TODO do we need to update sources.list here? (security?)
debuerreotype-apt-get "$rootfsDir" update -qq
debuerreotype-apt-get "$rootfsDir" update -q

debuerreotype-recalculate-epoch "$rootfsDir"
epoch="$(< "$rootfsDir/debuerreotype-epoch")"
Expand All @@ -137,9 +137,9 @@ touch_epoch() {

aptVersion="$("$debuerreotypeScriptsDir/.apt-version.sh" "$rootfsDir")"
if dpkg --compare-versions "$aptVersion" '>=' '1.1~'; then
debuerreotype-apt-get "$rootfsDir" full-upgrade -yqq
debuerreotype-apt-get "$rootfsDir" full-upgrade -yq
else
debuerreotype-apt-get "$rootfsDir" dist-upgrade -yqq
debuerreotype-apt-get "$rootfsDir" dist-upgrade -yq
fi

# copy the rootfs to create other variants
Expand All @@ -151,7 +151,7 @@ epoch2021="$(date --date '2021-01-01 00:00:00' +%s)"
if [ "$epoch" -lt "$epoch2021" ] || { isDebianBusterOrOlder="$([ -f "$rootfsDir/etc/os-release" ] && source "$rootfsDir/etc/os-release" && [ -n "${VERSION_ID:-}" ] && [ "${VERSION_ID%%.*}" -le 10 ] && echo 1)" && [ -n "$isDebianBusterOrOlder" ]; }; then
# prefer iproute2 if it exists
iproute=iproute2
if ! debuerreotype-apt-get "$rootfsDir" install -qq -s iproute2 &> /dev/null; then
if ! debuerreotype-apt-get "$rootfsDir" install -q -s iproute2 &> /dev/null; then
# poor wheezy
iproute=iproute
fi
Expand Down
8 changes: 4 additions & 4 deletions examples/steamos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ debuerreotype-init "${initArgs[@]}" "$rootfsDir" "$suite" "$mirror"
debuerreotype-minimizing-config "$rootfsDir"

echo "deb $mirror $suite main contrib non-free" | tee "$rootfsDir/etc/apt/sources.list"
debuerreotype-apt-get "$rootfsDir" update -qq
debuerreotype-apt-get "$rootfsDir" update -q

debuerreotype-recalculate-epoch "$rootfsDir"
epoch="$(< "$rootfsDir/debuerreotype-epoch")"
Expand All @@ -112,9 +112,9 @@ touch_epoch "$rootfsDir/etc/apt/sources.list"

aptVersion="$("$debuerreotypeScriptsDir/.apt-version.sh" "$rootfsDir")"
if dpkg --compare-versions "$aptVersion" '>=' '1.1~'; then
debuerreotype-apt-get "$rootfsDir" full-upgrade -yqq
debuerreotype-apt-get "$rootfsDir" full-upgrade -yq
else
debuerreotype-apt-get "$rootfsDir" dist-upgrade -yqq
debuerreotype-apt-get "$rootfsDir" dist-upgrade -yq
fi

# copy the rootfs to create other variants
Expand All @@ -123,7 +123,7 @@ tar -cC "$rootfsDir" . | tar -xC "$rootfsDir"-slim

# prefer iproute2 if it exists
iproute=iproute2
if ! debuerreotype-apt-get "$rootfsDir" install -qq -s iproute2 &> /dev/null; then
if ! debuerreotype-apt-get "$rootfsDir" install -q -s iproute2 &> /dev/null; then
# poor wheezy
iproute=iproute
fi
Expand Down
8 changes: 4 additions & 4 deletions examples/ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ tee "$rootfsDir/etc/apt/sources.list" <<-EOS
deb $secmirror $suite-security main restricted universe multiverse
EOS
# TODO make components list a script flag? backports?
debuerreotype-apt-get "$rootfsDir" update -qq
debuerreotype-apt-get "$rootfsDir" update -q

debuerreotype-recalculate-epoch "$rootfsDir"
epoch="$(< "$rootfsDir/debuerreotype-epoch")"
Expand All @@ -142,9 +142,9 @@ touch_epoch "$rootfsDir/etc/apt/sources.list"

aptVersion="$("$debuerreotypeScriptsDir/.apt-version.sh" "$rootfsDir")"
if dpkg --compare-versions "$aptVersion" '>=' '1.1~'; then
debuerreotype-apt-get "$rootfsDir" full-upgrade -yqq
debuerreotype-apt-get "$rootfsDir" full-upgrade -yq
else
debuerreotype-apt-get "$rootfsDir" dist-upgrade -yqq
debuerreotype-apt-get "$rootfsDir" dist-upgrade -yq
fi

# copy the rootfs to create other variants
Expand All @@ -153,7 +153,7 @@ tar -cC "$rootfsDir" . | tar -xC "$rootfsDir"-slim

# prefer iproute2 if it exists
iproute=iproute2
if ! debuerreotype-apt-get "$rootfsDir" install -qq -s iproute2 &> /dev/null; then
if ! debuerreotype-apt-get "$rootfsDir" install -q -s iproute2 &> /dev/null; then
# poor wheezy
iproute=iproute
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/debuerreotype-init
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ if [ -z "$nonDebian" ]; then
$([ -z "$debianEol" ] || echo '--eol') \
$([ -z "$debianPorts" ] || echo '--ports') \
"$targetDir" "$suite"
"$thisDir/debuerreotype-apt-get" "$targetDir" update -qq
"$thisDir/debuerreotype-apt-get" "$targetDir" update -q
fi

# since we're minbase, we know everything included is either essential, or a dependency of essential, so let's get clean "apt-mark showmanual" output
Expand Down
2 changes: 1 addition & 1 deletion scripts/debuerreotype-minimizing-config
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ EOF
chmod 0755 "$targetDir/usr/sbin/policy-rc.d"

# prevent upstart scripts from running during install/update (but only if the "upstart" package exists)
if "$thisDir/debuerreotype-chroot" "$targetDir" apt-get install -qq -s upstart &> /dev/null; then
if "$thisDir/debuerreotype-chroot" "$targetDir" apt-get install -q -s upstart &> /dev/null; then
"$thisDir/debuerreotype-chroot" "$targetDir" dpkg-divert --local --rename --add /sbin/initctl > /dev/null
cp -a "$targetDir/usr/sbin/policy-rc.d" "$targetDir/sbin/initctl"
sed -i 's/^exit.*/exit 0/' "$targetDir/sbin/initctl"
Expand Down

0 comments on commit 38ed01f

Please sign in to comment.