summaryrefslogtreecommitdiff
path: root/i/pc104/initrd/conf/update_initrd.sh
diff options
context:
space:
mode:
authordufourj2006-01-16 21:47:12 +0000
committerdufourj2006-01-16 21:47:12 +0000
commit144fba14de1f73fb7f8ce38639f05b795c8af141 (patch)
tree2159ee6d058da4f3c88d94c9accf3f013041f1a9 /i/pc104/initrd/conf/update_initrd.sh
parentfffdf9f5a7918070577ff6a96f083e957c2cf377 (diff)
PC104 :
- modifications mineurs pour les scripts du mode autonome ; - début du script d'update en autonome ; - correction du problème de dhcp en autonome ; - problème de ctrl-c ; - SD Card sux à mort !!
Diffstat (limited to 'i/pc104/initrd/conf/update_initrd.sh')
-rwxr-xr-xi/pc104/initrd/conf/update_initrd.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/i/pc104/initrd/conf/update_initrd.sh b/i/pc104/initrd/conf/update_initrd.sh
new file mode 100755
index 0000000..b06057c
--- /dev/null
+++ b/i/pc104/initrd/conf/update_initrd.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# The purpose of this script is to provide a system to update the PC104 in
+# autonomous mode via the network.
+# It is called by the linuxrc and should not be called by hand.
+
+# PATH is not correctly set...
+PATH=$PATH:/usr/sbin/
+# Bring eth0 up
+ifconfig eth0 up
+# Get the configuration of the network via dhcp
+udhcpc -i eth0 -s /etc/udhcpc.script
+# Wait here for a connection. I do not know if it is a feature or a bug, but
+# when nc receive a connection, it is end here.
+nc -l -p 1234
+
+# Mount the real system
+mount /mnt/localsys
+# Pivot root to the new_root.
+# XXX It is a good idea to pivot_root ? Chroot is better ?
+cd /mnt/localsys
+pivot_root . old_root
+exec chroot . sh <dev/console >dev/console 2>&1
+# This part sux : what's about the old process ?
+# Kill them ?
+umount /old_root
+# We should call all the script
+# TODO : find a better way to call it.
+/etc/init.d/mountvirtfs start
+/etc/init.d/mountall.sh start
+/etc/init.d/networking start
+/etc/init.d/ssh start
+# XXX And for the end ?
+# The FS has enough errors so do it well ! Umount everything !