Skip to content

Commit 3d2dda7

Browse files
Allow to specify keyring file when building the chroot
For the ICPC image we need a custom keyring since the sysops repo has a custom signing key.
1 parent 0c7db21 commit 3d2dda7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

misc-tools/dj_make_chroot.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Ubuntu: $UBUNTU_ARCHLIST
9797
Environment Overrides:
9898
DEBPROXY: Sets http(s) proxy to be used for package installation (Overridden if -p argument is used)
9999
DEBMIRROR: Sets mirror URL to be used for package registry (Overridden if -m argument is used)
100+
KEYRING: Sets the keyring to use for the package registry, useful for custom repositories (Overridden if -k argument is used)
100101
101102
EOF
102103
}
@@ -125,6 +126,7 @@ while getopts 'a:d:D:R:i:r:l:s:p:m:Hyfh' OPT ; do
125126
s) REPOLISTS=$OPTARG ;;
126127
p) DEBPROXY=$OPTARG ;;
127128
m) DEBMIRROR=$OPTARG ;;
129+
k) KEYRING=$OPTARG ;;
128130
H) HOSTLISTS=1 ;;
129131
y) FORCEYES=1 ;;
130132
f) FORCEDOWNLOAD=1 ;;
@@ -303,6 +305,10 @@ EXCLUDEOPT=""
303305
if [ -n "$EXCLUDEDEBS" ]; then
304306
EXCLUDEOPT="--exclude=$EXCLUDEDEBS"
305307
fi
308+
KEYRINGOPT=""
309+
if [ -n "$KEYRING" ]; then
310+
KEYRINGOPT="--keyring=$KEYRING"
311+
fi
306312

307313
if [ -n "$DEBPROXY" ]; then
308314
BOOTSTRAP_COMMAND="http_proxy=\"$DEBPROXY\" $BOOTSTRAP_COMMAND"
@@ -313,7 +319,7 @@ echo "Running debootstrap to install base system, this may take a while..."
313319
# Add extra paths that are not set by default on Redhat-like systems.
314320
# shellcheck disable=SC2086
315321
eval PATH="$PATH:/bin:/sbin:/usr/sbin" $BOOTSTRAP_COMMAND $INCLUDEOPT $EXCLUDEOPT \
316-
--variant=minbase --arch "$ARCH" "$RELEASE" "$CHROOTDIR" "$DEBMIRROR"
322+
$KEYRINGOPT --variant=minbase --arch "$ARCH" "$RELEASE" "$CHROOTDIR" "$DEBMIRROR"
317323

318324
if [ -n "$WORKDIR" ] && [ -d "$WORKDIR" ]; then
319325
rm -rf "$WORKDIR"

0 commit comments

Comments
 (0)