Skip to content

Commit a76f97d

Browse files
author
Carlos Rodríguez Hernández
authored
Deprecate Debian 10 (#165)
* Deprecate Debian 10 Signed-off-by: Carlos Rodríguez Hernández <[email protected]> * Change debootstrap Signed-off-by: Carlos Rodríguez Hernández <[email protected]> * Remove buster from checks Signed-off-by: Carlos Rodríguez Hernández <[email protected]> * Update bullseye Signed-off-by: Carlos Rodríguez Hernández <[email protected]> --------- Signed-off-by: Carlos Rodríguez Hernández <[email protected]>
1 parent 574527a commit a76f97d

File tree

9 files changed

+233
-239
lines changed

9 files changed

+233
-239
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
needs: [ shellcheck ]
4242
strategy:
4343
matrix:
44-
dist: [buster, bullseye, bookworm]
44+
dist: [bullseye, bookworm]
4545
arch: [amd64, arm64]
4646

4747
name: Build ${{ matrix.dist }} on ${{ matrix.arch }}
@@ -81,7 +81,7 @@ jobs:
8181
- uses: actions/checkout@v3
8282
- name: Push Manifests
8383
run: |
84-
DISTS="buster bullseye bookworm latest" bash pushmanifest
84+
DISTS="bullseye bookworm latest" bash pushmanifest
8585
8686
# If the CI Pipeline does not succeed we should notify the interested agents
8787
slack-notif:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ We provide a Makefile to help you build Minideb locally. It should be run on a D
7070
$ sudo make
7171
```
7272
73-
To build an individual release (buster, bullseye, or bookworm)
73+
To build an individual release (bullseye or bookworm)
7474
```
7575
$ sudo make bookworm
7676
```

buildall

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ set -o pipefail
88

99
arch=${1:-"amd64 arm64"}
1010

11-
dist="buster
12-
bullseye
11+
dist="bullseye
1312
bookworm
1413
"
1514
for a in $arch; do

debootstrap/bookworm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
buster
1+
bullseye

debootstrap/bullseye

-1
This file was deleted.

debootstrap/bullseye

+226
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
mirror_style release
2+
download_style apt
3+
finddebs_style from-indices
4+
variants - container fakechroot
5+
keyring /usr/share/keyrings/debian-archive-keyring.gpg
6+
7+
if doing_variant fakechroot; then
8+
test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
9+
fi
10+
11+
case $ARCH in
12+
alpha|ia64) LIBC="libc6.1" ;;
13+
kfreebsd-*) LIBC="libc0.1" ;;
14+
hurd-*) LIBC="libc0.3" ;;
15+
*) LIBC="libc6" ;;
16+
esac
17+
18+
work_out_debs () {
19+
# adduser in case users want to add a user to run as non-root
20+
# base-files as it has many important files
21+
# base-passwd to get user account info
22+
# bash because users will often shell in
23+
# bsdutils because it has some commands used in postinst
24+
# - particularly `logger` for `mysql-server` see
25+
# https://github.com/bitnami/minideb/issues/16
26+
# coreutils for many very common utilities
27+
# dash for a shell for scripts
28+
# debian-archive-keyring to verify apt packages
29+
# diffutils for diff as required for installing the system
30+
# (could maybe be removed after, but diffing is pretty common in debugging)
31+
# dpkg for dpkg
32+
# findutils for find as required for installing the system
33+
# grep as it is a very common debugging tool
34+
# gzip as decompressing zip is super common
35+
# hostname ?
36+
# libc-bin for ldconfig
37+
# login as su maybe used if run as non root (?)
38+
# lsb-base ?
39+
# mawk as it is used by dpkg
40+
# ncurses-base for terminfo files as docker sets TERM=xterm
41+
# see https://github.com/bitnami/minideb/issues/17
42+
# passwd for managing user accounts if run as non-root.
43+
# sed as a very commonly used tool
44+
# sysv-rc for update-rc.d, required when installing initscripts in postinsts
45+
# tar as uncompressing tarballs is super common when installing things.
46+
# tzdata for handling timezones
47+
# util-linux for getopt
48+
# mount is required for mounting /proc during debootstrap
49+
required="adduser base-files base-passwd bash bsdutils coreutils dash debian-archive-keyring diffutils dpkg findutils grep gzip hostname init-system-helpers libc-bin login lsb-base mawk ncurses-base passwd sed sysv-rc tar tzdata util-linux mount"
50+
51+
base="apt"
52+
53+
if doing_variant fakechroot; then
54+
# ldd.fake needs binutils
55+
required="$required binutils"
56+
fi
57+
58+
case $MIRRORS in
59+
https://*)
60+
base="$base apt-transport-https ca-certificates"
61+
;;
62+
esac
63+
}
64+
65+
first_stage_install () {
66+
extract $required
67+
68+
mkdir -p "$TARGET/var/lib/dpkg"
69+
: >"$TARGET/var/lib/dpkg/status"
70+
: >"$TARGET/var/lib/dpkg/available"
71+
72+
setup_etc
73+
if [ ! -e "$TARGET/etc/fstab" ]; then
74+
echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
75+
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
76+
fi
77+
78+
setup_devices
79+
80+
x_feign_install () {
81+
local pkg="$1"
82+
local deb="$(debfor $pkg)"
83+
local ver="$(extract_deb_field "$TARGET/$deb" Version)"
84+
85+
mkdir -p "$TARGET/var/lib/dpkg/info"
86+
87+
echo \
88+
"Package: $pkg
89+
Version: $ver
90+
Maintainer: unknown
91+
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
92+
93+
touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
94+
}
95+
96+
x_feign_install dpkg
97+
}
98+
99+
second_stage_install () {
100+
setup_dynamic_devices
101+
102+
x_core_install () {
103+
smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
104+
}
105+
106+
p () {
107+
baseprog="$(($baseprog + ${1:-1}))"
108+
}
109+
110+
if doing_variant fakechroot; then
111+
setup_proc_fakechroot
112+
else
113+
setup_proc
114+
in_target /sbin/ldconfig
115+
fi
116+
117+
DEBIAN_FRONTEND=noninteractive
118+
DEBCONF_NONINTERACTIVE_SEEN=true
119+
export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
120+
121+
baseprog=0
122+
bases=7
123+
124+
p; progress $baseprog $bases INSTCORE "Installing core packages" #1
125+
info INSTCORE "Installing core packages..."
126+
127+
p; progress $baseprog $bases INSTCORE "Installing core packages" #2
128+
ln -sf mawk "$TARGET/usr/bin/awk"
129+
x_core_install base-passwd
130+
x_core_install base-files
131+
p; progress $baseprog $bases INSTCORE "Installing core packages" #3
132+
x_core_install dpkg
133+
134+
if [ ! -e "$TARGET/etc/localtime" ]; then
135+
ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
136+
fi
137+
138+
if doing_variant fakechroot; then
139+
install_fakechroot_tools
140+
fi
141+
142+
p; progress $baseprog $bases INSTCORE "Installing core packages" #4
143+
x_core_install $LIBC
144+
145+
p; progress $baseprog $bases INSTCORE "Installing core packages" #5
146+
x_core_install perl-base
147+
148+
p; progress $baseprog $bases INSTCORE "Installing core packages" #6
149+
rm "$TARGET/usr/bin/awk"
150+
x_core_install mawk
151+
152+
p; progress $baseprog $bases INSTCORE "Installing core packages" #7
153+
if doing_variant -; then
154+
x_core_install debconf
155+
fi
156+
157+
baseprog=0
158+
bases=$(set -- $required; echo $#)
159+
160+
info UNPACKREQ "Unpacking required packages..."
161+
162+
exec 7>&1
163+
164+
smallyes '' |
165+
(repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
166+
dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
167+
dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING
168+
169+
info CONFREQ "Configuring required packages..."
170+
171+
echo \
172+
"#!/bin/sh
173+
exit 101" > "$TARGET/usr/sbin/policy-rc.d"
174+
chmod 755 "$TARGET/usr/sbin/policy-rc.d"
175+
176+
mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
177+
echo \
178+
"#!/bin/sh
179+
echo
180+
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
181+
chmod 755 "$TARGET/sbin/start-stop-daemon"
182+
183+
setup_dselect_method apt
184+
185+
smallyes '' |
186+
(in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
187+
dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
188+
dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING
189+
190+
baseprog=0
191+
bases="$(set -- $base; echo $#)"
192+
193+
info UNPACKBASE "Unpacking the base system..."
194+
195+
setup_available $required $base
196+
done_predeps=
197+
while predep=$(get_next_predep); do
198+
# We have to resolve dependencies of pre-dependencies manually because
199+
# dpkg --predep-package doesn't handle this.
200+
predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps")
201+
# XXX: progress is tricky due to how dpkg_progress works
202+
# -- cjwatson 2009-07-29
203+
p; smallyes '' |
204+
in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep)
205+
base=$(without "$base" "$predep")
206+
done_predeps="$done_predeps $predep"
207+
done
208+
209+
smallyes '' |
210+
(repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
211+
dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
212+
dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING
213+
214+
info CONFBASE "Configuring the base system..."
215+
216+
smallyes '' |
217+
(repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \
218+
dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
219+
dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
220+
221+
mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
222+
rm -f "$TARGET/usr/sbin/policy-rc.d"
223+
224+
progress $bases $bases CONFBASE "Configuring base system"
225+
info BASESUCCESS "Base system installed successfully."
226+
}

0 commit comments

Comments
 (0)