From b1aa0f441e561581c3c1379e932c2ff86cc5009f Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Thu, 2 Oct 2008 22:17:09 -0400 Subject: [PATCH] Support using the internal NAND as the persistent /home for the OLPC The OLPC's internal NAND is a really good idea to use for /home rather than taking up the very hard to find RAM. The NAND is default set up with a /home on mtd0, so also do some magic so that we create our homedir under that /home. --- fedora-live-base.ks | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fedora-live-base.ks b/fedora-live-base.ks index 58daf9c..df2e6ec 100644 --- a/fedora-live-base.ks +++ b/fedora-live-base.ks @@ -131,7 +131,10 @@ mountPersistentHome() { fi # if we're given a file rather than a blockdev, loopback it - if [ ! -b "\$homedev" ]; then + if [ "\${homedev##mtd}" != "\${homedev}" ]; then + # mtd devs don't have a block device but get magic-mounted with -t jffs2 + mountopts="-t jffs2" + elif [ ! -b "\$homedev" ]; then loopdev=\`losetup -f\` if [ "\${homedev##/mnt/live}" != "\${homedev}" ]; then action "Remounting live store r/w" mount -o remount,rw /mnt/live @@ -141,7 +144,7 @@ mountPersistentHome() { fi # if it's encrypted, we need to unlock it - if [ "\$(/lib/udev/vol_id -t \$homedev)" = "crypto_LUKS" ]; then + if [ "\$(/lib/udev/vol_id -t \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then echo echo "Setting up encrypted /home device" plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome" @@ -149,7 +152,10 @@ mountPersistentHome() { fi # and finally do the mount - mount \$homedev /home + mount \$mountopts \$homedev /home + # if we have /home under what's passed for persistent home, then + # we should make that the real /home. useful for mtd device on olpc + if [ -d /home/home ]; then mount --bind /home/home /home ; fi [ -x /sbin/restorecon ] && /sbin/restorecon /home if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi }