summaryrefslogtreecommitdiff
path: root/i/pc104/initrd/conf/update_initrd.sh
diff options
context:
space:
mode:
authordufourj2006-02-04 21:34:07 +0000
committerdufourj2006-02-04 21:34:07 +0000
commit831e13eea8edbe4fbb6693628607b14bfd4f1aa8 (patch)
tree242bfe110cde987c895ecd37024244bc5ccbfc0a /i/pc104/initrd/conf/update_initrd.sh
parentd730013d29570d1669ea242927f197e05147f6e4 (diff)
PC104 :
- suppression du pivot_root (chroot convient mieux aux besoins) ; - script de mise à jour du programme sur l'initrd PC104 en autonome quasi-fonctionnel (quelques amélioriation à faire) ; - impossibilité de démarrer un binaire créé sur lampion sans provoquer un kill du kernel (certains supports noyau manquant ? Lib ou autres programmes manquant ?). - l'initrd compressé c'est rapide à booter mais long à mettre à jour...
Diffstat (limited to 'i/pc104/initrd/conf/update_initrd.sh')
-rwxr-xr-xi/pc104/initrd/conf/update_initrd.sh36
1 files changed, 16 insertions, 20 deletions
diff --git a/i/pc104/initrd/conf/update_initrd.sh b/i/pc104/initrd/conf/update_initrd.sh
index 4a76956..1f99519 100755
--- a/i/pc104/initrd/conf/update_initrd.sh
+++ b/i/pc104/initrd/conf/update_initrd.sh
@@ -1,37 +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.
+# It is called by the linuxrc/init at boot in another process so it can be
+# blocking. It 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
+# TODO Check life time of this program and that it does not do stupid things
+# after a while...
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. Maybe it is because of the
# missing library (warmed by gcc at compiled time)
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 ?
+# From here, someone has connected to the 1234 port, we mount the real linux
+# inside of the PC104 and start a ssh daemon, it is easier to use
+#
+# Mount the real system read only (security reason in case of hard reboot)
+mount -r /mnt/localsys
+# Chroot to the new_root
cd /mnt/localsys
-pivot_root . old_root
-# FIXME: I do not sure this is the good solution... Why make a exec and a
-# chroot ? I am not sure it is a good idea...
-exec chroot . sh -c '/etc/init.d/mountvirtfs; /etc/init.d/ssh start;' \
+# For the moment, I have seen it is compulsary to put the redirection
+chroot . sh -c '/etc/init.d/mountvirtfs; /etc/init.d/ssh start; exit' \
<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 !
+# XXX I would like the previous command to end, and give back the hand to the
+# next one. This way, I could have still a way to comunicate with the PC104 by
+# the initrd and not by the chrooted mode.
+# read 5