@@ -76,6 +76,9 @@ Options:
76
76
to add to the chroot (comma separated). Signing keys for the
77
77
repository will be imported if they exist as <filename>.gpg,
78
78
<filename>.asc or <filename>.arm.
79
+ -H Use repository lists from the host. Useful to make sure
80
+ compiler/runner versions will be the same when using a custom
81
+ image.
79
82
-p <url> HTTP(S) Proxy URL to use during package install.
80
83
-m <url> Debian or Ubuntu mirror URL to be used for package installation.
81
84
-y Force overwriting the chroot dir and installing debootstrap.
@@ -110,7 +113,7 @@ FORCEYES=0
110
113
FORCEDOWNLOAD=0
111
114
112
115
# Read command-line parameters:
113
- while getopts ' a:d:D:R:i:r:l:s:p:m:yfh ' OPT ; do
116
+ while getopts ' a:d:D:R:i:r:l:s:p:m:Hyfh ' OPT ; do
114
117
case $OPT in
115
118
a) ARCH=$OPTARG ;;
116
119
d) CHROOTDIR=$OPTARG ;;
@@ -122,6 +125,7 @@ while getopts 'a:d:D:R:i:r:l:s:p:m:yfh' OPT ; do
122
125
s) REPOLISTS=$OPTARG ;;
123
126
p) DEBPROXY=$OPTARG ;;
124
127
m) DEBMIRROR=$OPTARG ;;
128
+ H) HOSTLISTS=1 ;;
125
129
y) FORCEYES=1 ;;
126
130
f) FORCEDOWNLOAD=1 ;;
127
131
h) SHOWHELP=1 ;;
@@ -411,6 +415,14 @@ if [ "$DISTRO" = 'Ubuntu' ]; then
411
415
in_chroot " ln -s /bin/true /sbin/initctl"
412
416
fi
413
417
418
+ # Use the repositories from the host
419
+ if [ -n " $HOSTLISTS " ]; then
420
+ for files in ' sources.list' ' sources.list.d' ' keyrings' ' trusted.gpg.d' ; do
421
+ cp -r " /etc/apt/${files} " " $CHROOTDIR /etc/apt/"
422
+ done
423
+ in_chroot " apt-get update && apt-get install ca-certificates"
424
+ fi
425
+
414
426
# Add additional repository lists to the chroot for upstream repos
415
427
if [ -n " $REPOLISTS " ]; then
416
428
in_chroot " apt-get install ca-certificates"
0 commit comments