From ef89b8a29f84db65cdd8fbcf0049911cd80ed5a2 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 14 Oct 2007 22:07:19 -0500 Subject: Make mkarchiso a bit more KISS Remove the need for a configuration file. Some of the command line options had to be switched up a bit in order to do this. Also simplify the package list- only one package list is needed, not a directory, and additional packages can be specified on the command line. Signed-off-by: Dan McGee --- mkarchiso | 57 +++++++++++++++++---------------------------------------- 1 file changed, 17 insertions(+), 40 deletions(-) (limited to 'mkarchiso') diff --git a/mkarchiso b/mkarchiso index 5ca511e..cb314cb 100755 --- a/mkarchiso +++ b/mkarchiso @@ -1,8 +1,9 @@ #!/bin/sh -CONFIG="$(pwd)/mkarchiso.conf" CPIOCONFIG="$(pwd)/archiso-mkinitcpio.conf" DEF_CONFIG_DIR="$(pwd)/default-config" +PKGFILE="$(pwd)/packages.list" +PKGLIST="" QUIET="y" FORCE="n" @@ -10,8 +11,6 @@ command_name="" work_dir="" isoname="" -PKGDIR="$(pwd)" - APPNAME=$(basename "${0}") # usage: usage @@ -19,12 +18,12 @@ usage () { echo "usage ${APPNAME} [options] command " echo " general options:" - echo " -c CONFIG Use CONFIG file. default: ${CONFIG}" - echo " -i CPIO_CONFIG Use CONFIG file for mkinitcpio. default: ${CPIOCONFIG}" - echo " -p PKGFILE_DIR Look for package list files in DIR. default: ${PKGDIR}" echo " -f Force overwrite of working files/squashfs image/iso" - echo " -v Verbose output. Default: no" - echo " -h This message" + echo " -i CPIO_CONFIG Use CONFIG file for mkinitcpio. default: ${CPIOCONFIG}" + echo " -P PKGFILE File with list of packages to install. default: ${PKGFILE}" + echo " -p PACKAGE Additional package to install, can be used multiple times" + echo " -v Enable verbose output." + echo " -h This message." echo " commands:" echo " install : where to build the ISO root" echo " squash : generate a squashfs image of the ISO root" @@ -33,11 +32,11 @@ usage () exit $1 } -while getopts 'c:i:p:fvh' arg; do +while getopts 'i:P:p:fvh' arg; do case "${arg}" in - c) CONFIG="${OPTARG}" ;; i) CPIOCONFIG="${OPTARG}" ;; - p) PKGDIR="${OPTARG}" ;; + P) PKGFILE="${OPTARG}" ;; + p) PKGLIST="${PKGLIST} ${OPTARG}" ;; f) FORCE="y" ;; v) QUIET="n" ;; h|?) usage 0 ;; @@ -67,15 +66,6 @@ esac [ "x${work_dir}" = "x" ] && (echo "please specify a working directory" && usage 1) -#TODO - do we even need a config file? -if [ -e "${CONFIG}" ]; then - source "${CONFIG}" -else - echo "error: Config '${CONFIG}' does not exist, aborting." - exit 1 -fi - -# {{{ Build isoroot="${work_dir}/iso" instroot="${work_dir}/install" @@ -107,7 +97,6 @@ install_pkgfile () if [ -e "${1}" ]; then toinstall="" while read pkg; do - echo $ignorepkgs | grep "\<$pkg\>" >/dev/null 2>&1 && continue toinstall="${toinstall} ${pkg}" done < ${1} _pacman "${toinstall}" @@ -130,30 +119,18 @@ if [ "${command_name}" = "install" -o "${command_name}" = "all" ]; then mkdir -p "${instroot}" echo "Installing packages..." - for pkgfile in ${package_files}; do - echo " Installing packages from '$pkgfile'" - install_pkgfile "${PKGDIR}/$pkgfile.packages" - done - for pkg in ${additional_packages}; do + echo " Installing packages from '${PKGFILE}'" + install_pkgfile "${PKGFILE}" + + for pkg in ${PKGLIST}; do echo " Installing package '${pkg}'" _pacman "${pkg}" done - echo "Installing kernel '${kernelpkg}'" - if ! _pacman "${kernelpkg}" ; then - echo "error: pacman failed to install '${kernelpkg}', aborting." - exit 1 - fi + echo "Updating kernel module dependancies" kernelver=$(_kversion) - kernelsuffix=${kernelver##*-} - echo "Kernel Version ${kernelver} (${kernelsuffix}) installed - installing modules..." - if [ -e "${PKGDIR}/${kernelsuffix}.modules" ]; then - install_pkgfile "${PKGDIR}/${kernelsuffix}.modules" - fi - - echo "Updating module dependancies" - [ "${kernelsuffix}" = "ARCH" ] && kernelsuffix="" - depmod -a -b "${instroot}" -v "${kernelver}" -F "${instroot}/boot/System.map26${kernelsuffix}" >/dev/null + depmod -a -b "${instroot}" -v "${kernelver}" -F "${instroot}/boot/System.map26" >/dev/null + # remove the initcpio images that were generated for the host system find "${instroot}/boot" -name *.img -delete echo "Applying default configuration for the Arch ISO" -- cgit v1.2.3-70-g09d2