Gentoo Archives: gnap-dev

From: Philipp Riegger <lists@××××××××××××.de>
To: gnap-dev@l.g.o
Subject: [gnap-dev] 05-festure-gnap_overlay-T.patch
Date: Thu, 05 Jul 2007 13:07:35
Message-Id: 44054.130.230.11.107.1183640851.squirrel@my.bawue.net
In Reply to: [gnap-dev] Some patches for gnap by Philipp Riegger
1 Index: tools/gnap_overlay
2 ===================================================================
3 --- tools/gnap_overlay (revision 58)
4 +++ tools/gnap_overlay (revision 60)
5 @@ -13,26 +13,27 @@
6 echo " ${GNAPNAME} -d hostdisk -r rootdev -o overlay [ options ]"
7 echo
8 echo 'Common options:'
9 - echo ' -o overlay Overlay directory or tbz2 file'
10 - echo ' -c conf overlay.conf file to use (if not in overlays)'
11 - echo ' -g gnap_core Use specific GNAP core tarball file'
12 - echo ' -n Do not use the GNAP castle logo'
13 - echo ' -f Force all answers to yes (dangerous!)'
14 + echo ' -o overlay Overlay directory or tbz2 file'
15 + echo ' -c conf overlay.conf file to use (if not in overlays)'
16 + echo ' -g gnap_core Use specific GNAP core tarball file'
17 + echo ' -n Do not use the GNAP castle logo'
18 + echo ' -f Force all answers to yes (dangerous!)'
19 + echo ' -T gnap_tempdir Use given temp dir'
20 echo
21 echo 'Options for ISO target (create an ISO containing bootable CD):'
22 - echo ' -i isoname Customized LiveCD ISO output file name'
23 + echo ' -i isoname Customized LiveCD ISO output file name'
24 echo
25 echo 'Options for disk target (install to a disk plugged in system):'
26 - echo ' -d hostdisk Disk to install to, as seen on current host'
27 - echo ' -r rootdev Boot device name as seen from target system'
28 - echo ' -m Cache filesystem in memory to reduce media wear'
29 - echo ' -s Use serial console on ttyS0'
30 + echo ' -d hostdisk Disk to install to, as seen on current host'
31 + echo ' -r rootdev Boot device name as seen from target system'
32 + echo ' -m Cache filesystem in memory to reduce media
33 wear'
34 + echo ' -s Use serial console on ttyS0'
35 echo
36 echo 'Options for image target (install into a disk image):'
37 - echo ' -l image Use existing image file as output'
38 - echo ' Warning: only one partition is supported!'
39 - echo ' -L image Create image file and use it as output'
40 - echo ' -S size Size of image file in megabyte'
41 + echo ' -l image Use existing image file as output'
42 + echo ' Warning: only one partition is supported!'
43 + echo ' -L image Create image file and use it as output'
44 + echo ' -S size Size of image file in megabyte'
45 echo ' The disk target options also apply, except -d.'
46 echo
47 echo "Please man ${GNAPNAME} for more details."
48 @@ -46,7 +47,8 @@
49 gbegin 'Checking parameters'
50
51 # Read options
52 -while getopts ':hg:o:c:nfi:d:l:r:ms:S:L:' options; do
53 +TEMPDIR=''
54 +while getopts ':hg:o:c:nfi:d:l:r:ms:S:L:T:' options; do
55 case ${options} in
56 h ) usage
57 exit 0;;
58 @@ -70,6 +72,7 @@
59 m ) CACHE='docache ';;
60 s ) SERIAL="console=ttyS0,${OPTARG}n81"
61 BAUDRATE="${OPTARG}";;
62 + T ) TEMPDIR="${OPTARG}";;
63 * ) gtest 1 'Specified options are incomplete or unknown !';;
64 esac
65 done
66 @@ -116,10 +119,19 @@
67 gconfirm 'Are you sure you want to continue ?'
68 fi
69
70 +# Setting up temporary directory
71 +if [[ "${TEMPDIR}" = "" ]]; then
72 + TEMPDIR=$(mktemp -d -t gnap_overlay.XXXXXX)
73 + gtest continued $? 'Failed to create temporary directory'
74 +elif [[ -d "${TEMPDIR}" ]]
75 + gconfirm "${TEMPDIR} already exists. Continue?"
76 +else
77 + mkdir -p "${TEMPDIR}"
78 + gtest continued $? "Failed to create ${TEMPDIR}"
79 +fi
80 +
81 # Common actions
82 gbegin "Expanding ${GNAPCORE} core"
83 -TEMPDIR=$(mktemp -d -t gnap_overlay.XXXXXX)
84 -gtest continued $? 'Failed to create temporary directory'
85 TEMPCOREDIR="${TEMPDIR}/core"
86 mkdir "${TEMPCOREDIR}"
87 gtest continued $? 'Failed to create core temporary subdirectory'
88
89 --
90 gnap-dev@g.o mailing list