diff options
author | 2008-08-19 21:17:50 -0400 | |
---|---|---|
committer | 2008-08-19 21:17:50 -0400 | |
commit | 7428103d76399f7a55a59e89b12034dfeefb0ea9 (patch) | |
tree | 750b88bce0d24f442ce40bfc5882b2718e18f66a | |
parent | Last commit was too quick, warning message was incorrectly written and missin... (diff) | |
download | clustering-livecd-7428103d76399f7a55a59e89b12034dfeefb0ea9.tar.gz clustering-livecd-7428103d76399f7a55a59e89b12034dfeefb0ea9.tar.bz2 clustering-livecd-7428103d76399f7a55a59e89b12034dfeefb0ea9.zip |
Corrected /etc/conf.d/net configuration to send processor count as DNSMASQ_USER_CLASS0
The computation of CPU count is implemented in preup() within /etc/conf.d/net
Many thanks to Roy Marples (dhcpcd + openrc + ... ) for his patience and guidance on this one, it will come in very handy for the autoconfiguration of cluster nodes.
-rw-r--r-- | catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh b/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh index 63ab733..506a848 100644 --- a/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh +++ b/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh @@ -63,10 +63,19 @@ openrc_diskless_setup() { change_opt 'wipe_tmp="NO"' /etc/conf.d/bootmisc # /etc/conf.d/net - echo '# server side DNSMASQ_USER_CLASS0 will contain the processor count' - echo 'dhcpcd_eth0="--renew --persistent --userclass=$(c=0; for i in /sys/devices/system/cpu/cpu[0-9]*; do ((c++)); done; echo $c)"' >> /etc/conf.d/net + cat > /etc/conf.d/net <<-EOF + preup() { + local c=0 i + + for i in /sys/devices/system/cpu/cpu[0-9]*; do + c=$((${c} + 1)) + done + + dhcpcd_eth0="--persistent --userclass=\"np=${c}\"" + } + EOF # The above is an alternative which doesn't use wc, thus no superficial process spawning. -# echo 'dhcpcd_eth0="--persistent --userclass=$(ls -1d /sys/devices/system/cpu/cpu[0-9]* | /usr/bin/wc -l)"' >> /etc/conf.d/net +# echo 'dhcpcd_eth0="--persistent --userclass=\"$(ls -1d /sys/devices/system/cpu/cpu[0-9]* | /usr/bin/wc -l)\""' >> /etc/conf.d/net # Set clock to localtime as default |