X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Finstall-bootscripts;h=07c2d1889968870e5121fa0dd2874a3dddb64b02;hb=2d56e369dbc033f743dfcc0b392c844d6299937b;hp=f0a45a34bec55206e87bc1d40dc1f7a6d5d99583;hpb=f3c8db3027d5dc530e1f30c88e0235975211582e;p=hvlinux.git diff --git a/stage2/install-bootscripts b/stage2/install-bootscripts index f0a45a3..07c2d18 100755 --- a/stage2/install-bootscripts +++ b/stage2/install-bootscripts @@ -8,7 +8,7 @@ cat > /etc/sysconfig/network/ifconfig.lo << "EOF" ONBOOT="yes" BOOTPROTO="static" IPADDR="127.0.0.1" -PREFIX_LENGTH=8 +NETMASK_LENGTH=8 IFSCOPE="scope host" EOF @@ -17,18 +17,45 @@ for nic_device in ${INTERFACES}; do file="/etc/sysconfig/network/ifconfig.${nic_device}" echo "ONBOOT=\"yes\"" > ${file} echo "BOOTPROTO=\"${BOOTPROTO[${LOOP_INDEX}]}\"" >> ${file} - echo "IPADDR=\"${IP_ADDRESS[${LOOP_INDEX}]}\"" >> ${file} - echo "PREFIX_LENGTH=\"${PREFIX_LENGTH[${LOOP_INDEX}]}\"" >> ${file} - echo "IFSCOPE=\"\"" >> ${file} - echo "GATEWAY=\"${GATEWAY[${LOOP_INDEX}]}\"" >> ${file} - - if [ "x${BOOTPROTO[${LOOP_INDEX}]}" = "xdhcp" ]; then + if [ "x${BOOTPROTO[${LOOP_INDEX}]}" = "xdhcp" -o \ + "x${BOOTPROTO[${LOOP_INDEX}]}" = "xwifi" ]; then DHCP_USED="yes" fi + if [ -n "${IP_ADDRESS[${LOOP_INDEX}]}" ]; then + echo "IPADDR=\"${IP_ADDRESS[${LOOP_INDEX}]}\"" >> ${file} + fi + if [ -n "${NETMASK_LENGTH[${LOOP_INDEX}]}" ]; then + echo "NETMASK_LENGTH=\"${NETMASK_LENGTH[${LOOP_INDEX}]}\"" >> ${file} + fi + if [ -n "${GATEWAY[${LOOP_INDEX}]}" ]; then + echo "GATEWAY=\"${GATEWAY[${LOOP_INDEX}]}\"" >> ${file} + fi + LOOP_INDEX=$((${LOOP_INDEX} + 1)) done +# Create template +cat > /etc/sysconfig/network/ifconfig.template << EOF +# yes or no +ONBOOT="yes" + +# static, dhcp or wifi +# When using static, you can still configure your DHCP server to reserve a +# static address (IPADDR). +# When using static address, don't forget to manually edit /etc/resolv.conf. +BOOTPROTO="static" + +# Only needed if BOOTPROTO=static +IPADDR="192.168.1.2" + +# Only needed if BOOTPROTO=static, normally 24 for 192.168.x.x LAN +NETMASK_LENGTH="24" + +# Only needed if BOOTPROTO=static. +GATEWAY="192.168.1.1" +EOF + # "/etc/resolv.conf" file if [ "x${DHCP_USED}" = "xno" ]; then if [ -f /etc/resolv.conf ]; then @@ -43,12 +70,20 @@ fi # "/etc/sysconfig/network/network-parameters" file creation echo "#!/bin/sh" > /etc/sysconfig/network/network-parameters +echo "" >> /etc/sysconfig/network/network-parameters +echo "# Run network script in the background, to speed-up boot time." >> \ + /etc/sysconfig/network/network-parameters +echo "BACKGROUND_START=no" >> /etc/sysconfig/network/network-parameters +echo "" >> /etc/sysconfig/network/network-parameters echo "DOMAINNAME=\"${DOMAIN}\"" >> /etc/sysconfig/network/network-parameters -echo "INTERFACES_UP=\"lo ${INTERFACES}\"" >> /etc/sysconfig/network/network-parameters -echo "INTERFACES_DN=\"${INTERFACES} lo\"" >> /etc/sysconfig/network/network-parameters +echo "INTERFACES=\"lo ${INTERFACES}\"" >> /etc/sysconfig/network/network-parameters cat >> /etc/sysconfig/network/network-parameters << EOF +# Signal to other scripts that all network interfaces have been started +# (especially usefull to prevent mountnetfs bootscript to block forever) +NETWORKING_UP_FILE=/var/run/networking-up + # On which network interface(s) to activate the DHCP server. # Leave empty or comment the line to disable the DHCP server. #DHCP_SERVER_IF="eth0" @@ -56,6 +91,12 @@ cat >> /etc/sysconfig/network/network-parameters << EOF # Set to "yes" to enable the NFS server: NFS_SERVER_ENA="no" +# Set to "yes" to enable the SSH server: +SSH_SERVER_ENA="no" + +# Set to "yes" to enable the DNS server: +DNS_SERVER_ENA="no" + # Set FIREWALL_ENA to "yes" to enable the firewall: FIREWALL_ENA="no" # Set FIREWALL_WWW to the ethernet interface connected to the outside world (internet): @@ -79,9 +120,9 @@ fi sed -i -e "s!^\(export PATH=\).*tools.*!\1/bin:/usr/bin:/sbin:/usr/sbin!" /etc/rc.d/init.d/functions # Copying boot scripts -STAGE2_BOOTSCRIPTS="ifdown ifup keyboard mountnetfs network sysklogd" +STAGE2_BOOTSCRIPTS="ifdown ifup keyboard mountnetfs network syslogd klogd" for bootscript in ${STAGE2_BOOTSCRIPTS}; do - install -m755 bootscripts/${bootscript} /etc/rc.d/init.d + install -v -m755 bootscripts/${bootscript} /etc/rc.d/init.d done # Necessary because bootscript_add_* scripts use ${LFS} when @@ -89,7 +130,8 @@ done export LFS= # rcsysinit.d -bootscript_add_rcsysinit sysklogd 50 93 +bootscript_add_rcsysinit syslogd 50 93 +bootscript_add_rcsysinit klogd 51 92 bootscript_add_rcsysinit keyboard 55 00 # rc3.d