mkrootfs: use built-in void pubkey; assign default void repo if -r unset.

This commit is contained in:
Juan RP 2014-06-25 08:23:37 +02:00
parent ddbf495c4c
commit f2e9e4f27a
1 changed files with 3 additions and 11 deletions

View File

@ -26,7 +26,6 @@
readonly PROGNAME=$(basename $0)
readonly ARCH=$(uname -m)
readonly VOIDRSAPUBKEY="60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d"
trap 'die "Interrupted! exiting..."' INT TERM HUP
@ -53,7 +52,6 @@ Options
-c <dir> Set XBPS cache directory (defaults to /var/cache/xbps)
-C <file> Full path to the XBPS configuration file
-h Show this help
-k <dir> Full path to a directory with the XBPS RSA public keys for repositories
-p <pkgs> Additional packages to install into the rootfs (separated by blanks)
-r <repo> Set XBPS repository (may be set multiple times)
-V Show version
@ -100,18 +98,18 @@ register_binfmt() {
esac
}
: ${XBPS_REPOSITORY:=--repository=http://repo.voidlinux.eu/current}
: ${XBPS_CACHEDIR:=--cachedir=/var/cache/xbps}
: ${PKGBASE:=base-system}
#
# main()
#
while getopts "b:C:c:hk:p:r:V" opt; do
while getopts "b:C:c:hp:r:V" opt; do
case $opt in
b) PKGBASE="$OPTARG";;
C) XBPS_CONFFILE="-C $OPTARG";;
c) XBPS_CACHEDIR="--cachedir=$OPTARG";;
h) usage; exit 0;;
k) KEYSDIR="$OPTARG";;
p) EXTRA_PKGS="$OPTARG";;
r) XBPS_REPOSITORY="--repository=$OPTARG $XBPS_REPOSITORY";;
V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0;;
@ -146,18 +144,12 @@ for f in chroot tar xbps-install xbps-reconfigure xbps-query; do
fi
done
if [ -z "$KEYSDIR" ]; then
KEYSDIR="/var/db/xbps/keys" # use void default
fi
#
# Check if package base-system is available.
#
rootfs=$(mktemp -d || die "FATAL: failed to create tempdir, exiting...")
if [ ! -f "$KEYSDIR/${VOIDRSAPUBKEY}.plist" ]; then
die "cannot find xbps keys to install binary packages, exiting."
fi
mkdir -p $rootfs/var/db/xbps/keys
cp $KEYSDIR/${VOIDRSAPUBKEY}.plist $rootfs/var/db/xbps/keys
cp keys/*.plist $rootfs/var/db/xbps/keys
run_cmd_target "xbps-install -S $XBPS_CONFFILE $XBPS_CACHEDIR $XBPS_REPOSITORY -r $rootfs"
run_cmd_target "xbps-query -R -r $rootfs $XBPS_CONFFILE $XBPS_CACHEDIR $XBPS_REPOSITORY -ppkgver $PKGBASE"