[PATCH olpc-os-builder 10/14] sd_card_image: unversioned layout: don't duplicate files for /boot

Sascha Silbe silbe at activitycentral.com
Thu Mar 17 11:21:24 EDT 2011


Duplicating the files destined for the boot partition on the root partition
takes up precious space and has no real benefit: OFW can't use them because
the root file system is ext4 (that was the reason to have a separate boot
partition in the first place).

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---
 modules/sd_card_image/image.50.makefs.sh |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/sd_card_image/image.50.makefs.sh b/modules/sd_card_image/image.50.makefs.sh
index 9b6118b..35dbce7 100644
--- a/modules/sd_card_image/image.50.makefs.sh
+++ b/modules/sd_card_image/image.50.makefs.sh
@@ -14,12 +14,11 @@ CYLINDER_SIZE_BYTE=$(($NUM_SECTORS_PER_TRACK * $NUM_HEADS * $BLOCK_SIZE_BYTE))
 
 # FIXME trap signals and cleanup
 # FIXME check that traps due to errors are caught
-BOOT=$intermediatesdir/mnt-boot
 ROOT=$intermediatesdir/mnt-root
+BOOT=$ROOT/boot
 
 umount $BOOT &>/dev/null || :
 umount $ROOT &>/dev/null || :
-mkdir -p $BOOT
 mkdir -p $ROOT
 
 
@@ -55,12 +54,13 @@ make_image()
 	kpartx -a -p p /dev/mapper/$dm_name
 
 	echo "Create filesystems..."
-	mke2fs -O dir_index,^resize_inode -L Boot -F /dev/mapper/${dm_name}p1
-	mount /dev/mapper/${dm_name}p1 $BOOT
-
 	mkfs.ext4 -O dir_index,^huge_file -E resize=8G -m1 -L OLPCRoot /dev/mapper/${dm_name}p2
 	tune2fs -o journal_data_ordered /dev/mapper/${dm_name}p2
 	mount /dev/mapper/${dm_name}p2 $ROOT
+	mkdir -p $BOOT
+
+	mke2fs -O dir_index,^resize_inode -L Boot -F /dev/mapper/${dm_name}p1
+	mount /dev/mapper/${dm_name}p1 $BOOT
 
 	echo "Copy in root filesystem..."
 	cp -a $fsmount/* $ROOT
@@ -87,12 +87,11 @@ make_image()
 		ln -s boot/alt $BOOT/boot-alt
 		cp -ar $ROOT/versions/pristine/$buildnr/boot/* $tgt
 	else
-		cp -ar $ROOT/boot/* $BOOT
 		ln -s . $BOOT/boot
 	fi
 
-	umount $ROOT
 	umount $BOOT
+	umount $ROOT
 	kpartx -d -p p /dev/mapper/$dm_name
 	dmsetup remove $dm_name
 	losetup -d $loop_dev
-- 
1.7.4.1




More information about the Devel mailing list