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 <aaronmgriffin@gmail.com>
This commit is contained in:
parent
4c3572f415
commit
978fdafbff
@ -3,6 +3,7 @@
|
|||||||
PKGLIST=""
|
PKGLIST=""
|
||||||
QUIET="y"
|
QUIET="y"
|
||||||
FORCE="n"
|
FORCE="n"
|
||||||
|
PACCONFIG="/etc/pacman.conf"
|
||||||
|
|
||||||
APPNAME=$(basename "${0}")
|
APPNAME=$(basename "${0}")
|
||||||
|
|
||||||
@ -13,6 +14,7 @@ usage ()
|
|||||||
echo " general options:"
|
echo " general options:"
|
||||||
echo " -f Force overwrite of working files/squashfs image/bootable image"
|
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 " -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 " -v Enable verbose output."
|
||||||
echo " -h This message."
|
echo " -h This message."
|
||||||
echo " commands:"
|
echo " commands:"
|
||||||
@ -29,6 +31,7 @@ usage ()
|
|||||||
while getopts 'i:P:p:a:t:fvh' arg; do
|
while getopts 'i:P:p:a:t:fvh' arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
p) PKGLIST="${PKGLIST} ${OPTARG}" ;;
|
p) PKGLIST="${PKGLIST} ${OPTARG}" ;;
|
||||||
|
C) PACCONFIG="${OPTARG}" ;;
|
||||||
f) FORCE="y" ;;
|
f) FORCE="y" ;;
|
||||||
v) QUIET="n" ;;
|
v) QUIET="n" ;;
|
||||||
h|?) usage 0 ;;
|
h|?) usage 0 ;;
|
||||||
@ -47,6 +50,11 @@ if [ "$EUID" != "0" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$PACCONFIG" ]; then
|
||||||
|
echo "error: pacman config file '$PACCONFIG' does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
command_name="${1}"
|
command_name="${1}"
|
||||||
work_dir=""
|
work_dir=""
|
||||||
imgname=""
|
imgname=""
|
||||||
@ -70,10 +78,10 @@ _pacman ()
|
|||||||
{
|
{
|
||||||
local ret
|
local ret
|
||||||
if [ "${QUIET}" = "y" ]; then
|
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=$?
|
ret=$?
|
||||||
else
|
else
|
||||||
mkarchroot -f "${work_dir}/root-image" $*
|
mkarchroot -C "$PACCONFIG" -f "${work_dir}/root-image" $*
|
||||||
ret=$?
|
ret=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user