[pkg-fso-commits] [SCM] Various non-packaged files branch, master, updated. fbcc696c651387637f16b277be5d4b6aad36edd0
Steffen Moeller
steffen_moeller at gmx.de
Thu Feb 19 23:43:44 UTC 2009
The following commit has been merged in the master branch:
commit 856e45f22f5108bd9b272e246886106be3e4aa29
Author: Steffen Moeller <steffen_moeller at gmx.de>
Date: Fri Feb 13 13:47:06 2009 +0100
Placing swap partition last, calculating cylinders
so the root FS can always be on the second partition.
diff --git a/install.sh b/install.sh
index 9a8431e..030ea51 100755
--- a/install.sh
+++ b/install.sh
@@ -157,7 +157,7 @@ Variables:
SD_PART1_FS the filesystem for the first microSD card partition,
i.e. the one containing the uImage.bin (default to
ext2, possible values are ext2/vfat)
- SD_PART1_SIZE number of megapytes for first partition (default $SD_PART1_SIZE)
+ SD_PART1_SIZE number of megabytes for first partition (default $SD_PART1_SIZE)
SD_SWAP_SIZE number of megabytes of swap partition (default $SD_SWAP_SIZE)
INST_DIR the directory where the microSD card partitions
will be mounted to (default to /mnt/debian)
@@ -398,6 +398,10 @@ dd if=/dev/zero of=$SD_DEVICE bs=512 count=1
# run partitioner
rootpartno=2
bootfstypeno=83
+
+mb=$(echo pq | fdisk /dev/mmcblk0 | grep Disk| cut -f 3 -d \ )
+cylinders=$(echo pq | fdisk /dev/mmcblk0 | grep cylinders|grep heads|cut -f 5 -d\ )
+
if [ "vfat" = "$SD_PART1_FS" ]; then
bootfstypeno=4
fi
@@ -409,6 +413,7 @@ p
1
+w
__END__
if [ -n "$SD_SWAP_SIZE" ]; then
@@ -426,27 +431,30 @@ t
$bootfstypeno
EOBOOTCONF
+ lastcylinder=$(($cylinders-($cylinders*$SD_SWAP_SIZE/$mb)))
if [ 0 -lt "$SD_SWAP_SIZE" ]; then
- rootpartno=3
- cat <<EOSWAPCONF >> /tmp/argsToFdisk$$
+ cat <<EOROOTCONF >> /tmp/argsToFdisk$$
n
p
2
-+${SD_SWAP_SIZE}M
+$lastcylinder
t
-82
-EOSWAPCONF
+83
+EOROOTCONF
+
fi
- cat <<EOROOTCONF >> /tmp/argsToFdisk$$
+ cat <<EOSWAPCONF >> /tmp/argsToFdisk$$
n
p
-$rootpartno
+3
+t
+82
w
-EOROOTCONF
+EOSWAPCONF
if fdisk $SD_DEVICE < /tmp/argsToFdisk$$; then
echo "Partitioning was successful."
@@ -456,6 +464,7 @@ EOROOTCONF
cat /tmp/argsToFdisk$$
exit -1
fi
+
fi
echo " * Waiting for partitions to appear"
@@ -658,11 +667,36 @@ rootfs / auto defaults,errors=remount-ro,noatime 0 1
__END__
if [ "$SINGLE_PART" != "true" ]; then
-cat >> $INST_DIR/etc/fstab <<__END__
+ if [ "ext2" = "$SD_PART1_FS" ]; then
+ cat >> $INST_DIR/etc/fstab <<__END__
/dev/mmcblk0p1 /boot auto defaults,noatime 0 2
__END__
+
+ else
+ cat >> $INST_DIR/etc/fstab <<__END__
+/dev/mmcblk0p1 /boot auto defaults,noatime,noauto 0 2
+__END__
+
+ fi
+
+ if [ 0 -lt "$SD_SWAP_SIZE" ]; then
+ cat >> $INST_DIR/etc/fstab <<__END__
+/dev/mmcblk0p3 none swap sw 0 0
+__END__
+
+ fi
+
+else
+
+ if [ 0 -lt "$SD_SWAP_SIZE" ]; then
+ cat >> $INST_DIR/etc/fstab <<__END__
+/dev/mmcblk0p2 none swap sw 0 0
+__END__
+ fi
+
fi
+
cat >> $INST_DIR/etc/fstab <<__END__
/dev/mtdblock6 /mnt/flash jffs2 defaults,noatime,noauto 0 2
proc /proc proc defaults 0 0
--
Various non-packaged files
More information about the pkg-fso-commits
mailing list