1 |
commit: c00d023004fcc310112ffc6aa6a049ee24bf38d8 |
2 |
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 23 17:54:29 2015 +0000 |
4 |
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 23 17:54:29 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=c00d0230 |
7 |
|
8 |
fix some quoting in create-iso.sh |
9 |
|
10 |
targets/support/create-iso.sh | 120 +++++++++++++++++++++--------------------- |
11 |
1 file changed, 60 insertions(+), 60 deletions(-) |
12 |
|
13 |
diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh |
14 |
index a8a194f..9714378 100755 |
15 |
--- a/targets/support/create-iso.sh |
16 |
+++ b/targets/support/create-iso.sh |
17 |
@@ -100,66 +100,66 @@ run_mkisofs() { |
18 |
case ${clst_hostarch} in |
19 |
alpha) |
20 |
echo ">> genisoimage --alpha-boot=boot/bootlx -R -l -J ${mkisofs_zisofs_opts} -V \"${clst_iso_volume_id}\" -o ${1} ${clst_target_path}" |
21 |
- genisoimage --alpha-boot=boot/bootlx -R -l -J ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path} || die "Cannot make ISO image" |
22 |
+ genisoimage --alpha-boot=boot/bootlx -R -l -J ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" "${clst_target_path}" || die "Cannot make ISO image" |
23 |
;; |
24 |
arm) |
25 |
;; |
26 |
hppa) |
27 |
echo ">> Running mkisofs to create iso image...." |
28 |
- run_mkisofs -R -l -J ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path}/ |
29 |
- pushd ${clst_target_path}/ |
30 |
- palo -f boot/palo.conf -C ${1} |
31 |
+ run_mkisofs -R -l -J ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" "${clst_target_path}"/ |
32 |
+ pushd "${clst_target_path}/" |
33 |
+ palo -f boot/palo.conf -C "${1}" |
34 |
popd |
35 |
;; |
36 |
ia64) |
37 |
- if [ ! -e ${clst_target_path}/gentoo.efimg ] |
38 |
+ if [ ! -e "${clst_target_path}/gentoo.efimg" ] |
39 |
then |
40 |
- iaSizeTemp=$(du -sk ${clst_target_path}/boot 2>/dev/null) |
41 |
+ iaSizeTemp=$(du -sk "${clst_target_path}/boot" 2>/dev/null) |
42 |
iaSizeB=$(echo ${iaSizeTemp} | cut '-d ' -f1) |
43 |
iaSize=$((${iaSizeB}+32)) # Add slack |
44 |
|
45 |
- dd if=/dev/zero of=${clst_target_path}/gentoo.efimg bs=1k \ |
46 |
+ dd if=/dev/zero of="${clst_target_path}/gentoo.efimg" bs=1k \ |
47 |
count=${iaSize} |
48 |
- mkdosfs -F 16 -n GENTOO ${clst_target_path}/gentoo.efimg |
49 |
+ mkdosfs -F 16 -n GENTOO "${clst_target_path}/gentoo.efimg" |
50 |
|
51 |
- mkdir ${clst_target_path}/gentoo.efimg.mountPoint |
52 |
- mount -t vfat -o loop ${clst_target_path}/gentoo.efimg \ |
53 |
- ${clst_target_path}/gentoo.efimg.mountPoint |
54 |
+ mkdir "${clst_target_path}/gentoo.efimg.mountPoint" |
55 |
+ mount -t vfat -o loop "${clst_target_path}/gentoo.efimg" \ |
56 |
+ "${clst_target_path}/gentoo.efimg.mountPoint" |
57 |
|
58 |
echo '>> Populating EFI image...' |
59 |
- cp -rv ${clst_target_path}/boot/* \ |
60 |
- ${clst_target_path}/gentoo.efimg.mountPoint |
61 |
+ cp -rv "${clst_target_path}"/boot/* \ |
62 |
+ "${clst_target_path}/gentoo.efimg.mountPoint" |
63 |
|
64 |
- umount ${clst_target_path}/gentoo.efimg.mountPoint |
65 |
- rmdir ${clst_target_path}/gentoo.efimg.mountPoint |
66 |
+ umount "${clst_target_path}/gentoo.efimg.mountPoint" |
67 |
+ rmdir "${clst_target_path}/gentoo.efimg.mountPoint" |
68 |
else |
69 |
echo ">> Found populated EFI image at \ |
70 |
${clst_target_path}/gentoo.efimg" |
71 |
fi |
72 |
echo '>> Removing /boot...' |
73 |
- rm -rf ${clst_target_path}/boot |
74 |
+ rm -rf "${clst_target_path}/boot" |
75 |
|
76 |
echo ">> Running mkisofs to create iso image...." |
77 |
- run_mkisofs -R -l -b gentoo.efimg -c boot.cat -no-emul-boot -J ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path}/ |
78 |
+ run_mkisofs -R -l -b gentoo.efimg -c boot.cat -no-emul-boot -J ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" "${clst_target_path}"/ |
79 |
;; |
80 |
mips) |
81 |
case ${clst_fstype} in |
82 |
squashfs) |
83 |
# $clst_target_path/[kernels|arcload] already exists, create loopback and sgibootcd |
84 |
- [ ! -d "${clst_target_path}/loopback" ] && mkdir ${clst_target_path}/loopback |
85 |
- [ ! -d "${clst_target_path}/sgibootcd" ] && mkdir ${clst_target_path}/sgibootcd |
86 |
+ [ ! -d "${clst_target_path}/loopback" ] && mkdir "${clst_target_path}/loopback" |
87 |
+ [ ! -d "${clst_target_path}/sgibootcd" ] && mkdir "${clst_target_path}/sgibootcd" |
88 |
|
89 |
# Setup variables |
90 |
- [ -f "${clst_target_path}/livecd" ] && rm -f ${clst_target_path}/livecd |
91 |
+ [ -f "${clst_target_path}/livecd" ] && rm -f "${clst_target_path}/livecd" |
92 |
img="${clst_target_path}/loopback/image.squashfs" |
93 |
knl="${clst_target_path}/kernels" |
94 |
arc="${clst_target_path}/arcload" |
95 |
cfg="${clst_target_path}/sgibootcd/sgibootcd.cfg" |
96 |
- echo "" > ${cfg} |
97 |
+ echo "" > "${cfg}" |
98 |
|
99 |
# If the image file exists in $clst_target_path, move it to the loopback dir |
100 |
[ -e "${clst_target_path}/image.squashfs" ] \ |
101 |
- && mv -f ${clst_target_path}/image.squashfs ${clst_target_path}/loopback |
102 |
+ && mv -f "${clst_target_path}/image.squashfs" "${clst_target_path}/loopback" |
103 |
|
104 |
# An sgibootcd config is essentially a collection of commandline params |
105 |
# stored in a text file. We could pass these on the command line, but it's |
106 |
@@ -200,64 +200,64 @@ case ${clst_hostarch} in |
107 |
esac |
108 |
;; |
109 |
ppc*|powerpc*) |
110 |
- if [ -f ${clst_target_path}/ppc/bootinfo.txt ] |
111 |
+ if [ -f "${clst_target_path}/ppc/bootinfo.txt" ] |
112 |
then |
113 |
echo "bootinfo.txt found .. updating it" |
114 |
sed -i -e \ |
115 |
's#^<description>.*</description>$#<description>'"${clst_iso_volume_id}"'</description>#' \ |
116 |
- ${clst_target_path}/ppc/bootinfo.txt |
117 |
+ "${clst_target_path}/ppc/bootinfo.txt" |
118 |
sed -i -e \ |
119 |
's#^<os-name>.*</os-name>$#<os-name>'"${clst_iso_volume_id}"'</os-name>#' \ |
120 |
- ${clst_target_path}/ppc/bootinfo.txt |
121 |
+ "${clst_target_path}/ppc/bootinfo.txt" |
122 |
fi |
123 |
|
124 |
echo ">> Running mkisofs to create iso image...." |
125 |
- run_mkisofs -r -U -chrp-boot -netatalk -hfs -probe -map ${clst_target_path}/boot/map.hfs -part -no-desktop -hfs-volid "${clst_iso_volume_id}" -hfs-bless ${clst_target_path}/boot -hide-hfs "zisofs" -hide-hfs "stages" -hide-hfs "distfiles" -hide-hfs "snapshots" -J ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path}/ |
126 |
+ run_mkisofs -r -U -chrp-boot -netatalk -hfs -probe -map "${clst_target_path}"/boot/map.hfs -part -no-desktop -hfs-volid "${clst_iso_volume_id}" -hfs-bless "${clst_target_path}"/boot -hide-hfs "zisofs" -hide-hfs "stages" -hide-hfs "distfiles" -hide-hfs "snapshots" -J ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" "${clst_target_path}"/ |
127 |
;; |
128 |
sparc*) |
129 |
# Old silo (<=1.2.6) requires a specially built mkisofs |
130 |
# We try to autodetect this in a simple way, said mkisofs |
131 |
# should be in the cdtar, otherwise use the new style. |
132 |
- if [ -x ${clst_target_path}/boot/mkisofs.sparc.fu ] |
133 |
+ if [ -x "${clst_target_path}/boot/mkisofs.sparc.fu" ] |
134 |
then |
135 |
- mv ${clst_target_path}/boot/mkisofs.sparc.fu /tmp |
136 |
+ mv "${clst_target_path}/boot/mkisofs.sparc.fu" /tmp |
137 |
echo "Running mkisofs.sparc.fu to create iso image...." |
138 |
echo "/tmp/mkisofs.sparc.fu ${mkisofs_zisofs_opts} -o ${1} -D -r -pad -quiet -S 'boot/cd.b' -B '/boot/second.b' -s '/boot/silo.conf' -V \"${clst_iso_volume_id}\" ${clst_target_path}/" |
139 |
- /tmp/mkisofs.sparc.fu ${mkisofs_zisofs_opts} -o ${1} -D -r -pad -quiet -S 'boot/cd.b' -B '/boot/second.b' -s '/boot/silo.conf' -V "${clst_iso_volume_id}" ${clst_target_path}/ || die "Cannot make ISO image" |
140 |
+ /tmp/mkisofs.sparc.fu ${mkisofs_zisofs_opts} -o "${1}" -D -r -pad -quiet -S 'boot/cd.b' -B '/boot/second.b' -s '/boot/silo.conf' -V "${clst_iso_volume_id}" "${clst_target_path}"/ || die "Cannot make ISO image" |
141 |
rm /tmp/mkisofs.sparc.fu |
142 |
else |
143 |
echo "Running mkisofs to create iso image...." |
144 |
- run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -G "${clst_target_path}/boot/isofs.b" -B ... ${clst_target_path}/ |
145 |
+ run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" -G "${clst_target_path}/boot/isofs.b" -B ... "${clst_target_path}"/ |
146 |
fi |
147 |
|
148 |
;; |
149 |
x86|amd64) |
150 |
- if [ -e ${clst_target_path}/boot/elilo.efi ] |
151 |
+ if [ -e "${clst_target_path}/boot/elilo.efi" ] |
152 |
then |
153 |
- if [ ! -e ${clst_target_path}/gentoo.efimg ] |
154 |
+ if [ ! -e "${clst_target_path}/gentoo.efimg" ] |
155 |
then |
156 |
- iaSizeTemp=$(du -sk ${clst_target_path}/boot 2>/dev/null) |
157 |
+ iaSizeTemp=$(du -sk "${clst_target_path}/boot" 2>/dev/null) |
158 |
iaSizeB=$(echo ${iaSizeTemp} | cut '-d ' -f1) |
159 |
iaSize=$((${iaSizeB}+32)) # Add slack |
160 |
|
161 |
- dd if=/dev/zero of=${clst_target_path}/gentoo.efimg bs=1k \ |
162 |
+ dd if=/dev/zero of="${clst_target_path}/gentoo.efimg" bs=1k \ |
163 |
count=${iaSize} |
164 |
- mkdosfs -F 16 -n GENTOO ${clst_target_path}/gentoo.efimg |
165 |
+ mkdosfs -F 16 -n GENTOO "${clst_target_path}/gentoo.efimg" |
166 |
|
167 |
- mkdir ${clst_target_path}/gentoo.efimg.mountPoint |
168 |
- mount -t vfat -o loop ${clst_target_path}/gentoo.efimg \ |
169 |
- ${clst_target_path}/gentoo.efimg.mountPoint |
170 |
+ mkdir "${clst_target_path}/gentoo.efimg.mountPoint" |
171 |
+ mount -t vfat -o loop "${clst_target_path}/gentoo.efimg" \ |
172 |
+ "${clst_target_path}/gentoo.efimg.mountPoint" |
173 |
|
174 |
echo "Populating EFI image" |
175 |
- cp -rv ${clst_target_path}/boot/* \ |
176 |
- ${clst_target_path}/gentoo.efimg.mountPoint |
177 |
+ cp -rv "${clst_target_path}"/boot/* \ |
178 |
+ "${clst_target_path}/gentoo.efimg.mountPoint" |
179 |
|
180 |
- umount ${clst_target_path}/gentoo.efimg.mountPoint |
181 |
- rmdir ${clst_target_path}/gentoo.efimg.mountPoint |
182 |
- if [ ! -e ${clst_target_path}/boot/grub/stage2_eltorito ] |
183 |
+ umount "${clst_target_path}/gentoo.efimg.mountPoint" |
184 |
+ rmdir "${clst_target_path}/gentoo.efimg.mountPoint" |
185 |
+ if [ ! -e "${clst_target_path}/boot/grub/stage2_eltorito" ] |
186 |
then |
187 |
echo "Removing /boot" |
188 |
- rm -rf ${clst_target_path}/boot |
189 |
+ rm -rf "${clst_target_path}/boot" |
190 |
fi |
191 |
else |
192 |
echo "Found populated EFI image at \ |
193 |
@@ -265,37 +265,37 @@ case ${clst_hostarch} in |
194 |
fi |
195 |
fi |
196 |
|
197 |
- if [ -e ${clst_target_path}/isolinux/isolinux.bin ] |
198 |
+ if [ -e "${clst_target_path}/isolinux/isolinux.bin" ] |
199 |
then |
200 |
- if [ -d ${clst_target_path}/boot ] |
201 |
+ if [ -d "${clst_target_path}/boot" ] |
202 |
then |
203 |
- if [ -n "$(ls ${clst_target_path}/boot)" ] |
204 |
+ if [ -n "$(ls \"${clst_target_path}/boot\")" ] |
205 |
then |
206 |
- mv ${clst_target_path}/boot/* ${clst_target_path}/isolinux |
207 |
- rm -r ${clst_target_path}/boot |
208 |
+ mv "${clst_target_path}"/boot/* "${clst_target_path}/isolinux" |
209 |
+ rm -r "${clst_target_path}/boot" |
210 |
echo "Creating ISO using ISOLINUX bootloader" |
211 |
- run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ${clst_target_path}/ |
212 |
- isohybrid ${1} |
213 |
- elif [ -e ${clst_target_path}/gentoo.efimg ] |
214 |
+ run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${clst_target_path}"/ |
215 |
+ isohybrid "${1}" |
216 |
+ elif [ -e "${clst_target_path}/gentoo.efimg" ] |
217 |
then |
218 |
echo "Creating ISO using both ISOLINUX and EFI bootloader" |
219 |
- run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -b gentoo.efimg -c boot.cat -no-emul-boot -z ${clst_target_path}/ |
220 |
+ run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -b gentoo.efimg -c boot.cat -no-emul-boot -z "${clst_target_path}"/ |
221 |
fi |
222 |
else |
223 |
echo "Creating ISO using ISOLINUX bootloader" |
224 |
- run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ${clst_target_path}/ |
225 |
- isohybrid ${1} |
226 |
+ run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${clst_target_path}"/ |
227 |
+ isohybrid "${1}" |
228 |
fi |
229 |
- elif [ -e ${clst_target_path}/boot/grub/stage2_eltorito ] |
230 |
+ elif [ -e "${clst_target_path}/boot/grub/stage2_eltorito" ] |
231 |
then |
232 |
echo "Creating ISO using GRUB bootloader" |
233 |
- run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -b boot/grub/stage2_eltorito -c boot/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ${clst_target_path}/ |
234 |
- elif [ -e ${clst_target_path}/gentoo.efimg ] |
235 |
+ run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" -b boot/grub/stage2_eltorito -c boot/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${clst_target_path}"/ |
236 |
+ elif [ -e "${clst_target_path}/gentoo.efimg" ] |
237 |
then |
238 |
echo 'Creating ISO using EFI bootloader' |
239 |
- run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -b gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path}/ |
240 |
+ run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" -b gentoo.efimg -c boot.cat -no-emul-boot "${clst_target_path}"/ |
241 |
else |
242 |
- run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} ${clst_target_path}/ |
243 |
+ run_mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o "${1}" "${clst_target_path}"/ |
244 |
fi |
245 |
;; |
246 |
esac |