Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chroot host option astana #2680

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion misc-tools/dj_make_chroot.in
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ Options:
to add to the chroot (comma separated). Signing keys for the
repository will be imported if they exist as <filename>.gpg,
<filename>.asc or <filename>.arm.
-H Use repository lists from the host. Useful to make sure
compiler/runner versions will be the same when using a custom
image.
-p <url> HTTP(S) Proxy URL to use during package install.
-m <url> Debian or Ubuntu mirror URL to be used for package installation.
-y Force overwriting the chroot dir and installing debootstrap.
Expand Down Expand Up @@ -110,7 +113,7 @@ FORCEYES=0
FORCEDOWNLOAD=0

# Read command-line parameters:
while getopts 'a:d:D:R:i:r:l:s:p:m:yfh' OPT ; do
while getopts 'a:d:D:R:i:r:l:s:p:m:Hyfh' OPT ; do
case $OPT in
a) ARCH=$OPTARG ;;
d) CHROOTDIR=$OPTARG ;;
Expand All @@ -122,6 +125,7 @@ while getopts 'a:d:D:R:i:r:l:s:p:m:yfh' OPT ; do
s) REPOLISTS=$OPTARG ;;
p) DEBPROXY=$OPTARG ;;
m) DEBMIRROR=$OPTARG ;;
H) HOSTLISTS=1 ;;
y) FORCEYES=1 ;;
f) FORCEDOWNLOAD=1 ;;
h) SHOWHELP=1 ;;
Expand Down Expand Up @@ -411,6 +415,14 @@ if [ "$DISTRO" = 'Ubuntu' ]; then
in_chroot "ln -s /bin/true /sbin/initctl"
fi

# Use the repositories from the host
if [ -n "$HOSTLISTS" ]; then
for files in 'sources.list' 'sources.list.d' 'keyrings' 'trusted.gpg.d'; do
cp -r "/etc/apt/${files}" "$CHROOTDIR/etc/apt/"
done
in_chroot "apt-get update && apt-get install ca-certificates"
fi

# Add additional repository lists to the chroot for upstream repos
if [ -n "$REPOLISTS" ]; then
in_chroot "apt-get install ca-certificates"
Expand Down
Loading