M images/debian/functions => images/debian/functions +11 -5
@@ 52,6 52,7 @@ add_repository() {
distro=$(echo $src | cut -d' ' -f2)
cmpnt=$(echo $src | cut -d' ' -f3)
key=$(echo $src | cut -d' ' -f4)
+ signed_by=""
if [ "$key" != "" ]
then
# Import the GPG key into a user trustdb
@@ 60,16 61,21 @@ add_repository() {
--keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys $key
+ guest_ssh -p $port build@localhost sudo \
+ mkdir -pm 0755 /etc/apt/keyrings
+
# Export the GPG key to Apt's key directory
guest_ssh -p $port build@localhost sudo \
gpg \
- --output /etc/apt/trusted.gpg.d/$key.gpg \
+ --output /etc/apt/keyrings/$name.gpg \
--export $key
+
+ signed_by="[signed-by=/etc/apt/keyrings/$name.gpg]"
fi
- printf 'deb %s %s %s\n' "$repo" "$distro" "$cmpnt" \
- | guest_ssh -p $port build@localhost sudo tee -a /etc/apt/sources.list
- printf 'deb-src %s %s %s\n' "$repo" "$distro" "$cmpnt" \
- | guest_ssh -p $port build@localhost sudo tee -a /etc/apt/sources.list
+ printf 'deb %s %s %s %s\n' "$signed_by" "$repo" "$distro" "$cmpnt" \
+ | guest_ssh -p $port build@localhost sudo tee -a /etc/apt/sources.list.d/$name.list
+ printf 'deb-src %s %s %s %s\n' "$signed_by" "$repo" "$distro" "$cmpnt" \
+ | guest_ssh -p $port build@localhost sudo tee -a /etc/apt/sources.list.d/$name.list
guest_ssh -p "$port" build@localhost sudo apt-get update
}
M images/debian/genimg => images/debian/genimg +0 -1
@@ 109,7 109,6 @@ EOF
echo 'APT::Install-Recommends "False";' > /mnt/etc/apt/apt.conf.d/60recommends
-run_root apt-key update
run_root apt-get update
run_root apt-get -y install locales
run_root apt-get -y install $kpkg