summaryrefslogtreecommitdiff
path: root/packages/openslug-init/openslug-init-0.10/turnup
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@nslu2-linux.org>2005-07-19 06:31:56 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-07-19 06:31:56 +0000
commit1b45793e53bc6eb1ac71ef2f051359b674815788 (patch)
tree945695c44dcd9ca1ad8e0bd8fc514a6c6db0eda5 /packages/openslug-init/openslug-init-0.10/turnup
parente76d9a8ba9c798803949a61da8d5e72c66ec7f7b (diff)
slugbug 206: fix the tmpfs directories in NFS
slugbug 207: fix the flashdisk mount so that it works in the presence of an existing readonly mount (turnup, like reflash, now removes all existing flashdisk mounts)
Diffstat (limited to 'packages/openslug-init/openslug-init-0.10/turnup')
-rw-r--r--packages/openslug-init/openslug-init-0.10/turnup32
1 files changed, 26 insertions, 6 deletions
diff --git a/packages/openslug-init/openslug-init-0.10/turnup b/packages/openslug-init/openslug-init-0.10/turnup
index ce504b022e..0029697c50 100644
--- a/packages/openslug-init/openslug-init-0.10/turnup
+++ b/packages/openslug-init/openslug-init-0.10/turnup
@@ -4,10 +4,13 @@
#
. /etc/default/functions
+#
+# configuration
+# The following variables control which directories in /var end up on the rootfs
+# and which end up in a temporary file system.
INRAM_MEMSTICK="/var/cache /var/lock /var/log /var/run /var/tmp /var/lib/ipkg"
-INRAM_NFS="/var/cache /var/run"
+INRAM_NFS="/var/cache /var/lock /var/run /var/tmp"
INRAM_DISK=""
-
#
# force: override certain checks
force=
@@ -61,6 +64,23 @@ fsoptions() {
fi
}
#
+# get_flash <directory> {mount options}
+# mount the flash device, writeable, on the given directory
+get_flash() {
+ local ffsdir ffsdev
+
+ ffsdir="$1"
+ shift
+ test -n "$ffsdir" -a -d "$ffsdir" || {
+ echo "$0: $ffsdir: internal error, flash mount point not a directory" >&2
+ return 1
+ }
+
+ ffsdev="$(mtblockdev Flashdisk)"
+ umountflash "$ffsdev" &&
+ mountflash "$ffsdev" "$ffsdir" "$@"
+}
+#
# check_rootfs [-i] <root fs directory>
# Make sure the candidate rootfs is empty
check_rootfs() {
@@ -425,7 +445,7 @@ disk() {
}
# make sure we can get to the flash file system first
- mountflash "$ffs" || {
+ get_flash "$ffs" || {
rmdir "$new" "$ffs"
return 1
}
@@ -509,7 +529,7 @@ boot_reset() {
return 1
}
- mountflash "$ffs" || {
+ get_flash "$ffs" || {
rmdir "$ffs"
return 1
}
@@ -558,7 +578,7 @@ nfs() {
}
# make sure we can get to the flash file system first
- mountflash "$ffs" || {
+ get_flash "$ffs" || {
rmdir "$new" "$ffs"
return 1
}
@@ -670,7 +690,7 @@ fix_hw_addr() {
# this isn't the flash device
ffs="/tmp/flashdisk.$$"
# make sure we can get to the flash file system first
- mountflash "$ffs" || {
+ get_flash "$ffs" || {
rmdir "$ffs"
return 1
}