]> git.proxmox.com Git - grub2.git/blame - tests/partmap_test.in
cryptodisk: teach grub_cryptodisk_insert() about partitions (bug #45889)
[grub2.git] / tests / partmap_test.in
CommitLineData
5626056f
CW
1#! /bin/sh
2set -e
3
8901b00c 4# Copyright (C) 2010 Free Software Foundation, Inc.
5#
6# GRUB is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# GRUB is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
56672f4a 18
4ebff753 19parted=parted
56672f4a 20grubshell=@builddir@/grub-shell
21
37ba07eb
VS
22. "@builddir@/grub-core/modinfo.sh"
23
56672f4a 24create_disk_image () {
3fd8bae5 25 name="$1"
56672f4a 26 size=$2
3fd8bae5
VS
27 rm -f "${name}"
28 dd if=/dev/zero of="${name}" bs=512 count=1 seek=$((size * 2048 - 1)) status=noxfer > /dev/null
56672f4a 29}
30
1e908b34
RS
31create_dfly_image () {
32 name="$1"
33 rm -f ${name}
34
35 gunzip < "@srcdir@/tests/dfly-mbr-mbexample.mbr.img.gz" | dd of=${name} bs=1 seek=440 count=72 conv=notrunc > /dev/null
36 gunzip < "@srcdir@/tests/dfly-mbr-mbexample.dfly.img.gz" | dd of=${name} bs=512 seek=33 count=1 conv=notrunc > /dev/null
37}
38
56672f4a 39check_output () {
40 outfile=$1
41 shift
42
37ba07eb
VS
43 for dsk in $@; do
44 if ! grep "($dsk)" "${outfile}" >/dev/null
56672f4a 45 then
37ba07eb 46 echo "($dsk): disk/partiton not found"
56672f4a 47 exit 1
48 fi
49 done
50}
51
52list_parts () {
53 mod=$1;
54 shift;
37ba07eb 55 imgfile="$1"
56672f4a 56 shift
37ba07eb 57 outfile="$1"
56672f4a 58 shift
59
a6393224 60 echo ls | "${grubshell}" --disk="${imgfile}" \
37ba07eb
VS
61 --modules=$mod | tr -d "\n\r" > "${outfile}"
62 cat "${outfile}"
56672f4a 63 echo
64}
65
37ba07eb 66case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
eac49cff 67 mips-qemu_mips | mipsel-qemu_mips | i386-qemu | i386-multiboot | i386-coreboot | mipsel-loongson)
37ba07eb
VS
68 disk=ata0
69 ;;
34b2bced
VS
70 powerpc-ieee1275)
71 disk=ieee1275//pci@80000000/mac-io@4/ata-3@20000/disk@0
f93e89ef 72 # FIXME: QEMU firmware has bugs which prevent it from accessing hard disk w/o recognised label.
34b2bced
VS
73 exit 0
74 ;;
c9d586ea
VS
75 sparc64-ieee1275)
76 disk=ieee1275//pci@1fe\,0/pci-ata@5/ide0@500/disk@0
f93e89ef 77 # FIXME: QEMU firmware has bugs which prevent it from accessing hard disk w/o recognised label.
c9d586ea
VS
78 exit 0
79 ;;
dbc56d8f
VS
80 i386-ieee1275)
81 disk=ieee1275/d
f93e89ef 82 # FIXME: QEMU firmware has bugs which prevent it from accessing hard disk w/o recognised label.
a3d566d4 83 exit 0
dbc56d8f 84 ;;
6aff0107 85 mips-arc)
f93e89ef 86 # FIXME: ARC firmware has bugs which prevent it from accessing hard disk w/o dvh disklabel.
86eb23bc 87 exit 0 ;;
7f63a64f
VS
88 mipsel-arc)
89 disk=arc/scsi0/disk0/rdisk0
7f63a64f 90 ;;
37ba07eb
VS
91 *)
92 disk=hd0
93 ;;
94esac
95imgfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
96outfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
56672f4a 97
98#
99# MSDOS partition types
100#
101
102echo "Checking MSDOS partition types..."
103
104# 0 primary
37ba07eb
VS
105create_disk_image "${imgfile}" 64
106${parted} -a none -s "${imgfile}" mklabel msdos
107list_parts part_msdos "${imgfile}" "${outfile}"
108check_output "${outfile}" $disk
56672f4a 109
110# 1 primary
37ba07eb
VS
111create_disk_image "${imgfile}" 64
112${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M
113list_parts part_msdos "${imgfile}" "${outfile}"
114check_output "${outfile}" $disk $disk,msdos1
56672f4a 115
116# 2 primary
37ba07eb
VS
117create_disk_image "${imgfile}" 128
118${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M
119list_parts part_msdos "${imgfile}" "${outfile}"
120check_output "${outfile}" $disk $disk,msdos1 $disk,msdos2
56672f4a 121
122# 3 primary
37ba07eb
VS
123create_disk_image "${imgfile}" 128
124${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart primary 20M 30M
125list_parts part_msdos "${imgfile}" "${outfile}"
126check_output "${outfile}" $disk $disk,msdos1 $disk,msdos2 $disk,msdos3
56672f4a 127
128# 4 primary
37ba07eb
VS
129create_disk_image "${imgfile}" 128
130${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M
131list_parts part_msdos "${imgfile}" "${outfile}"
132check_output "${outfile}" $disk $disk,msdos1 $disk,msdos2 $disk,msdos3 $disk,msdos4
56672f4a 133
134# 1 primary, 1 extended
37ba07eb
VS
135create_disk_image "${imgfile}" 128
136${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100%
137list_parts part_msdos "${imgfile}" "${outfile}"
138check_output "${outfile}" $disk $disk,msdos1
56672f4a 139
140# 1 primary, 1 extended, 1 logical
37ba07eb
VS
141create_disk_image "${imgfile}" 128
142${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M
143list_parts part_msdos "${imgfile}" "${outfile}"
144check_output "${outfile}" $disk $disk,msdos1 $disk,msdos5
56672f4a 145
146# 1 primary, 1 extended, 2 logical
37ba07eb
VS
147create_disk_image "${imgfile}" 128
148${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M
149list_parts part_msdos "${imgfile}" "${outfile}"
150check_output "${outfile}" $disk $disk,msdos1 $disk,msdos5 $disk,msdos6
56672f4a 151
152# 1 primary, 1 extended, 3 logical
37ba07eb
VS
153create_disk_image "${imgfile}" 128
154${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M mkpart logical 40M 50M
155list_parts part_msdos "${imgfile}" "${outfile}"
156check_output "${outfile}" $disk $disk,msdos1 $disk,msdos5 $disk,msdos6 $disk,msdos7
56672f4a 157
158# 1 primary, 1 extended, 4 logical
37ba07eb
VS
159create_disk_image "${imgfile}" 128
160${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M mkpart logical 40M 50M mkpart logical 50M 60M
161list_parts part_msdos "${imgfile}" "${outfile}"
162check_output "${outfile}" $disk $disk,msdos1 $disk,msdos5 $disk,msdos6 $disk,msdos7 $disk,msdos8
56672f4a 163
164
165#
166# GPT partition types
167#
168
169echo "Checking GPT partition types..."
170
171# 0 parts
37ba07eb
VS
172create_disk_image "${imgfile}" 64
173${parted} -a none -s "${imgfile}" mklabel gpt
174list_parts part_gpt "${imgfile}" "${outfile}"
175check_output "${outfile}" $disk
56672f4a 176
177# 1 parts
37ba07eb
VS
178create_disk_image "${imgfile}" 64
179${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M
180list_parts part_gpt "${imgfile}" "${outfile}"
181check_output "${outfile}" $disk $disk,gpt1
56672f4a 182
183# 2 parts
37ba07eb
VS
184create_disk_image "${imgfile}" 128
185${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M
186list_parts part_gpt "${imgfile}" "${outfile}"
187check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2
56672f4a 188
189# 3 parts
37ba07eb
VS
190create_disk_image "${imgfile}" 128
191${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M
192list_parts part_gpt "${imgfile}" "${outfile}"
193check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2 $disk,gpt3
56672f4a 194
195# 4 parts
37ba07eb
VS
196create_disk_image "${imgfile}" 128
197${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 4 20M 30M mkpart 5 30M 40M
198list_parts part_gpt "${imgfile}" "${outfile}"
199check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2 $disk,gpt3 $disk,gpt4
56672f4a 200
201# 5 parts
37ba07eb
VS
202create_disk_image "${imgfile}" 128
203${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M mkpart 4 30M 40M mkpart 5 40M 50M
204list_parts part_gpt "${imgfile}" "${outfile}"
205check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2 $disk,gpt3 $disk,gpt4 $disk,gpt5
56672f4a 206
207# 6 parts
37ba07eb
VS
208create_disk_image "${imgfile}" 128
209${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M mkpart 4 30M 40M mkpart 5 40M 50M mkpart 6 50M 60M
210list_parts part_gpt "${imgfile}" "${outfile}"
211check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2 $disk,gpt3 $disk,gpt4 $disk,gpt5 $disk,gpt6
56672f4a 212
213
214#
215# SUN partition types
216#
217# It seems partition #3 is reserved for whole disk by parted.
218#
219
220echo "Checking SUN partition types..."
221
222# 0 parts
37ba07eb
VS
223create_disk_image "${imgfile}" 64
224${parted} -a none -s "${imgfile}" mklabel sun
225list_parts part_sun "${imgfile}" "${outfile}"
226check_output "${outfile}" $disk
56672f4a 227
228# 1 parts
37ba07eb
VS
229create_disk_image "${imgfile}" 64
230${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M
231list_parts part_sun "${imgfile}" "${outfile}"
232check_output "${outfile}" $disk $disk,sun1
56672f4a 233
234# 2 parts
37ba07eb
VS
235create_disk_image "${imgfile}" 128
236${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M
237list_parts part_sun "${imgfile}" "${outfile}"
238check_output "${outfile}" $disk $disk,sun1 $disk,sun2
56672f4a 239
240# 3 parts
37ba07eb
VS
241create_disk_image "${imgfile}" 128
242${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M
243list_parts part_sun "${imgfile}" "${outfile}"
244check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4
56672f4a 245
246# 4 parts
37ba07eb
VS
247create_disk_image "${imgfile}" 128
248${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M
249list_parts part_sun "${imgfile}" "${outfile}"
250check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5
56672f4a 251
252# 5 parts
37ba07eb
VS
253create_disk_image "${imgfile}" 128
254${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M mkpart 40M 50M
255list_parts part_sun "${imgfile}" "${outfile}"
256check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5 $disk,sun6
56672f4a 257
258# 6 parts
37ba07eb
VS
259create_disk_image "${imgfile}" 128
260${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M mkpart 40M 50M mkpart 50M 60M
261list_parts part_sun "${imgfile}" "${outfile}"
262check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5 $disk,sun6 $disk,sun7
56672f4a 263
3f9634e5
VS
264# 7 parts
265create_disk_image "${imgfile}" 128
266${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M mkpart 40M 50M mkpart 50M 60M mkpart 60M 70M
267list_parts part_sun "${imgfile}" "${outfile}"
268check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5 $disk,sun6 $disk,sun7 $disk,sun8
269
56672f4a 270
271#
272# Apple partition types
273#
274# Partition table itself is part of some partition, so there is always
3f9634e5
VS
275# a partition by default. Furthermore free space is also a partition,
276# so there is always at least 2 partitions
56672f4a 277#
278
279echo "Checking APPLE partition types..."
280
281# 0 parts
37ba07eb
VS
282create_disk_image "${imgfile}" 64
283${parted} -a none -s "${imgfile}" mklabel mac
284list_parts part_apple "${imgfile}" "${outfile}"
285check_output "${outfile}" $disk $disk,apple1 $disk,apple2
56672f4a 286
287# 1 parts
37ba07eb
VS
288create_disk_image "${imgfile}" 64
289${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M
290list_parts part_apple "${imgfile}" "${outfile}"
291check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple3
56672f4a 292
293# 2 parts
37ba07eb
VS
294create_disk_image "${imgfile}" 128
295${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M
296list_parts part_apple "${imgfile}" "${outfile}"
297check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple3 $disk,apple4
56672f4a 298
299# 3 parts
37ba07eb
VS
300create_disk_image "${imgfile}" 128
301${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M
302list_parts part_apple "${imgfile}" "${outfile}"
303check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5
56672f4a 304
305# 4 parts
37ba07eb
VS
306create_disk_image "${imgfile}" 128
307${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M mkpart d 30M 40M
308list_parts part_apple "${imgfile}" "${outfile}"
309check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5 $disk,apple6
56672f4a 310
311# 5 parts
37ba07eb
VS
312create_disk_image "${imgfile}" 128
313${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M mkpart d 30M 40M mkpart e 40M 50M
314list_parts part_apple "${imgfile}" "${outfile}"
315check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5 $disk,apple6 $disk,apple7
56672f4a 316
317# 6 parts
37ba07eb
VS
318create_disk_image "${imgfile}" 128
319${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M mkpart d 30M 40M mkpart e 40M 50M mkpart f 50M 60M
320list_parts part_apple "${imgfile}" "${outfile}"
321check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5 $disk,apple6 $disk,apple7 $disk,apple8
3f9634e5
VS
322
323#
324# DVH partition types
325#
326# Partition #11 is reserved for whole disk by parted.
327# Parted also aliases #9 as whole disk
328#
329
330echo "Checking DVH partition types..."
331
332# 0 parts
333create_disk_image "${imgfile}" 64
334${parted} -a none -s "${imgfile}" mklabel dvh
335list_parts part_dvh "${imgfile}" "${outfile}"
336check_output "${outfile}" $disk
337
338# 1 parts
339create_disk_image "${imgfile}" 64
340${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M
341list_parts part_dvh "${imgfile}" "${outfile}"
342check_output "${outfile}" $disk $disk,dvh1
343
344# 2 parts
345create_disk_image "${imgfile}" 128
346${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M
347list_parts part_dvh "${imgfile}" "${outfile}"
348check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2
349
350# 3 parts
351create_disk_image "${imgfile}" 128
352${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M
353list_parts part_dvh "${imgfile}" "${outfile}"
354check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3
355
356# 4 parts
357create_disk_image "${imgfile}" 128
358${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M
359list_parts part_dvh "${imgfile}" "${outfile}"
360check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4
361
362# 5 parts
363create_disk_image "${imgfile}" 128
364${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M
365list_parts part_dvh "${imgfile}" "${outfile}"
366check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5
367
368# 6 parts
369create_disk_image "${imgfile}" 128
370${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M
371list_parts part_dvh "${imgfile}" "${outfile}"
372check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6
373
374# 7 parts
375create_disk_image "${imgfile}" 128
376${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M
377list_parts part_dvh "${imgfile}" "${outfile}"
378check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7
379
380# 8 parts
381create_disk_image "${imgfile}" 128
382${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M
383list_parts part_dvh "${imgfile}" "${outfile}"
384check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8
385
386# 9 parts
387create_disk_image "${imgfile}" 128
388${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M
389list_parts part_dvh "${imgfile}" "${outfile}"
390check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10
391
392# 10 parts
393create_disk_image "${imgfile}" 128
394${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M
395list_parts part_dvh "${imgfile}" "${outfile}"
396check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12
397
398# 11 parts
399create_disk_image "${imgfile}" 128
400${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M mkpart primary 100M 110M
401list_parts part_dvh "${imgfile}" "${outfile}"
402check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12 $disk,dvh13
403
404# 12 parts
405create_disk_image "${imgfile}" 128
406${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M mkpart primary 100M 110M mkpart primary 110M 120M
407list_parts part_dvh "${imgfile}" "${outfile}"
408check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12 $disk,dvh13 $disk,dvh14
409
410# 13 parts
411create_disk_image "${imgfile}" 135
412${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M mkpart primary 100M 110M mkpart primary 110M 120M mkpart primary 120M 130M
413list_parts part_dvh "${imgfile}" "${outfile}"
414check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12 $disk,dvh13 $disk,dvh14 $disk,dvh15
415
416# 14 parts
417create_disk_image "${imgfile}" 145
418${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M mkpart primary 100M 110M mkpart primary 110M 120M mkpart primary 120M 130M mkpart primary 130M 140M
419list_parts part_dvh "${imgfile}" "${outfile}"
420check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12 $disk,dvh13 $disk,dvh14 $disk,dvh15 $disk,dvh16
421
422echo "Checking AMIGA partition types..."
423
424# 0 parts
425create_disk_image "${imgfile}" 64
426${parted} -a none -s "${imgfile}" mklabel amiga
427list_parts part_amiga "${imgfile}" "${outfile}"
428check_output "${outfile}" $disk
429
430# 1 parts
431create_disk_image "${imgfile}" 64
432${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M
433list_parts part_amiga "${imgfile}" "${outfile}"
434check_output "${outfile}" $disk $disk,amiga1
435
436# 2 parts
437create_disk_image "${imgfile}" 128
438${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M
439list_parts part_amiga "${imgfile}" "${outfile}"
440check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2
441
442# 3 parts
443create_disk_image "${imgfile}" 128
444${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M
445list_parts part_amiga "${imgfile}" "${outfile}"
446check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3
447
448# 4 parts
449create_disk_image "${imgfile}" 128
450${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M
451list_parts part_amiga "${imgfile}" "${outfile}"
452check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4
453
454# 5 parts
455create_disk_image "${imgfile}" 128
456${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M mkpart x 40M 50M
457list_parts part_amiga "${imgfile}" "${outfile}"
458check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5
459
460# 6 parts
461create_disk_image "${imgfile}" 128
462${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M mkpart x 40M 50M mkpart x 50M 60M
463list_parts part_amiga "${imgfile}" "${outfile}"
464check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5 $disk,amiga6
465
466# 7 parts
467create_disk_image "${imgfile}" 128
468${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M mkpart x 40M 50M mkpart x 50M 60M mkpart x 60M 70M
469list_parts part_amiga "${imgfile}" "${outfile}"
470check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5 $disk,amiga6 $disk,amiga7
471
1e908b34
RS
472#
473# DragonFly BSD disklabel64
474#
475
476echo "Checking DragonFly BSD disklabel64..."
477
478create_dfly_image "${imgfile}"
479list_parts part_dfly "${imgfile}" "${outfile}"
480check_output "${outfile}" $disk $disk,msdos1 $disk,msdos1,dfly1 $disk,msdos1,dfly2 $disk,msdos1,dfly3