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
=== modified file 'linaro-media-create'
--- linaro-media-create 2010-08-23 22:52:21 +0000
+++ linaro-media-create 2010-08-26 21:35:51 +0000
@@ -18,7 +18,7 @@
1818
19ensure_command uuidgen uuidgen-runtime19ensure_command uuidgen uuidgen-runtime
20ensure_command parted parted20ensure_command parted parted
21ensure_command fdisk util-linux # threre is a fdisk binary provided by gnu-fdisk as well21ensure_command sfdisk fdisk util-linux
22ensure_command wget wget22ensure_command wget wget
23ensure_command mkfs.ext3 e2fsprogs23ensure_command mkfs.ext3 e2fsprogs
24ensure_command mkfs.ext4 e2fsprogs24ensure_command mkfs.ext4 e2fsprogs
@@ -129,12 +129,20 @@
129else129else
130partdev=${MMC}130partdev=${MMC}
131fi131fi
132# Create a VFAT partition of 9 cylinders which is about 64M132
133# Create a VFAT or FAT16 partition of 9 cylinders which is about 64M
133# and a linux partition of the rest134# and a linux partition of the rest
135if [ "$FAT_SIZE" = "32" ]; then
134sudo sfdisk -D -H $HEADS -S $SECTORS $CYLINDER_ARG $partdev << 'THEEND'136sudo sfdisk -D -H $HEADS -S $SECTORS $CYLINDER_ARG $partdev << 'THEEND'
135,9,0x0C,*137,9,0x0C,*
136,,,-138,,,-
137THEEND139THEEND
140else
141sudo sfdisk -D -H $HEADS -S $SECTORS $CYLINDER_ARG $partdev << 'THEEND'
142,9,0x0E,*
143,,,-
144THEEND
145fi
138146
139if [ "${IMAGE_FILE}" ]; then147if [ "${IMAGE_FILE}" ]; then
140VFATOFFSET=$(($(fdisk -l -u $IMAGE_FILE | grep FAT | awk '{print $3}')*512))148VFATOFFSET=$(($(fdisk -l -u $IMAGE_FILE | grep FAT | awk '{print $3}')*512))
@@ -279,14 +287,14 @@
279287
280function check_mmc {288function check_mmc {
281 DISK_NAME="Disk|Platte"289 DISK_NAME="Disk|Platte"
282 FDISK=$(sudo fdisk -l | grep "[${DISK_NAME}] ${MMC}" | awk '{print $2}')290 FDISK=$(sudo sfdisk -l | grep "[${DISK_NAME}] ${MMC}" | awk '{print $2}')
283291
284 if test "-$FDISK-" = "-$MMC:-"292 if test "-$FDISK-" = "-$MMC:-"
285 then293 then
286 echo ""294 echo ""
287 echo "I see..."295 echo "I see..."
288 echo "sudo fdisk -l:"296 echo "sudo sfdisk -l:"
289 sudo fdisk -l | grep "[${DISK_NAME}] /dev/" --color=never297 sudo sfdisk -l | grep "[${DISK_NAME}] /dev/" --color=never
290 echo ""298 echo ""
291 echo "mount:"299 echo "mount:"
292 mount | grep -v none | grep "/dev/" --color=never300 mount | grep -v none | grep "/dev/" --color=never
@@ -298,8 +306,8 @@
298 echo ""306 echo ""
299 echo "Are you sure? I Don't see [${MMC}], here is what I do see..."307 echo "Are you sure? I Don't see [${MMC}], here is what I do see..."
300 echo ""308 echo ""
301 echo "sudo fdisk -l:"309 echo "sudo sfdisk -l:"
302 sudo fdisk -l | grep "[${DISK_NAME}] /dev/" --color=never310 sudo sfdisk -l | grep "[${DISK_NAME}] /dev/" --color=never
303 echo ""311 echo ""
304 echo "mount:"312 echo "mount:"
305 mount | grep -v none | grep "/dev/" --color=never313 mount | grep -v none | grep "/dev/" --color=never

Subscribers

People subscribed via source and target branches