summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaromil <jaromil@129b00e9-8bf7-0310-bee9-bd51b64996e4>2008-03-15 14:14:18 (GMT)
committer jaromil <jaromil@129b00e9-8bf7-0310-bee9-bd51b64996e4>2008-03-15 14:14:18 (GMT)
commit9d5e9a8005ec7860f16e23ef1a2a8af0aa3e11d1 (patch)
tree2cea4780fb3c74fe26a1b62a5730df839e1ad2c7
parent71d0371b649a881fa042e11362f46fb2ab10cab0 (diff)
fixes for thin client setup: PXE and samba mounted system
now uses correctly the kernel modules offered by the host git-svn-id: svn://dyne.org/dynebolic@267 129b00e9-8bf7-0310-bee9-bd51b64996e4
-rw-r--r--dyneII/startup/lib/bootstrap.sh160
-rw-r--r--dyneII/startup/lib/kmods.sh22
-rw-r--r--dyneII/startup/lib/modules.sh28
3 files changed, 110 insertions, 100 deletions
diff --git a/dyneII/startup/lib/bootstrap.sh b/dyneII/startup/lib/bootstrap.sh
index 51d6e22..2a00714 100644
--- a/dyneII/startup/lib/bootstrap.sh
+++ b/dyneII/startup/lib/bootstrap.sh
@@ -197,6 +197,84 @@ mount -o bind,rw /dev/shm/tmp /tmp
chmod a+rwx /tmp
chmod +t /tmp
+#### if network boot is configured...
+# at this point all modules should be loaded in order to have
+# the network card recognized. put needed modules in /boot or in a dock
+BOOT_NETWORK="`get_config network_boot`" # "iface ip_address netmask gateway dns" or "dhcp"
+if [ $BOOT_NETWORK ]; then
+
+ if [ "`ifconfig -a | grep eth`" ]; then
+
+ notice "Network booting is configured"
+
+ IFACE=`echo $BOOT_NETWORK | cut -d, -f1`
+ IP=`echo $BOOT_NETWORK | cut -d, -f2`
+ if [ "`echo $IP | grep -iE 'pump|dhcp|auto'`" ]; then
+ act "autodetect network configuration (DHCP)"
+ pump -i ${IFACE}
+ else
+ act "configuring interface ${IFACE} with ip ${IP}"
+ ifconfig ${IFACE} ${IP}
+ fi
+
+
+#### FTP DOWNLOAD
+
+ DOCK_FTP=`get_config dock_download_ftp` # remote_host remote_dyne_dir local_destination_dir
+ if [ $DOCK_FTP ]; then
+ REMOTE_HOST="`echo $DOCK_FTP |awk '{ print $1 }'`"
+ REMOTE_DIR="`echo $DOCK_FTP |awk '{ print $2 }'`"
+ LOCAL_DIR="`echo $DOCK_FTP |awk '{ print $3 }'`"
+ notice "Configured to download a dock from ftp://${REMOTE_HOST}/${REMOTE_DIR}"
+ act "will save the dock in $LOCAL_DIR"
+ ncftpget -R $REMOTE_HOST $LOCAL_DIR $REMOTE_DIR
+ fi
+
+
+
+#### RSYNC UPDATE
+
+ DOCK_RSYNC=`get_config dock_update_rsync` # rsync.host::module/dyne local_destination_dir
+ if [ $DOCK_RSYNC ]; then
+ REMOTE_RSYNC="`echo $DOCK_RSYNC |awk '{ print $1 }'`"
+ LOCAL_DIR="`echo $DOCK_RSYNC |awk '{ print $2 }'`"
+ notice "Upgrading the system from rsync://$REMOTE_RSYNC"
+ act "will save the dock in $LOCAL_DIR"
+ rsync -Pr ${REMOTE_RSYNC} ${LOCAL_DIR}
+ fi
+
+
+#### SAMBA REMOTE DOCKING
+
+ DOCK_SAMBA=`get_config dock_mount_samba` # network_address (public access)
+ if [ $DOCK_SAMBA ]; then
+ notice "Configured to mount samba dock from ${DOCK_SAMBA}"
+ mkdir -p /mnt/smbdock
+ loadmod smbfs
+ sync
+ mount -t smbfs -o ro,guest,ttl=10000,sock=IPTOS_LOWDELAY,TCP_NODELAY //${DOCK_SAMBA}/dyne.dock /mnt/smbdock
+ if [ $? != 0 ]; then # mount failed
+ error "mount failed, remote dock aborted"
+ else
+ if ! [ -r "/mnt/smbdock/dyne.sys" ]; then
+ error "no dyne system found on ${DOCK_SAMBA}"
+ umount /mnt/smbdock
+ else
+ DYNE_SYS_MEDIA=samba
+ DYNE_SYS_MNT=/mnt/smbdock
+ DYNE_SYS_DEV=${DOCK_SAMBA}
+ add_volume samba ${DOCK_SAMBA} smbdock smbfs
+ fi
+ fi
+ fi
+
+
+
+ else
+ error "Can't find any network device: network boot is aborted"
+ fi
+fi
+
#########################################
## scan all volumes by default
@@ -303,88 +381,6 @@ fi
-#### if network boot is configured...
-# at this point all modules should be loaded in order to have
-# the network card recognized. put needed modules in /boot or in a dock
-BOOT_NETWORK="`get_config network_boot`" # "iface ip_address netmask gateway dns" or "dhcp"
-if [ $BOOT_NETWORK ]; then
-
- if [ "`ifconfig -a | grep eth`" ]; then
-
- notice "Network booting is configured"
-
- IFACE=`echo $BOOT_NETWORK | cut -d, -f1`
- IP=`echo $BOOT_NETWORK | cut -d, -f2`
- if [ "`echo $IP | grep -iE 'pump|dhcp|auto'`" ]; then
- act "autodetect network configuration (DHCP)"
- pump -i ${IFACE}
- else
- act "configuring interface ${IFACE} with ip ${IP}"
- ifconfig ${IFACE} ${IP}
- fi
-
-
-
-
-#### FTP DOWNLOAD
-
- DOCK_FTP=`get_config dock_download_ftp` # remote_host remote_dyne_dir local_destination_dir
- if [ $DOCK_FTP ]; then
- REMOTE_HOST="`echo $DOCK_FTP |awk '{ print $1 }'`"
- REMOTE_DIR="`echo $DOCK_FTP |awk '{ print $2 }'`"
- LOCAL_DIR="`echo $DOCK_FTP |awk '{ print $3 }'`"
- notice "Configured to download a dock from ftp://${REMOTE_HOST}/${REMOTE_DIR}"
- act "will save the dock in $LOCAL_DIR"
- ncftpget -R $REMOTE_HOST $LOCAL_DIR $REMOTE_DIR
- fi
-
-
-
-#### RSYNC UPDATE
-
- DOCK_RSYNC=`get_config dock_update_rsync` # rsync.host::module/dyne local_destination_dir
- if [ $DOCK_RSYNC ]; then
- REMOTE_RSYNC="`echo $DOCK_RSYNC |awk '{ print $1 }'`"
- LOCAL_DIR="`echo $DOCK_RSYNC |awk '{ print $2 }'`"
- notice "Upgrading the system from rsync://$REMOTE_RSYNC"
- act "will save the dock in $LOCAL_DIR"
- rsync -Pr ${REMOTE_RSYNC} ${LOCAL_DIR}
- fi
-
-
-
-
-#### SAMBA REMOTE DOCKING
-
- DOCK_SAMBA=`get_config dock_mount_samba` # network_address (public access)
- if [ $DOCK_SAMBA ]; then
- notice "Configured to mount samba dock from ${DOCK_SAMBA}"
- mkdir -p /mnt/smbdock
- loadmod smbfs
- sync
- mount -t smbfs -o ro,guest,ttl=10000,sock=IPTOS_LOWDELAY,TCP_NODELAY //${DOCK_SAMBA}/dyne.dock /mnt/smbdock
- if [ $? != 0 ]; then # mount failed
- error "mount failed, remote dock aborted"
- else
- if ! [ -r "/mnt/smbdock/dyne.sys" ]; then
- error "no dyne system found on ${DOCK_SAMBA}"
- umount /mnt/smbdock
- else
- DYNE_SYS_MEDIA=samba
- DYNE_SYS_MNT=/mnt/smbdock
- DYNE_SYS_DEV=${DOCK_SAMBA}
- add_volume samba ${DOCK_SAMBA} smbdock smbfs
- fi
- fi
- fi
-
-
-
- else
- error "Can't find any network device: network boot is aborted"
- fi
-fi
-
#### if /usr is not already mounted then let's go looking for a system
#### this control lets have dyne:bolic run from a partition
diff --git a/dyneII/startup/lib/kmods.sh b/dyneII/startup/lib/kmods.sh
index 58faa0c..10bd452 100644
--- a/dyneII/startup/lib/kmods.sh
+++ b/dyneII/startup/lib/kmods.sh
@@ -6,28 +6,14 @@ source /lib/dyne/utils.sh
scan_docked_kmods() {
- if [ "$1" = "hdisk" ]; then
-
- kmods=`cat /boot/volumes | grep '^hdisk' | grep krn`
-
- elif [ "$1" = "dvd" ]; then
-
- kmods=`cat /boot/volumes | grep '^dvd' | grep krn`
-
- elif [ "$1" = "cdrom" ]; then
-
- kmods=`cat /boot/volumes | grep '^cdrom' | grep krn`
-
- else
-
- return
-
- fi
+ kmods=`cat /boot/volumes | grep krn`
for k in ${(f)kmods}; do
kpath="`echo ${k} | awk '{print $3}'`/dyne/linux-${KRN}.kmods"
-
+ if ! [ -r $kpath ]; then # try without dyne/ for samba
+ kpath="`echo ${k} | awk '{print $3}'`/linux-${KRN}.kmods"
+ fi
if ! [ -r $kpath ]; then continue; fi
if [ "$kmods_found" = "true" ]; then break; fi
diff --git a/dyneII/startup/lib/modules.sh b/dyneII/startup/lib/modules.sh
index bb9e836..596f3de 100644
--- a/dyneII/startup/lib/modules.sh
+++ b/dyneII/startup/lib/modules.sh
@@ -219,6 +219,34 @@ mount_dyne_modules() {
act "${mod_name} mounted in /opt"
done
+
+# samba docks have no dyne subdir
+
+ for mod in `find ${moddock}/modules/ -name '*.dyne'`; do
+ # squashed .dyne module
+
+ # get the name without path nor .dyne suffix
+ mod_name=`basename ${mod} .dyne`
+
+ if [ -r /opt/${mod_name}/VERSION ]; then
+ act "module ${mod_name} is already mounted, skipping.."
+ continue
+ fi
+
+ mkdir -p /opt/${mod_name}
+
+ mount -t squashfs -o loop,ro,suid ${mod} /opt/${mod_name}
+ if [ $? != 0 ]; then #mount failed
+ error "failed mounting ${mod_name}"
+ continue
+ fi
+
+ add_module_path ${mod_name}
+
+ act "${mod_name} mounted in /opt"
+
+ done
+
done
fi