2023-01-28 00:05:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
[ -f /.dockerenv ] || { echo "please run in supplied container"; exit 1; }
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cat <<-EOF > /etc/apt/sources.list
|
2023-06-16 06:23:10 +00:00
|
|
|
deb http://deb.debian.org/debian bookworm main
|
|
|
|
deb http://security.debian.org/debian-security bookworm-security main
|
|
|
|
deb http://deb.debian.org/debian bookworm-updates main
|
2023-01-28 00:05:03 +00:00
|
|
|
EOF
|
2023-05-05 15:11:17 +00:00
|
|
|
rm /etc/apt/sources.list.d/*
|
2023-01-28 00:05:03 +00:00
|
|
|
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
|
|
|
|
apt-get update
|
2023-06-16 06:23:10 +00:00
|
|
|
apt-get install -y --download-only $( \
|
2023-01-28 00:05:03 +00:00
|
|
|
dpkg-query \
|
|
|
|
-W \
|
|
|
|
-f='${db:Status-Abbrev}\t${binary:Package} - ${binary:Summary}\n' \
|
|
|
|
| awk -F'\t' '/^ii/ {print $2}' \
|
|
|
|
| awk '{print $1}' \
|
|
|
|
)
|
2023-04-13 21:20:55 +00:00
|
|
|
apt-get install \
|
|
|
|
-y \
|
|
|
|
--download-only \
|
2023-09-21 17:55:57 +00:00
|
|
|
sudo gettext dpkg-dev git-restore-mtime \
|
2023-06-16 06:23:10 +00:00
|
|
|
$(cat /config/apt-base.list)
|
2023-01-28 00:05:03 +00:00
|
|
|
|
|
|
|
( cd /var/cache/apt/archives \
|
|
|
|
&& find . -type f \( -iname \*.deb \) -exec sha256sum {} \; \
|
|
|
|
| sed 's/.\///g' \
|
|
|
|
| LC_ALL=C sort
|
2023-06-16 06:23:10 +00:00
|
|
|
) > /config/apt-hashes-${ARCH}.list
|
2023-01-28 00:05:03 +00:00
|
|
|
|
|
|
|
for deb in /var/cache/apt/archives/*.deb; do
|
|
|
|
package=$(dpkg-deb -f $deb Package);
|
|
|
|
version=$(dpkg --info ${deb} | grep "^ Version: " | sed 's/^ Version: //g');
|
2023-06-16 06:23:10 +00:00
|
|
|
echo "${package}=${version}" >> /config/apt-pins-${ARCH}.list;
|
2023-01-28 00:05:03 +00:00
|
|
|
done
|
|
|
|
|
2023-06-16 06:23:10 +00:00
|
|
|
snapshot_url="http://snapshot.debian.org/archive/debian"
|
|
|
|
snapshot_date=$(date +"%Y%m%dT000000Z")
|
|
|
|
cat <<-EOF > /config/apt-sources-x86_64.list
|
|
|
|
deb [trusted=yes] ${snapshot_url}/${snapshot_date} bookworm main
|
|
|
|
deb [trusted=yes] ${snapshot_url}-security/${snapshot_date} bookworm-security main
|
|
|
|
deb [trusted=yes] ${snapshot_url}/${snapshot_date} bookworm-updates main
|
|
|
|
EOF
|
|
|
|
chown -R $LOCAL_USER /config/
|