Re: [blfs-dev] (peer review?) lfs-bootscripts-20190524, /sbin/ifup + bridge -> bug ?

2019-06-12 Thread DJ Lucas via blfs-dev


On 6/10/2019 7:39 AM, Jean-Marc Pigeon via blfs-dev wrote:


Let me comments on this, trying not to be mean but rather constructive.
(after all, the whole LFS project purpose is to learn).

Lets be blunt and summarize your previous statement as I understand it.

"previous script incarnation are messy, I have problems with message 
cosmetic entries, such lets add a a variable (VIRTINT) to 
configuration STANDARD to help me write code).

Then in the 20190524 iteration,  ifup code become such:

# If interface ISNOT virtual then configure interface
# prepare interface
# if interface IS virtual then configure interface.

May I suggest (as it was previously)

# prepare interface
# configure interface
If I'm correctly understanding your comments above, you've 
misinterpreted the first if block in the original script (lending credit 
to my assertion of needless complexity). Please try and single step 
through it once for a virtual interface and take note of the unneeded 
call to up(). The logic you applied to the new script is ultimately 
exactly how the old worked as well, and this is how it needs to be. You 
can't set up an interface if it doesn't yet exist. The method of 
determining if it is a virtual interface has changed to explicitly 
stating so, avoiding that unnecessary call to up(), and the expensive 
test that also leads to unnecessary redirection and several unnecessary 
'echo \n' invocations that made the downstream scripts more complex than 
they needed to be. I could simply end the output (accurately stating 
that the interface was set UP, and so I did. There is still room for 
improvement in that regard, I could probably kill a few of the 'echo -n' 
as well, and it was only reduced by a couple of empty messages anyway, 
but it's better than it was, and presentation is now consistent with the 
rest of the scripts (the original reason that I looked at it).


From above, I am unable to determine if you are still having a problem 
after you've set VIRTINT to yes as requested. If there is still a 
problem after correcting your configuration for the new script, then I 
do need to address that error. Additionally, if you can suggest a better 
way to test (preferably a test that we don't have to dump the result and 
do the echo \n thing again), I could reconsider the additional variable 
if it's really a big deal, but please understand that I view this as 
static data, something that does belong in the configuration rather than 
being tucked away in difficult to read logic.


--DJ


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


Re: [blfs-dev] (peer review?) lfs-bootscripts-20190524, /sbin/ifup + bridge -> bug ?

2019-06-10 Thread Jean-Marc Pigeon via blfs-dev

Hello DJ,

On 06/10/2019 01:14 AM, DJ Lucas via blfs-dev wrote:


On 6/9/2019 3:45 PM, Jean-Marc Pigeon via blfs-dev wrote:

Hello,

/sbin/ifup was changed between lfs-bootscripts-20180820
and fs-bootscripts-20190524

Sequence
;---
# Bring up the interface
if [ "$VIRTINT" != "yes" ]; then
   up ${IFACE}
fi

for S in ${SERVICE}; do
;---

This cause trouble in case you have defined a bridge interface.
(a bridge interface is now a virtual one?),
as the bridge can NOT be UP before service bridge define it.

There is a kind of discrepancy between
line 99:
if [ "$VIRTINT" != "yes" ]; then
   up ${IFACE}

and line 122:
if [ "${VIRTINT}" == "yes" ]; then
   up ${IFACE}


Comments??


This was answered in a private thread, but repeating here in case it
comes up again. For any virtual interfaces, you need to add
"VIRTINT=yes" to the configuration. This is to avoid a couple of
problems with the earlier incarnations of this script (and Beyond BLFS
scripts). The order of operations has changed a bit to avoid the
unnecessary boot_mesg*2 cosmetic entries and disposing of the bad return
value, as well as bringing up a virtual interface before it is
configured by the service (and to fix a couple of other odd corner cases).

HTH


Let me comments on this, trying not to be mean but rather constructive.
(after all, the whole LFS project purpose is to learn).

Lets be blunt and summarize your previous statement as I understand it.

"previous script incarnation are messy, I have problems with message 
cosmetic entries, such lets add a a variable (VIRTINT) to configuration 
STANDARD to help me write code).

Then in the 20190524 iteration,  ifup code become such:

# If interface ISNOT virtual then configure interface
# prepare interface
# if interface IS virtual then configure interface.

May I suggest (as it was previously)

# prepare interface
# configure interface

Procedure "prepare interface" should hide and take
care about real/virtual interface context (layering).
Adding/extending standard or adding complexity to
(current) configuration files is always tricky.
My 2 cents.


On a more philosophical stand, "we" have a big problem
with Linux components layering. Very hard to predict
a distribution behaviour, it all depends about
compilation context and sequence (IMHO, This is LFS
project interest, trying to address this...)

For each of us, the problem is not to write lines
of code, the problem is to write lean and clean code.
(This is the very real challenge, ask to Boeing Max 9 team :( )

--
seen "Linux from scratch" and looking for ISO files
www.osukiss.org



smime.p7s
Description: S/MIME Cryptographic Signature
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page