From 978fdafbffc000a5802c9505ae6ec1565b96871d Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sun, 21 Dec 2008 02:24:39 -0600 Subject: Allow specifying of pacman.conf file in mkarchiso Use the -C flag to allow us to build alternate isos on a different architecture and things of the sort Signed-off-by: Aaron Griffin --- archiso/mkarchiso | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'archiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 9a27cb5..3e54b5b 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -3,6 +3,7 @@ PKGLIST="" QUIET="y" FORCE="n" +PACCONFIG="/etc/pacman.conf" APPNAME=$(basename "${0}") @@ -13,6 +14,7 @@ usage () echo " general options:" echo " -f Force overwrite of working files/squashfs image/bootable image" echo " -p PACKAGE(S) Additional package(s) to install, can be used multiple times" + echo " -C Config file for pacman. Default $PACCONFIG" echo " -v Enable verbose output." echo " -h This message." echo " commands:" @@ -29,6 +31,7 @@ usage () while getopts 'i:P:p:a:t:fvh' arg; do case "${arg}" in p) PKGLIST="${PKGLIST} ${OPTARG}" ;; + C) PACCONFIG="${OPTARG}" ;; f) FORCE="y" ;; v) QUIET="n" ;; h|?) usage 0 ;; @@ -47,6 +50,11 @@ if [ "$EUID" != "0" ]; then exit 1 fi +if [ ! -f "$PACCONFIG" ]; then + echo "error: pacman config file '$PACCONFIG' does not exist" + exit 1 +fi + command_name="${1}" work_dir="" imgname="" @@ -70,10 +78,10 @@ _pacman () { local ret if [ "${QUIET}" = "y" ]; then - mkarchroot -f "${work_dir}/root-image" $* 2>&1 >/dev/null + mkarchroot -C "$PACCONFIG" -f "${work_dir}/root-image" $* 2>&1 >/dev/null ret=$? else - mkarchroot -f "${work_dir}/root-image" $* + mkarchroot -C "$PACCONFIG" -f "${work_dir}/root-image" $* ret=$? fi -- cgit v1.2.3-70-g09d2