Ported rest of scripts for use by linux-template-builder
This commit is contained in:
parent
cd96dcb95a
commit
c97f16d5ba
10 changed files with 95 additions and 206 deletions
43
scripts/02_install_groups.sh
Executable file
43
scripts/02_install_groups.sh
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash -e
|
||||
# vim: set ts=4 sw=4 sts=4 et :
|
||||
### 02_install_groups.sh : Install specified additional packages into chroot
|
||||
echo "--> Alpine Linux 02_install_groups.sh"
|
||||
|
||||
set -e
|
||||
if [ "${VERBOSE:-0}" -ge 2 ] || [ "${DEBUG:-0}" -eq 1 ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [ -n "$TEMPLATE_FLAVOR" ]; then
|
||||
PKGLISTFILE="${TEMPLATE_CONTENT_DIR}/packages_${TEMPLATE_FLAVOR}.list"
|
||||
if ! [ -r "$PKGLISTFILE" ]; then
|
||||
echo "ERROR: PKGLISTFILE '${PKGLISTFILE}' does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
PKGLISTFILE="${TEMPLATE_CONTENT_DIR}/packages.list"
|
||||
fi
|
||||
|
||||
# Strip comments, then convert newlines to single spaces
|
||||
PKGGROUPS="$(sed '/^ *#/d; s/ *#.*//' "${PKGLISTFILE}" | sed ':a;N;$!ba; s/\n/ /g; s/ */ /g')"
|
||||
|
||||
APKTOOLS_CACHE_DIR="${CACHE_DIR}/apk_cache"
|
||||
export APKTOOLS_CACHE_DIR
|
||||
|
||||
ln -sf ../../var/cache/apk $INSTALLDIR/etc/apk/cache
|
||||
|
||||
echo " --> Enabling main and community repos..."
|
||||
su -c "echo 'https://dl-cdn.alpinelinux.org/alpine/v3.18/main' > $INSTALLDIR/etc/apk/repositories"
|
||||
su -c "echo 'https://dl-cdn.alpinelinux.org/alpine/v3.18/community' >> $INSTALLDIR/etc/apk/repositories"
|
||||
|
||||
echo " --> Synchronize resolv.conf..."
|
||||
cp /etc/resolv.conf "${INSTALL_DIR}/etc/resolv.conf"
|
||||
|
||||
echo " --> Updating installed packages..."
|
||||
"${TEMPLATE_CONTENT_DIR}/alpine-chroot" "$INSTALL_DIR" /bin/sh -c \
|
||||
"apk update; apk upgrade"
|
||||
|
||||
echo " --> Installing Alpine Linux package groups..."
|
||||
echo " --> Selected packages: ${PKGGROUPS}"
|
||||
"${TEMPLATE_CONTENT_DIR}/alpine-chroot" "$INSTALL_DIR" /bin/sh -c \
|
||||
"apk add ${PKGGROUPS}"
|
Loading…
Add table
Add a link
Reference in a new issue