2011/9/1 Bruce Dubbs <bruce.du...@gmail.com>: > xinglp wrote: >> 2011/9/1 Bruce Dubbs <bruce.du...@gmail.com>: >>> xinglp wrote: >>>> 2011/8/31 Bruce Dubbs <bruce.du...@gmail.com>: >>>>> xinglp wrote: >>>>>> This is a patch fix some issues I met. >>>>> I'm looking at the changes, but don't see what problems they are trying >>>>> to solve. >>>>> >>>>> In the rc script, I think the change you made will set IN_BOOT >>>>> improperly if the user executes init to change run levels from, for >>>>> example, 5 to 3. >>>> Setting "ONBOOT=no" in /etc/sysconfig/ifconfig.xxx has NO effects. >>> OK, lets just address this for now. The boot sequence is >>> >>> Run init.d/rc script >>> Run init.d/network script >>> Run /sbin/ifup script >>> >>> I think I see the problem. In init.d/rc there is the line >>> >>> [ "${previous}" = "N" ] && IN_BOOT=1 >>> >>> Try changing that to >>> if [ "${previous}" = "N" ]; then >>> IN_BOOT=1 >>> export IN_BOOT >>> fi >>> >>> Please let me know if that works for you. >> >> Only work system startup, but not shutdown. > > Good. I'll make that change. Note that IN_BOOT should not be set for > shutdown. > > Now lets look at your other change: > > --- lfs-bootscripts-20110803.orig/lfs/sysconfig/network-devices/ifdown > +++ lfs-bootscripts-20110803/lfs/sysconfig/network-devices/ifdown > @@ -37,6 +37,11 @@ > exit 1 > fi > > +if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then > + echo_skipped > + exit 0 > +fi > + > > This will never be true because ifdown in never called by any scripts > during boot so IN_BOOT will never be equal to 1. > ################ > > @@ -57,9 +62,11 @@ > > if [ -n "${link_status}" ]; then > if echo "${link_status}" | grep -q UP; then > - boot_mesg "Bringing down the ${IFACE} interface..." > - ip link set ${IFACE} down > - evaluate_retval > + if ! ip addr show ${IFACE}|grep -q inet; then > + boot_mesg "Bringing down the ${IFACE} interface..." > + ip link set ${IFACE} down > + evaluate_retval > + fi > fi > fi > > This looks reasonable, but I'd like you to change it to: > > > if [ -n "${link_status}" ]; then > if [ echo "${link_status}" | grep -q UP && > ! ip addr show ${IFACE} | grep -q inet ]; then > > boot_mesg "Bringing down the ${IFACE} interface..." > ip link set ${IFACE} down > evaluate_retval > fi > fi > > Let me know if that works for you. > > -- Bruce > > > -- > http://linuxfromscratch.org/mailman/listinfo/lfs-dev > FAQ: http://www.linuxfromscratch.org/faq/ > Unsubscribe: See the above information page >
Finally. cp -av /etc/sysconfig/{ifconfig.eth0.ipv4,ifconfig.test} edit /etc/sysconfig/ifconfig.test set ONBOOT=yes to it. then reboot the lfs system, you will see a warning. -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page