diff options
author | Santiago Collazo <scollazo@activitycentral.com> | 2012-11-03 19:05:52 (GMT) |
---|---|---|
committer | Santiago Collazo <scollazo@activitycentral.com> | 2012-11-03 19:05:52 (GMT) |
commit | a8e2bea516c50bcae9c5d920bee09250fed0b49e (patch) | |
tree | 6f590f80c006b3ca62d279102c75e209e4e75bf4 | |
parent | f0422c0c4fd8ff3ea8ce1d51675e22f61d6df60c (diff) |
Polished kpartx changes
-rw-r--r-- | modules/sd_card_image/image.50.makefs.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/sd_card_image/image.50.makefs.sh b/modules/sd_card_image/image.50.makefs.sh index 81201a6..f85a5c3 100644 --- a/modules/sd_card_image/image.50.makefs.sh +++ b/modules/sd_card_image/image.50.makefs.sh @@ -79,9 +79,10 @@ make_image() $ROOT_PARTITION_START_BLOCK,,, EOF - disk_loop=$(kpartx -l $img | head -n1 | awk '{print $5}' | sed -e 's/dev/dev\/mapper/g' ) - boot_loop="${disk_loop}p1" - root_loop="${disk_loop}p2" + loop=$(kpartx -l $img | head -n1 | awk '{print $5}' | sed -e 's:.*/::' ) + disk_loop=/dev/loop$loop + boot_loop="/dev/mapper/loop${loop}p1" + root_loop="/dev/mapper/loop${loop}p2" kpartx -a -v $img @@ -126,8 +127,9 @@ EOF umount $ROOT umount $BOOT - kpartx -d $disk_loop || : + kpartx -d $disk_loop || : + losetup -D || : # FIXME: any value to running e2fsck now? maybe with -D ? } |