Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add first time boot code to format the user partition if invalid.

Automount boot and user partitions
  • Loading branch information...
commit e27cdce1045b1c4bffcdc7710b2a3b4661b0384e 1 parent 89d390a
@fhunleth fhunleth authored
View
4 board/erlangbone/busybox_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.19.3
-# Sat Jan 21 16:22:49 2012
+# Sat Feb 4 21:03:43 2012
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -543,7 +543,7 @@ CONFIG_FDFORMAT=y
# CONFIG_FLOCK is not set
CONFIG_FREERAMDISK=y
# CONFIG_FSCK_MINIX is not set
-# CONFIG_MKFS_EXT2 is not set
+CONFIG_MKFS_EXT2=y
# CONFIG_MKFS_MINIX is not set
# CONFIG_FEATURE_MINIX2 is not set
# CONFIG_MKFS_REISER is not set
View
1  build_disk_image.sh
@@ -58,6 +58,7 @@ echo "Created $OUTPUTFILE and $OUTPUTFILE.zip."
echo
echo "Write to a MicroSD card by running:"
echo
+echo "find /dev -name \"sdX?\" -exec umount \"{}\" \";\""
echo "sudo dd if=$OUTPUTFILE of=/dev/sdX bs=128k"
echo "where sdX is where the MicroSD card was mounted."
View
30 create_sdcard.sh
@@ -1,30 +0,0 @@
-#!/bin/sh -e
-
-export LC_ALL=C
-
-if [ $# -ne 1 ]; then
- echo "Usage: sudo $0 </dev/sdX>"
- exit 1
-fi
-
-DRIVE=$1
-
-sfdisk -H 255 -S 63 $DRIVE << EOF
-0,9,c,*
-,62
-,62
-,124
-EOF
-
-mkfs.vfat ${DRIVE}1 -n boot
-mkdir -p /tmp/sdcard
-mount ${DRIVE}1 /tmp/sdcard
-cp output/images/MLO /tmp/sdcard
-cp output/images/uImage /tmp/sdcard
-cp output/images/u-boot.img /tmp/sdcard
-umount /tmp/sdcard
-rmdir /tmp/sdcard
-
-dd if=output/images/rootfs.ext2 of=${DRIVE}2 bs=128k
-
-mkfs.ext2 -L home ${DRIVE}4
View
5 fs/skeleton/etc/fstab
@@ -12,5 +12,6 @@ sysfs /sys sysfs defaults 0 0
# put its cookie file and some small scripts there.
tmpfs /home/default tmpfs defaults,gid=1000,uid=1000,mode=2755,size=16m 0 0
-# Large file system for big and persistent stuff
-/dev/mmcblk0p4 /mnt ext2 defaults 0 0
+# Other filesystems on the MicroSD card
+/dev/mmcblk0p1 /mnt/boot vfat ro,defaults 0 0
+/dev/mmcblk0p3 /mnt/user ext2 defaults 0 0
View
30 fs/skeleton/etc/init.d/S99firstboot
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Check for the first boot and initialize the MicroSD card
+# if it has not been initialized before.
+
+# The image creation script will create a file in the VFAT partition
+# called 1stboot. After we have initialized everything, erase this
+# file. The next time that the user boots, this logic will be skipped.
+
+if [ -e /mnt/boot/1stboot ];
+then
+ echo "First time boot detected"
+
+ grep mmcblk0p3 /proc/mounts >/dev/null
+ if [ "$?" != "0" ];
+ then
+ echo "Performing first time format of /mnt/user (/dev/mmcblk0p3)"
+ mke2fs -L bbone-user /dev/mmcblk0p3
+
+ # Mount our newly formatter user partition
+ mount /mnt/user
+ fi
+
+ echo "Clearing first time boot flag"
+ mount -o remount,rw /mnt/boot
+ rm /mnt/boot/1stboot
+ mount -o remount,ro /mnt/boot
+fi
+
+
View
0  fs/skeleton/mnt/.empty → fs/skeleton/mnt/boot/.empty
File renamed without changes
View
0  fs/skeleton/mnt/user/.empty
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.