Changeset 6131 in /cluster/svnroot


Ignore:
Timestamp:
Jun 5, 2019 5:43:40 PM (17 months ago)
Author:
skylar
Message:

add option to control where extract_squashfs makes its directories re #1015

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar/bccd-3.3.4/bin/extract_squashfs

    r6130 r6131  
    88
    99function usage() {
    10     echo -e "$(basename "$0") -i <path-to-bccd-iso>\\n" >&2
    11     echo "Extract the KNOPPIX/KNOPPIX squashfs to a directory" >&2
     10    echo -e "$(basename "$0") -i <path-to-bccd-iso> [ -t /path/to/tmp/dir ] \\n" >&2
     11    echo "Extract the KNOPPIX/KNOPPIX squashfs to a temporary directory rooted in the path given in -t" >&2
     12    echo "(defaults to /tmp)" >&2
    1213    echo "See http://bccd.net/wiki/index.php/DevelopmentInstructions#Regenerating_KNOPPIX.2FKNOPPIX_squashfs for more details" >&2
    1314}
     
    5051    INT TERM ERR EXIT
    5152
    52 while getopts "hi:" option; do
     53TMPDIR="/tmp"
     54
     55while getopts "hi:t:" option; do
    5356    case "${option}" in
    5457        h )
     
    5962            ISO_PATH="${OPTARG}"
    6063            ;;
     64        t )
     65            TMPDIR="${OPTARG}"
     66            ;;
    6167        * )
    6268            usage
     
    6571    esac
    6672done
     73
     74export TMPDIR
    6775
    6876if [[ "$(whoami)" != "root" ]]; then
     
    7886fi
    7987
    80 ISO_MOUNT=$(/bin/mktemp -d -p /tmp bccd_mount.XXXXXX)
    81 SQUASHFS_MOUNT=$(/bin/mktemp -d -p /tmp squashfs_mount.XXXXXX)
    82 ISO_DIR=$(/bin/mktemp -d -p /tmp bccd.XXXXXX)
    83 SQUASHFS_DIR=$(/bin/mktemp -d -p /tmp squashfs.XXXXXX)
     88ISO_MOUNT=$(mktemp -d -p "${TMPDIR}" bccd_mount.XXXXXX)
     89SQUASHFS_MOUNT=$(mktemp -d -p "${TMPDIR}" squashfs_mount.XXXXXX)
     90ISO_DIR=$(mktemp -d -p "${TMPDIR}" bccd.XXXXXX)
     91SQUASHFS_DIR=$(mktemp -d -p "${TMPDIR}" squashfs.XXXXXX)
    8492SQUASHFS="${ISO_DIR}/live/filesystem.squashfs"
    8593
Note: See TracChangeset for help on using the changeset viewer.