Merge lp:~salgado/linaro-image-tools/remove-extra-get-devs-by-id-call into lp:linaro-image-tools/11.11

Proposed by Guilherme Salgado
Status: Merged
Approved by: James Westby
Approved revision: 168
Merged at revision: 167
Proposed branch: lp:~salgado/linaro-image-tools/remove-extra-get-devs-by-id-call
Merge into: lp:linaro-image-tools/11.11
Diff against target: 87 lines (+32/-31)
1 file modified
linaro-media-create (+32/-31)
To merge this branch: bzr merge lp:~salgado/linaro-image-tools/remove-extra-get-devs-by-id-call
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+40739@code.launchpad.net

Description of the change

Remove an unnecessary call to get_device_by_id and fix some indentation

To post a comment you must log in.
Revision history for this message
Peter Maydell (pmaydell) wrote :

I would prefer not to mix whitespace cleanup and semantic changes in the same commit...

167. By Guilherme Salgado

Properly indent code. I wish we had some form of watchdog to at least prevent <tab>s in the code

168. By Guilherme Salgado

Remove an unnecessary call to get_device_by_id and fix some indentation

Revision history for this message
Guilherme Salgado (salgado) wrote :

On Fri, 2010-11-12 at 17:14 +0000, Peter Maydell wrote:
> I would prefer not to mix whitespace cleanup and semantic changes in the same commit...

And I would prefer that I didn't have to fix indentation and replace
<tab>s with spaces. ;)

In general I don't mix cleanup with semantic changes, but in this case
the semantic change is a one-liner, so I didn't bother. Anyway, I've
split that into a couple commits (r167 and r168) so they can be reviewed
(or reverted, if needed) independently.

Revision history for this message
James Westby (james-w) :
review: Approve

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-11-09 20:48:16 +0000
3+++ linaro-media-create 2010-11-12 17:24:20 +0000
4@@ -451,7 +451,7 @@
5
6 for d in $loop_devices; do
7 if [ -n "$d" ]; then
8- sudo losetup -d "$d"
9+ sudo losetup -d "$d"
10 fi
11 done
12
13@@ -517,35 +517,37 @@
14
15 prepare_partitions() {
16
17-echo -n "waiting for partitioning to settle ..."
18-sync
19-sleep 3
20-echo "done."
21-get_device_by_id
22-
23-if [ "$BOOTFS_STEP" ]; then
24- echo ""
25- echo "Formating Boot Partition"
26- echo ""
27- if [ -z "$BOOTFS" ]; then
28- echo "Partition $BOOTFS does not exist"
29- exit 2
30- else
31- sudo mkfs.vfat -F ${FAT_SIZE} ${BOOTFS} -n ${BOOT_LABEL}
32- fi
33-fi
34-
35-if [ "$ROOTFS_STEP" ]; then
36- echo ""
37- echo "Formating ${RFS} Partition"
38- echo ""
39- if [ -z "$ROOTFS" ]; then
40- echo "Partition $ROOTFS does not exist"
41- exit 2
42- else
43- sudo mkfs.${RFS} -U "$RFS_UUID" ${ROOTFS} -L ${RFS_LABEL}
44- fi
45-fi
46+ # sync and sleep a bit as the partitions may have been created in the
47+ # previous step.
48+ echo -n "waiting for partitioning to settle ..."
49+ sync
50+ sleep 3
51+ echo "done."
52+ get_device_by_id
53+
54+ if [ "$BOOTFS_STEP" ]; then
55+ echo ""
56+ echo "Formating Boot Partition"
57+ echo ""
58+ if [ -z "$BOOTFS" ]; then
59+ echo "Partition $BOOTFS does not exist"
60+ exit 2
61+ else
62+ sudo mkfs.vfat -F ${FAT_SIZE} ${BOOTFS} -n ${BOOT_LABEL}
63+ fi
64+ fi
65+
66+ if [ "$ROOTFS_STEP" ]; then
67+ echo ""
68+ echo "Formating ${RFS} Partition"
69+ echo ""
70+ if [ -z "$ROOTFS" ]; then
71+ echo "Partition $ROOTFS does not exist"
72+ exit 2
73+ else
74+ sudo mkfs.${RFS} -U "$RFS_UUID" ${ROOTFS} -L ${RFS_LABEL}
75+ fi
76+ fi
77 }
78
79 populate_boot() {
80@@ -907,7 +909,6 @@
81 else
82 echo "Warning, --hwpack <filename> was not specified, the result is unlikely to be functional without manual effort to setup uImage, MLO, u-boot.bin and so as as appropriate for your hardware."
83 fi
84-get_device_by_id
85 for func in $DEPLOY_STEPS; do
86 $func
87 done

Subscribers

People subscribed via source and target branches