Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 197791 - baselayout-2 and TCP/IP-less system
Summary: baselayout-2 and TCP/IP-less system
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-01 15:43 UTC by Alon Bar-Lev (RETIRED)
Modified: 2008-01-07 13:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
bridge-utils-1.2-noip.patch (bridge-utils-1.2-noip.patch,730 bytes, patch)
2007-11-01 15:45 UTC, Alon Bar-Lev (RETIRED)
Details | Diff
ifplugd-0.28-noip.patch (ifplugd-0.28-noip.patch,707 bytes, patch)
2007-11-01 15:48 UTC, Alon Bar-Lev (RETIRED)
Details | Diff
null lo patch (lo.patch,399 bytes, patch)
2007-11-01 16:12 UTC, Roy Marples (RETIRED)
Details | Diff
find /proc/net and /proc/sys/net (find.out,629 bytes, text/plain)
2007-11-01 16:57 UTC, Alon Bar-Lev (RETIRED)
Details
ipless.patch (ipless.patch,3.02 KB, patch)
2007-11-01 17:25 UTC, Roy Marples (RETIRED)
Details | Diff
ipless.patch (ipless.patch,3.84 KB, patch)
2007-11-01 20:21 UTC, Roy Marples (RETIRED)
Details | Diff
ipless.patch (ipless.patch,3.79 KB, patch)
2007-11-01 22:14 UTC, Roy Marples (RETIRED)
Details | Diff
ipless.patch (ipless.patch,3.79 KB, patch)
2007-11-01 22:17 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 15:43:34 UTC
Hello Roy,

Sorry it took some time, I have concluded these are the only issues left for supporting a system without TCP/IP in kernel.

Tested with rc6.

1. It will be nice if lo interface will accept config_lo="null" and will not try to assign IP address if null configuration is requested, same as any other interface.

2. ip route flush table cache dev XXX issues a warning that cannot open /proc/sys/net/.... maybe redirect to null (it returns success anyway).

3. /lib/rc/net/bridge.sh uses ifconfig in order to set promisc. From my tests this is not needed for bridging... Anyway, ifconfig does not work without TCP/IP... if iproute2 module is used, then ip link set $int promisc $state should be used in bridge as well.

4. ifplugd configuration does not work correctly, when this configuration is selected (modules="plug"), when interface is started I get:
WARNING: net.eth0 not under our control, aborting
This comes out of src/runscript.c, I don't exactly know what happens, I guess that if configuration is null then interface is started, and the condition of inactive does not apply.

5. OT: It is difficult to debug the background networking scripts... As the --debug only apply to current instance... Please consider adding IN_DEBUG environment variable or something similar so that debug will be inherited. Also the binary part of baselayout does not consider the --debug.

Thanks!
Comment 1 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 15:45:51 UTC
Created attachment 134899 [details, diff]
bridge-utils-1.2-noip.patch

A patch to allow bridge-utils to work in TCP/IP-less system.

robbat2: Upstream merged this.
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 15:48:08 UTC
Created attachment 134901 [details, diff]
ifplugd-0.28-noip.patch

A patch to allow bridge-utils to work in TCP/IP-less system.

uberlord: I sent to upstream, got no response, maybe you can help.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-11-01 15:56:49 UTC
(In reply to comment #0)
> 1. It will be nice if lo interface will accept config_lo="null" and will not
> try to assign IP address if null configuration is requested, same as any other
> interface.

Don't put net.lo in a runlevel then and we won't do anything with it.

> 5. OT: It is difficult to debug the background networking scripts... As the
> --debug only apply to current instance... Please consider adding IN_DEBUG
> environment variable or something similar so that debug will be inherited. Also
> the binary part of baselayout does not consider the --debug.

IN_BACKGROUND=true /etc/init.d/net.eth0 --debug start
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 16:07:49 UTC
> Don't put net.lo in a runlevel then and we won't do anything with it.

This is what I did.
But then I need to have several softlevel in order to determine when to include it and when not. An easier and more consistent solution would be to support "null" configuration.

> 5. OT: It is difficult to debug the background networking scripts... As the

IN_BACKGROUND=true /etc/init.d/net.eth0 --debug start

Tried this... :)
But I could not reproduce the issue by hand, I even commented out the ifplugd action and tried again...
I don't understand why the message (4) appear.
Comment 5 Roy Marples (RETIRED) gentoo-dev 2007-11-01 16:12:42 UTC
Created attachment 134915 [details, diff]
null lo patch

Well, it's no hardship to do this. Does this work for you?
Comment 6 Roy Marples (RETIRED) gentoo-dev 2007-11-01 16:23:46 UTC
Could you attach a directory layout of /proc/net and /proc/sys/net from your ipless kernel? Thanks
Comment 7 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 16:49:13 UTC
> Does this work for you?

Partially.
The routes should also be ignored
I ${config} is not available at the route point, but if I copy it, I can do:
[ "${config}" != "null" ] && routes="..."

Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 16:57:34 UTC
Created attachment 134919 [details]
find /proc/net and /proc/sys/net
Comment 9 Roy Marples (RETIRED) gentoo-dev 2007-11-01 17:25:19 UTC
Created attachment 134923 [details, diff]
ipless.patch

OK, this should deal with most of what you want changed in baselayout.
Comment 10 SpanKY gentoo-dev 2007-11-01 19:01:52 UTC
does disabling that stuff make any sense ?  iow, why are you running iproute/ifplugd/whatever in the first place on a system that lacks IP ?

simply sending things to >/dev/null is lame and can cover up real problems
Comment 11 Roy Marples (RETIRED) gentoo-dev 2007-11-01 19:09:42 UTC
(In reply to comment #10)
> does disabling that stuff make any sense ?  iow, why are you running
> iproute/ifplugd/whatever in the first place on a system that lacks IP ?

bridge uses iproute2/ifconfig to put the slave interface into promiscous mode. This is required if the slave interface has an ip address.

> simply sending things to >/dev/null is lame and can cover up real problems

I couldn't see anything in /proc to indicate if iconfig/iproute2 stands a chance of working or not. If the exact error message was given instead of "cannot open
/proc/sys/net/...." then maybe we could do something else.
Comment 12 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 19:25:37 UTC
(In reply to comment #11)
> bridge uses iproute2/ifconfig to put the slave interface into promiscous mode.
> This is required if the slave interface has an ip address.

What is slave interface?
Do you mean the eth0 for example that is part of the bridge?
If so, maybe turning promisc should be optional.

> > simply sending things to >/dev/null is lame and can cover up real problems
> 
> I couldn't see anything in /proc to indicate if iconfig/iproute2 stands a
> chance of working or not. If the exact error message was given instead of
> "cannot open
> /proc/sys/net/...." then maybe we could do something else.
> 

ip link set eth0 promisc on

Works... it uses ioctl to do this.
Why didn't you use this if iproute2 is available?
Comment 13 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 19:37:50 UTC
I still get:
WARNING: net.eth0 not under our control, aborting
For ifplugd.

Why do I want ifplugd to work?
When interface is up it is nice to do some stuff using baselayout and not hack a new ifplugd configuration.

This is strange, as if I comment out ifplugd.action and do:
/etc/init.d/net.eth0 start
IN_BACKGROUND=true /etc/init.d/net.eth0 start
All works great!
Comment 14 Roy Marples (RETIRED) gentoo-dev 2007-11-01 20:21:00 UTC
Created attachment 134954 [details, diff]
ipless.patch

OK, we just /dev/null the flushing of the cache now and use iproute2 if available, falling back to ifconfig.

The ifplugd issue is probably related to bug #196029 and futher commentry on that issue should move there or elsewhere. I'll test your ifplugd patch for the AF_LOCAL thingy when I find some working cat5.
Comment 15 SpanKY gentoo-dev 2007-11-01 20:47:04 UTC
the route flushing only makes sense if /proc/net/route exists, so use that instead of /dev/null

and then put a comment to indicate "this check is in case user has disabled IP support in their kernel and they are trying to use bridging (which tails into iproute)"
Comment 16 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 20:50:54 UTC
It does not work properly.
The IFACE value is modified...
I did not expect this either, but I checked this out...

---
#!/bin/sh
test1() {
        echo "B001 ${A}"
}
A="value1"
echo "A001 ${A}"
test1
A="value2" test1
echo "A002 ${A}"
---
Outputs:
---
A001 value1
B001 value1
B001 value2
A002 value2
---
While I expect:
---
A001 value1
B001 value1
B001 value2
A002 value1
---

I checked with bash and busybox...
So I must miss something.
Shouldn't internal function behaves as external commands?
Comment 17 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 20:52:48 UTC
(In reply to comment #14)
> The ifplugd issue is probably related to bug #196029 and futher commentry on
> that issue should move there or elsewhere.

OK. But I don't understand how it is related.
But thanks!
Comment 18 Roy Marples (RETIRED) gentoo-dev 2007-11-01 22:14:56 UTC
Created attachment 134970 [details, diff]
ipless.patch

ok, this should be good to go now.
Comment 19 Roy Marples (RETIRED) gentoo-dev 2007-11-01 22:17:20 UTC
Created attachment 134972 [details, diff]
ipless.patch

erm, maybe this is
Comment 20 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 22:18:04 UTC
Thanks!
A simple question... Won't it be cleaner to pass the interface as an argument?
Comment 21 Roy Marples (RETIRED) gentoo-dev 2007-11-01 22:22:40 UTC
In this instance yes, but most of the time it's not needed as we normally work on the interface in question.
Comment 22 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-01 22:41:47 UTC
-[ -e /proc/net/route ] && ip route flush table cache dev "${IFACE}"
+[ -e /proc/net/route ] && ip route flush table cache dev "${IFACE}" || true

And we are there!
Thank you so much!
Comment 23 SpanKY gentoo-dev 2007-11-01 23:14:54 UTC
umm, no ... that does not have the behavior we want

if [ -e /proc/net/route ] ; then
    ip route flush table cache dev "${IFACE}"
fi
Comment 24 SpanKY gentoo-dev 2007-11-01 23:15:47 UTC
also, the comment in iproute2_post_start() is incorrect ... it isnt a TCP issue, it's an IP issue
Comment 25 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-02 05:54:27 UTC
(In reply to comment #23)
> umm, no ... that does not have the behavior we want
> 
> if [ -e /proc/net/route ] ; then
>     ip route flush table cache dev "${IFACE}"
> fi
> 

This will return false if no /proc/net/route, while is should return true.

How about:

! [ -e /proc/net/route ] || ip route flush table cache dev "${IFACE}"

Comment 26 SpanKY gentoo-dev 2007-11-02 06:37:39 UTC
no it wont and that's the point ... yours forces ignoring the exit status while mine properly returns the correct status

test it if you think otherwise:
if false ; then true ; fi ; echo $? <- ok
if true ; then true ; fi ; echo $?  <- ok
if true ; then false ; fi ; echo $? <- ok

false && true || true ; echo $? <- ok
true && true || true ; echo $?  <- ok
true && false || true ; echo $? <- bad
Comment 27 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-02 06:56:11 UTC
OK.
Sorry.
Comment 28 Roy Marples (RETIRED) gentoo-dev 2007-11-02 07:27:51 UTC
(In reply to comment #23)
> umm, no ... that does not have the behavior we want
> 
> if [ -e /proc/net/route ] ; then
>     ip route flush table cache dev "${IFACE}"
> fi
> 

Thanks Dad!

Comment 29 Roy Marples (RETIRED) gentoo-dev 2007-11-02 11:17:24 UTC
(In reply to comment #2)
> Created an attachment (id=134901) [edit]
> ifplugd-0.28-noip.patch
> 
> A patch to allow bridge-utils to work in TCP/IP-less system.
> 
> uberlord: I sent to upstream, got no response, maybe you can help.

Works ok, added to -r9. upstream is kinda dead i think.
Comment 30 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-20 22:11:05 UTC
ifplugd merged! :)
Comment 31 Alon Bar-Lev (RETIRED) gentoo-dev 2008-01-01 17:27:37 UTC
robbat2: Can you please add bridge-utils patch (attachment#134899 [details, diff]).
This is the last issue, as ifplugd is setup and openrc fixes the baselayout stuff.

Thanks!
Comment 32 Alon Bar-Lev (RETIRED) gentoo-dev 2008-01-07 13:43:27 UTC
OK.
I've opened bug#204744 for bridge-utils fixups.
Thanks for your help!