On Tue, 2021-03-16 at 12:35 -0400, Scott Andrews wrote:
> 
> I am in the process of adding ipv6 to the the network scripts
> 
> Yes, I have read IPv6-in-LFS.txt and that isn't the proper way to add
> ipv6 to the bootscripts in my opinion. Good information wrong
> implementation. I am looking to create ipv6-static and maybe
> ipv6-static-route files.
> 
> May have to add something for wpa and dhcp, I have not researched
> that at this time and right now I am only concerned to get ipv6
> working with a static ip.
> 
> Now for the issues I have found......
> 
> grep -R PREVLEVEL *
> init.d/rc:previous=${PREVLEVEL}
> PREVLEVEL is never set in any script......
> 
> So Later......
> 
> grep -R previous *
> init.d/rc:previous=${PREVLEVEL}
> init.d/rc:[ "${previous}" == "" ] && previous=N
> init.d/rc:if [ "${previous}" != "N" ]; then
> init.d/rc:
> prev_start=/etc/rc.d/rc${previous}.d/S[0-9][0-9]${suffix}
> init.d/rc:if [ "${previous}" == "N" ]; then export
> IN_BOOT=1; fi 
> init.d/rc:      if [ "${previous}" != "N" ]; then
> init.d/rc:
> prev_start=/etc/rc.d/rc${previous}.d/S[0-9][0-9]${suffix}
> init.d/rc:if [ "${previous}" == "N" -a  "${runlevel}" != "S" ]; then
> 
> Since PREVLEVEL is not set anywhere in any of the boot scripts,
> as previous is always set to N

hint: init(8)

> 
> And previous is only set once in /etc/init.d/rc
> 
> Trouble ahead........
> 
> grep -R IN_BOOT *
> init.d/rc:if [ "${previous}" == "N" ]; then export IN_BOOT=1; fi
> sbin/ifup:if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then
> 
> Since IN_BOOT is only defined when rc has run ie "booting"
> 
> And IN_BOOT is undefined when: /etc/init.d/network restart
> 
> That causes all ifconfig.<iface> files to be brought up, with no way
> to disable one,

Well, I guess I've never tried /etc/init.d/network restart, since usually,
after boot, I only want to stop/start individual interfaces (I use "ifdown
<iface>" then "ifup <iface>").

If I want to disable an interface, I do:
mv /etc/sysconfig/{,nouse}ifconfig.<iface>

Certainly, lfs bootscripts are crude sometimes, and could be refined.
But then, they might not please everybody. I'd say they are some kind of
tradeoff between individual taste and everybody's expectations...

> 
> Adding/changing in /sbin/ifup:
> 
> # Do not process this service if ONBOOT is set to disabled
> if [ "${ONBOOT}" == "disabled" ]; then exit 0; fi

See above for disabling.

> 
> # Do not process this service if started by boot, and ONBOOT
> # is not set to yes
> if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then
>         exit 0
> fi
> 
> fixes this.....
> 
> My guess is that more evils exist in the bootscripts and to come out
> at night?

Well, the less sophisticated, the less possibility of evil, but some rough
corners...

> 
> PS.  
> 
> Shouldn't all the scripts have either
> 
> #! /bin/sh
> or
> #! /bin/bash
> 
> Just for consistency? and not be mixed?

Well, I'm not very good at spotting "bashisms", but maybe those who have
/bin/bash are supposed to really need bash?

> 
> And no undefined variables?

See above for PREVLEVEL


-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to