summaryrefslogtreecommitdiff
path: root/packages/openslug-init/openslug-init-0.10/turnup
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@nslu2-linux.org>2005-07-16 22:26:50 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-07-16 22:26:50 +0000
commit75614468f46b70cc3aa9d9dc88d44e54666219e3 (patch)
treeeaf4ae2d96d0581018e7669f94edf376dfab3d0f /packages/openslug-init/openslug-init-0.10/turnup
parentfe3dc9b7310e70bb1eac866a5b55b5f4bfbdf0df (diff)
parent53aaeb6d952beea5a2df399321b286c6a72b025c (diff)
propagate from branch 'org.openembedded.dev' (head 50712da157ce819a41034d91e842f659f060e42e)
to branch 'org.openembedded.nslu2-linux' (head b810c89693fd745a4fd808082ffac3a03e1223c4)
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, 19 insertions, 13 deletions
diff --git a/packages/openslug-init/openslug-init-0.10/turnup b/packages/openslug-init/openslug-init-0.10/turnup
index 80afac7819..ce504b022e 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
@@ -749,8 +753,10 @@ init_network() {
read_one "First DNS server" network dns_server1
read_one "Second DNS server" network dns_server2
read_one "Third DNS server" network dns_server3
+ echo "$ip_addr $disk_server_name" >> /etc/hosts
+ ;;
+ dhcp) sed -i -e "s/localhost\$/localhost $disk_server_name/" /etc/hosts
;;
- dhcp) ;;
*) bootproto=dhcp;;
esac
#