]> git.proxmox.com Git - grub2.git/blame - tests/partmap_test.in
bump version to 2.06-13+pmx2
[grub2.git] / tests / partmap_test.in
CommitLineData
a827807a 1#! @BUILD_SHEBANG@
5626056f
CW
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 ;;
b4787552
VS
91 arm*-efi)
92 disk=hd3
93 ;;
37ba07eb
VS
94 *)
95 disk=hd0
96 ;;
97esac
c0540205
AB
98
99if ! which parted >/dev/null 2>&1; then
100 echo "parted not installed; cannot test partmap"
101 exit 77
102fi
103
37ba07eb
VS
104imgfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
105outfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
56672f4a 106
107#
108# MSDOS partition types
109#
110
111echo "Checking MSDOS partition types..."
112
113# 0 primary
37ba07eb
VS
114create_disk_image "${imgfile}" 64
115${parted} -a none -s "${imgfile}" mklabel msdos
116list_parts part_msdos "${imgfile}" "${outfile}"
117check_output "${outfile}" $disk
56672f4a 118
119# 1 primary
37ba07eb
VS
120create_disk_image "${imgfile}" 64
121${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M
122list_parts part_msdos "${imgfile}" "${outfile}"
123check_output "${outfile}" $disk $disk,msdos1
56672f4a 124
125# 2 primary
37ba07eb
VS
126create_disk_image "${imgfile}" 128
127${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M
128list_parts part_msdos "${imgfile}" "${outfile}"
129check_output "${outfile}" $disk $disk,msdos1 $disk,msdos2
56672f4a 130
131# 3 primary
37ba07eb
VS
132create_disk_image "${imgfile}" 128
133${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart primary 20M 30M
134list_parts part_msdos "${imgfile}" "${outfile}"
135check_output "${outfile}" $disk $disk,msdos1 $disk,msdos2 $disk,msdos3
56672f4a 136
137# 4 primary
37ba07eb
VS
138create_disk_image "${imgfile}" 128
139${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M
140list_parts part_msdos "${imgfile}" "${outfile}"
141check_output "${outfile}" $disk $disk,msdos1 $disk,msdos2 $disk,msdos3 $disk,msdos4
56672f4a 142
143# 1 primary, 1 extended
37ba07eb
VS
144create_disk_image "${imgfile}" 128
145${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100%
146list_parts part_msdos "${imgfile}" "${outfile}"
147check_output "${outfile}" $disk $disk,msdos1
56672f4a 148
149# 1 primary, 1 extended, 1 logical
37ba07eb
VS
150create_disk_image "${imgfile}" 128
151${parted} -a none -s "${imgfile}" mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M
152list_parts part_msdos "${imgfile}" "${outfile}"
153check_output "${outfile}" $disk $disk,msdos1 $disk,msdos5
56672f4a 154
155# 1 primary, 1 extended, 2 logical
37ba07eb
VS
156create_disk_image "${imgfile}" 128
157${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
158list_parts part_msdos "${imgfile}" "${outfile}"
159check_output "${outfile}" $disk $disk,msdos1 $disk,msdos5 $disk,msdos6
56672f4a 160
161# 1 primary, 1 extended, 3 logical
37ba07eb
VS
162create_disk_image "${imgfile}" 128
163${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
164list_parts part_msdos "${imgfile}" "${outfile}"
165check_output "${outfile}" $disk $disk,msdos1 $disk,msdos5 $disk,msdos6 $disk,msdos7
56672f4a 166
167# 1 primary, 1 extended, 4 logical
37ba07eb
VS
168create_disk_image "${imgfile}" 128
169${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
170list_parts part_msdos "${imgfile}" "${outfile}"
171check_output "${outfile}" $disk $disk,msdos1 $disk,msdos5 $disk,msdos6 $disk,msdos7 $disk,msdos8
56672f4a 172
173
174#
175# GPT partition types
176#
177
178echo "Checking GPT partition types..."
179
180# 0 parts
37ba07eb
VS
181create_disk_image "${imgfile}" 64
182${parted} -a none -s "${imgfile}" mklabel gpt
183list_parts part_gpt "${imgfile}" "${outfile}"
184check_output "${outfile}" $disk
56672f4a 185
186# 1 parts
37ba07eb
VS
187create_disk_image "${imgfile}" 64
188${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M
189list_parts part_gpt "${imgfile}" "${outfile}"
190check_output "${outfile}" $disk $disk,gpt1
56672f4a 191
192# 2 parts
37ba07eb
VS
193create_disk_image "${imgfile}" 128
194${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M
195list_parts part_gpt "${imgfile}" "${outfile}"
196check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2
56672f4a 197
198# 3 parts
37ba07eb
VS
199create_disk_image "${imgfile}" 128
200${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M
201list_parts part_gpt "${imgfile}" "${outfile}"
202check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2 $disk,gpt3
56672f4a 203
204# 4 parts
37ba07eb
VS
205create_disk_image "${imgfile}" 128
206${parted} -a none -s "${imgfile}" mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 4 20M 30M mkpart 5 30M 40M
207list_parts part_gpt "${imgfile}" "${outfile}"
208check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2 $disk,gpt3 $disk,gpt4
56672f4a 209
210# 5 parts
37ba07eb
VS
211create_disk_image "${imgfile}" 128
212${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
213list_parts part_gpt "${imgfile}" "${outfile}"
214check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2 $disk,gpt3 $disk,gpt4 $disk,gpt5
56672f4a 215
216# 6 parts
37ba07eb
VS
217create_disk_image "${imgfile}" 128
218${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
219list_parts part_gpt "${imgfile}" "${outfile}"
220check_output "${outfile}" $disk $disk,gpt1 $disk,gpt2 $disk,gpt3 $disk,gpt4 $disk,gpt5 $disk,gpt6
56672f4a 221
222
223#
224# SUN partition types
225#
226# It seems partition #3 is reserved for whole disk by parted.
227#
228
229echo "Checking SUN partition types..."
230
231# 0 parts
37ba07eb
VS
232create_disk_image "${imgfile}" 64
233${parted} -a none -s "${imgfile}" mklabel sun
234list_parts part_sun "${imgfile}" "${outfile}"
235check_output "${outfile}" $disk
56672f4a 236
237# 1 parts
37ba07eb
VS
238create_disk_image "${imgfile}" 64
239${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M
240list_parts part_sun "${imgfile}" "${outfile}"
241check_output "${outfile}" $disk $disk,sun1
56672f4a 242
243# 2 parts
37ba07eb
VS
244create_disk_image "${imgfile}" 128
245${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M
246list_parts part_sun "${imgfile}" "${outfile}"
247check_output "${outfile}" $disk $disk,sun1 $disk,sun2
56672f4a 248
249# 3 parts
37ba07eb
VS
250create_disk_image "${imgfile}" 128
251${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M
252list_parts part_sun "${imgfile}" "${outfile}"
253check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4
56672f4a 254
255# 4 parts
37ba07eb
VS
256create_disk_image "${imgfile}" 128
257${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M
258list_parts part_sun "${imgfile}" "${outfile}"
259check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5
56672f4a 260
261# 5 parts
37ba07eb
VS
262create_disk_image "${imgfile}" 128
263${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M mkpart 40M 50M
264list_parts part_sun "${imgfile}" "${outfile}"
265check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5 $disk,sun6
56672f4a 266
267# 6 parts
37ba07eb
VS
268create_disk_image "${imgfile}" 128
269${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
270list_parts part_sun "${imgfile}" "${outfile}"
271check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5 $disk,sun6 $disk,sun7
56672f4a 272
3f9634e5
VS
273# 7 parts
274create_disk_image "${imgfile}" 128
275${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
276list_parts part_sun "${imgfile}" "${outfile}"
277check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5 $disk,sun6 $disk,sun7 $disk,sun8
278
56672f4a 279
280#
281# Apple partition types
282#
283# Partition table itself is part of some partition, so there is always
3f9634e5
VS
284# a partition by default. Furthermore free space is also a partition,
285# so there is always at least 2 partitions
56672f4a 286#
287
288echo "Checking APPLE partition types..."
289
290# 0 parts
37ba07eb
VS
291create_disk_image "${imgfile}" 64
292${parted} -a none -s "${imgfile}" mklabel mac
293list_parts part_apple "${imgfile}" "${outfile}"
294check_output "${outfile}" $disk $disk,apple1 $disk,apple2
56672f4a 295
296# 1 parts
37ba07eb
VS
297create_disk_image "${imgfile}" 64
298${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M
299list_parts part_apple "${imgfile}" "${outfile}"
300check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple3
56672f4a 301
302# 2 parts
37ba07eb
VS
303create_disk_image "${imgfile}" 128
304${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M
305list_parts part_apple "${imgfile}" "${outfile}"
306check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple3 $disk,apple4
56672f4a 307
308# 3 parts
37ba07eb
VS
309create_disk_image "${imgfile}" 128
310${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M
311list_parts part_apple "${imgfile}" "${outfile}"
312check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5
56672f4a 313
314# 4 parts
37ba07eb
VS
315create_disk_image "${imgfile}" 128
316${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M mkpart d 30M 40M
317list_parts part_apple "${imgfile}" "${outfile}"
318check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5 $disk,apple6
56672f4a 319
320# 5 parts
37ba07eb
VS
321create_disk_image "${imgfile}" 128
322${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
323list_parts part_apple "${imgfile}" "${outfile}"
324check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5 $disk,apple6 $disk,apple7
56672f4a 325
326# 6 parts
37ba07eb
VS
327create_disk_image "${imgfile}" 128
328${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
329list_parts part_apple "${imgfile}" "${outfile}"
330check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5 $disk,apple6 $disk,apple7 $disk,apple8
3f9634e5
VS
331
332#
333# DVH partition types
334#
335# Partition #11 is reserved for whole disk by parted.
336# Parted also aliases #9 as whole disk
337#
338
339echo "Checking DVH partition types..."
340
341# 0 parts
342create_disk_image "${imgfile}" 64
343${parted} -a none -s "${imgfile}" mklabel dvh
344list_parts part_dvh "${imgfile}" "${outfile}"
345check_output "${outfile}" $disk
346
347# 1 parts
348create_disk_image "${imgfile}" 64
349${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M
350list_parts part_dvh "${imgfile}" "${outfile}"
351check_output "${outfile}" $disk $disk,dvh1
352
353# 2 parts
354create_disk_image "${imgfile}" 128
355${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M
356list_parts part_dvh "${imgfile}" "${outfile}"
357check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2
358
359# 3 parts
360create_disk_image "${imgfile}" 128
361${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M
362list_parts part_dvh "${imgfile}" "${outfile}"
363check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3
364
365# 4 parts
366create_disk_image "${imgfile}" 128
367${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M
368list_parts part_dvh "${imgfile}" "${outfile}"
369check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4
370
371# 5 parts
372create_disk_image "${imgfile}" 128
373${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
374list_parts part_dvh "${imgfile}" "${outfile}"
375check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5
376
377# 6 parts
378create_disk_image "${imgfile}" 128
379${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
380list_parts part_dvh "${imgfile}" "${outfile}"
381check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6
382
383# 7 parts
384create_disk_image "${imgfile}" 128
385${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
386list_parts part_dvh "${imgfile}" "${outfile}"
387check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7
388
389# 8 parts
390create_disk_image "${imgfile}" 128
391${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
392list_parts part_dvh "${imgfile}" "${outfile}"
393check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8
394
395# 9 parts
396create_disk_image "${imgfile}" 128
397${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
398list_parts part_dvh "${imgfile}" "${outfile}"
399check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10
400
401# 10 parts
402create_disk_image "${imgfile}" 128
403${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
404list_parts part_dvh "${imgfile}" "${outfile}"
405check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12
406
407# 11 parts
408create_disk_image "${imgfile}" 128
409${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
410list_parts part_dvh "${imgfile}" "${outfile}"
411check_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
412
413# 12 parts
414create_disk_image "${imgfile}" 128
415${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
416list_parts part_dvh "${imgfile}" "${outfile}"
417check_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
418
419# 13 parts
420create_disk_image "${imgfile}" 135
421${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
422list_parts part_dvh "${imgfile}" "${outfile}"
423check_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
424
425# 14 parts
426create_disk_image "${imgfile}" 145
427${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
428list_parts part_dvh "${imgfile}" "${outfile}"
429check_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
430
431echo "Checking AMIGA partition types..."
432
433# 0 parts
434create_disk_image "${imgfile}" 64
435${parted} -a none -s "${imgfile}" mklabel amiga
436list_parts part_amiga "${imgfile}" "${outfile}"
437check_output "${outfile}" $disk
438
439# 1 parts
440create_disk_image "${imgfile}" 64
441${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M
442list_parts part_amiga "${imgfile}" "${outfile}"
443check_output "${outfile}" $disk $disk,amiga1
444
445# 2 parts
446create_disk_image "${imgfile}" 128
447${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M
448list_parts part_amiga "${imgfile}" "${outfile}"
449check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2
450
451# 3 parts
452create_disk_image "${imgfile}" 128
453${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M
454list_parts part_amiga "${imgfile}" "${outfile}"
455check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3
456
457# 4 parts
458create_disk_image "${imgfile}" 128
459${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M
460list_parts part_amiga "${imgfile}" "${outfile}"
461check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4
462
463# 5 parts
464create_disk_image "${imgfile}" 128
465${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
466list_parts part_amiga "${imgfile}" "${outfile}"
467check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5
468
469# 6 parts
470create_disk_image "${imgfile}" 128
471${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
472list_parts part_amiga "${imgfile}" "${outfile}"
473check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5 $disk,amiga6
474
475# 7 parts
476create_disk_image "${imgfile}" 128
477${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
478list_parts part_amiga "${imgfile}" "${outfile}"
479check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5 $disk,amiga6 $disk,amiga7
480
1e908b34
RS
481#
482# DragonFly BSD disklabel64
483#
484
485echo "Checking DragonFly BSD disklabel64..."
486
487create_dfly_image "${imgfile}"
488list_parts part_dfly "${imgfile}" "${outfile}"
489check_output "${outfile}" $disk $disk,msdos1 $disk,msdos1,dfly1 $disk,msdos1,dfly2 $disk,msdos1,dfly3