diff options
Diffstat (limited to 'archiso/mkarchiso')
-rwxr-xr-x | archiso/mkarchiso | 12 |
1 files changed, 10 insertions, 2 deletions
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 <file> 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 |