From f6d0c0596b696a3460bc404ec07c6feaae603a6f Mon Sep 17 00:00:00 2001 From: Mike Staszel Date: Wed, 7 Jul 2010 18:49:07 -0700 Subject: [PATCH] Added plugscripts and the fixroot.sh script --- scripts/plugscripts/README | 3 +++ scripts/plugscripts/fixroot.sh | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 scripts/plugscripts/README create mode 100755 scripts/plugscripts/fixroot.sh diff --git a/scripts/plugscripts/README b/scripts/plugscripts/README new file mode 100644 index 000000000..bead5ea54 --- /dev/null +++ b/scripts/plugscripts/README @@ -0,0 +1,3 @@ +==== ./scripts/plugscripts/ ==== +This folder contains scripts that should be run on a user's device, +post-install. diff --git a/scripts/plugscripts/fixroot.sh b/scripts/plugscripts/fixroot.sh new file mode 100755 index 000000000..dd2d77d49 --- /dev/null +++ b/scripts/plugscripts/fixroot.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root." 1>&2 + exit 1 +fi + +echo "This script will fix fstab for you so that tools like df work correctly." +echo "" +echo "" +echo "Please select your root device from the list below:" + +showMenu () { + echo "1) NAND" + echo "2) SD" + echo "3) USB" + echo "4) Exit" +} +showMenu +read CHOICE + +case "$CHOICE" in + "1"|"NAND") + echo "ubi0:rootfs / ubifs defaults,noatime 0 0" >> /etc/fstab + ;; + "2"|"SD") + echo "/dev/mmcblk0p1 / ext2 defaults,noatime 0 0" >> /etc/fstab + ;; + "3"|"USB") + echo "/dev/sda1 / ext2 defaults,noatime 0 0" >> /etc/fstab + ;; + "4"|"Exit") + exit + ;; + +esac + +clear +echo "Below is the new fstab, check it before rebooting!" +echo "" +echo "" +echo "" +echo "" +cat /etc/fstab