Merge lp:~tom-gall/linaro-image-tools/linaro-media-create into lp:linaro-image-tools/11.11

Proposed by Tom Gall
Status: Rejected
Rejected by: Alexander Sack
Proposed branch: lp:~tom-gall/linaro-image-tools/linaro-media-create
Merge into: lp:linaro-image-tools/11.11
Diff against target: 63 lines (+15/-7)
1 file modified
linaro-media-create (+15/-7)
To merge this branch: bzr merge lp:~tom-gall/linaro-image-tools/linaro-media-create
Reviewer Review Type Date Requested Status
Alexander Sack (community) Needs Resubmitting
Review via email: mp+33841@code.launchpad.net

Description of the change

Small fix to linaro-media-create so that it respects FAT_SIZE which will now set the partition type correctly (0x0C or 0x0E)

Also removed use of fdisk in favor of sfdisk for MMC.

Fixes lp:622979

To post a comment you must log in.
Revision history for this message
Alexander Sack (asac) wrote :

please resubmit with fix for:

ensure_command sfdisk fdisk util-linux

... this should be done in two lines; one line for each command.

review: Needs Resubmitting

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'linaro-media-create'
2--- linaro-media-create 2010-08-23 22:52:21 +0000
3+++ linaro-media-create 2010-08-26 21:35:51 +0000
4@@ -18,7 +18,7 @@
5
6 ensure_command uuidgen uuidgen-runtime
7 ensure_command parted parted
8-ensure_command fdisk util-linux # threre is a fdisk binary provided by gnu-fdisk as well
9+ensure_command sfdisk fdisk util-linux
10 ensure_command wget wget
11 ensure_command mkfs.ext3 e2fsprogs
12 ensure_command mkfs.ext4 e2fsprogs
13@@ -129,12 +129,20 @@
14 else
15 partdev=${MMC}
16 fi
17-# Create a VFAT partition of 9 cylinders which is about 64M
18+
19+# Create a VFAT or FAT16 partition of 9 cylinders which is about 64M
20 # and a linux partition of the rest
21+if [ "$FAT_SIZE" = "32" ]; then
22 sudo sfdisk -D -H $HEADS -S $SECTORS $CYLINDER_ARG $partdev << 'THEEND'
23 ,9,0x0C,*
24 ,,,-
25 THEEND
26+else
27+sudo sfdisk -D -H $HEADS -S $SECTORS $CYLINDER_ARG $partdev << 'THEEND'
28+,9,0x0E,*
29+,,,-
30+THEEND
31+fi
32
33 if [ "${IMAGE_FILE}" ]; then
34 VFATOFFSET=$(($(fdisk -l -u $IMAGE_FILE | grep FAT | awk '{print $3}')*512))
35@@ -279,14 +287,14 @@
36
37 function check_mmc {
38 DISK_NAME="Disk|Platte"
39- FDISK=$(sudo fdisk -l | grep "[${DISK_NAME}] ${MMC}" | awk '{print $2}')
40+ FDISK=$(sudo sfdisk -l | grep "[${DISK_NAME}] ${MMC}" | awk '{print $2}')
41
42 if test "-$FDISK-" = "-$MMC:-"
43 then
44 echo ""
45 echo "I see..."
46- echo "sudo fdisk -l:"
47- sudo fdisk -l | grep "[${DISK_NAME}] /dev/" --color=never
48+ echo "sudo sfdisk -l:"
49+ sudo sfdisk -l | grep "[${DISK_NAME}] /dev/" --color=never
50 echo ""
51 echo "mount:"
52 mount | grep -v none | grep "/dev/" --color=never
53@@ -298,8 +306,8 @@
54 echo ""
55 echo "Are you sure? I Don't see [${MMC}], here is what I do see..."
56 echo ""
57- echo "sudo fdisk -l:"
58- sudo fdisk -l | grep "[${DISK_NAME}] /dev/" --color=never
59+ echo "sudo sfdisk -l:"
60+ sudo sfdisk -l | grep "[${DISK_NAME}] /dev/" --color=never
61 echo ""
62 echo "mount:"
63 mount | grep -v none | grep "/dev/" --color=never

Subscribers

People subscribed via source and target branches