diff -ur --exclude .svn --exclude upload.sh --exclude diff.sh gnap-2.0+cleanup+split/src/gnap_make gnap-2.0+cleanup+split+namespace/src/gnap_make --- gnap-2.0+cleanup+split/src/gnap_make 2007-08-02 15:54:29.000000000 +0300 +++ gnap-2.0+cleanup+split+namespace/src/gnap_make 2007-08-02 15:50:45.000000000 +0300 @@ -1,9 +1,9 @@ #!/bin/bash -GNAPVERSION='2.0' +VERSION='2.0' -GNAPLIBDIR='/usr/lib/gnap' -source ${GNAPLIBDIR}/gnap_shared.sh -echo "GNAP Core Building tool ${GNAPNAME} version ${GNAPVERSION}" +GNAP_LIBDIR='/usr/lib/gnap' +source ${GNAP_LIBDIR}/gnap_shared.sh +echo "GNAP Core Building tool ${NAME} version ${VERSION}" usage() { echo 'Options:' @@ -17,7 +17,7 @@ echo ' -c catalyst.conf Use specific catalyst.conf file' echo ' -e specs Specs directory or tar.bz2 file' echo - echo "Please use man ${GNAPNAME} for more details." + echo "Please use man ${NAME} for more details." } if [[ "$#" -eq 0 ]]; then @@ -28,58 +28,64 @@ gbegin 'Checking parameters' # Catalyst executable and config file -CATALYST_BIN="/usr/bin/catalyst" -CATALYST_CONF="/etc/catalyst/catalyst.conf" +GNAP_CATALYST_BIN="/usr/bin/catalyst" +GNAP_CATALYST_CONF="/etc/catalyst/catalyst.conf" # Read options +GNAP_STAGE3=0 +GNAP_LIVECD1=0 +GNAP_LIVECD2=0 +GNAP_TARBALL=0 +GNAP_MODULES=0 +GNAP_STAMP=$(date +%Y%m%d) NOTARGET=1 -STAMP=$(date +%Y%m%d) +NEEDS_SNAPSHOT=0 while getopts ':hs:p:m:o:v:t:fl:c:e:' option; do case ${option} in h ) usage exit 0;; - s ) STAGE3FILE="${OPTARG}";; - p ) SNAPSHOTFILE="${OPTARG}";; - o ) PORTAGE_OVERLAYS="${PORTAGE_OVERLAYS} ${OPTARG}";; - v ) STAMP="${OPTARG}";; + s ) GNAP_STAGE3FILE="${OPTARG}";; + p ) GNAP_SNAPSHOTFILE="${OPTARG}";; + o ) GNAP_PORTAGE_OVERLAYS="${GNAP_PORTAGE_OVERLAYS} ${OPTARG}";; + v ) GNAP_STAMP="${OPTARG}";; t ) case "${OPTARG}" in all ) - STAGE3=1 - LIVECD1=1 - LIVECD2=1 - TARBALL=1 - MODULES=1 + GNAP_STAGE3=1 + GNAP_LIVECD1=1 + GNAP_LIVECD2=1 + GNAP_TARBALL=1 + GNAP_MODULES=1 NEEDS_SNAPSHOT=1;; stage3 ) - STAGE3=1 + GNAP_STAGE3=1 NEEDS_SNAPSHOT=1;; livecd-stage1 ) - LIVECD1=1 + GNAP_LIVECD1=1 NEEDS_SNAPSHOT=1;; livecd-stage2 ) - LIVECD2=1 + GNAP_LIVECD2=1 NEEDS_SNAPSHOT=1;; tarball ) - TARBALL=1;; + GNAP_TARBALL=1;; extensions ) - MODULES=1 + GNAP_MODULES=1 NEEDS_SNAPSHOT=1;; * ) gtest 1 'Specified stage is unknown!';; esac NOTARGET=0;; - f ) FORCEYES=1;; - l ) GNAPLOGPREFIX="${OPTARG}";; - c ) CATALYST_CONF="${OPTARG}";; - e ) SPECS="${OPTARG}";; + f ) GNAP_FORCEYES=1;; + l ) GNAP_LOGPREFIX="${OPTARG}";; + c ) GNAP_CATALYST_CONF="${OPTARG}";; + e ) GNAP_SPECS="${OPTARG}";; * ) gtest 1 'Specified options are incomplete or unknown!';; esac done # Root is needed test "${EUID}" -eq 0 -gtest continued $? "You need to be root to run ${GNAPNAME}" +gtest continued $? "You need to be root to run ${NAME}" # Setting up temporary directory TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX) @@ -87,15 +93,15 @@ # Prepare specs dir and check common.conf file SPECDIR="${TEMPDIR}/specs" -if [[ -f "${SPECS}" ]]; then +if [[ -f "${GNAP_SPECS}" ]]; then gmkdir "${SPECDIR}" - tar jx -f "${SPECS}" -C "${SPECDIR}" + tar jx -f "${GNAP_SPECS}" -C "${SPECDIR}" gtest continued $? 'Failed to unpack specs' -elif [[ -d "${SPECS}" ]]; then - cp -rp "${SPECS}" "${SPECDIR}" +elif [[ -d "${GNAP_SPECS}" ]]; then + cp -rp "${GNAP_SPECS}" "${SPECDIR}" gtest continued $? 'Failed to copy specs directory contents' else - gtest continued 1 "${SPECS} not found, provide a valid -e option" + gtest continued 1 "${GNAP_SPECS} not found, provide a valid -e option" fi test -f "${SPECDIR}/common.conf" gtest continued $? "Incorrect specdir: ${SPECDIR}/common.conf not found!" @@ -108,9 +114,9 @@ fi # catalyst.conf file -test -f "${CATALYST_CONF}" -gtest continued $? "${CATALYST_CONF} file not found!" -source "${CATALYST_CONF}" +test -f "${GNAP_CATALYST_CONF}" +gtest continued $? "${GNAP_CATALYST_CONF} file not found!" +source "${GNAP_CATALYST_CONF}" # At least one target is needed test "${NOTARGET}" -eq 0 @@ -121,76 +127,76 @@ gmkdir "${storedir}" # Stage3 needs a seed stage -if [[ "${STAGE3}" -eq 1 ]]; then - test -f "${STAGE3FILE}" +if [[ "${GNAP_STAGE3}" -eq 1 ]]; then + test -f "${GNAP_STAGE3FILE}" gtest continued $? 'The "-s" option needs to designate a valid seed stage' fi # Snapshot must exist if a stage is selected if [[ "${NEEDS_SNAPSHOT}" -eq 1 ]]; then - test -f "${SNAPSHOTFILE}" - gtest continued $? "Can't find ${SNAPSHOTFILE}" + test -f "${GNAP_SNAPSHOTFILE}" + gtest continued $? "Can't find ${GNAP_SNAPSHOTFILE}" fi # Seed stage if needed must be an existing file -if [[ "${STAGE3}" -eq 1 ]]; then - test -f "${STAGE3FILE}" - gtest continued $? "${STAGE3FILE} is not a valid stage3 tarball" +if [[ "${GNAP_STAGE3}" -eq 1 ]]; then + test -f "${GNAP_STAGE3FILE}" + gtest continued $? "${GNAP_STAGE3FILE} is not a valid stage3 tarball" fi # If extensions and no stage3, warn that we'll use seedstage as stage3 -STAGE3LOC="${storedir}/builds/${RELTYPE}/stage3-${SUBARCH}-${STAMP}.tar.bz2" -if [[ "${MODULES}" -eq 1 || "${LIVECD1}" -eq 1 ]]; then - if [[ "${STAGE3}" -ne 1 && ! -f "${STAGE3LOC}" ]]; then +STAGE3LOC="${storedir}/builds/${RELTYPE}/stage3-${SUBARCH}-${GNAP_STAMP}.tar.bz2" +if [[ "${GNAP_MODULES}" -eq 1 || "${GNAP_LIVECD1}" -eq 1 ]]; then + if [[ "${GNAP_STAGE3}" -ne 1 && ! -f "${STAGE3LOC}" ]]; then gwarn '"livecd-stage1" or "extensions" was selected without "stage3".' gconfirm 'Should I use the seed stage as stage3 result?' gmkdir "${storedir}/builds/${RELTYPE}" - cp "${STAGE3FILE}" "${STAGE3LOC}" + cp "${GNAP_STAGE3FILE}" "${STAGE3LOC}" fi fi # Explain what will get built -if [[ "${STAGE3}" -eq 1 ]]; then +if [[ "${GNAP_STAGE3}" -eq 1 ]]; then TARGETLIST='[stage3] ' fi -if [[ "${LIVECD1}" -eq 1 ]]; then +if [[ "${GNAP_LIVECD1}" -eq 1 ]]; then TARGETLIST="${TARGETLIST}[livecd-stage1] " fi -if [[ "${LIVECD2}" -eq 1 ]]; then +if [[ "${GNAP_LIVECD2}" -eq 1 ]]; then TARGETLIST="${TARGETLIST}[livecd-stage2] " fi -if [[ "${TARBALL}" -eq 1 ]]; then +if [[ "${GNAP_TARBALL}" -eq 1 ]]; then TARGETLIST="${TARGETLIST}[tarball] " fi -if [[ "${MODULES}" -eq 1 ]]; then +if [[ "${GNAP_MODULES}" -eq 1 ]]; then TARGETLIST="${TARGETLIST}[extensions]" fi ginfo 'The following targets will be called:' ginfo "${TARGETLIST}" # Confirm tarball overwrite if TARBALL stage selected -if [[ "${TARBALL}" -eq 1 && -e "gnap-${GNAPVERSION}-${STAMP}.tar" ]]; then - gconfirm "gnap-${GNAPVERSION}-${STAMP}.tar already exists, overwrite" +if [[ "${GNAP_TARBALL}" -eq 1 && -e "gnap-${VERSION}-${GNAP_STAMP}.tar" ]]; then + gconfirm "gnap-${VERSION}-${GNAP_STAMP}.tar already exists, overwrite" fi # Logfile setup and confirmation -if [[ -z "$GNAPLOGPREFIX" ]]; then - GNAPLOGPREFIX="./${GNAPNAME}-${STAMP}" +if [[ -z "$GNAP_LOGPREFIX" ]]; then + GNAP_LOGPREFIX="./${NAME}-${GNAP_STAMP}" fi -if [[ -f "${GNAPLOGPREFIX}.out" || -f "${GNAPLOGPREFIX}.err" ]]; then - if [[ "${FORCEYES}" -ne 1 ]]; then +if [[ -f "${GNAP_LOGPREFIX}.out" || -f "${GNAP_LOGPREFIX}.err" ]]; then + if [[ "${GNAP_FORCEYES}" -ne 1 ]]; then read -ep \ " ${W}*${N} Logfile(s) already exists. Append/Overwrite [A]: " \ answer if [[ "${answer}" == 'o' || "${answer}" == 'O' ]]; then - rm "${GNAPLOGPREFIX}.out" "${GNAPLOGPREFIX}.err" + rm "${GNAP_LOGPREFIX}.out" "${GNAP_LOGPREFIX}.err" fi fi fi -touch "${GNAPLOGPREFIX}.out" -touch "${GNAPLOGPREFIX}.err" -SEELOGFILES="see ${GNAPLOGPREFIX}.err and .out for details" +touch "${GNAP_LOGPREFIX}.out" +touch "${GNAP_LOGPREFIX}.err" +SEELOGFILES="see ${GNAP_LOGPREFIX}.err and .out for details" # Snapshot preparation if [[ "${NEEDS_SNAPSHOT}" -eq 1 ]]; then @@ -198,34 +204,34 @@ gmkdir "${storedir}/snapshots" - if [[ -z "${PORTAGE_OVERLAYS}" ]]; then - cp "${SNAPSHOTFILE}" "${storedir}/snapshots/portage-${STAMP}.tar.bz2" + if [[ -z "${GNAP_PORTAGE_OVERLAYS}" ]]; then + cp "${GNAP_SNAPSHOTFILE}" "${storedir}/snapshots/portage-${GNAP_STAMP}.tar.bz2" gtest $? "Snapshot preparation failed, ${SEELOGFILES}" else TEMPPRTDIR="${TEMPDIR}/portage" gmkdir "${TEMPPRTDIR}" - tar jxf "${SNAPSHOTFILE}" -C "${TEMPPRTDIR}" \ - >> "${GNAPLOGPREFIX}.out" 2>> "${GNAPLOGPREFIX}.err" + tar jxf "${GNAP_SNAPSHOTFILE}" -C "${TEMPPRTDIR}" \ + >> "${GNAP_LOGPREFIX}.out" 2>> "${GNAP_LOGPREFIX}.err" - for overlay in ${PORTAGE_OVERLAYS} ; do + for overlay in ${GNAP_PORTAGE_OVERLAYS} ; do cp -rp ${overlay}/* "${TEMPPRTDIR}/portage" gtest continued $? "Failed to copy ${overlay}" done - tar jcf "${storedir}/snapshots/portage-${STAMP}.tar.bz2" \ + tar jcf "${storedir}/snapshots/portage-${GNAP_STAMP}.tar.bz2" \ -C "${TEMPPRTDIR}" . \ - >> "${GNAPLOGPREFIX}.out" 2>> "${GNAPLOGPREFIX}.err" + >> "${GNAP_LOGPREFIX}.out" 2>> "${GNAP_LOGPREFIX}.err" gtest $? "Snapshot preparation failed, ${SEELOGFILES}" fi fi # Stage3 phase -if [[ "${STAGE3}" -eq 1 ]]; then +if [[ "${GNAP_STAGE3}" -eq 1 ]]; then gbegin "${G}[stage3]${N} stage (base system build)" gmkdir "${storedir}/builds/${RELTYPE}" - cp "${STAGE3FILE}" "${storedir}/builds/${RELTYPE}/seedstage.tar.bz2" + cp "${GNAP_STAGE3FILE}" "${storedir}/builds/${RELTYPE}/seedstage.tar.bz2" TEMPCONF="${TEMPDIR}/stage3.conf" touch "${TEMPCONF}" @@ -235,20 +241,20 @@ ${DISTCCSPEC} subarch: ${SUBARCH} rel_type: ${RELTYPE} -snapshot: ${STAMP} -version_stamp: ${STAMP} +snapshot: ${GNAP_STAMP} +version_stamp: ${GNAP_STAMP} profile: ${PROFILE} source_subpath: ${RELTYPE}/seedstage portage_confdir: ${SPECDIR}/portage_confdir EOF - $CATALYST_BIN -c "${CATALYST_CONF}" -f "${TEMPCONF}" \ - >> "${GNAPLOGPREFIX}.out" 2>> "${GNAPLOGPREFIX}.err" + $GNAP_CATALYST_BIN -c "${GNAP_CATALYST_CONF}" -f "${TEMPCONF}" \ + >> "${GNAP_LOGPREFIX}.out" 2>> "${GNAP_LOGPREFIX}.err" gtest $? "[stage3] failed, ${SEELOGFILES}" rm "${storedir}/builds/${RELTYPE}/seedstage.tar.bz2" fi # LIVECD-STAGE1 phase -if [[ "${LIVECD1}" -eq 1 ]]; then +if [[ "${GNAP_LIVECD1}" -eq 1 ]]; then gbegin "${G}[livecd-stage1]${N} stage (GNAP-specific packages build)" TEMPCONF="${TEMPDIR}/livecd-stage1.conf" touch "${TEMPCONF}" @@ -258,21 +264,21 @@ ${DISTCCSPEC} subarch: ${SUBARCH} rel_type: ${RELTYPE} -snapshot: ${STAMP} -version_stamp: ${STAMP} +snapshot: ${GNAP_STAMP} +version_stamp: ${GNAP_STAMP} profile: ${PROFILE} -source_subpath: ${RELTYPE}/stage3-${SUBARCH}-${STAMP} +source_subpath: ${RELTYPE}/stage3-${SUBARCH}-${GNAP_STAMP} portage_confdir: ${SPECDIR}/portage_confdir EOF cat "${SPECDIR}/packages.conf" >> "${TEMPCONF}" - $CATALYST_BIN -c "${CATALYST_CONF}" -f "${TEMPCONF}" \ - >> "${GNAPLOGPREFIX}.out" 2>> "${GNAPLOGPREFIX}.err" + $GNAP_CATALYST_BIN -c "${GNAP_CATALYST_CONF}" -f "${TEMPCONF}" \ + >> "${GNAP_LOGPREFIX}.out" 2>> "${GNAP_LOGPREFIX}.err" gtest $? "[livecd-stage1] failed, ${SEELOGFILES}" fi # LIVECD-STAGE2 phase -if [[ "${LIVECD2}" -eq 1 ]]; then +if [[ "${GNAP_LIVECD2}" -eq 1 ]]; then gbegin "${G}[livecd-stage2]${N} stage (kernel and LiveCD builds)" TEMPCONF="${TEMPDIR}/livecd-stage2.conf" touch "${TEMPCONF}" @@ -282,30 +288,30 @@ ${DISTCCSPEC} subarch: ${SUBARCH} rel_type: ${RELTYPE} -snapshot: ${STAMP} -version_stamp: ${STAMP} +snapshot: ${GNAP_STAMP} +version_stamp: ${GNAP_STAMP} profile: ${PROFILE} -source_subpath: ${RELTYPE}/livecd-stage1-${SUBARCH}-${STAMP} +source_subpath: ${RELTYPE}/livecd-stage1-${SUBARCH}-${GNAP_STAMP} boot/kernel/gentoo/sources: ${KERNEL_SOURCES} boot/kernel/gentoo/config: ${SPECDIR}/kernel.config -boot/kernel/gentoo/extraversion: GNAP-${GNAPVERSION} -livecd/iso: gnap-${GNAPVERSION}-${STAMP}.iso +boot/kernel/gentoo/extraversion: GNAP-${VERSION} +livecd/iso: gnap-${VERSION}-${GNAP_STAMP}.iso livecd/fsscript: ${SPECDIR}/fsscript livecd/root_overlay: ${SPECDIR}/root_overlay EOF cat "${SPECDIR}/livecd.conf" >> "${TEMPCONF}" - $CATALYST_BIN -c "${CATALYST_CONF}" -f "${TEMPCONF}" \ - >> "${GNAPLOGPREFIX}.out" 2>> "${GNAPLOGPREFIX}.err" + $GNAP_CATALYST_BIN -c "${GNAP_CATALYST_CONF}" -f "${TEMPCONF}" \ + >> "${GNAP_LOGPREFIX}.out" 2>> "${GNAP_LOGPREFIX}.err" gtest $? "[livecd-stage2] failed, ${SEELOGFILES}" fi # TARBALL phase -if [[ "${TARBALL}" -eq 1 ]]; then +if [[ "${GNAP_TARBALL}" -eq 1 ]]; then gbegin "${G}[tarball]${N} phase (Creation of core and basefs components)" - test -e "gnap-${GNAPVERSION}-${STAMP}.iso" - gtest continued $? "No gnap-${GNAPVERSION}-${STAMP}.iso file to convert !" - test -d "${storedir}/tmp/gnap/livecd-stage1-${SUBARCH}-${STAMP}" + test -e "gnap-${VERSION}-${GNAP_STAMP}.iso" + gtest continued $? "No gnap-${VERSION}-${GNAP_STAMP}.iso file to convert !" + test -d "${storedir}/tmp/gnap/livecd-stage1-${SUBARCH}-${GNAP_STAMP}" gtest $? 'Missing livecd-stage2 results' gbegin ' Creating core component' @@ -314,7 +320,7 @@ TEMPISODIR="${TEMPDIR}/iso" gmkdir "${TEMPISODIR}" - mount -o loop "gnap-${GNAPVERSION}-${STAMP}.iso" ${TEMPMNTDIR} && \ + mount -o loop "gnap-${VERSION}-${GNAP_STAMP}.iso" ${TEMPMNTDIR} && \ cp -r ${TEMPMNTDIR}/* ${TEMPISODIR} gtest continued $? 'Failed to mount ISO and copy files' umount "${TEMPMNTDIR}" @@ -324,23 +330,23 @@ cp "${SPECDIR}/isolinux/syslinux.cfg" ${TEMPISODIR}/ cp "${SPECDIR}/isolinux/boot.msg" ${TEMPISODIR}/isolinux/ DATE=$(date --utc) - echo "GNAP-${GNAPVERSION}-${STAMP} built on ${DATE}" \ + echo "GNAP-${VERSION}-${GNAP_STAMP} built on ${DATE}" \ >> "${TEMPISODIR}/isolinux/boot.msg" - tar cf "gnap-${GNAPVERSION}-${STAMP}.tar" -C "${TEMPISODIR}" . + tar cf "gnap-${VERSION}-${GNAP_STAMP}.tar" -C "${TEMPISODIR}" . gtest $? 'Failed to create tarball' - rm "gnap-${GNAPVERSION}-${STAMP}.iso" + rm "gnap-${VERSION}-${GNAP_STAMP}.iso" gbegin ' Creating basefs component' - tar jcf "gnap-basefs-${GNAPVERSION}-${STAMP}.tar.bz2" \ - -C "${storedir}/tmp/gnap/livecd-stage2-${SUBARCH}-${STAMP}" . + tar jcf "gnap-basefs-${VERSION}-${GNAP_STAMP}.tar.bz2" \ + -C "${storedir}/tmp/gnap/livecd-stage2-${SUBARCH}-${GNAP_STAMP}" . gtest $? 'Unable to create basefs tarball' fi # EXTENSIONS phase -if [[ "${MODULES}" -eq 1 ]]; then +if [[ "${GNAP_MODULES}" -eq 1 ]]; then gbegin "${G}[extensions]${N} stage start" - GRP_PREFIX="${storedir}/builds/${RELTYPE}/grp-${SUBARCH}-${STAMP}" + GRP_PREFIX="${storedir}/builds/${RELTYPE}/grp-${SUBARCH}-${GNAP_STAMP}" SPECMODULE="${SPECDIR}/extensions.conf" mod_list=$(grep '^extensions:' "${SPECMODULE}" 2>/dev/null); mod_list="${mod_list/extensions:/}" @@ -362,25 +368,25 @@ ${DISTCCSPEC} subarch: ${SUBARCH} rel_type: ${RELTYPE} -snapshot: ${STAMP} -version_stamp: ${STAMP} +snapshot: ${GNAP_STAMP} +version_stamp: ${GNAP_STAMP} profile: ${PROFILE} -source_subpath: ${RELTYPE}/stage3-${SUBARCH}-${STAMP} +source_subpath: ${RELTYPE}/stage3-${SUBARCH}-${GNAP_STAMP} grp: ${mod_name} grp/use: ${mod_useflags} grp/${mod_name}/type: pkgset grp/${mod_name}/packages: ${mod_packlist} EOF - $CATALYST_BIN -c "${CATALYST_CONF}" -f "${TEMPCONF}" \ - >> "${GNAPLOGPREFIX}.out" 2>> "${GNAPLOGPREFIX}.err" + $GNAP_CATALYST_BIN -c "${GNAP_CATALYST_CONF}" -f "${TEMPCONF}" \ + >> "${GNAP_LOGPREFIX}.out" 2>> "${GNAP_LOGPREFIX}.err" gtest continued $? "Extension build failed, ${SEELOGFILES}" TEMPMODULEDIR="${TEMPDIR}/module_${mod_name}" gmkdir "${TEMPMODULEDIR}" for pkg in $( ls ${GRP_PREFIX}/${mod_name}/All/*.tbz2 ); do tar jxf $pkg -C "${TEMPMODULEDIR}" -p \ - >> "${GNAPLOGPREFIX}.out" 2>> "${GNAPLOGPREFIX}.err" + >> "${GNAP_LOGPREFIX}.out" 2>> "${GNAP_LOGPREFIX}.err" done gtest continued $? 'Failed to unpack extension packages' @@ -392,9 +398,9 @@ rm -rf ${mod_rmlist} gtest continued $? 'Failed to apply extension cleanup instructions' - tar jcf "gnapext_${mod_name}-${STAMP}.tbz2" \ + tar jcf "gnapext_${mod_name}-${GNAP_STAMP}.tbz2" \ -C "${TEMPMODULEDIR}" . \ - >> "${GNAPLOGPREFIX}.out" 2>> "${GNAPLOGPREFIX}.err" + >> "${GNAP_LOGPREFIX}.out" 2>> "${GNAP_LOGPREFIX}.err" gtest $? 'Failed to build extension file' done fi diff -ur --exclude .svn --exclude upload.sh --exclude diff.sh gnap-2.0+cleanup+split/tools/gnap_overlay gnap-2.0+cleanup+split+namespace/tools/gnap_overlay --- gnap-2.0+cleanup+split/tools/gnap_overlay 2007-07-27 16:00:56.000000000 +0300 +++ gnap-2.0+cleanup+split+namespace/tools/gnap_overlay 2007-07-27 16:00:02.000000000 +0300 @@ -1,17 +1,15 @@ #!/bin/bash VERSION='2.0' -GNAPLIBDIR='/usr/lib/gnap' -source ${GNAPLIBDIR}/gnap_shared.sh -echo "GNAP overlay tool ${GNAPNAME} ${VERSION}" - -IMG_SIZE=15 +GNAP_LIBDIR='/usr/lib/gnap' +source ${GNAP_LIBDIR}/gnap_shared.sh +echo "GNAP overlay tool ${NAME} ${VERSION}" usage() { echo echo 'Usage:' - echo " ${GNAPNAME} -i isoname -o overlay [ options ]" - echo " ${GNAPNAME} -d hostdisk -r rootdev -o overlay [ options ]" + echo " ${NAME} -i isoname -o overlay [ options ]" + echo " ${NAME} -d hostdisk -r rootdev -o overlay [ options ]" echo echo 'Common options:' echo ' -o overlay Overlay directory or tbz2 file' @@ -36,7 +34,7 @@ echo ' -S size Size of image file in megabyte' echo ' The disk target options also apply, except -d.' echo - echo "Please use man ${GNAPNAME} for more details." + echo "Please use man ${NAME} for more details." } if [[ "$#" -eq 0 || "${1}" == '-h' ]]; then @@ -47,105 +45,106 @@ gbegin 'Checking parameters' # Read options -NOLOGO=0 -FORCEYES=0 -OUTPUT='' -TYPE='' -CREATE='n' -TARGETROOT='' -CACHE='' -SERIAL='' -BAUDRATE='' +GNAP_NOLOGO=0 +GNAP_FORCEYES=0 +GNAP_OUTPUT='' +GNAP_TYPE='' +GNAP_CREATE='n' +GNAP_IMG_SIZE=15 +GNAP_TARGETROOT='' +GNAP_CACHE='' +GNAP_SERIAL='' +GNAP_BAUDRATE='' while getopts ':hg:o:c:nfi:d:l:r:ms:S:L:' option; do case ${option} in h ) usage exit 0;; - g ) GNAPCORE="${OPTARG}";; - o ) OVERLAYS="${OVERLAYS} ${OPTARG}";; - c ) OVERLAYCONF="${OPTARG}";; - n ) NOLOGO=1;; - f ) FORCEYES=1;; - i ) OUTPUT="${OPTARG}" - TYPE='iso';; - d ) OUTPUT="${OPTARG}" - TYPE='disk';; - l ) OUTPUT="${OPTARG}" - TYPE='image' - CREATE='n';; - L ) OUTPUT="${OPTARG}" - TYPE='image' - CREATE='y';; - S ) IMG_SIZE="${OPTARG}";; - r ) TARGETROOT="${OPTARG}";; - m ) CACHE='docache ';; - s ) SERIAL="console=ttyS0,${OPTARG}n81" - BAUDRATE="${OPTARG}";; + g ) GNAP_CORE="${OPTARG}";; + o ) GNAP_OVERLAYS="${GNAP_OVERLAYS} ${OPTARG}";; + c ) GNAP_OVERLAY_CONF="${OPTARG}";; + n ) GNAP_NOLOGO=1;; + f ) GNAP_FORCEYES=1;; + i ) GNAP_OUTPUT="${OPTARG}" + GNAP_TYPE='iso';; + d ) GNAP_OUTPUT="${OPTARG}" + GNAP_TYPE='disk';; + l ) GNAP_OUTPUT="${OPTARG}" + GNAP_TYPE='image' + GNAP_CREATE='n';; + L ) GNAP_OUTPUT="${OPTARG}" + GNAP_TYPE='image' + GNAP_CREATE='y';; + S ) GNAP_IMG_SIZE="${OPTARG}";; + r ) GNAP_TARGETROOT="${OPTARG}";; + m ) GNAP_CACHE='docache ';; + s ) GNAP_SERIAL="console=ttyS0,${OPTARG}n81" + GNAP_BAUDRATE="${OPTARG}";; * ) gtest 1 'Specified options are incomplete or unknown!';; esac done # Target type (-i or -d) is needed -test -n "${TYPE}" +test -n "${GNAP_TYPE}" gtest continued $? 'Please specify a target (-i or -d option)' # Core file is required -test -f "${GNAPCORE}" +test -f "${GNAP_CORE}" gtest continued $? 'Please specify a valid GNAP core file (-g option)' -case "${TYPE}" in +case "${GNAP_TYPE}" in disk) # if disk type, doublecheck everything is ok - PARENTDEV="${OUTPUT:0:$((${#OUTPUT}-1))}" + PARENTDEV="${GNAP_OUTPUT:0:$((${#GNAP_OUTPUT}-1))}" test -b "${PARENTDEV}" gtest continued $? "${PARENTDEV} device does not exist on this system" - test -b "${OUTPUT}" - gtest continued $? "${OUTPUT} partition does not exist on this system" + test -b "${GNAP_OUTPUT}" + gtest continued $? "${GNAP_OUTPUT} partition does not exist on this system" ;; image) - if [[ "${CREATE}" != 'y' ]]; then + if [[ "${GNAP_CREATE}" != 'y' ]]; then # Check whether image file exists - test -f "${OUTPUT}" - gtest continued $? "Image file ${OUTPUT} does not exist." + test -f "${GNAP_OUTPUT}" + gtest continued $? "Image file ${GNAP_OUTPUT} does not exist." fi ;; esac # At least one overlay is required -test -n "${OVERLAYS}${OVERLAYCONF}" +test -n "${GNAP_OVERLAYS}${GNAP_OVERLAY_CONF}" gtest $? 'Please specify at least an overlay (-o) or config file (-c)' # Warning for disk type targets -if [[ "${TYPE}" == 'disk' ]]; then +if [[ "${GNAP_TYPE}" == 'disk' ]]; then gwarn 'Warning : you have selected disk install' - gwarn "Make sure you are root or have full access to ${OUTPUT}" + gwarn "Make sure you are root or have full access to ${GNAP_OUTPUT}" gwarn "${PARENTDEV} must have an MBR installed, run:" - gwarn "${W}dd if=${GNAPMBR} of=${PARENTDEV} bs=512 count=1${N} if needed" - gwarn "${OUTPUT} must contain an active partition:" + gwarn "${W}dd if=${GNAP_MBR} of=${PARENTDEV} bs=512 count=1${N} if needed" + gwarn "${GNAP_OUTPUT} must contain an active partition:" gwarn " use ${W}fdisk ${PARENTDEV}${N} if needed" - gwarn "Current data on ${OUTPUT} will be ${B}destroyed${N}!" + gwarn "Current data on ${GNAP_OUTPUT} will be ${B}destroyed${N}!" gconfirm 'Are you sure you want to continue ?' fi # Common actions -gbegin "Expanding ${GNAPCORE} core" +gbegin "Expanding ${GNAP_CORE} core" TEMPDIR=$(mktemp -d -t gnap_overlay.XXXXXX) gtest continued $? 'Failed to create temporary directory' TEMPCOREDIR="${TEMPDIR}/core" gmkdir "${TEMPCOREDIR}" -tar x -C "${TEMPCOREDIR}" -f "${GNAPCORE}" +tar x -C "${TEMPCOREDIR}" -f "${GNAP_CORE}" gtest $? 'Failed to extract core' gbegin 'Preparing overlay' TEMPOVERDIR="${TEMPDIR}/overlay" gmkdir "${TEMPOVERDIR}" -if [[ -n "${BAUDRATE}" ]]; then +if [[ -n "${GNAP_BAUDRATE}" ]]; then gbegin 'Adding baudrate for serial console' gmkdir -p "${TEMPOVERDIR}/etc/gnap" - echo -n "${BAUDRATE}" > "${TEMPOVERDIR}/etc/gnap/baudrate" + echo -n "${GNAP_BAUDRATE}" > "${TEMPOVERDIR}/etc/gnap/baudrate" gtest $? 'Failed to create /etc/gnap/baudrate' fi -for overlay in ${OVERLAYS} ; do +for overlay in ${GNAP_OVERLAYS} ; do if [[ -d "${overlay}" ]]; then gbegin "Adding ${overlay} (directory overlay)" cp -rp "${overlay}"/* "${TEMPOVERDIR}" @@ -156,13 +155,13 @@ gtest $? "${overlay} is not a valid conflet file (tbz2 format)" fi done -if [[ -n "${OVERLAYCONF}" ]]; then - gbegin "Adding ${OVERLAYCONF} (overlay.conf file)" +if [[ -n "${GNAP_OVERLAY_CONF}" ]]; then + gbegin "Adding ${GNAP_OVERLAY_CONF} (overlay.conf file)" if [[ ! -d "${TEMPOVERDIR}/etc" ]]; then gmkdir "${TEMPOVERDIR}/etc" fi - cp "${OVERLAYCONF}" "${TEMPOVERDIR}/etc/overlay.conf" - gtest $? "Failed to copy ${OVERLAYCONF}" + cp "${GNAP_OVERLAY_CONF}" "${TEMPOVERDIR}/etc/overlay.conf" + gtest $? "Failed to copy ${GNAP_OVERLAY_CONF}" fi gbegin 'Creating overlay tarball' test -f "${TEMPOVERDIR}/etc/overlay.conf" @@ -172,28 +171,28 @@ gtest $? 'Failed to create overlay tarball' DATE=$(date --utc) -if [[ "${NOLOGO}" -eq 1 ]]; then +if [[ "${GNAP_NOLOGO}" -eq 1 ]]; then echo "GNAP ${VERSION}" > "${TEMPCOREDIR}/isolinux/boot.msg" fi -if [[ -n "${OVERLAYS}" ]]; then - echo "Overlaid with ${OVERLAYS} on ${DATE}" \ +if [[ -n "${GNAP_OVERLAYS}" ]]; then + echo "Overlaid with ${GNAP_OVERLAYS} on ${DATE}" \ >> "${TEMPCOREDIR}/isolinux/boot.msg" fi # Target specific actions -if [[ "${TYPE}" == 'iso' ]]; then - if [[ -f "${OUTPUT}" ]]; then - gconfirm "File ${OUTPUT} already exists, overwrite?" +if [[ "${GNAP_TYPE}" == 'iso' ]]; then + if [[ -f "${GNAP_OUTPUT}" ]]; then + gconfirm "File ${GNAP_OUTPUT} already exists, overwrite?" fi rm "${TEMPCOREDIR}/syslinux.cfg" - gbegin "Building ${OUTPUT} ISO file" - mkisofs -quiet -J -r -l -x "${TEMPCOREDIR}/.." -o "${OUTPUT}" \ + gbegin "Building ${GNAP_OUTPUT} ISO file" + mkisofs -quiet -J -r -l -x "${TEMPCOREDIR}/.." -o "${GNAP_OUTPUT}" \ -b isolinux/isolinux.bin -c isolinux/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table "${TEMPCOREDIR}" gtest $? else - if [[ "${TYPE}" == 'image' ]]; then + if [[ "${GNAP_TYPE}" == 'image' ]]; then gbegin 'Looking for free loop device' LOOP='' for i in /dev/loop/?* /dev/loop?*; do @@ -210,25 +209,25 @@ ginfo "Using loop device ${LOOP}" - if [[ "${CREATE}" == y ]]; then - if [[ -f "${OUTPUT}" ]]; then - gconfirm "File ${OUTPUT} already exists, overwrite?" + if [[ "${GNAP_CREATE}" == y ]]; then + if [[ -f "${GNAP_OUTPUT}" ]]; then + gconfirm "File ${GNAP_OUTPUT} already exists, overwrite?" fi gbegin 'Creating image file' # 1048576 = 1 MiB - dd if=/dev/zero of="${OUTPUT}" bs=1048576 count="${IMG_SIZE}" \ + dd if=/dev/zero of="${GNAP_OUTPUT}" bs=1048576 count="${GNAP_IMG_SIZE}" \ >/dev/null 2>&1 gtest $? gbegin 'Creating partition table' # Create one partition of the full size - echo '0;;6;*' | sfdisk -D -H 64 -S 32 "${OUTPUT}" >/dev/null 2>&1 + echo '0;;6;*' | sfdisk -D -H 64 -S 32 "${GNAP_OUTPUT}" >/dev/null 2>&1 gtest $? fi gbegin 'Reading Cylinder/Heads/Sectors' - CHS=$(sfdisk -G "${OUTPUT}" 2>/dev/null) + CHS=$(sfdisk -G "${GNAP_OUTPUT}" 2>/dev/null) gtest $? set -- ${CHS/*:/} @@ -241,22 +240,22 @@ ginfo "Offset is ${offset}" - gbegin "Mounting ${OUTPUT} to ${LOOP}" - losetup -o "${offset}" "${LOOP}" "${OUTPUT}" + gbegin "Mounting ${GNAP_OUTPUT} to ${LOOP}" + losetup -o "${offset}" "${LOOP}" "${GNAP_OUTPUT}" gtest $? - ORIG_OUTPUT="${OUTPUT}" - OUTPUT="${LOOP}" + ORIG_OUTPUT="${GNAP_OUTPUT}" + GNAP_OUTPUT="${LOOP}" fi - gbegin "Formatting ${OUTPUT}" - mkfs.msdos "${OUTPUT}" > /dev/null 2>&1 + gbegin "Formatting ${GNAP_OUTPUT}" + mkfs.msdos "${GNAP_OUTPUT}" > /dev/null 2>&1 gtest $? - gbegin "Mounting ${OUTPUT}" + gbegin "Mounting ${GNAP_OUTPUT}" TEMPMOUNTDIR="${TEMPDIR}/mount" gmkdir "${TEMPMOUNTDIR}" - mount -t msdos "${OUTPUT}" "${TEMPMOUNTDIR}" + mount -t msdos "${GNAP_OUTPUT}" "${TEMPMOUNTDIR}" gtest $? gbegin 'Copying files' @@ -268,31 +267,31 @@ cp ${TEMPCOREDIR}/overlay.tgz ${TEMPMOUNTDIR}/ &&\ cp ${TEMPCOREDIR}/image.squashfs ${TEMPMOUNTDIR}/image.sfs &&\ sed -i \ - "s:cdroot:cdroot=/dev/${TARGETROOT} ${CACHE}${SERIAL}:" \ + "s:cdroot:cdroot=/dev/${GNAP_TARGETROOT} ${GNAP_CACHE}${GNAP_SERIAL}:" \ "${TEMPMOUNTDIR}/syslinux.cfg" gtest $? - gbegin "Unmounting ${OUTPUT}" + gbegin "Unmounting ${GNAP_OUTPUT}" umount "${TEMPMOUNTDIR}" gtest $? # Is autocleaned so maybe not useful - if [[ "${TYPE}" == 'image' ]]; then + if [[ "${GNAP_TYPE}" == 'image' ]]; then losetup -d "${LOOP}" LOOP= fi export MTOOLS_SKIP_CHECK=1 - case "${TYPE}" in + case "${GNAP_TYPE}" in disk) gbegin 'Syslinuxing' - syslinux "${OUTPUT}" + syslinux "${GNAP_OUTPUT}" gtest $? ;; image) gbegin 'Preparing disk for boot' syslinux -o "${offset}" "${ORIG_OUTPUT}" && \ - dd if="${GNAPMBR}" of="${ORIG_OUTPUT}" bs=512 count=1 \ + dd if="${GNAP_MBR}" of="${ORIG_OUTPUT}" bs=512 count=1 \ conv=notrunc >/dev/null 2>&1 gtest $? ;; diff -ur --exclude .svn --exclude upload.sh --exclude diff.sh gnap-2.0+cleanup+split/tools/gnap_remaster gnap-2.0+cleanup+split+namespace/tools/gnap_remaster --- gnap-2.0+cleanup+split/tools/gnap_remaster 2007-07-27 16:10:54.000000000 +0300 +++ gnap-2.0+cleanup+split+namespace/tools/gnap_remaster 2007-07-27 16:17:48.000000000 +0300 @@ -1,16 +1,16 @@ #!/bin/bash VERSION='2.0' -GNAPLIBDIR='/usr/lib/gnap' -source ${GNAPLIBDIR}/gnap_shared.sh -echo "GNAP remastering tool ${GNAPNAME} ${VERSION}" +GNAP_LIBDIR='/usr/lib/gnap' +source ${GNAP_LIBDIR}/gnap_shared.sh +echo "GNAP remastering tool ${NAME} ${VERSION}" -OUTPUT='mygnap-core.tar' +GNAP_OUTPUT='mygnap-core.tar' usage() { echo echo 'Usage:' - echo " ${GNAPNAME} [ options ]" + echo " ${NAME} [ options ]" echo echo 'Options:' echo ' -e extension Extension to include in core file' @@ -22,7 +22,7 @@ echo ' -d extdir Directory where to find extensions' echo ' -f Force all answers to yes (dangerous!)' echo - echo "Please use man ${GNAPNAME} for more details." + echo "Please use man ${NAME} for more details." } if [[ "$#" -eq 0 || "${1}" == '-h' ]]; then @@ -33,64 +33,64 @@ gbegin 'Checking parameters' # Read options -EXTENSIONS='' -KERNEXT='' -MODEXT='' -GNAPBASEFS='' -GNAPEXTDIR='' -FORCEYES=0 +GNAP_EXTENSIONS='' +GNAP_KERNEXT='' +GNAP_MODEXT='' +GNAP_BASEFS='' +GNAP_EXTDIR='' +GNAP_FORCEYES=0 while getopts ':he:k:m:o:g:b:d:f' option; do case ${option} in h ) usage exit 0;; - e ) EXTENSIONS="${EXTENSIONS} ${OPTARG}";; - k ) KERNEXT="${OPTARG}";; - m ) MODEXT="${OPTARG}";; - o ) OUTPUT="${OPTARG}";; - g ) GNAPCORE="${OPTARG}";; - b ) GNAPBASEFS="${OPTARG}";; - d ) GNAPEXTDIR="${OPTARG}";; - f ) FORCEYES=1;; + e ) GNAP_EXTENSIONS="${GNAP_EXTENSIONS} ${OPTARG}";; + k ) GNAP_KERNEXT="${OPTARG}";; + m ) GNAP_MODEXT="${OPTARG}";; + o ) GNAP_OUTPUT="${OPTARG}";; + g ) GNAP_CORE="${OPTARG}";; + b ) GNAP_BASEFS="${OPTARG}";; + d ) GNAP_EXTDIR="${OPTARG}";; + f ) GNAP_FORCEYES=1;; * ) gtest 1 'Specified options are incomplete or unknown!';; esac done # Root is needed test "${EUID}" -eq 0 -gtest continued $? "You need to be root to run ${GNAPNAME}" +gtest continued $? "You need to be root to run ${NAME}" # basefs file is required -test -f "${GNAPBASEFS}" +test -f "${GNAP_BASEFS}" gtest continued $? 'Please specify a valid GNAP basefs file (-b option)' # core file is required -test -f "${GNAPCORE}" +test -f "${GNAP_CORE}" gtest continued $? 'Please specify a valid GNAP core file (-g option)' # At least one operation is required -test -n "${EXTENSIONS}" -o -n "${KERNEXT}" -o -n "${MODEXT}" +test -n "${GNAP_EXTENSIONS}" -o -n "${GNAP_KERNEXT}" -o -n "${GNAP_MODEXT}" gtest $? 'Please specify at least one operation (-e, -k, -m) to perform' # Confirm tarball overwrite -if [[ -e "${OUTPUT}" ]]; then - gconfirm "${OUTPUT} already exists, overwrite" +if [[ -e "${GNAP_OUTPUT}" ]]; then + gconfirm "${GNAP_OUTPUT} already exists, overwrite" fi # Preparing new FS -gbegin "Unpacking ${GNAPBASEFS} basefs" +gbegin "Unpacking ${GNAP_BASEFS} basefs" TEMPDIR=$(mktemp -d -t gnap_remaster.XXXXXX) gtest continued $? 'Failed to create temporary directory' TEMPOVERDIR="${TEMPDIR}/basefs" gmkdir "${TEMPOVERDIR}" -tar jx -C "${TEMPOVERDIR}" -f "${GNAPBASEFS}" +tar jx -C "${TEMPOVERDIR}" -f "${GNAP_BASEFS}" gtest $? 'Failed to unpack basefs' -for overlay in ${EXTENSIONS} ; do +for overlay in ${GNAP_EXTENSIONS} ; do gbegin "Adding ${overlay} extension" - test -f "${GNAPEXTDIR}/gnapext_${overlay}.tbz2" - gtest continued $? "${GNAPEXTDIR}/gnapext_${overlay}.tbz2 does not exist" - tar jxf "${GNAPEXTDIR}/gnapext_${overlay}.tbz2" -C "${TEMPOVERDIR}" + test -f "${GNAP_EXTDIR}/gnapext_${overlay}.tbz2" + gtest continued $? "${GNAP_EXTDIR}/gnapext_${overlay}.tbz2 does not exist" + tar jxf "${GNAP_EXTDIR}/gnapext_${overlay}.tbz2" -C "${TEMPOVERDIR}" gtest $? "${overlay} is not a valid extension (tbz2 format)" done @@ -99,31 +99,31 @@ TEMPCOREDIR="${TEMPDIR}/core" gmkdir "${TEMPCOREDIR}" -tar x -C "${TEMPCOREDIR}" -f "${GNAPCORE}" --exclude image.squashfs +tar x -C "${TEMPCOREDIR}" -f "${GNAP_CORE}" --exclude image.squashfs gtest $? 'Failed to extract core' -if [[ -f "${KERNEXT}" ]]; then - gbegin "Replacing kernel and initrd using ${KERNEXT}" +if [[ -f "${GNAP_KERNEXT}" ]]; then + gbegin "Replacing kernel and initrd using ${GNAP_KERNEXT}" TEMPKERNDIR="${TEMPDIR}/kernel" gmkdir "${TEMPKERNDIR}" - tar jx -C "${TEMPKERNDIR}" -f "${KERNEXT}" + tar jx -C "${TEMPKERNDIR}" -f "${GNAP_KERNEXT}" gtest continued $? 'Failed to extract kernpackage' cp ${TEMPKERNDIR}/kernel* "${TEMPCOREDIR}/isolinux/gentoo" && \ cp ${TEMPKERNDIR}/initr* "${TEMPCOREDIR}/isolinux/gentoo.igz" gtest $? 'Failed to copy kernel and initrd' -elif [[ -n "${KERNEXT}" ]]; then - gwarn "${KERNEXT} does not exist, ignoring..." +elif [[ -n "${GNAP_KERNEXT}" ]]; then + gwarn "${GNAP_KERNEXT} does not exist, ignoring..." fi -if [[ -f "${MODEXT}" ]]; then - gbegin "Replacing modules using ${MODEXT}" +if [[ -f "${GNAP_MODEXT}" ]]; then + gbegin "Replacing modules using ${GNAP_MODEXT}" rm -rf "${TEMPOVERDIR}/lib/modules" && - tar jx -C "${TEMPOVERDIR}" -f "${MODEXT}" + tar jx -C "${TEMPOVERDIR}" -f "${GNAP_MODEXT}" gtest $? 'Failed to replace modules' -elif [[ -n "${MODEXT}" ]]; then - gwarn "${MODEXT} does not exist, ignoring..." +elif [[ -n "${GNAP_MODEXT}" ]]; then + gwarn "${GNAP_MODEXT} does not exist, ignoring..." fi gbegin 'Creating new squashfs filesystem' @@ -131,8 +131,8 @@ > /dev/null 2>/dev/null gtest $? 'Failed to create squashfs' -gbegin "Creating ${OUTPUT} core file" -tar cf "${OUTPUT}" -C "${TEMPCOREDIR}" . +gbegin "Creating ${GNAP_OUTPUT} core file" +tar cf "${GNAP_OUTPUT}" -C "${TEMPCOREDIR}" . gtest $? 'Failed to create new core tarball' # Successful finish diff -ur --exclude .svn --exclude upload.sh --exclude diff.sh gnap-2.0+cleanup+split/tools/gnap_shared.sh gnap-2.0+cleanup+split+namespace/tools/gnap_shared.sh --- gnap-2.0+cleanup+split/tools/gnap_shared.sh 2007-08-02 15:54:46.000000000 +0300 +++ gnap-2.0+cleanup+split+namespace/tools/gnap_shared.sh 2007-08-02 15:51:30.000000000 +0300 @@ -1,22 +1,22 @@ -GNAPNAME=$(basename "$0") +NAME=$(basename "$0") -case ${GNAPNAME} in +case ${NAME} in gnap_make ) GNAP_PRODUCT="Build";; gnap_overlay ) GNAP_PRODUCT="Overlay";; gnap_remaster ) GNAP_PRODUCT="Remaster";; * ) GNAP_PRODUCT="Something";; esac -STAGE3FILE="${GNAPLIBDIR}/gnap-stage3seed.tar.bz2" -SNAPSHOTFILE="${GNAPLIBDIR}/gnap-portagesnapshot.tar.bz2" -SPECS="${GNAPLIBDIR}/gnap-specs.tar.bz2" -GNAPCORE="${GNAPLIBDIR}/gnap-core.tar" -GNAPMBR="${GNAPLIBDIR}/mbr/mbr.bin" -GNAPEXTDIR="${GNAPLIBDIR}/extensions" -GNAPBASEFS="${GNAPLIBDIR}/gnap-basefs.tar.bz2" +GNAP_STAGE3FILE="${GNAP_LIBDIR}/gnap-stage3seed.tar.bz2" +GNAP_SNAPSHOTFILE="${GNAP_LIBDIR}/gnap-portagesnapshot.tar.bz2" +GNAP_SPECS="${GNAP_LIBDIR}/gnap-specs.tar.bz2" +GNAP_CORE="${GNAP_LIBDIR}/gnap-core.tar" +GNAP_MBR="${GNAP_LIBDIR}/mbr/mbr.bin" +GNAP_EXTDIR="${GNAP_LIBDIR}/extensions" +GNAP_BASEFS="${GNAP_LIBDIR}/gnap-basefs.tar.bz2" +GNAP_FORCEYES=0 TEMPDIR='' LOOP='' -FORCEYES=0 G=$'\e[32;01m' B=$'\e[31;01m' @@ -40,7 +40,7 @@ } gconfirm() { - if [[ "${FORCEYES}" -eq 1 ]]; then + if [[ "${GNAP_FORCEYES}" -eq 1 ]]; then gwarn "${*} forced to yes" else read -ep " ${W}*${N} ${*} [N]: " answer @@ -79,7 +79,7 @@ if [[ -n "${TEMPDIR}" || -n "${LOOP}" ]]; then cleanup fi - echo " ${GNAP_PRODUCT} failed, try ${GNAPNAME} -h for more help" + echo " ${GNAP_PRODUCT} failed, try ${NAME} -h for more help" exit 1 fi }