summaryrefslogtreecommitdiff
path: root/packages/openslug-init/openslug-init-0.10/turnup
diff options
context:
space:
mode:
Diffstat (limited to 'packages/openslug-init/openslug-init-0.10/turnup')
-rw-r--r--packages/openslug-init/openslug-init-0.10/turnup28
1 files changed, 16 insertions, 12 deletions
diff --git a/packages/openslug-init/openslug-init-0.10/turnup b/packages/openslug-init/openslug-init-0.10/turnup
index 80afac7819..977fa1f520 100644
--- a/packages/openslug-init/openslug-init-0.10/turnup
+++ b/packages/openslug-init/openslug-init-0.10/turnup
@@ -4,6 +4,10 @@
#
. /etc/default/functions
+INRAM_MEMSTICK="/var/cache /var/lock /var/log /var/run /var/tmp /var/lib/ipkg"
+INRAM_NFS="/var/cache /var/run"
+INRAM_DISK=""
+
#
# force: override certain checks
force=
@@ -169,29 +173,29 @@ setup_var() {
}
case "$2" in
disk|nfs|memstick);;
- *) echo "turnup: setup_var($1,$2): expected 'disk' or 'nfs'" >&2
+ *) echo "turnup: setup_var($1,$2): expected 'disk', 'nfs' or 'memstick'" >&2
return 1;;
esac
#
# populate /var, there is a shell script to do this, but it uses
# absolute path names
- chroot "$1" /bin/busybox sh /etc/init.d/populate-var.sh || {
+ chroot "$1" /bin/busybox sh /etc/init.d/populate-volatile.sh || {
echo "turnup: /var: could not populate directory" >&2
return 1
}
case "$2" in
- nfs|memstick)
- for d in "cache" "lock" "log" "run" "tmp" "lib/ipkg"; do
- RAMDIR="/media/ram/${d}"
- VARDIR="/var/${d}"
- rm -rf "${1}/${VARDIR}"
- ln -s "${RAMDIR}" "${1}/${VARDIR}"
- sed -i "s@ ${VARDIR}@ ${RAMDIR}@" "$1"/etc/init.d/populate-var.sh
- done
- echo "mkdir -p /media/ram/lib/ipkg" >>"$1"/etc/init.d/populate-var.sh
- ;;
+ disk) RAMTARGETS=${INRAM_DISK};;
+ nfs) RAMTARGETS=${INRAM_NFS};;
+ memstick) RAMTARGETS=${INRAM_MEMSTICK};;
esac
+
+ for d in ${RAMTARGETS}; do
+ RAMDIR="/media/ram${d}"
+ REALDIR="${d}"
+ rm -rf "${1}${REALDIR}"
+ ln -s "${RAMDIR}" "${1}${REALDIR}"
+ done
# the startup link is left for the moment, this seems safer
#rm "$1"/etc/rc?.d/[KS]??populate-var.sh
# remove the /var tmpfs entry from the new /etc/fstab