Skip to content

Commit b6ee62b

Browse files
committed
bookworm
1 parent b6f8887 commit b6ee62b

4 files changed

Lines changed: 92 additions & 5 deletions

File tree

.drone.jsonnet

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
local name = "rootfs";
2-
local distro = "buster";
32

4-
local build(arch, dind) = [{
3+
local build(arch, distro, dind) = [{
54
kind: "pipeline",
65
name: distro + "-" + arch,
76

@@ -169,6 +168,9 @@ local build(arch, dind) = [{
169168
]
170169
}];
171170

172-
build("amd64", "20.10.21-dind") +
173-
build("arm64", "19.03.8-dind") +
174-
build("arm", "19.03.8-dind")
171+
build("amd64", "bookworm", "20.10.21-dind") +
172+
build("arm64", "bookworm", "19.03.8-dind") +
173+
build("arm", "bookworm", "19.03.8-dind") +
174+
build("amd64", "buster", "20.10.21-dind") +
175+
build("arm64", "buster", "19.03.8-dind") +
176+
build("arm", "buster", "19.03.8-dind")

bootstrap/bootstrap-bookworm.sh

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/bin/bash -ex
2+
3+
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
4+
5+
ARCH=$1
6+
DEB_ARCH=$(dpkg --print-architecture)
7+
REPO=http://http.debian.net/debian
8+
KEY=https://ftp-master.debian.org/keys/archive-key-12.asc
9+
DISTRO=bookworm
10+
11+
#Fix debconf frontend warnings
12+
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
13+
export DEBCONF_FRONTEND=noninteractive
14+
export DEBIAN_FRONTEND=noninteractive
15+
export TMPDIR=/tmp
16+
export TMP=/tmp
17+
18+
ROOTFS=${DIR}/build
19+
20+
function cleanup {
21+
22+
mount | grep $ROOTFS || true
23+
mount | grep $ROOTFS | awk '{print "umounting "$1; system("umount "$3)}' || true
24+
mount | grep $ROOTFS || true
25+
26+
echo "killing chroot services"
27+
lsof 2>&1 | grep $ROOTFS | awk '{print $1 $2}' | sort | uniq
28+
echo "chroot services after kill"
29+
lsof 2>&1 | grep $ROOTFS || true
30+
}
31+
32+
cleanup
33+
34+
rm -rf ${ROOTFS}
35+
apt update
36+
apt install -y debootstrap rsync
37+
debootstrap --no-check-gpg --include=\
38+
avahi-daemon,\
39+
bzip2,\
40+
ca-certificates,\
41+
curl,\
42+
dbus,\
43+
fancontrol,\
44+
gnupg,\
45+
less,\
46+
locales,\
47+
net-tools,\
48+
ntp,\
49+
openssh-server,\
50+
parted,\
51+
rsync,\
52+
sudo,\
53+
unzip,\
54+
wget,\
55+
wireless-tools \
56+
--arch=${DEB_ARCH} ${DISTRO} ${ROOTFS} ${REPO}
57+
58+
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' ${ROOTFS}/etc/locale.gen
59+
echo "LC_ALL=en_US.UTF-8" >> ${ROOTFS}/etc/environment
60+
chroot ${ROOTFS} /bin/bash -c "locale-gen en_US en_US.UTF-8"
61+
chroot ${ROOTFS} wget ${KEY} -O archive.key
62+
chroot ${ROOTFS} apt-key add archive.key
63+
mount -v --bind /dev ${ROOTFS}/dev
64+
chroot ${ROOTFS} /bin/bash -c "echo \"root:syncloud\" | chpasswd"
65+
66+
echo "copy system files to get image working"
67+
rsync -avhp --ignore-times --stats ${DIR}/files/common/ ${ROOTFS}
68+
rsync -avhp --ignore-times --stats ${DIR}/files/arch/${ARCH}/ ${ROOTFS}
69+
rsync -avhp --ignore-times --stats ${DIR}/files/distro/${DISTRO}/ ${ROOTFS}
70+
cp $DIR/../install.sh ${ROOTFS}/root
71+
grep localhost ${ROOTFS}/etc/hosts
72+
grep dev ${ROOTFS}/etc/fstab
73+
ls -la ${ROOTFS}/etc/network
74+
grep eth ${ROOTFS}/etc/network/interfaces
75+
76+
sed -i -e'/AVAHI_DAEMON_DETECT_LOCAL/s/1/0/' ${ROOTFS}/etc/default/avahi-daemon
77+
sed -i "s/^.*PermitRootLogin.*/PermitRootLogin yes/g" ${ROOTFS}/etc/ssh/sshd_config
78+
79+
umount ${ROOTFS}/dev
80+
cleanup
81+
82+
echo "cleaning apt cache"
83+
rm -rf ${ROOTFS}/var/cache/apt/archives/*.deb
84+
tar cf $DIR/bootstrap.tar -C $ROOTFS .

bootstrap/files/distro/bookworm/.gitkeep

Whitespace-only changes.

test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ DISTRO=$1
1212
ARCH=$2
1313
DOMAIN=${ARCH}
1414

15+
1516
apk add sshpass cmd:pip
1617

1718
device=rootfs

0 commit comments

Comments
 (0)