Re: Weird problem with MDEV as a daemon

2020-09-09 Thread David Henderson
Good morning Leonid.  Sorry to hear about your issues with BB mdev.
While I can't provide any help regarding this situation, I do know of
another mdev software that might help you resolve some of your
problems:

https://skarnet.org/software/mdevd/

Dave



On 9/8/20, Leonid Zhigunov  wrote:
> Hi,
>
> I am using Busybox 1.31.0.
> I tried to use MDEV for SD card automounting, but couldn't make it to work.
>
> If mdev.conf entry has a simple command, say, *echo automount, everything
> works fine.
> As soon as the card is inserted or removed, the command is invoked and
> prints "automount".
>
> But if I specify a script file name intead, i.e. */etc/mdev.d/automount,
> things get strange.
> The sript file has proper permissions. It can be successfully executed from
> the command line by
> # /etc/mdev.d/automount
> # sh /etc/mdev.d/automount
> # sh -c /etc/mdev.d/automount
> and, provided with proper ACTION and MDEV env variables, it does all things
> it suppose to do.
>
> But regardless of script's name, location or contents, whether it has
> #!/bin/sh prefix or not,
> it doesn't work with MDEV.
>
> What I get is the strange output on the terminal (when #mdev -df) every
> time
> the command is invoked:
> : not foundev.d/automount
>
> In the mdev.log is the same:
> running: /etc/mdev.d/automount
> : not foundev.d/automount
>
> Ok, I added some printfs in the busybox's entry point, to print actual
> command line string
> busybox is invoked with. The interesting thing is: on every command
> strating
> from the very first init
> prints are ok, but from mdev it showed:
>  h -c /etc/mdev.d/automount, i.e. the first character was missing (or
> replaced with space).
> So I added argv[0][0] as hex in the beginning, and again everything was ok
> for everything
> # umount
> 75 umount
>
> but MDEV:
> # mdev -df
>  3 sh -c /etc/mdev.d/automount (first character is missing, 7)
> : not foundev.d/automount
>
> Then I thried to replace system() call in MDEV with how it's done in
> ifupdown doit().
> I got even funnier result:
>
> # mdev -df
> 6d mdev -df
>  f /bin/sh /etc/mdev/automount (first character is missing, 2)
> ': No such file or directoryev.d/automount
> ': File existsn '/etc/mdev.d/automount
> The last line is actually a somehow overidden string from MDEV's
> bb_perror_msg("can't run '%s'", command);
>
> This all makes me think that system() call MDEV is using or nested shell
> invocations are not
> working as they suppose to and somehow mess up the output.
>
> Has anyone seen something similar?
> Is it my-only problem? Did I miss some required settings in the build
> configuration?
>
> Any help is much appreciated.
>
> Kind regards,
> Leonid
>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: Non-responsive maintainer?

2020-06-05 Thread David Henderson
Thank you for you for your continued dedication Deny's!

Dave




On 6/5/20, Natanael Copa  wrote:
> On Fri, 5 Jun 2020 12:10:54 +0200
> Bernhard Reutner-Fischer  wrote:
>
>> PS: Furthermore don't forget that Denys is doing this stuff for more
>> than 10 years now and in these years has "donated" quite alot of his
>> spare time to the project. One usually does not hear "thanks alot for
>> your continued dedication" when being maintainer.
>
> It is 14 years in September this year. (https://busybox.net/oldnews.html)
>
> Denys,
>
> Thank you for you for your continued dedication! It is highly
> appreciated.
>
> -nc
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dd progress

2020-05-07 Thread David Henderson
Good morning Damien!

You can also pipe it through 'pv'.  There are plenty of examples of
this on the web, but something like:

dd if=/dev/sda1 | pv -whatever | dd of=/tmp/test.img

Hope this helps!
Dave



On 5/7/20, Damien LEFEVRE  wrote:
> Hi,
>
> I have an embedded device with BusyBox v1.30.1.
>
> Is there a way to get the status/progress of dd command?
>
> Thanks,
> -Damien
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] losetup: Create loop device if it does not exist

2019-10-22 Thread David Henderson
I think this is better functionality.  If anything is scripted, this
patch will make it easier instead of having to test if the file exists
(or if the binary exits due to the file not already existing).  I
actually think most binaries work like this...  Just my $0.02

Dave


On 10/22/19, Joerg Vehlow  wrote:
> No interest in util-linux compatibility?
>
> Am 23.09.2019 um 07:39 schrieb Joerg Vehlow:
>> From: Joerg Vehlow 
>>
>> util-linux's losetup creates a loop device, if it is missing.
>> This is missing in busybox's implementation.
>>
>> Testcase:
>> losetup /dev/loop1000 
>> If /dev/loop1000 does not exist busybox give an error but
>> util-linux's losetup just creates the file
>>
>> Signed-off-by: Joerg Vehlow 
>> ---
>>   util-linux/losetup.c | 15 +++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/util-linux/losetup.c b/util-linux/losetup.c
>> index cc6c2b1d5..790c41cab 100644
>> --- a/util-linux/losetup.c
>> +++ b/util-linux/losetup.c
>> @@ -147,10 +147,25 @@ int losetup_main(int argc UNUSED_PARAM, char
>> **argv)
>>  d = *argv++;
>>
>>  if (argv[0]) {
>> +struct stat statbuf;
>> +int n;
>>  unsigned flags = (opt & OPT_r) ?
>> BB_LO_FLAGS_READ_ONLY : 0;
>> +
>>  if (opt & OPT_P) {
>>  flags |= BB_LO_FLAGS_PARTSCAN;
>>  }
>> +
>> +// If the loop device does not exist, create it
>> +if (stat(d, ) != 0 && errno == ENOENT) {
>> +if (sscanf(d, LOOP_FORMAT, ) != 1) {
>> +errno = 0;
>> +bb_perror_msg_and_die("Loop device
>> %s does not exist and does not start with " LOOP_NAME, d);
>> +}
>> +if (mknod(d, S_IFBLK|0644, makedev(7, n))
>> != 0) {
>> +bb_simple_perror_msg_and_die(d);
>> +}
>> +}
>> +
>>  if (set_loop(, argv[0], offset, flags) < 0)
>>  bb_simple_perror_msg_and_die(argv[0]);
>>  return EXIT_SUCCESS;
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: inode usage

2018-12-11 Thread David Henderson
Yup!  I can't believe I didn't check that... Thanks Jody!

Dave


On 12/11/18, Jody Bruchon  wrote:
> Do you have an alias for 'df' by some chance?
>
> On 12/11/2018 11:10 AM, David Henderson wrote:
>> So I was checking with the 'df' from coreutils on another computer and
>> in doing so I stumbled upon something bizarre.  Going back to my main
>> computer (that only has the BB 'df'):
>>
>> # which df
>> /bin/df
>> # df -B1 -i /
>> rootfs  374.3k  28.8k  345.5k  8%  /
>> # /bin/df -B1 -i /
>> rootfs  383299  29528  353771  8%  /
>>
>> Why would the values change only when the applet is preceded by its
>> parent directory?  Is this a bug of some sort?
>>
>> Thanks,
>> Dave
>>
>>
>> On 12/11/18, David Henderson  wrote:
>>> Good morning all!  I am working on a project and need to find the
>>> inode usage of the file system.  When I run the 'df -i' command from
>>> the prompt I get the inode usage, but it only shows in the thousands
>>> (e.g. 374.3k).  I have tried several methods to try and get it to show
>>> the raw number (e.g. 374368) but can't seem to figure it out.  Is this
>>> possible with the BB df applet?
>>>
>>> Thanks,
>>> Dave
>>>
>> ___
>> busybox mailing list
>> busybox@busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: inode usage

2018-12-11 Thread David Henderson
So I was checking with the 'df' from coreutils on another computer and
in doing so I stumbled upon something bizarre.  Going back to my main
computer (that only has the BB 'df'):

# which df
/bin/df
# df -B1 -i /
rootfs  374.3k  28.8k  345.5k  8%  /
# /bin/df -B1 -i /
rootfs  383299  29528  353771  8%  /

Why would the values change only when the applet is preceded by its
parent directory?  Is this a bug of some sort?

Thanks,
Dave


On 12/11/18, David Henderson  wrote:
> Good morning all!  I am working on a project and need to find the
> inode usage of the file system.  When I run the 'df -i' command from
> the prompt I get the inode usage, but it only shows in the thousands
> (e.g. 374.3k).  I have tried several methods to try and get it to show
> the raw number (e.g. 374368) but can't seem to figure it out.  Is this
> possible with the BB df applet?
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


inode usage

2018-12-11 Thread David Henderson
Good morning all!  I am working on a project and need to find the
inode usage of the file system.  When I run the 'df -i' command from
the prompt I get the inode usage, but it only shows in the thousands
(e.g. 374.3k).  I have tried several methods to try and get it to show
the raw number (e.g. 374368) but can't seem to figure it out.  Is this
possible with the BB df applet?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: df output

2018-07-24 Thread David Henderson
Please disregard - it was an alias that was set...

Dave


On 7/24/18, David Henderson  wrote:
> Good afternoon!  I am trying to get different output from 'df' by
> including the '-k', '-m', etc, however, the output is the same no
> matter what is passed.  Am I missing something?  Using BB version
> 1.24.1.
>
> # df -k /dev/sda1
> FilesystemSize  Used Available Use% Mounted on
> /dev/sda1   442.7G326.0G 94.1G  78% /mnt/DATA
>
> #df -m /dev/sda1
> FilesystemSize  Used Available Use% Mounted on
> /dev/sda1   442.7G326.0G 94.1G  78% /mnt/DATA
>
> #df -P /dev/sda1
> FilesystemSize  Used Available Capacity Mounted on
> /dev/sda1   442.7G326.0G 94.1G  78% /mnt/DATA
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


df output

2018-07-24 Thread David Henderson
Good afternoon!  I am trying to get different output from 'df' by
including the '-k', '-m', etc, however, the output is the same no
matter what is passed.  Am I missing something?  Using BB version
1.24.1.

# df -k /dev/sda1
FilesystemSize  Used Available Use% Mounted on
/dev/sda1   442.7G326.0G 94.1G  78% /mnt/DATA

#df -m /dev/sda1
FilesystemSize  Used Available Use% Mounted on
/dev/sda1   442.7G326.0G 94.1G  78% /mnt/DATA

#df -P /dev/sda1
FilesystemSize  Used Available Capacity Mounted on
/dev/sda1   442.7G326.0G 94.1G  78% /mnt/DATA

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


mdev scripts

2017-11-02 Thread David Henderson
Good afternoon all!  I was interesting in migrating from udev to mdev,
but had some concerns.  As I have been compiling packages along the
way for the repo, I have noticed that some packages include a udev
rules file, but no mdev (since it is probably used much less than
udev).  Does anyone have or know of a collection of mdev scripts to
fully replace udev?  I have come across the mdev-like-a-boss
collection, but haven't had too much time to fully look into all the
scripts it includes.  Any help or guidance would be appreciated!

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: move files using find

2017-07-14 Thread David Henderson
Nevermind.  I ended up figuring it out.  Granted it's not for BB, but
just as a follow-up if anyone comes across this thread they will have
what I came up with:

find /tmp/test -type f \( -name \*.typelib -o -name \*.gir \) -exec
/bin/sh -c 'TEMP="${1#*/}"; mkdir -p "${0}/${TEMP%/*}" 2>/dev/null; mv
-- "$1" "${0}/${TEMP%/*}"' "/tmp/test.gir" {} \;

This preserves the path when finding/copying files from a source to a
destination.

Dave


On 7/14/17, David Henderson <dhender...@digital-pipe.com> wrote:
> Oops!  It does appear that I was using GNU find, not BB.  Sorry about
> that.  Any thoughts on how this can be done without execdir then using
> BB find?
>
> Thanks,
> Dave
>
>
> On 7/14/17, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>> On Thu, Jul 13, 2017 at 11:52 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> Good evening all!  I am trying to move files from one location to
>>> another while preserving the path.  If I search for a directory, it
>>> seems like I have found the correct syntax:
>>>
>>> find "/usr/local/share/man" -type d -execdir mv -- {} "/opt/test" \;
>>>
>>> However, if I try to move files, I can't seem to figure it out:
>>>
>>> find "/tmp/test" -type f \( -name \*.typelib -o -name \*.gir \)
>>> -execdir mv -- {} "/opt/test/" \;
>>>
>>> To which I get "No such file or directory" or "Not a directory" error.
>>
>> I'm getting
>>
>> find: unrecognized: -execdir
>>
>> as expected, since bbox knows nothing about find -execdir.
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: move files using find

2017-07-14 Thread David Henderson
Oops!  It does appear that I was using GNU find, not BB.  Sorry about
that.  Any thoughts on how this can be done without execdir then using
BB find?

Thanks,
Dave


On 7/14/17, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> On Thu, Jul 13, 2017 at 11:52 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Good evening all!  I am trying to move files from one location to
>> another while preserving the path.  If I search for a directory, it
>> seems like I have found the correct syntax:
>>
>> find "/usr/local/share/man" -type d -execdir mv -- {} "/opt/test" \;
>>
>> However, if I try to move files, I can't seem to figure it out:
>>
>> find "/tmp/test" -type f \( -name \*.typelib -o -name \*.gir \)
>> -execdir mv -- {} "/opt/test/" \;
>>
>> To which I get "No such file or directory" or "Not a directory" error.
>
> I'm getting
>
> find: unrecognized: -execdir
>
> as expected, since bbox knows nothing about find -execdir.
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


move files using find

2017-07-13 Thread David Henderson
Good evening all!  I am trying to move files from one location to
another while preserving the path.  If I search for a directory, it
seems like I have found the correct syntax:

find "/usr/local/share/man" -type d -execdir mv -- {} "/opt/test" \;

However, if I try to move files, I can't seem to figure it out:

find "/tmp/test" -type f \( -name \*.typelib -o -name \*.gir \)
-execdir mv -- {} "/opt/test/" \;

To which I get "No such file or directory" or "Not a directory" error.
Using syntax based on this post:

https://superuser.com/questions/596876/how-to-find-a-file-and-move-it-into-the-directory-it-was-found-in

But it seems like it was working in that post because it was GNU find,
not BB find.  Any help to resolve this would greatly be appreciated!

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: mounting errors

2017-02-27 Thread David Henderson
Thanks for the follow-up Jody.  I guess I have no choice but to do so...

Dave


On 2/24/17, Jody Bruchon <j...@jodybruchon.com> wrote:
> On 2017-02-24 08:49, David Henderson wrote:
>> Thanks for the tip Rob!  So it looks like my only resolution to this
>> problem is the dmesg silencing?  The only issue I see with that is
>> that perhaps something I need to see won't get shown.
> Setting the level higher will restrict immediate console output to more
> and more critical messages only; since I administer all of my machines
> remotely, I tend to see zero console logging and find that the rare
> instances I have console logging going on, the messages tend to mangle
> program output or the command I'm typing when I least expect it.
> Increasing the urgency threshold for console logging will allow truly
> severe problems like a disk command failure to still be logged to the
> console while preventing simple warnings from polluting the console. I
> prefer to run dmesg manually to read these warnings.
>
> I look at it this way: if there's a problem then someone will go out of
> the way to read the logs and see what warning messages are present, but
> if there's not really a problem (as in this case) they'll never see the
> messages because the operation succeeded.
>
> An example I run into a lot: if you mount a journaled HFS+ filesystem it
> will force it to be read-only unless you pass '-o rw,force' and a kernel
> warning will be logged saying so. I don't see that on my console, but
> when I try to write to the filesystem I'll get an error and see the
> warning message when I run dmesg. Then I know to umount, mount -o
> rw,force, and resume working as usual.
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: mounting errors

2017-02-24 Thread David Henderson
Thanks for the tip Rob!  So it looks like my only resolution to this
problem is the dmesg silencing?  The only issue I see with that is
that perhaps something I need to see won't get shown.  Is this
something that can get brought to the attention of the kernel
developers?

Thanks,
Dave


On 2/23/17, Rob Landley <r...@landley.net> wrote:
>
>
> On 02/22/2017 06:09 AM, Jody Bruchon wrote:
>> On 2017-02-22 2:28 AM, Mattias Schlenker wrote:
>>> Am 21.02.2017 um 22:09 schrieb David Henderson:
>>>
>>>> EXT4-fs (sde2): couldn't mount as ext3 due to feature incompatibilities
>>>> EXT4-fs (sde2): couldn't mount as ext2 due to feature incompatibilities
>>>
>>> Are you in control of the kernel configuration? In this case it is
>>> better to use the ext4 driver for ext2/3/4
>> Those messages appear to be from the ext4 driver.
>
> Way back when I wrote toybox mount code that autodetected the filesystem
> type, I had it default to MS_SILENT so it wouldn't spam dmesg when it
> tried to mount things using the wrong driver.
>
> It looks like the ext4 driver is ignoring that flag, which technically
> is a bug in the kernel.
>
> Rob
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: mounting errors

2017-02-23 Thread David Henderson
Thanks for the continued help everyone!  After doing some more trial
and error, it looks like when using ext3, these messages are not shown
at all.  And when using ext2, only the following message is shown:

EXT4-fs (sde2): couldn't mount as ext3 due to feature incompatibilities

Unfortunately I can not specify the file system as there is no way to
know what the user will have selected as the file system (e.g. ext*,
vfat, or ntfs).  I have to use the auto-probe, but want to get rid of
these messages since they are not only an annoyance, but also users
may think something is wrong when it isn't.  Additionally, I'm not
sure why this occurs in one OS and not another.

Is there a better way to permanently resolve this problem without
having to constantly use 'dmesg -n 2'?

Thanks,
Dave


On 2/22/17, Jody Bruchon <j...@jodybruchon.com> wrote:
> On 2017-02-22 08:43, David Henderson wrote:
>> Good morning all!  Yes I am not specifying the type as ext4
>> explicitly, so it is being probed.  The partitions mount and work
>> correctly, I just keep getting these error messages any time they are
>> mounted (e.g. bootup, attaching external drives, etc).  I'm not sure
>> what 'feature incompatibilities' it is referring to...  Any thoughts
>> on how to resolve the problem?
> Feature incompatibilities refers to things added in ext4 and not present
> in ext3 or ext2. The filesystems are similar but not identical; there
> are a lot of features available and when you call mkfs.ext4 there are
> several ext4-only ones automatically enabled. The easiest way to resolve
> the "problem" (it's really just a notice, not an error) is to explicitly
> specify the type as ext4 instead of auto. Personally...I would just
> ignore the messages and move along since they don't really indicate a
> problem. If they're popping up on your console, consider changing your
> console logging level with e.g. 'dmesg -n 2' which is what I did so I
> only get severe errors directly on my console, not every little notice
> the kernel spits out like these.
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: mounting errors

2017-02-22 Thread David Henderson
Good morning all!  Yes I am not specifying the type as ext4
explicitly, so it is being probed.  The partitions mount and work
correctly, I just keep getting these error messages any time they are
mounted (e.g. bootup, attaching external drives, etc).  I'm not sure
what 'feature incompatibilities' it is referring to...  Any thoughts
on how to resolve the problem?

Thanks,
Dave


On 2/22/17, Jody Bruchon <j...@jodybruchon.com> wrote:
> On 2017-02-22 2:28 AM, Mattias Schlenker wrote:
>> Am 21.02.2017 um 22:09 schrieb David Henderson:
>>
>>> EXT4-fs (sde2): couldn't mount as ext3 due to feature incompatibilities
>>> EXT4-fs (sde2): couldn't mount as ext2 due to feature incompatibilities
>>
>> Are you in control of the kernel configuration? In this case it is
>> better to use the ext4 driver for ext2/3/4
> Those messages appear to be from the ext4 driver.
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


mounting errors

2017-02-21 Thread David Henderson
Good afternoon all!  I am using the BB mount command to mount several
partitions, but when the command is executed I get:

EXT4-fs (sde2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (sde2): couldn't mount as ext2 due to feature incompatibilities

The filesystem is indeed ext4, so I'm not sure why it is trying to
mount as either of the other two formats.  What could be causing this?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: potential error with adduser

2016-12-15 Thread David Henderson
Thanks for the reply Sam!

On 12/15/16, Sam Liddicott <s...@liddicott.com> wrote:
> You are allowed to have inaccurate information in /etc/passwd.

Obviously :)

> For instance, there is nothing to check that the information in the GECOS
> field [https://en.wikipedia.org/wiki/Gecos_field] is correct.

For sure, but this is also a comment, not something as important as a
home directory specification.  Most don't even use that field at all
(at least in my experience).  And also, the default isn't to add
something like "this is a robot" for the value of this field using
'adduser'.  Whatever you specify is the value that is inserted.  If I
use the -H parameter, I would expect to not have a value for the home
directory since I elected not to create one.

> There is nothing to stop you deleting the created home directory
> afterwards, and nothing to force you to update the password file if you do
> delete it afterwards.
>
> I think you want the user to have an empty home directory field; that might
> be specified with: -h ""
>
> Maybe that is what you are asking for?
>
> Sam

I was more or less surprised by the fact that the default method was
to put false information in the passwd file and was clarifying if this
was appropriate.  As I've stated numerous times, I can't see a
circumstance where this would be advised.

Dave


> On 14 December 2016 at 20:59, David Henderson <dhender...@digital-pipe.com>
> wrote:
>
>> Hey Tito, thanks again for the reply.  I'm not sure how that example
>> is disproving my concerns. :)  It is still reflecting inaccurate
>> information in /etc/passwd.
>>
>> Dave
>>
>>
>> On 12/14/16, Tito <farmat...@tiscali.it> wrote:
>> >
>> >
>> > On 12/14/2016 03:26 PM, David Henderson wrote:
>> >> Thanks for the reply Tito!  No problem about the initial response - it
>> >> happens. :)  To me it would seem little odd to state something in one
>> >> place, but not have it in reality.  Would there be a reason to have
>> >> this mismatch of information?  It has an appearance of just being
>> >> messy and providing misinformation.
>> >>
>> >> Thanks,
>> >> Dave
>> >
>> > Hi,
>> > take as example this line from /etc/passwd
>> >
>> > nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
>> >
>> > this is an user that you would create with using -H:
>> >
>> > adduser -u 65534 -G nobody -h /nonexistant -H -D -s /usr/sbin/nologin
>> >
>> > Ciao,
>> > Tito
>> >
>> >>
>> >> On 12/14/16, Tito <farmat...@tiscali.it> wrote:
>> >>>
>> >>>
>> >>> On 12/14/2016 07:59 AM, Tito wrote:
>> >>>> On 12/13/2016 04:46 PM, David Henderson wrote:
>> >>>>> Good morning gang!  Working with the 'adduser' applet and noticed
>> that
>> >>>>> when specifying the '-H' parameter the /etc/passwd file still gets
>> >>>>> a
>> >>>>> home directory value (which doesn't exist in the file system).  Is
>> >>>>> this an error?  If no home directory was to be made, shouldn't that
>> >>>>> value be blank?
>> >>>>>
>> >>>>> Thanks,
>> >>>>> Dave
>> >>>>
>> >>>> Hi,
>> >>>> from man adduser on debian:
>> >>>> "adduser will create a home directory subject to DHOME, GROUPHOMES,
>> and
>> >>>> LETTERHOMES.  The home directory can be overridden from the command
>> >>>> line
>> >>>> with the --home option"
>> >>>> In fact we don't support DHOME, GROUPHOMES, and LETTERHOMES but
>> >>>> use only the user name to create the home directory unless
>> >>>> the name is specified on the command line with the -H option.
>> >>>>
>> >>>> /* create string for $HOME if not specified already */
>> >>>> pw.pw_dir = xasprintf("/home/%s", argv[0]);
>> >>>>
>> >>>> We don't support  --no-create-home option at the moment
>> >>>> but i think it would be easy to add.
>> >>>>
>> >>>> Ciao,
>> >>>> Tito
>> >>>
>> >>> Sorry, I misunderstood your question and was in a rush.
>> >>> So let's try to be more accurate this time.
>> >>> In reality we support the -H option as you correctly
&

Re: potential error with adduser

2016-12-15 Thread David Henderson
Good morning Tito.  I would actually think that having accurate
information would be preferred - by most if not all.  I don't see the
point or value in having false info anywhere.

Dave


On 12/14/16, Tito <farmat...@tiscali.it> wrote:
>
>
> On 12/14/2016 09:59 PM, David Henderson wrote:
>> Hey Tito, thanks again for the reply.  I'm not sure how that example
>> is disproving my concerns. :)  It is still reflecting inaccurate
>> information in /etc/passwd.
>>
>> Dave
>
> Hi,
> in this case you want the information to be inaccurate
> as you want that particular user to have a "nonexistent"
> home dir.
>
> Ciao,
> Tito
>
>>
>> On 12/14/16, Tito <farmat...@tiscali.it> wrote:
>>>
>>>
>>> On 12/14/2016 03:26 PM, David Henderson wrote:
>>>> Thanks for the reply Tito!  No problem about the initial response - it
>>>> happens. :)  To me it would seem little odd to state something in one
>>>> place, but not have it in reality.  Would there be a reason to have
>>>> this mismatch of information?  It has an appearance of just being
>>>> messy and providing misinformation.
>>>>
>>>> Thanks,
>>>> Dave
>>>
>>> Hi,
>>> take as example this line from /etc/passwd
>>>
>>> nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
>>>
>>> this is an user that you would create with using -H:
>>>
>>> adduser -u 65534 -G nobody -h /nonexistant -H -D -s /usr/sbin/nologin
>>>
>>> Ciao,
>>> Tito
>>>
>>>>
>>>> On 12/14/16, Tito <farmat...@tiscali.it> wrote:
>>>>>
>>>>>
>>>>> On 12/14/2016 07:59 AM, Tito wrote:
>>>>>> On 12/13/2016 04:46 PM, David Henderson wrote:
>>>>>>> Good morning gang!  Working with the 'adduser' applet and noticed
>>>>>>> that
>>>>>>> when specifying the '-H' parameter the /etc/passwd file still gets a
>>>>>>> home directory value (which doesn't exist in the file system).  Is
>>>>>>> this an error?  If no home directory was to be made, shouldn't that
>>>>>>> value be blank?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Dave
>>>>>>
>>>>>> Hi,
>>>>>> from man adduser on debian:
>>>>>> "adduser will create a home directory subject to DHOME, GROUPHOMES,
>>>>>> and
>>>>>> LETTERHOMES.  The home directory can be overridden from the command
>>>>>> line
>>>>>> with the --home option"
>>>>>> In fact we don't support DHOME, GROUPHOMES, and LETTERHOMES but
>>>>>> use only the user name to create the home directory unless
>>>>>> the name is specified on the command line with the -H option.
>>>>>>
>>>>>> /* create string for $HOME if not specified already */
>>>>>> pw.pw_dir = xasprintf("/home/%s", argv[0]);
>>>>>>
>>>>>> We don't support  --no-create-home option at the moment
>>>>>> but i think it would be easy to add.
>>>>>>
>>>>>> Ciao,
>>>>>> Tito
>>>>>
>>>>> Sorry, I misunderstood your question and was in a rush.
>>>>> So let's try to be more accurate this time.
>>>>> In reality we support the -H option as you correctly
>>>>> stated:
>>>>>
>>>>> -H  same as --no-create-home
>>>>> -h alternative name for home dir rather than user's name
>>>>>
>>>>> but -H --no-create-home refers only to the creation of the
>>>>> home dir (the mkdir) not to having it in /etc/passwd:
>>>>>
>>>>> "Do not create the home directory, even if it doesn't exist"
>>>>>
>>>>> so i think busybox is doing it correctly.
>>>>>
>>>>> Sorry for the previous noise.
>>>>>
>>>>> Ciao,
>>>>> Tito
>>>>>
>>>>> ___
>>>>> busybox mailing list
>>>>> busybox@busybox.net
>>>>> http://lists.busybox.net/mailman/listinfo/busybox
>>>>>
>>>>
>>> ___
>>> busybox mailing list
>>> busybox@busybox.net
>>> http://lists.busybox.net/mailman/listinfo/busybox
>>>
>>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: potential error with adduser

2016-12-14 Thread David Henderson
Hey Tito, thanks again for the reply.  I'm not sure how that example
is disproving my concerns. :)  It is still reflecting inaccurate
information in /etc/passwd.

Dave


On 12/14/16, Tito <farmat...@tiscali.it> wrote:
>
>
> On 12/14/2016 03:26 PM, David Henderson wrote:
>> Thanks for the reply Tito!  No problem about the initial response - it
>> happens. :)  To me it would seem little odd to state something in one
>> place, but not have it in reality.  Would there be a reason to have
>> this mismatch of information?  It has an appearance of just being
>> messy and providing misinformation.
>>
>> Thanks,
>> Dave
>
> Hi,
> take as example this line from /etc/passwd
>
> nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
>
> this is an user that you would create with using -H:
>
> adduser -u 65534 -G nobody -h /nonexistant -H -D -s /usr/sbin/nologin
>
> Ciao,
> Tito
>
>>
>> On 12/14/16, Tito <farmat...@tiscali.it> wrote:
>>>
>>>
>>> On 12/14/2016 07:59 AM, Tito wrote:
>>>> On 12/13/2016 04:46 PM, David Henderson wrote:
>>>>> Good morning gang!  Working with the 'adduser' applet and noticed that
>>>>> when specifying the '-H' parameter the /etc/passwd file still gets a
>>>>> home directory value (which doesn't exist in the file system).  Is
>>>>> this an error?  If no home directory was to be made, shouldn't that
>>>>> value be blank?
>>>>>
>>>>> Thanks,
>>>>> Dave
>>>>
>>>> Hi,
>>>> from man adduser on debian:
>>>> "adduser will create a home directory subject to DHOME, GROUPHOMES, and
>>>> LETTERHOMES.  The home directory can be overridden from the command
>>>> line
>>>> with the --home option"
>>>> In fact we don't support DHOME, GROUPHOMES, and LETTERHOMES but
>>>> use only the user name to create the home directory unless
>>>> the name is specified on the command line with the -H option.
>>>>
>>>> /* create string for $HOME if not specified already */
>>>> pw.pw_dir = xasprintf("/home/%s", argv[0]);
>>>>
>>>> We don't support  --no-create-home option at the moment
>>>> but i think it would be easy to add.
>>>>
>>>> Ciao,
>>>> Tito
>>>
>>> Sorry, I misunderstood your question and was in a rush.
>>> So let's try to be more accurate this time.
>>> In reality we support the -H option as you correctly
>>> stated:
>>>
>>> -H  same as --no-create-home
>>> -h alternative name for home dir rather than user's name
>>>
>>> but -H --no-create-home refers only to the creation of the
>>> home dir (the mkdir) not to having it in /etc/passwd:
>>>
>>> "Do not create the home directory, even if it doesn't exist"
>>>
>>> so i think busybox is doing it correctly.
>>>
>>> Sorry for the previous noise.
>>>
>>> Ciao,
>>> Tito
>>>
>>> ___
>>> busybox mailing list
>>> busybox@busybox.net
>>> http://lists.busybox.net/mailman/listinfo/busybox
>>>
>>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: potential error with adduser

2016-12-14 Thread David Henderson
Thanks for the reply Tito!  No problem about the initial response - it
happens. :)  To me it would seem little odd to state something in one
place, but not have it in reality.  Would there be a reason to have
this mismatch of information?  It has an appearance of just being
messy and providing misinformation.

Thanks,
Dave


On 12/14/16, Tito <farmat...@tiscali.it> wrote:
>
>
> On 12/14/2016 07:59 AM, Tito wrote:
>> On 12/13/2016 04:46 PM, David Henderson wrote:
>>> Good morning gang!  Working with the 'adduser' applet and noticed that
>>> when specifying the '-H' parameter the /etc/passwd file still gets a
>>> home directory value (which doesn't exist in the file system).  Is
>>> this an error?  If no home directory was to be made, shouldn't that
>>> value be blank?
>>>
>>> Thanks,
>>> Dave
>>
>> Hi,
>> from man adduser on debian:
>> "adduser will create a home directory subject to DHOME, GROUPHOMES, and
>> LETTERHOMES.  The home directory can be overridden from the command line
>> with the --home option"
>> In fact we don't support DHOME, GROUPHOMES, and LETTERHOMES but
>> use only the user name to create the home directory unless
>> the name is specified on the command line with the -H option.
>>
>> /* create string for $HOME if not specified already */
>> pw.pw_dir = xasprintf("/home/%s", argv[0]);
>>
>> We don't support  --no-create-home option at the moment
>> but i think it would be easy to add.
>>
>> Ciao,
>> Tito
>
> Sorry, I misunderstood your question and was in a rush.
> So let's try to be more accurate this time.
> In reality we support the -H option as you correctly
> stated:
>
> -H  same as --no-create-home
> -h alternative name for home dir rather than user's name
>
> but -H --no-create-home refers only to the creation of the
> home dir (the mkdir) not to having it in /etc/passwd:
>
> "Do not create the home directory, even if it doesn't exist"
>
> so i think busybox is doing it correctly.
>
> Sorry for the previous noise.
>
> Ciao,
> Tito
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


potential error with adduser

2016-12-13 Thread David Henderson
Good morning gang!  Working with the 'adduser' applet and noticed that
when specifying the '-H' parameter the /etc/passwd file still gets a
home directory value (which doesn't exist in the file system).  Is
this an error?  If no home directory was to be made, shouldn't that
value be blank?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: copying multiple files

2016-11-22 Thread David Henderson
Good morning Jim, thanks for your help as well!  After talking with
Grant yesterday it dawned on me that this must be a bash-ism.  Your
suggestion is pretty good at cutting down on the amount of syntax to
deal with.  It is certainly clearer than the hack I put together. :)
The reason that I want to make this the shortest command possible is
because I don't want to add 60 lines of code to a script just to copy
10 files (with error control and so forth).

Thanks,
Dave


On 11/21/16, Cathey, Jim <jcat...@ciena.com> wrote:
> So you've written a shell script that relies upon non-POSIX
> behavior, specifically GNU bash extensions, and it doesn't
> work in POSIX-ey ash.  No big surprise.  You will have to
> do it differently, or install bash on your target.  Same
> dilemma everybody else faces when dealing with 'small' targets.
>
> What's _wrong_ with this kind of thing:
>
>   P=/tmp/test cp -f $P/a $P/b $P/c ... dest/
>
> anyway?  (I used $P to cut down the source line length, but
> it's totally unnecessary to the functionality.)  It's not
> like you have to get everything done in one command, either.
> The cp command is not some kind of atomic operation.  Are you
> after a fewest-line-count award?
>
> -- Jim
>
> -Original Message-
> From: busybox [mailto:busybox-boun...@busybox.net] On Behalf Of David
> Henderson
> Sent: Monday, November 21, 2016 2:07 PM
> To: Grant Edwards
> Cc: busybox@busybox.net
> Subject: Re: copying multiple files
>
> Thanks again for your continued help Grant.  Unfortunately the file
> names are not actually similar as in the example (e.g. help.txt,
> world.png, ...) so using braces won't help either.  Any other
> thoughts?  Currently I'm forced to use a combination of find and cp -
> ugh - just to reduce the number of lines necessary for the
> operation...
>
> Thanks,
> Dave
>
>
> On 11/21/16, Grant Edwards <grant.b.edwa...@gmail.com> wrote:
>> On 2016-11-21, David Henderson <dhender...@digital-pipe.com> wrote:
>>> On 11/21/16, Grant Edwards <grant.b.edwa...@gmail.com> wrote:
>>>> On 2016-11-21, David Henderson <dhender...@digital-pipe.com> wrote:
>>>>
>>>>> cp -f /tmp/test/{a.txt,b.txt,c.txt} /tmp/test2/{1.txt,2.txt,3.txt}
>>>>> /tmp/dest
>>>>
>>>>> This keeps failing.  Is this implemented in BB?
>>>>
>>>> Try this:
>>>>
>>>>$ busybox ash
>>>>~ $ echo /tmp/test/{a.txt,b.txt,c.txt}
>>>>/tmp/test/{a.txt,b.txt,c.txt}
>>>>
>>>> It appears that the busybox shell does not implement bash/C shell
>>>> alternation (aka "brace expansion").  None of the busybox builds I
>>>> have on hand do anyway, and I don't see any options in the config file
>>>> to enable such a feature...
>>
>>> Hey Grant, thanks for the reply!  Unfortunately that command will just
>>> echo what you type to the screen, not actually copy anything.
>>
>> I know.  I was showing you how to determine if alternation (brace
>> expansion) wasn't happenning.  It doesn't on any of my builds of
>> busybox.
>>
>>> Any other thoughts?
>>
>> Don't try to use alternation:
>>
>>   cp -f /tmp/test/[abc].txt /tmp/test2/[123].txt /tmp/dest
>>
>> --
>> Grant Edwards   grant.b.edwardsYow! ... I think I'd
>>   at   better go back to my
>> DESK
>>   gmail.comand toy with a few
>> common
>>MISAPPREHENSIONS ...
>>
>> ___
>> busybox mailing list
>> busybox@busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: copying multiple files

2016-11-21 Thread David Henderson
Thanks again for your continued help Grant.  Unfortunately the file
names are not actually similar as in the example (e.g. help.txt,
world.png, ...) so using braces won't help either.  Any other
thoughts?  Currently I'm forced to use a combination of find and cp -
ugh - just to reduce the number of lines necessary for the
operation...

Thanks,
Dave


On 11/21/16, Grant Edwards <grant.b.edwa...@gmail.com> wrote:
> On 2016-11-21, David Henderson <dhender...@digital-pipe.com> wrote:
>> On 11/21/16, Grant Edwards <grant.b.edwa...@gmail.com> wrote:
>>> On 2016-11-21, David Henderson <dhender...@digital-pipe.com> wrote:
>>>
>>>> cp -f /tmp/test/{a.txt,b.txt,c.txt} /tmp/test2/{1.txt,2.txt,3.txt}
>>>> /tmp/dest
>>>
>>>> This keeps failing.  Is this implemented in BB?
>>>
>>> Try this:
>>>
>>>$ busybox ash
>>>~ $ echo /tmp/test/{a.txt,b.txt,c.txt}
>>>/tmp/test/{a.txt,b.txt,c.txt}
>>>
>>> It appears that the busybox shell does not implement bash/C shell
>>> alternation (aka "brace expansion").  None of the busybox builds I
>>> have on hand do anyway, and I don't see any options in the config file
>>> to enable such a feature...
>
>> Hey Grant, thanks for the reply!  Unfortunately that command will just
>> echo what you type to the screen, not actually copy anything.
>
> I know.  I was showing you how to determine if alternation (brace
> expansion) wasn't happenning.  It doesn't on any of my builds of
> busybox.
>
>> Any other thoughts?
>
> Don't try to use alternation:
>
>   cp -f /tmp/test/[abc].txt /tmp/test2/[123].txt /tmp/dest
>
> --
> Grant Edwards   grant.b.edwardsYow! ... I think I'd
>   at   better go back to my
> DESK
>   gmail.comand toy with a few
> common
>MISAPPREHENSIONS ...
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: copying multiple files

2016-11-21 Thread David Henderson
Hey Grant, thanks for the reply!  Unfortunately that command will just
echo what you type to the screen, not actually copy anything.  Any
other thoughts?

Thanks,
Dave


On 11/21/16, Grant Edwards <grant.b.edwa...@gmail.com> wrote:
> On 2016-11-21, David Henderson <dhender...@digital-pipe.com> wrote:
>> Good afternoon.  I have several files in two different directories
>> that I'm trying to copy in a destination using:
>>
>> cp -f /tmp/test/{a.txt,b.txt,c.txt} /tmp/test2/{1.txt,2.txt,3.txt}
>> /tmp/dest
>>
>> This keeps failing.  Is this implemented in BB?
>
> Try this:
>
>$ busybox ash
>~ $ echo /tmp/test/{a.txt,b.txt,c.txt}
>/tmp/test/{a.txt,b.txt,c.txt}
>
> It appears that the busybox shell does not implement bash/C shell
> alternation (aka "brace expansion").  None of the busybox builds I
> have on hand do anyway, and I don't see any options in the config file
> to enable such a feature...
>
> --
> Grant Edwards   grant.b.edwardsYow! Is this sexual
>   at   intercourse yet??  Is
> it,
>   gmail.comhuh, is it??
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


copying multiple files

2016-11-21 Thread David Henderson
Good afternoon.  I have several files in two different directories
that I'm trying to copy in a destination using:

cp -f /tmp/test/{a.txt,b.txt,c.txt} /tmp/test2/{1.txt,2.txt,3.txt} /tmp/dest

This keeps failing.  Is this implemented in BB?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


mounting using uuids

2016-10-19 Thread David Henderson
Good afternoon all, I am attempting to mount a partition using the
/etc/fstab file using its UUID.  Busybox fails with the message "No
such file or directory", however, if I use the same fstab file using
GNU's mount, everything works as designed.  Is there some special way
to mount like this using busybox?  The line in the fstab is:

UUID=630ec5ac-ea.../mnt/testext4defaults00

Calling: mount -a [-T /some/other/location/fstab]

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH 1/1] ifupdown: add write lock around ifstate access

2016-09-29 Thread David Henderson
Awesome, thanks Danomi!

Dave


On 9/28/16, Danomi Manchego  wrote:
> So that concurrent access on systems with multiple
> network interfaces correctly update the ifstate file.
>
> Signed-off-by: Danomi Manchego 
> ---
>  networking/ifupdown.c | 31 +++
>  1 file changed, 31 insertions(+)
>
> diff --git a/networking/ifupdown.c b/networking/ifupdown.c
> index b0bc0d7..1902c42 100644
> --- a/networking/ifupdown.c
> +++ b/networking/ifupdown.c
> @@ -1196,6 +1196,29 @@ static llist_t *find_iface_state(llist_t *state_list,
> const char *iface)
>   return NULL;
>  }
>
> +static FILE *open_ifstate_lock_file(void)
> +{
> + FILE *fp = fopen_for_write("/var/lock/ifupdown.lock");
> +
> + if (fp) {
> + struct flock fl;
> + fl.l_type = F_WRLCK;
> + fl.l_whence = SEEK_SET;
> + fl.l_start = 0;
> + fl.l_len = 0;
> + fcntl(fileno(fp), F_SETLKW, );
> + }
> +
> + return fp;
> +}
> +
> +static void close_ifstate_lock_file(FILE *fp)
> +{
> + if (fp) {
> + fclose(fp);
> + }
> +}
> +
>  /* read the previous state from the state file */
>  static llist_t *read_iface_state(void)
>  {
> @@ -1276,9 +1299,14 @@ int ifupdown_main(int argc UNUSED_PARAM, char
> **argv)
>   }
>
>   if (!FORCE) {
> +
> + FILE *state_lock_fp = open_ifstate_lock_file();
> +
>   llist_t *state_list = read_iface_state();
>   const llist_t *iface_state = 
> find_iface_state(state_list, iface);
>
> + close_ifstate_lock_file(state_lock_fp);
> +
>   if (cmds == iface_up) {
>   /* ifup */
>   if (iface_state) {
> @@ -1348,6 +1376,7 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv)
>   any_failures = 1;
>   } else if (!NO_ACT) {
>   /* update the state file */
> + FILE *state_lock_fp = open_ifstate_lock_file();
>   FILE *state_fp;
>   llist_t *state;
>   llist_t *state_list = read_iface_state();
> @@ -1378,6 +1407,8 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv)
>   }
>   fclose(state_fp);
>   llist_free(state_list, free);
> +
> + close_ifstate_lock_file(state_lock_fp);
>   }
>   next:
>   free(iface);
> --
> 1.9.1
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifup/down broken!!!

2016-09-29 Thread David Henderson
On 9/28/16, Xabier Oneca  --  xOneca  wrote:
> Hello David,
>
>> However, as noted, it appears that the script was having an 'exit 1'
>> even though it was going through all the lines and should have been
>> exiting 0.  Once one of the lines further up in the script was
>> commented out, it would exit correctly.  For some reason the script
>> wasn't giving an 'exit 0' by running all the way through - as it
>> should be doing.
>
> I tried your script adding 'set -x' before your first line of code, so
> I can see the execution trace of the script:
>
> + echo resolv.conf
> + env
> + CONFIG=
> + '[' -e /etc/network/interfaces ']'
> + echo eth0
> + grep -q :
> + '[' '' '!=' '' ']'
>
> In my case /etc/network/interfaces does exist, so the first "fail" is in
>
>   ( echo "$IFACE" | grep -q ':' )
>
> This skips the next full block of code. The next command is to check
> if $CONFIG is not empty (not the case, as you can see in the execution
> trace). As Dietmar explained, that's the command likely having your
> script returning 1, since scripts always exit with the status of the
> last command executed.
>
> HTH,
>
> Xabier Oneca_,,_
>

Good morning Xabier, thanks for the help!  During my testing (I will
do so again this afternoon), I commented out just the last line and it
exited status 1.  I then commented out the next block of code (the one
with 'grep') and that stopped the script from exiting 1.  After I do
the test again, I'll let you know.

Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-28 Thread David Henderson
On 9/27/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> On Mon, Sep 26, 2016 at 9:32 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> On 9/26/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>>> On Mon, Sep 26, 2016 at 5:51 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> Just following up with this...
>>>
>>> You have some sort of problem on your system, but you refuse to provide
>>> strace log of the problematic ifup invocation.
>>>
>>> If you don't want to provide information which can help in diagnosing
>>> the situation, it's fine. But stop nagging me.
>>
>> That's incorrect.  Once it has been installed on the device, I have
>> provided all information returned by strace.  I'm actually not even
>> aware of what you're talking about in this thread.
>
> I was talking about not posting strace log. In other thread,
> you did post it now. That's better.
> (It got linewrapped, making it harder to read. In cases like this
> (text with long lines) please attach it to your email, not paste it
> in the email body).

Got it, sorry about that!


>> I'm following up
>> with this question:
>>
>> So can I perform my own methods via the scripts to prevent BB from
>> attempting its own 'udhcpc' calls?  I don't want duplicate calls to
>> the same DHCP server.
>
> I have hard time finding a good advice "how to use ifup"
> when I personally think that ifup shouldn't be used in the first place.
>
> Your particular problem was, finally, diagnosed to a broken script
> in /etc/network/if-up.d/
> With fixed script, the "usual" dhcp config for ifup may work.

Ok, I understand.  So do you recommend using something like ifplugd?
I'm just interested in typical eth0/wlan0 type networking - no pppd or
vpn.

Also, what I didn't quite grasp was that the article you referenced
made mention of using one script to 'keep things in order'.  As I
mentioned, I'm not really a big fan of monolithic approaches and
wanted to use something more modular.  In this case, I would create
small scripts in the /etc/network/if-*.d directories for things like
creating the /etc/resolv.conf file.  What would be an advantage of the
single script over the smaller scripts?  So,  for example, does your
single script not even bother with using the if-*.d directories and
just reside in /etc/network?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifup/down broken!!!

2016-09-28 Thread David Henderson
Good morning Denys, thanks for your input!  Yes, once the script had
an 'exit 0' appended to it, ifup/down began to work correctly.
However, as noted, it appears that the script was having an 'exit 1'
even though it was going through all the lines and should have been
exiting 0.  Once one of the lines further up in the script was
commented out, it would exit correctly.  For some reason the script
wasn't giving an 'exit 0' by running all the way through - as it
should be doing.

Dave


On 9/27/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> On Tue, Sep 27, 2016 at 2:44 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> On 9/27/16, dietmar.schind...@manroland-web.com
>> <dietmar.schind...@manroland-web.com> wrote:
>>>> Von: David Henderson
>>>> Gesendet: Montag, 26. September 2016 17:04
>>>>
>>>> ...  The script is as follows:
>>>>
>>>> #!/bin/sh
>>>> #
>>>> # DEBUG
>>>> echo 'resolv.conf' > /tmp/debug.ifup
>>>> env >> /tmp/debug.ifup
>>>>
>>>> # everything below this point was added recently
>>>> CONFIG=''
>>>>
>>>> # this segment was what was causing an exit 1
>>>> [ -e '/etc/network/interfaces' ] && ( echo "$IFACE" | grep -q ':' ) &&
>>>> {
>>>> [ "$IF_DNS_DOMAIN" ] && CONFIG="${CONFIG}domain
>>>> ${IF_DNS_DOMAIN}\n"
>>>> [ "$IF_DNS_SEARCH" ] && CONFIG="${CONFIG}search
>>>> ${IF_DNS_SEARCH}\n"
>>>> [ "$IF_DNS_SORTLIST" ] && CONFIG="${CONFIG}sortlist
>>>> ${IF_DNS_SORTLIST}\n"
>>>> for NS in $IF_DNS_NAMESERVER $IF_DNS_NAMESERVERS; do
>>>> CONFIG="${CONFIG}nameserver $NS\n"
>>>> done
>>>> }
>>>> [ "$CONFIG" != '' ] && echo -e "$CONFIG" > /etc/resolv.conf
>>>>
>>>>
>>>> The "[ -e '/etc/network/interfaces' ] && ..." section was the part
>>>> that appears to be causing the 'exit 1' status - most likely from the
>>>> 'grep -q ':'' call.  Does this indicate an issue with /bin/sh as the
>>>> normal exit value of the script should be 0?  It appears that the
>>>> 'grep' call is returning a false response that is being retained and
>>>> causing the 'exit 1' status of the script even though the script
>>>> continues to process until the end (which should be an exit 0 now
>>>> right?)...
>>>
>>> Why does it appear to you that the next-to-last command dictates the
>>> script's exit status? That is implausible. In fact, the last command's
>>> exit
>>> status is also the script's exit status, so most probably the test [
>>> "$CONFIG" != '' ] returns 1 (false) because $CONFIG is empty.
>>> --
>>> Regards,
>>> Dietmar Schindler
>>
>> Good morning Dietmar, thanks for the reply to this.  The reason I
>> believe that is because I commented out the "[ 'CONFIG' != '' ]" line
>> and nothing changed.  I then commented out the next block above it,
>> which did stop the 'exit 1' status from 'ifup'.  I find it wierd that
>> that was the case too, but it was.
>
> Thus, the reason for ifup not working for you was
> /etc/network/if-up.d/000_dns-nameservers
> exiting with nonzero exit code, i.e. it was signaling a failure to ifup,
> which in turn was deciding that "upping eth0 failed",
> and wasn't writing /var/run/ifstate.
>
> Your strace output shows that when that problem is resolved,
> /var/run/ifstate is successfully updated:
>
> 18287 19:38:45.666707 open("/var/run/ifstate", O_RDONLY|O_LARGEFILE) = 3
> 18287 19:38:45.666769 fstat64(3, {st_mode=S_IFREG|0664, st_size=0, ...}) =
> 0
> 18287 19:38:45.666908 read(3, "", 4096) = 0
> 18287 19:38:45.666957 close(3)  = 0
> 18287 19:38:45.667059 open("/var/run/ifstate",
> O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
> 18287 19:38:45.667132 fstat64(3, {st_mode=S_IFREG|0664, st_size=0, ...}) =
> 0
> 18287 19:38:45.667261 write(3, "eth0=eth0\n", 10) = 10
> 18287 19:38:45.667319 close(3)  = 0
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-27 Thread David Henderson
Just following up with this...

Thanks,
Dave


On 9/26/16, David Henderson <dhender...@digital-pipe.com> wrote:
> On 9/26/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>> On Mon, Sep 26, 2016 at 5:51 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> Just following up with this...
>>
>> You have some sort of problem on your system, but you refuse to provide
>> strace log of the problematic ifup invocation.
>>
>> If you don't want to provide information which can help in diagnosing
>> the situation, it's fine. But stop nagging me.
>
> That's incorrect.  Once it has been installed on the device, I have
> provided all information returned by strace.  I'm actually not even
> aware of what you're talking about in this thread.  I'm following up
> with this question:
>
> So can I perform my own methods via the scripts to prevent BB from
> attempting its own 'udhcpc' calls?  I don't want duplicate calls to
> the same DHCP server.
>
> What does that have to do with strace?
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifup/down broken!!!

2016-09-27 Thread David Henderson
On 9/27/16, dietmar.schind...@manroland-web.com
<dietmar.schind...@manroland-web.com> wrote:
>> Von: David Henderson
>> Gesendet: Montag, 26. September 2016 17:04
>>
>> ...  The script is as follows:
>>
>> #!/bin/sh
>> #
>> # DEBUG
>> echo 'resolv.conf' > /tmp/debug.ifup
>> env >> /tmp/debug.ifup
>>
>> # everything below this point was added recently
>> CONFIG=''
>>
>> # this segment was what was causing an exit 1
>> [ -e '/etc/network/interfaces' ] && ( echo "$IFACE" | grep -q ':' ) && {
>> [ "$IF_DNS_DOMAIN" ] && CONFIG="${CONFIG}domain
>> ${IF_DNS_DOMAIN}\n"
>> [ "$IF_DNS_SEARCH" ] && CONFIG="${CONFIG}search
>> ${IF_DNS_SEARCH}\n"
>> [ "$IF_DNS_SORTLIST" ] && CONFIG="${CONFIG}sortlist
>> ${IF_DNS_SORTLIST}\n"
>> for NS in $IF_DNS_NAMESERVER $IF_DNS_NAMESERVERS; do
>> CONFIG="${CONFIG}nameserver $NS\n"
>> done
>> }
>> [ "$CONFIG" != '' ] && echo -e "$CONFIG" > /etc/resolv.conf
>>
>>
>> The "[ -e '/etc/network/interfaces' ] && ..." section was the part
>> that appears to be causing the 'exit 1' status - most likely from the
>> 'grep -q ':'' call.  Does this indicate an issue with /bin/sh as the
>> normal exit value of the script should be 0?  It appears that the
>> 'grep' call is returning a false response that is being retained and
>> causing the 'exit 1' status of the script even though the script
>> continues to process until the end (which should be an exit 0 now
>> right?)...
>
> Why does it appear to you that the next-to-last command dictates the
> script's exit status? That is implausible. In fact, the last command's exit
> status is also the script's exit status, so most probably the test [
> "$CONFIG" != '' ] returns 1 (false) because $CONFIG is empty.
> --
> Regards,
> Dietmar Schindler

Good morning Dietmar, thanks for the reply to this.  The reason I
believe that is because I commented out the "[ 'CONFIG' != '' ]" line
and nothing changed.  I then commented out the next block above it,
which did stop the 'exit 1' status from 'ifup'.  I find it wierd that
that was the case too, but it was.

Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-26 Thread David Henderson
On 9/26/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> On Mon, Sep 26, 2016 at 5:51 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Just following up with this...
>
> You have some sort of problem on your system, but you refuse to provide
> strace log of the problematic ifup invocation.
>
> If you don't want to provide information which can help in diagnosing
> the situation, it's fine. But stop nagging me.

That's incorrect.  Once it has been installed on the device, I have
provided all information returned by strace.  I'm actually not even
aware of what you're talking about in this thread.  I'm following up
with this question:

So can I perform my own methods via the scripts to prevent BB from
attempting its own 'udhcpc' calls?  I don't want duplicate calls to
the same DHCP server.

What does that have to do with strace?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-26 Thread David Henderson
Just following up with this...

Thanks,
Dave


On 9/20/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Thanks for your help with this too Denys.  Answers are inline...
>
>
> On 9/20/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>> On Tue, Sep 20, 2016 at 5:31 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> Hey Martin, thanks again for your help!  So I had to bring back
>>> 'sneaker-net' to get strace on the machine via flash drive (after
>>> locating one), but it is now on the machine!  I could not see anything
>>> in the 'ps' output (and it is the GNU version) regarding what was
>>> being called for contacting a DHCP server for the adapter.  I also
>>> tried running the command that Peter suggested, but the command he
>>> listed has invalid syntax.
>>
>> An examlpe run works for me:
>>
>> $ strace -f -e execve sh -c /bin/pwd
>> execve("/usr/bin/sh", ["sh", "-c", "/bin/pwd"], [/* 52 vars */]) = 0
>> execve("/bin/pwd", ["/bin/pwd"], [/* 52 vars */]) = 0
>> /tmp
>> +++ exited with 0 +++
>>
>> You might have an old version of strace.
>
> Possibly, it chokes with the 'execve' parameter as it's not valid in
> my 'strace'.
>
>
>>> After a few more calls and a ton of goop
>>> from 'strace'
>>
>> We need the entire "ton of goop" from strace.
>> For example, the "strace -oLOG -f -tt -s99 COMMAND" is my favorite.
>>
>>
>>>, it appears that 'udhcpc' was being called as follows
>>> (at least on my dev machine):
>>>
>>> udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
>>>
>>> (Just in case anyone else comes across this post)
>>>
>>> Now that I know what is being called, can anyone help with the other
>>> part of the original question?
>>
>> Ok, the question:
>>
>>> scripts that are run in the /etc/network/if-{,pre-,post-}{up,down}.d/
>>> directories.  Can/should I specify a script in the proper directory to
>>> execute the udhcpc binary (or another binary for that matter) with my
>>> own parameters for the interface without BB trying to use its own
>>> methods of obtaining an IP address automatically - effectively
>>> preventing the duplication of requests to the DHCP server for that
>>> interface?
>>
>> My personal opinion is that as soon as "simple" ifup/ifdown setup
>> is too primitive for your needs, e.g.:
>> - you need many IPs on one iface,
>> - you need dynamical ifaces (ppp, vpn), and you need to redefine
>>   routing/firewalling based on what's up and what isn't,
>> - you need additional things to be started/stopped
>>   (WPA supplicant, babysitter)
>>
>> at this point ifup becomes more PITA than help. It forces you
>> to do stuff in awkward ways.
>
> So can I perform my own methods via the scripts to prevent BB from
> attempting its own 'udhcpc' calls?  I don't want duplicate calls to
> the same DHCP server.
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifup/down broken!!!

2016-09-26 Thread David Henderson
On 9/26/16, Denys Vlasenko  wrote:
> On Mon, Sep 26, 2016 at 2:38 AM, Danomi Manchego
>  wrote:
>> All,
>>
>> i thought I'd share a previous experience, in case it helped.  In one
>> of our projects, we had multiple ethernet interfaces for a time,
>> controlled by full-blown ifplugd, but using bb ifupdown.  On start-up,
>> I would find that the two interfaces coming up at the same time would
>> result in incomplete /var/run/ifstate file, because each ifplugd would
>> use ifupdown to read the file, do work, then write out an update.  But
>> there's no write lock in bb ifupdown, so the two interfaces can
>> trample each other, losing state of one interface or the other.  Not
>> so good.
>
> Yes, exactly. Worse still, with ifupdown style management of network,
> two interfaces coming up can trample over /etc/resolv.conf
> (via udhcpc -> dhcp script) and routing.
> And firewall configuration. And many other things,
> depending on what custom scripts you add to it.
>
> That's why I personally don't use it.
>
> It exists in BB because developers almost never force decisions
> upon users. Dev merely provide tools. Users decide what they do
> with them.

So then should file locks be added to those applets?  Would that
resolve the problem?

Denys, so are you saying that BB requires additional software in order
to get networking working correctly under your way of doing it?  I
haven't looked, but is there an ifplugd daemon in BB?  Is there some
other built-in daemon I should be using?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifup/down broken!!!

2016-09-26 Thread David Henderson
Noted, thanks for the info Danomi!

Dave


On 9/25/16, Danomi Manchego <danomimanchego...@gmail.com> wrote:
> All,
>
> i thought I'd share a previous experience, in case it helped.  In one
> of our projects, we had multiple ethernet interfaces for a time,
> controlled by full-blown ifplugd, but using bb ifupdown.  On start-up,
> I would find that the two interfaces coming up at the same time would
> result in incomplete /var/run/ifstate file, because each ifplugd would
> use ifupdown to read the file, do work, then write out an update.  But
> there's no write lock in bb ifupdown, so the two interfaces can
> trample each other, losing state of one interface or the other.  Not
> so good.
>
> Good luck,
> Danomi -
>
>
> On Sat, Sep 24, 2016 at 5:09 PM, Denys Vlasenko
> <vda.li...@googlemail.com> wrote:
>> ..On Sat, Sep 24, 2016 at 7:41 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> Good afternoon all!  This is to let those that are attempting to work
>>> with the busybox applets 'ifup' and 'ifdown' that their current status
>>> is broken in certain conditions and to let them know the unfortunate
>>> work around you must go through to make it work.
>>>
>>> Testing has shown that there are two conditions that must be meet in
>>> order for an 'ifup -a' call during boot to process correctly:
>>>
>>> 1) you must have a pre-existing /etc/network/interfaces file
>>
>>> 2) each adapter must have static network config information (e.g. no
>>> dhcp)
>>
>>> If those two conditions are true, then everything works as designed.
>>> Any alterations causes the applets to choke from an apparent issue
>>> writing to the /var/run/ifstate file.
>>
>>
>> Trying to reproduce.
>>
>> My /etc/network/interfaces is two lines:
>> iface lo inet loopback
>> iface eth0 inet dhcp
>>
>> I have these empty directories:
>> /etc/network/if-down.d
>> /etc/network/if-post-down.d
>> /etc/network/if-pre-up.d
>> /etc/network/if-up.d
>> /var/run
>>
>>
>> Booting a qemu machine:
>>
>> ./run-qemu /boot/vmlinuz-4.8.0-rc5+
>> [0.00] Linux version 4.8.0-rc5+ (root@localhost) (gcc version
>> 6.1.1 20160810 (Red Hat 6.1.1-5) (GCC) ) #7 SMP Sat Sep 17 23:24:30
>> CEST 2016
>> [0.00] Command line: panic=1 console=ttyS0
>> [0.00] x86/fpu: Legacy x87 FPU detected.
>> [0.00] x86/fpu: Using 'eager' FPU context switches.
>> [0.00] e820: BIOS-provided physical RAM map:
>> [0.00] BIOS-e820: [mem 0x-0x0009fbff]
>> usable
>> ...
>> ...
>> [1.761051] tsc: Refined TSC clocksource calibration: 2712.012 MHz
>> [1.761931] clocksource: tsc: mask: 0x max_cycles:
>> 0x271791bffc3, max_idle_ns: 440795320414 ns
>> [1.893550] input: ImExPS/2 BYD TouchPad as
>> /devices/platform/i8042/serio1/input/input3
>> [2.771797] clocksource: Switched to clocksource tsc
>> Your current kernel is:
>> Linux (none) 4.8.0-rc5+ #7 SMP Sat Sep 17 23:24:30 CEST 2016 x86_64
>> GNU/Linux
>> I see following modules in current directory:
>> e1000.ko
>> e1000e.ko
>>
>>   (need to load e1000 module for eth0 to exist:)
>>
>> / # insmod e1000.ko
>> [   45.919343] e1000: Intel(R) PRO/1000 Network Driver - version
>> 7.3.21-k8-NAPI
>> [   45.919590] e1000: Copyright (c) 1999-2006 Intel Corporation.
>> [   46.412214] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
>> [   46.706789] e1000 :00:03.0 eth0: (PCI:33MHz:32-bit)
>> 52:54:00:12:34:56
>> [   46.707506] e1000 :00:03.0 eth0: Intel(R) PRO/1000 Network
>> Connection
>> [   46.714497] insmod (127) used greatest stack depth: 12872 bytes left
>>
>>   (ok, let's try it!!!)
>>
>> / # ifup eth0
>> [   50.696362] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
>> [   50.697526] e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow
>> Control: RX
>> [   50.700412] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
>> udhcpc: started, v1.26.0.git
>> udhcpc: sending discover
>> udhcpc: sending select for 10.0.2.15
>> udhcpc: lease of 10.0.2.15 obtained, lease time 86400
>>
>> / # ip a
>> 1: lo:  mtu 65536 qdisc noop qlen 1
>> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen
>> 1000
>> link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
>> inet6 fec0::5054:ff:fe1

Re: ifup dependency

2016-09-26 Thread David Henderson
On 9/26/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> On Mon, Sep 26, 2016 at 8:56 AM, Peter Korsgaard <pe...@korsgaard.com>
> wrote:
>>>>>>> "Bernhard" == Bernhard Reutner-Fischer <rep.dot@gmail.com>
>>>>>>> writes:
>>
>>  > On 17 September 2016 08:07:01 CEST, Peter Korsgaard
>> <pe...@korsgaard.com> wrote:
>>  >>>>>>> "David" == David Henderson <dhender...@digital-pipe.com> writes:
>>  >>
>>  >> > Hey Peter, thanks for the reply.  I was more or less referring to
>>  >> > should the 'menuconfig' portion of BB automatically add that in as
>> a
>>  >> > dependency if ifup/down has been selected, and not should I add
>> this
>>  >> > applet into my BB compile.  I was just letting the community know
>>  >> > about the "problem".
>>  >>
>>  >> Yes indeed, I think CONFIG_IFUPDOWN should select CONFIG_RUN_PARTS.
>>
>>  > No it should not. It's perfectly fine to use another run-parts. The
>>  > help-text should mention that any run-parts has to be installed
>>  > though.
>>
>> True.
>
> It's already in the help since about 2003:
>
> config IFUPDOWN
> bool "ifupdown"
> default y
> help
>   Activate or deactivate the specified interfaces. This applet
> makes
>   use of either "ifconfig" and "route" or the "ip" command to
> actually
>   configure network interfaces. Therefore, you will probably also
> want
>   to enable either IFCONFIG and ROUTE, or enable
>   FEATURE_IFUPDOWN_IP and the various IP options.
>   Of course you could use non-busybox versions of these programs,
> so
>   against my better judgement (since this will surely result in
> plenty
>   of support questions on the mailing list), I do not force you to
>   enable these additional options. It is up to you to supply either
>   "ifconfig", "route" and "run-parts" or the "ip" command, either
>   via busybox or via standalone utilities.
>
>
>
> It's possible to add that sometimes udhcpc, bootpc, pon, poff,
> start-stop-daemon, wvdial, and run-parts can be used,
> but the list gets somewhat unwieldy.

This re-affirms my suggestion about some type of a popup.  People
typically look at the help for info on what a particular applet may
do, not what its requirements are.  It would be better to have a popup
to alert the user that "Hey you either need to enable the BB
supplemental binaries required for this to work, or supply your own -
see the help for details."  Again, I didn't look at the help because I
knew what the commands did.

Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifup/down broken!!!

2016-09-26 Thread David Henderson
Good morning all!  Thanks for the help Denys, replies are inline...


On 9/24/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> ..On Sat, Sep 24, 2016 at 7:41 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Good afternoon all!  This is to let those that are attempting to work
>> with the busybox applets 'ifup' and 'ifdown' that their current status
>> is broken in certain conditions and to let them know the unfortunate
>> work around you must go through to make it work.
>>
>> Testing has shown that there are two conditions that must be meet in
>> order for an 'ifup -a' call during boot to process correctly:
>>
>> 1) you must have a pre-existing /etc/network/interfaces file
>
>> 2) each adapter must have static network config information (e.g. no
>> dhcp)
>
>> If those two conditions are true, then everything works as designed.
>> Any alterations causes the applets to choke from an apparent issue
>> writing to the /var/run/ifstate file.
>
>
> Trying to reproduce.
>
> My /etc/network/interfaces is two lines:
> iface lo inet loopback
> iface eth0 inet dhcp
>
> I have these empty directories:
> /etc/network/if-down.d
> /etc/network/if-post-down.d
> /etc/network/if-pre-up.d
> /etc/network/if-up.d
> /var/run
>
>
> Booting a qemu machine:
>
> ./run-qemu /boot/vmlinuz-4.8.0-rc5+
> [0.00] Linux version 4.8.0-rc5+ (root@localhost) (gcc version
> 6.1.1 20160810 (Red Hat 6.1.1-5) (GCC) ) #7 SMP Sat Sep 17 23:24:30
> CEST 2016
> [0.00] Command line: panic=1 console=ttyS0
> [0.00] x86/fpu: Legacy x87 FPU detected.
> [0.00] x86/fpu: Using 'eager' FPU context switches.
> [0.00] e820: BIOS-provided physical RAM map:
> [0.00] BIOS-e820: [mem 0x-0x0009fbff]
> usable
> ...
> ...
> [1.761051] tsc: Refined TSC clocksource calibration: 2712.012 MHz
> [1.761931] clocksource: tsc: mask: 0x max_cycles:
> 0x271791bffc3, max_idle_ns: 440795320414 ns
> [1.893550] input: ImExPS/2 BYD TouchPad as
> /devices/platform/i8042/serio1/input/input3
> [2.771797] clocksource: Switched to clocksource tsc
> Your current kernel is:
> Linux (none) 4.8.0-rc5+ #7 SMP Sat Sep 17 23:24:30 CEST 2016 x86_64
> GNU/Linux
> I see following modules in current directory:
> e1000.ko
> e1000e.ko
>
>   (need to load e1000 module for eth0 to exist:)
>
> / # insmod e1000.ko
> [   45.919343] e1000: Intel(R) PRO/1000 Network Driver - version
> 7.3.21-k8-NAPI
> [   45.919590] e1000: Copyright (c) 1999-2006 Intel Corporation.
> [   46.412214] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
> [   46.706789] e1000 :00:03.0 eth0: (PCI:33MHz:32-bit)
> 52:54:00:12:34:56
> [   46.707506] e1000 :00:03.0 eth0: Intel(R) PRO/1000 Network
> Connection
> [   46.714497] insmod (127) used greatest stack depth: 12872 bytes left
>
>   (ok, let's try it!!!)
>
> / # ifup eth0
> [   50.696362] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
> [   50.697526] e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow
> Control: RX
> [   50.700412] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> udhcpc: started, v1.26.0.git
> udhcpc: sending discover
> udhcpc: sending select for 10.0.2.15
> udhcpc: lease of 10.0.2.15 obtained, lease time 86400
>
> / # ip a
> 1: lo:  mtu 65536 qdisc noop qlen 1
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen
> 1000
> link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
> inet6 fec0::5054:ff:fe12:3456/64 scope site tentative dynamic
>valid_lft 86400sec preferred_lft 14400sec
> inet6 fe80::5054:ff:fe12:3456/64 scope link
>valid_lft forever preferred_lft forever
>
> / # cat /var/run/ifstate
> eth0=eth0
>
> / # ifup lo
>
> / # ip a
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> inet 127.0.0.1/8 scope host lo
>valid_lft forever preferred_lft forever
> inet6 ::1/128 scope host
>valid_lft forever preferred_lft forever
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen
> 1000
> link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
> inet6 fec0::5054:ff:fe12:3456/64 scope site dynamic
>valid_lft 86400sec preferred_lft 14400sec
> inet6 fe80::5054:ff:fe12:3456/64 scope link
>valid_lft forever preferred_lft forever
>
> / # cat /var/run/ifstate
> eth0=eth0
> lo=lo
>
>
> So. Works for me.

Performed a fresh boot of the machine, 

Re: ifup dependency

2016-09-26 Thread David Henderson
Good morning all!  Thanks for the replies guys.  And that is a good
point Bernhard.  Something in the help would probably be a good idea.
Also, what about a popup alert (if possible) since some may not read
the help if they are just adding those applets as I did.  There was no
reason for me to look at the help since I knew what the commands did.
Thoughts?

Thanks,
Dave


On 9/26/16, Peter Korsgaard <pe...@korsgaard.com> wrote:
>>>>>> "Bernhard" == Bernhard Reutner-Fischer <rep.dot@gmail.com>
>>>>>> writes:
>
>  > On 17 September 2016 08:07:01 CEST, Peter Korsgaard <pe...@korsgaard.com>
> wrote:
>  >>>>>>> "David" == David Henderson <dhender...@digital-pipe.com> writes:
>  >>
>  >> > Hey Peter, thanks for the reply.  I was more or less referring to
>  >> > should the 'menuconfig' portion of BB automatically add that in as a
>  >> > dependency if ifup/down has been selected, and not should I add this
>  >> > applet into my BB compile.  I was just letting the community know
>  >> > about the "problem".
>  >>
>  >> Yes indeed, I think CONFIG_IFUPDOWN should select CONFIG_RUN_PARTS.
>
>  > No it should not. It's perfectly fine to use another run-parts. The
>  > help-text should mention that any run-parts has to be installed
>  > though.
>
> True.
>
> --
> Bye, Peter Korsgaard
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


ifup/down broken!!!

2016-09-24 Thread David Henderson
Good afternoon all!  This is to let those that are attempting to work
with the busybox applets 'ifup' and 'ifdown' that their current status
is broken in certain conditions and to let them know the unfortunate
work around you must go through to make it work.

Testing has shown that there are two conditions that must be meet in
order for an 'ifup -a' call during boot to process correctly:

1) you must have a pre-existing /etc/network/interfaces file
2) each adapter must have static network config information (e.g. no dhcp)

If those two conditions are true, then everything works as designed.
Any alterations causes the applets to choke from an apparent issue
writing to the /var/run/ifstate file.  The only solution I can see is
that the burden of manually maintaining the /var/run/ifstate file is
on the user/interface.  Denys has recently said not to use 'ifup -a'
during boot, but has not offered any other solution unfortunately.
Incidentally, trying to bring up particular interfaces (e.g. ifup
eth0) does not work either.  Perhaps busybox requires additional
software for these commands to work properly - ifplugd?  Can anyone
confirm?

Additionally there is another issue using 'ifdown' with virtual
adapters bringing down the main interface that has been corrected by
Martin Townsend in another post so make sure that has been added or
that the version your using has that patch (should be > 1.24.x I
think).

Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: additional ifupdown problems

2016-09-24 Thread David Henderson
So I've altered the boot script to now use:

NETDEVICES="$(awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>>$LOG_BOOT)"
for DEVICE in $NETDEVICES; do
ifconfig $DEVICE 2>>/var/log/${DEVICE}.log | grep -ve 'inet
addr:127.0.0.1' | grep -q "inet addr"
if [ "$?" != 0 ]; then
echo "auto $DEVICE" >> /etc/network/interfaces
echo "iface $DEVICE inet dhcp" >> /etc/network/interfaces
echo '' >> /etc/network/interfaces

ifup -v $DEVICE 2>&1 | tee -a /var/log/${DEVICE}.log >>$LOG_BOOT

sleep 1
fi
done

The results are still the same - no writing to /var/run/ifstate.  Help
is appreciated!

Thanks,
Dave


On 9/23/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Good morning Martin.  I have actually be a part of that thread - still
> waiting for a reply from Denys on it actually.  I'll apply the patch
> at some point to resolve the ifdown issue, however, I'm still trying
> to figure out what is going on with bringing up the interfaces without
> an /etc/network/interfaces file.  How am I supposed to do this
> properly Denys?  You've been vocal about this, but aren't supplying
> additional info.
>
> Thanks for your help though Martin!
>
> Dave
>
>
> On 9/22/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>> Hi Dave,
>>
>> I think you will need my recent patch that I submitted to get ifdown
>> working, check the archived mailing list for about a week ago.  I was
>> getting the same problem with an aliased/virtual IP address.
>>
>> Very strange why this works though, rules out sudoer problems.  I'm
>> afraid this one has me stumped.
>>
>> - Martin.
>>
>> On Thu, Sep 22, 2016 at 7:53 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> So to add more confusion to the mix, I've been able to successfully
>>> add 'virtual' adapter (e.g. eth0:1) configuration with everything
>>> working correctly - both 'ifup' and the modification of the
>>> /var/run/ifstate file!  Also, the test script in if-up.d ran
>>> flawlessly.  I do still get an error on 'ifdown' though:
>>>
>>> # sudo ifdown -v eth0:1
>>> run-parts /etc/network/if-down.d
>>> ip addr flush dev eth0:1
>>> ip link set eth0:1 down
>>> ip: SIOCSIFFLAGS: Cannot assign requested address
>>>
>>> The adapter does indeed go down, but is failing to complete the job
>>> successfully.  Attempts with 'eth0' is still having the same
>>> problems...
>>>
>>> Dave
>>>
>>>
>>> On 9/22/16, David Henderson <dhender...@digital-pipe.com> wrote:
>>>> Hey Martin, it does not appear that a /proc/config.gz is present.  I
>>>> guess that option wasn't added in the kernel config itself.  What was
>>>> the option to check btw?
>>>>
>>>> I also checked the full dmesg output, but it doesn't appear that
>>>> anything was in that log.
>>>>
>>>> Let me ask this question.  I have to run 'ifup' using sudo - which has
>>>> a direct entry in /etc/sudoers.  I would assume this is true, but the
>>>> commands that are run using 'ifup' are also run as the elevated
>>>> account and do not require a specific entry in the /etc/sudoers
>>>> account for 'ip' as well right?
>>>>
>>>> Thanks,
>>>> Dave
>>>>
>>>>
>>>> On 9/22/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>> Don't suppose there's a /proc/config.gz file on your board? this would
>>>>> be the kernel configuration but the kernel would have to be built with
>>>>> this feature enabled.
>>>>> zcat /proc/config.gz would give you the configuration.
>>>>> Can't remember if I've already asked but is there anything useful in
>>>>> dmesg?
>>>>>
>>>>> -Martin.
>>>>>
>>>>> On Thu, Sep 22, 2016 at 2:26 PM, David Henderson
>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>> Thanks for your continued efforts Martin!  I can try the full blown
>>>>>> iproute2 later today and let you know.  Not sure about the kernel
>>>>>> config as I'm working with a fork of TC linux - they maintain that
>>>>>> portion.  And I don't think it's a firewall issue because the routing
>>>>>> does get setup during boot, it's just that the ifstate file doesn't
>&

Re: ifupdown problem

2016-09-24 Thread David Henderson
Following up with this Denys.

Thanks,
Dave


On 9/23/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Following up with this Denys.
>
> Thanks,
> Dave
>
>
> On 9/22/16, David Henderson <dhender...@digital-pipe.com> wrote:
>> On 9/22/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>>> On Wed, Sep 21, 2016 at 2:57 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> On 9/20/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>>>>> On Tue, Sep 20, 2016 at 8:33 PM, David Henderson
>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>>> General idea is described here:
>>>>>>> https://busybox.net/~vda/no_ifup.txt
>>>>>>
>>>>>> Looked at it, wouldn't this be the same thing as scripts in
>>>>>> /etc/network/if-*.d directories?
>>>>>
>>>>> It won't be the same, and the document explains why.
>>>>> You did not understand it.
>>>>> Example #1: the "ifup -a hangs at boot" case
>>>>> Example #2: "ifup eth0" + pppd in parallel simultaneously upping ppp0.
>>>>> What will be the default route in "ifup" world?
>>>>
>>>> So the only difference is to not pass the '-a' switch, but instead to
>>>> pass the direct name of the adapter?
>>>
>>> No, I'm saying something rather different.
>>> It is explained in the link.
>>>
>>
>> I'm trying to understand what it is that you are saying.  You keep
>> referring me to the link, but if I don't understand it, I don't think
>> I'm going to without further explanation.  I'm currently working on
>> the networking side of a project and am interested in knowing what
>> you're talking about.
>>
>> Dave
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: additional ifupdown problems

2016-09-23 Thread David Henderson
Good morning Martin.  I have actually be a part of that thread - still
waiting for a reply from Denys on it actually.  I'll apply the patch
at some point to resolve the ifdown issue, however, I'm still trying
to figure out what is going on with bringing up the interfaces without
an /etc/network/interfaces file.  How am I supposed to do this
properly Denys?  You've been vocal about this, but aren't supplying
additional info.

Thanks for your help though Martin!

Dave


On 9/22/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi Dave,
>
> I think you will need my recent patch that I submitted to get ifdown
> working, check the archived mailing list for about a week ago.  I was
> getting the same problem with an aliased/virtual IP address.
>
> Very strange why this works though, rules out sudoer problems.  I'm
> afraid this one has me stumped.
>
> - Martin.
>
> On Thu, Sep 22, 2016 at 7:53 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> So to add more confusion to the mix, I've been able to successfully
>> add 'virtual' adapter (e.g. eth0:1) configuration with everything
>> working correctly - both 'ifup' and the modification of the
>> /var/run/ifstate file!  Also, the test script in if-up.d ran
>> flawlessly.  I do still get an error on 'ifdown' though:
>>
>> # sudo ifdown -v eth0:1
>> run-parts /etc/network/if-down.d
>> ip addr flush dev eth0:1
>> ip link set eth0:1 down
>> ip: SIOCSIFFLAGS: Cannot assign requested address
>>
>> The adapter does indeed go down, but is failing to complete the job
>> successfully.  Attempts with 'eth0' is still having the same
>> problems...
>>
>> Dave
>>
>>
>> On 9/22/16, David Henderson <dhender...@digital-pipe.com> wrote:
>>> Hey Martin, it does not appear that a /proc/config.gz is present.  I
>>> guess that option wasn't added in the kernel config itself.  What was
>>> the option to check btw?
>>>
>>> I also checked the full dmesg output, but it doesn't appear that
>>> anything was in that log.
>>>
>>> Let me ask this question.  I have to run 'ifup' using sudo - which has
>>> a direct entry in /etc/sudoers.  I would assume this is true, but the
>>> commands that are run using 'ifup' are also run as the elevated
>>> account and do not require a specific entry in the /etc/sudoers
>>> account for 'ip' as well right?
>>>
>>> Thanks,
>>> Dave
>>>
>>>
>>> On 9/22/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>> Don't suppose there's a /proc/config.gz file on your board? this would
>>>> be the kernel configuration but the kernel would have to be built with
>>>> this feature enabled.
>>>> zcat /proc/config.gz would give you the configuration.
>>>> Can't remember if I've already asked but is there anything useful in
>>>> dmesg?
>>>>
>>>> -Martin.
>>>>
>>>> On Thu, Sep 22, 2016 at 2:26 PM, David Henderson
>>>> <dhender...@digital-pipe.com> wrote:
>>>>> Thanks for your continued efforts Martin!  I can try the full blown
>>>>> iproute2 later today and let you know.  Not sure about the kernel
>>>>> config as I'm working with a fork of TC linux - they maintain that
>>>>> portion.  And I don't think it's a firewall issue because the routing
>>>>> does get setup during boot, it's just that the ifstate file doesn't
>>>>> get written to for some reason (and I don't think firewalls will
>>>>> prevent writing to local files :).
>>>>>
>>>>> Thanks,
>>>>> Dave
>>>>>
>>>>>
>>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>>> Hi Dave,
>>>>>>
>>>>>> On Wed, Sep 21, 2016 at 4:51 PM, David Henderson
>>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>>>>> Hi Dave,
>>>>>>>>
>>>>>>>> On Wed, Sep 21, 2016 at 3:41 PM, David Henderson
>>>>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>>>>> Hey Martin,
>>>>>>>>>
>>>>>>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>>>>>>> Hi Dave,
>>>>>>>>>>
>>>>>>>>>> On Wed, 

Re: ifupdown problem

2016-09-23 Thread David Henderson
Following up with this Denys.

Thanks,
Dave


On 9/22/16, David Henderson <dhender...@digital-pipe.com> wrote:
> On 9/22/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>> On Wed, Sep 21, 2016 at 2:57 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> On 9/20/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>>>> On Tue, Sep 20, 2016 at 8:33 PM, David Henderson
>>>> <dhender...@digital-pipe.com> wrote:
>>>>>> General idea is described here:
>>>>>> https://busybox.net/~vda/no_ifup.txt
>>>>>
>>>>> Looked at it, wouldn't this be the same thing as scripts in
>>>>> /etc/network/if-*.d directories?
>>>>
>>>> It won't be the same, and the document explains why.
>>>> You did not understand it.
>>>> Example #1: the "ifup -a hangs at boot" case
>>>> Example #2: "ifup eth0" + pppd in parallel simultaneously upping ppp0.
>>>> What will be the default route in "ifup" world?
>>>
>>> So the only difference is to not pass the '-a' switch, but instead to
>>> pass the direct name of the adapter?
>>
>> No, I'm saying something rather different.
>> It is explained in the link.
>>
>
> I'm trying to understand what it is that you are saying.  You keep
> referring me to the link, but if I don't understand it, I don't think
> I'm going to without further explanation.  I'm currently working on
> the networking side of a project and am interested in knowing what
> you're talking about.
>
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: additional ifupdown problems

2016-09-22 Thread David Henderson
Here's some more useful info... So if there are contents in the
/etc/network/interfaces file (at least static IP info), everything
works as designed (ifup/down and /var/run/ifstate) via the 'ifup -a'
during bootup.  Although if eth0 is ifdown'ed and has a virtual config
eth0:1, when you down eth0, the virtual adapter goes down too.  Not
sure if this is a bug or if eth0:1 piggy backs on eth0 making it
necessary.  However, if eth0 gets brought back online, the eth0:1
still remains down even though it is listed in /var/run/ifstate.

If no /etc/network/interfaces file is present during boot, currently
the boot script executes the following for wired NIC's:

NETDEVICES="$(awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>>$LOG_BOOT)"
for DEVICE in $NETDEVICES; do
   ifconfig $DEVICE 2>>$LOG_BOOT | grep -q "inet addr"
   if [ "$?" != 0 ]; then
  ifup -v $DEVICE >>$LOG_BOOT 2>&1   # tried with and without this

  trap 2 3 11
  if [ $DEBUG -eq 1 ]; then
 /sbin/udhcpc -b -i $DEVICE -x hostname:$(/bin/hostname) -p
/var/run/udhcpc.${DEVICE}.pid 2>&1 | tee -a $LOG_BOOT
>>/var/log/udhcpc.${DEVICE}.log
  else
 /sbin/udhcpc -b -i $DEVICE -x hostname:$(/bin/hostname) -p
/var/run/udhcpc.$DEVICE.pid >/dev/null
2>>/var/log/udhcpc.${DEVICE}.log
  fi
      trap "" 2 3 11
  sleep 1
   fi
done

Thanks,
Dave


On 9/22/16, David Henderson <dhender...@digital-pipe.com> wrote:
> So to add more confusion to the mix, I've been able to successfully
> add 'virtual' adapter (e.g. eth0:1) configuration with everything
> working correctly - both 'ifup' and the modification of the
> /var/run/ifstate file!  Also, the test script in if-up.d ran
> flawlessly.  I do still get an error on 'ifdown' though:
>
> # sudo ifdown -v eth0:1
> run-parts /etc/network/if-down.d
> ip addr flush dev eth0:1
> ip link set eth0:1 down
> ip: SIOCSIFFLAGS: Cannot assign requested address
>
> The adapter does indeed go down, but is failing to complete the job
> successfully.  Attempts with 'eth0' is still having the same
> problems...
>
> Dave
>
>
> On 9/22/16, David Henderson <dhender...@digital-pipe.com> wrote:
>> Hey Martin, it does not appear that a /proc/config.gz is present.  I
>> guess that option wasn't added in the kernel config itself.  What was
>> the option to check btw?
>>
>> I also checked the full dmesg output, but it doesn't appear that
>> anything was in that log.
>>
>> Let me ask this question.  I have to run 'ifup' using sudo - which has
>> a direct entry in /etc/sudoers.  I would assume this is true, but the
>> commands that are run using 'ifup' are also run as the elevated
>> account and do not require a specific entry in the /etc/sudoers
>> account for 'ip' as well right?
>>
>> Thanks,
>> Dave
>>
>>
>> On 9/22/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Don't suppose there's a /proc/config.gz file on your board? this would
>>> be the kernel configuration but the kernel would have to be built with
>>> this feature enabled.
>>> zcat /proc/config.gz would give you the configuration.
>>> Can't remember if I've already asked but is there anything useful in
>>> dmesg?
>>>
>>> -Martin.
>>>
>>> On Thu, Sep 22, 2016 at 2:26 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> Thanks for your continued efforts Martin!  I can try the full blown
>>>> iproute2 later today and let you know.  Not sure about the kernel
>>>> config as I'm working with a fork of TC linux - they maintain that
>>>> portion.  And I don't think it's a firewall issue because the routing
>>>> does get setup during boot, it's just that the ifstate file doesn't
>>>> get written to for some reason (and I don't think firewalls will
>>>> prevent writing to local files :).
>>>>
>>>> Thanks,
>>>> Dave
>>>>
>>>>
>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>> Hi Dave,
>>>>>
>>>>> On Wed, Sep 21, 2016 at 4:51 PM, David Henderson
>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>>>> Hi Dave,
>>>>>>>
>>>>>>> On Wed, Sep 21, 2016 at 3:41 PM, David Henderson
>>>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>>>> Hey Martin,
>>>>>>>>
>>>>>>>> On 9/21/16, Marti

Re: additional ifupdown problems

2016-09-22 Thread David Henderson
So to add more confusion to the mix, I've been able to successfully
add 'virtual' adapter (e.g. eth0:1) configuration with everything
working correctly - both 'ifup' and the modification of the
/var/run/ifstate file!  Also, the test script in if-up.d ran
flawlessly.  I do still get an error on 'ifdown' though:

# sudo ifdown -v eth0:1
run-parts /etc/network/if-down.d
ip addr flush dev eth0:1
ip link set eth0:1 down
ip: SIOCSIFFLAGS: Cannot assign requested address

The adapter does indeed go down, but is failing to complete the job
successfully.  Attempts with 'eth0' is still having the same
problems...

Dave


On 9/22/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Hey Martin, it does not appear that a /proc/config.gz is present.  I
> guess that option wasn't added in the kernel config itself.  What was
> the option to check btw?
>
> I also checked the full dmesg output, but it doesn't appear that
> anything was in that log.
>
> Let me ask this question.  I have to run 'ifup' using sudo - which has
> a direct entry in /etc/sudoers.  I would assume this is true, but the
> commands that are run using 'ifup' are also run as the elevated
> account and do not require a specific entry in the /etc/sudoers
> account for 'ip' as well right?
>
> Thanks,
> Dave
>
>
> On 9/22/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>> Don't suppose there's a /proc/config.gz file on your board? this would
>> be the kernel configuration but the kernel would have to be built with
>> this feature enabled.
>> zcat /proc/config.gz would give you the configuration.
>> Can't remember if I've already asked but is there anything useful in
>> dmesg?
>>
>> -Martin.
>>
>> On Thu, Sep 22, 2016 at 2:26 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> Thanks for your continued efforts Martin!  I can try the full blown
>>> iproute2 later today and let you know.  Not sure about the kernel
>>> config as I'm working with a fork of TC linux - they maintain that
>>> portion.  And I don't think it's a firewall issue because the routing
>>> does get setup during boot, it's just that the ifstate file doesn't
>>> get written to for some reason (and I don't think firewalls will
>>> prevent writing to local files :).
>>>
>>> Thanks,
>>> Dave
>>>
>>>
>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>> Hi Dave,
>>>>
>>>> On Wed, Sep 21, 2016 at 4:51 PM, David Henderson
>>>> <dhender...@digital-pipe.com> wrote:
>>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>>> Hi Dave,
>>>>>>
>>>>>> On Wed, Sep 21, 2016 at 3:41 PM, David Henderson
>>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>>> Hey Martin,
>>>>>>>
>>>>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>>>>> Hi Dave,
>>>>>>>>
>>>>>>>> On Wed, Sep 21, 2016 at 2:06 PM, David Henderson
>>>>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>>>>> Good morning everyone!  I'll add each question with the answer
>>>>>>>>> below:
>>>>>>>>>
>>>>>>>>> Q: maybe because something in if-pre-up.d fails?
>>>>>>>>> A: there is only that one test script in if-up.d, no others so
>>>>>>>>> nothing
>>>>>>>>> there to fail.  And judging by the output from 'ifup', it doesn't
>>>>>>>>> even
>>>>>>>>> appear that the parsing of the if-up.d directory is happening,
>>>>>>>>> only
>>>>>>>>> if-pre-up.d.
>>>>>>>> You misread the question, maybe something in if-pre-up.d fails
>>>>>>>> which
>>>>>>>> means it doesn't even attempt if-up.d, I don't know the
>>>>>>>> implementation
>>>>>>>> that well so I don't know if this would happen.
>>>>>>>
>>>>>>> I think you misread the answer :)  There are no files in any of the
>>>>>>> if-*.d directories except the if-up.d directory, and there is only
>>>>>>> that one test script that was shown in another thread (which only
>>>>>>> uses
>>>>>>> one 'echo' call and one 'env' call).  There is nothing in a

Re: additional ifupdown problems

2016-09-22 Thread David Henderson
Hey Martin, it does not appear that a /proc/config.gz is present.  I
guess that option wasn't added in the kernel config itself.  What was
the option to check btw?

I also checked the full dmesg output, but it doesn't appear that
anything was in that log.

Let me ask this question.  I have to run 'ifup' using sudo - which has
a direct entry in /etc/sudoers.  I would assume this is true, but the
commands that are run using 'ifup' are also run as the elevated
account and do not require a specific entry in the /etc/sudoers
account for 'ip' as well right?

Thanks,
Dave


On 9/22/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Don't suppose there's a /proc/config.gz file on your board? this would
> be the kernel configuration but the kernel would have to be built with
> this feature enabled.
> zcat /proc/config.gz would give you the configuration.
> Can't remember if I've already asked but is there anything useful in dmesg?
>
> -Martin.
>
> On Thu, Sep 22, 2016 at 2:26 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Thanks for your continued efforts Martin!  I can try the full blown
>> iproute2 later today and let you know.  Not sure about the kernel
>> config as I'm working with a fork of TC linux - they maintain that
>> portion.  And I don't think it's a firewall issue because the routing
>> does get setup during boot, it's just that the ifstate file doesn't
>> get written to for some reason (and I don't think firewalls will
>> prevent writing to local files :).
>>
>> Thanks,
>> Dave
>>
>>
>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Hi Dave,
>>>
>>> On Wed, Sep 21, 2016 at 4:51 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>> Hi Dave,
>>>>>
>>>>> On Wed, Sep 21, 2016 at 3:41 PM, David Henderson
>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>> Hey Martin,
>>>>>>
>>>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>>>> Hi Dave,
>>>>>>>
>>>>>>> On Wed, Sep 21, 2016 at 2:06 PM, David Henderson
>>>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>>>> Good morning everyone!  I'll add each question with the answer
>>>>>>>> below:
>>>>>>>>
>>>>>>>> Q: maybe because something in if-pre-up.d fails?
>>>>>>>> A: there is only that one test script in if-up.d, no others so
>>>>>>>> nothing
>>>>>>>> there to fail.  And judging by the output from 'ifup', it doesn't
>>>>>>>> even
>>>>>>>> appear that the parsing of the if-up.d directory is happening, only
>>>>>>>> if-pre-up.d.
>>>>>>> You misread the question, maybe something in if-pre-up.d fails which
>>>>>>> means it doesn't even attempt if-up.d, I don't know the
>>>>>>> implementation
>>>>>>> that well so I don't know if this would happen.
>>>>>>
>>>>>> I think you misread the answer :)  There are no files in any of the
>>>>>> if-*.d directories except the if-up.d directory, and there is only
>>>>>> that one test script that was shown in another thread (which only
>>>>>> uses
>>>>>> one 'echo' call and one 'env' call).  There is nothing in any of
>>>>>> these
>>>>>> directories to fail.
>>>>>>
>>>>>>>> Q: maybe something is overwriting it (do you have inotfiy-watch)?
>>>>>>>> A: I do not have inotify-watch running.  Unless something in BB is
>>>>>>>> happening I have nothing else regarding networking running (e.g.
>>>>>>>> ifplugd, pppd, openvpn, etc).
>>>>>>> inotify-watch is a utility that you could run to determine if the
>>>>>>> file
>>>>>>> is being overwritten but maybe hard to use during boot anyway.
>>>>>>
>>>>>> Got it!  No I don't have that running.  However, as specified, unless
>>>>>> there is something in BB that also interacts with that file, there is
>>>>>> no other services running that would even care about the
>>>>>> /var/run/ifstate file.  Only 'ifup -a' is called during bootup that
>>>

Re: additional ifupdown problems

2016-09-22 Thread David Henderson
Thanks for your continued efforts Martin!  I can try the full blown
iproute2 later today and let you know.  Not sure about the kernel
config as I'm working with a fork of TC linux - they maintain that
portion.  And I don't think it's a firewall issue because the routing
does get setup during boot, it's just that the ifstate file doesn't
get written to for some reason (and I don't think firewalls will
prevent writing to local files :).

Thanks,
Dave


On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi Dave,
>
> On Wed, Sep 21, 2016 at 4:51 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Hi Dave,
>>>
>>> On Wed, Sep 21, 2016 at 3:41 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> Hey Martin,
>>>>
>>>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>> Hi Dave,
>>>>>
>>>>> On Wed, Sep 21, 2016 at 2:06 PM, David Henderson
>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>> Good morning everyone!  I'll add each question with the answer below:
>>>>>>
>>>>>> Q: maybe because something in if-pre-up.d fails?
>>>>>> A: there is only that one test script in if-up.d, no others so
>>>>>> nothing
>>>>>> there to fail.  And judging by the output from 'ifup', it doesn't
>>>>>> even
>>>>>> appear that the parsing of the if-up.d directory is happening, only
>>>>>> if-pre-up.d.
>>>>> You misread the question, maybe something in if-pre-up.d fails which
>>>>> means it doesn't even attempt if-up.d, I don't know the implementation
>>>>> that well so I don't know if this would happen.
>>>>
>>>> I think you misread the answer :)  There are no files in any of the
>>>> if-*.d directories except the if-up.d directory, and there is only
>>>> that one test script that was shown in another thread (which only uses
>>>> one 'echo' call and one 'env' call).  There is nothing in any of these
>>>> directories to fail.
>>>>
>>>>>> Q: maybe something is overwriting it (do you have inotfiy-watch)?
>>>>>> A: I do not have inotify-watch running.  Unless something in BB is
>>>>>> happening I have nothing else regarding networking running (e.g.
>>>>>> ifplugd, pppd, openvpn, etc).
>>>>> inotify-watch is a utility that you could run to determine if the file
>>>>> is being overwritten but maybe hard to use during boot anyway.
>>>>
>>>> Got it!  No I don't have that running.  However, as specified, unless
>>>> there is something in BB that also interacts with that file, there is
>>>> no other services running that would even care about the
>>>> /var/run/ifstate file.  Only 'ifup -a' is called during bootup that is
>>>> regarding networking.  The only other software that is installed that
>>>> interacts with networking is the wpa suite, but afaik, it doesn't
>>>> bother with that file.  Also, wpa currently isn't even being executed
>>>> because interaction has been with the wired side.  Would the absence
>>>> of a physical connection cause any issues?  It doesn't seem to bother
>>>> whether the network adapter is configured or not in the software
>>>> (using a static IP address as shown below).
>>>>
>>>>>> Q: permissions?
>>>>>> A: file has been adjusted during the boot process (before 'ifup -a'
>>>>>> is
>>>>>> called) to become: root:staff 664.  Additionally I have tried
>>>>>> changing
>>>>>> to my own user account with the 'staff' group and 777 - no
>>>>>> difference.
>>>>>>
>>>>> I had a quick look through the code and as ifup is failing it is not
>>>>> writing out the new interface to ifstate so you need to find out why
>>>>> ifup is not working.
>>>>>
>>>>> As a test you could move all scripts out of if-pre-up.d and see if
>>>>> your test script gets called this will confirm whether something in
>>>>> if-pre-up.d is the problem.  If so move them back in one at a time
>>>>> until it breaks again.  Otherwise I'm out of ideas I'm afraid.
>>>>
>>>> Again, there are no other scripts in any of those directories to fail
&g

Re: ifupdown scripts

2016-09-22 Thread David Henderson
Following up with this too.

Dave


On 9/20/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Does BB require certain permissions or ownership of the
> scripts/directories for this to get called?
>
> Dave
>
>
> On 9/20/16, David Henderson <dhender...@digital-pipe.com> wrote:
>> Hey Martin, thanks for your help!  I tried renaming the file as you
>> requested, but it is still not being called.  I did just submit a new
>> post regarding additional problems with ifup/down.  Perhaps something
>> in there can help with a resolution here - in short running an 'ifup
>> -v eth0' doesn't appear to ever get to looking inside the if-up.d
>> directory, only if-pre-up.d.
>>
>> Thanks,
>> Dave
>>
>>
>> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Hi David,
>>>
>>> Does it work if you drop the .conf?
>>> /etc/network/if-up.d/000_resolv
>>>
>>> -Martin
>>>
>>> On Mon, Sep 19, 2016 at 9:59 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> Good afternoon all!  I have been continuing to work with the
>>>> networking in BB and have added a single script
>>>> '/etc/network/if-up.d/000_resolv.conf' that does not seem to be called
>>>> when 'ifup -a' is called during the boot process.  The script has a
>>>> permission of 755 and ownership of root:root.  The contents are as
>>>> follows:
>>>>
>>>> #!/bin/sh
>>>> echo 'resolv.conf' > /tmp/debug.txt
>>>> env >> /tmp/debug.txt
>>>>
>>>>
>>>> Any thoughts on what is going on?
>>>>
>>>> Thanks,
>>>> Dave
>>>> ___
>>>> busybox mailing list
>>>> busybox@busybox.net
>>>> http://lists.busybox.net/mailman/listinfo/busybox
>>>
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-22 Thread David Henderson
Just following up with this...

Dave


On 9/20/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Thanks for your help with this too Denys.  Answers are inline...
>
>
> On 9/20/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>> On Tue, Sep 20, 2016 at 5:31 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> Hey Martin, thanks again for your help!  So I had to bring back
>>> 'sneaker-net' to get strace on the machine via flash drive (after
>>> locating one), but it is now on the machine!  I could not see anything
>>> in the 'ps' output (and it is the GNU version) regarding what was
>>> being called for contacting a DHCP server for the adapter.  I also
>>> tried running the command that Peter suggested, but the command he
>>> listed has invalid syntax.
>>
>> An examlpe run works for me:
>>
>> $ strace -f -e execve sh -c /bin/pwd
>> execve("/usr/bin/sh", ["sh", "-c", "/bin/pwd"], [/* 52 vars */]) = 0
>> execve("/bin/pwd", ["/bin/pwd"], [/* 52 vars */]) = 0
>> /tmp
>> +++ exited with 0 +++
>>
>> You might have an old version of strace.
>
> Possibly, it chokes with the 'execve' parameter as it's not valid in
> my 'strace'.
>
>
>>> After a few more calls and a ton of goop
>>> from 'strace'
>>
>> We need the entire "ton of goop" from strace.
>> For example, the "strace -oLOG -f -tt -s99 COMMAND" is my favorite.
>>
>>
>>>, it appears that 'udhcpc' was being called as follows
>>> (at least on my dev machine):
>>>
>>> udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
>>>
>>> (Just in case anyone else comes across this post)
>>>
>>> Now that I know what is being called, can anyone help with the other
>>> part of the original question?
>>
>> Ok, the question:
>>
>>> scripts that are run in the /etc/network/if-{,pre-,post-}{up,down}.d/
>>> directories.  Can/should I specify a script in the proper directory to
>>> execute the udhcpc binary (or another binary for that matter) with my
>>> own parameters for the interface without BB trying to use its own
>>> methods of obtaining an IP address automatically - effectively
>>> preventing the duplication of requests to the DHCP server for that
>>> interface?
>>
>> My personal opinion is that as soon as "simple" ifup/ifdown setup
>> is too primitive for your needs, e.g.:
>> - you need many IPs on one iface,
>> - you need dynamical ifaces (ppp, vpn), and you need to redefine
>>   routing/firewalling based on what's up and what isn't,
>> - you need additional things to be started/stopped
>>   (WPA supplicant, babysitter)
>>
>> at this point ifup becomes more PITA than help. It forces you
>> to do stuff in awkward ways.
>
> So can I perform my own methods via the scripts to prevent BB from
> attempting its own 'udhcpc' calls?  I don't want duplicate calls to
> the same DHCP server.
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifupdown problem

2016-09-22 Thread David Henderson
On 9/22/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> On Wed, Sep 21, 2016 at 2:57 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> On 9/20/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
>>> On Tue, Sep 20, 2016 at 8:33 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>>> General idea is described here:
>>>>> https://busybox.net/~vda/no_ifup.txt
>>>>
>>>> Looked at it, wouldn't this be the same thing as scripts in
>>>> /etc/network/if-*.d directories?
>>>
>>> It won't be the same, and the document explains why.
>>> You did not understand it.
>>> Example #1: the "ifup -a hangs at boot" case
>>> Example #2: "ifup eth0" + pppd in parallel simultaneously upping ppp0.
>>> What will be the default route in "ifup" world?
>>
>> So the only difference is to not pass the '-a' switch, but instead to
>> pass the direct name of the adapter?
>
> No, I'm saying something rather different.
> It is explained in the link.
>

I'm trying to understand what it is that you are saying.  You keep
referring me to the link, but if I don't understand it, I don't think
I'm going to without further explanation.  I'm currently working on
the networking side of a project and am interested in knowing what
you're talking about.

Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: additional ifupdown problems

2016-09-21 Thread David Henderson
On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi Dave,
>
> On Wed, Sep 21, 2016 at 3:41 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Hey Martin,
>>
>> On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Hi Dave,
>>>
>>> On Wed, Sep 21, 2016 at 2:06 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> Good morning everyone!  I'll add each question with the answer below:
>>>>
>>>> Q: maybe because something in if-pre-up.d fails?
>>>> A: there is only that one test script in if-up.d, no others so nothing
>>>> there to fail.  And judging by the output from 'ifup', it doesn't even
>>>> appear that the parsing of the if-up.d directory is happening, only
>>>> if-pre-up.d.
>>> You misread the question, maybe something in if-pre-up.d fails which
>>> means it doesn't even attempt if-up.d, I don't know the implementation
>>> that well so I don't know if this would happen.
>>
>> I think you misread the answer :)  There are no files in any of the
>> if-*.d directories except the if-up.d directory, and there is only
>> that one test script that was shown in another thread (which only uses
>> one 'echo' call and one 'env' call).  There is nothing in any of these
>> directories to fail.
>>
>>>> Q: maybe something is overwriting it (do you have inotfiy-watch)?
>>>> A: I do not have inotify-watch running.  Unless something in BB is
>>>> happening I have nothing else regarding networking running (e.g.
>>>> ifplugd, pppd, openvpn, etc).
>>> inotify-watch is a utility that you could run to determine if the file
>>> is being overwritten but maybe hard to use during boot anyway.
>>
>> Got it!  No I don't have that running.  However, as specified, unless
>> there is something in BB that also interacts with that file, there is
>> no other services running that would even care about the
>> /var/run/ifstate file.  Only 'ifup -a' is called during bootup that is
>> regarding networking.  The only other software that is installed that
>> interacts with networking is the wpa suite, but afaik, it doesn't
>> bother with that file.  Also, wpa currently isn't even being executed
>> because interaction has been with the wired side.  Would the absence
>> of a physical connection cause any issues?  It doesn't seem to bother
>> whether the network adapter is configured or not in the software
>> (using a static IP address as shown below).
>>
>>>> Q: permissions?
>>>> A: file has been adjusted during the boot process (before 'ifup -a' is
>>>> called) to become: root:staff 664.  Additionally I have tried changing
>>>> to my own user account with the 'staff' group and 777 - no difference.
>>>>
>>> I had a quick look through the code and as ifup is failing it is not
>>> writing out the new interface to ifstate so you need to find out why
>>> ifup is not working.
>>>
>>> As a test you could move all scripts out of if-pre-up.d and see if
>>> your test script gets called this will confirm whether something in
>>> if-pre-up.d is the problem.  If so move them back in one at a time
>>> until it breaks again.  Otherwise I'm out of ideas I'm afraid.
>>
>> Again, there are no other scripts in any of those directories to fail
>> and the one that is in there isn't even getting processed based on the
>> 'ifup' output - it's in 'if-up.d', not 'if-pre-up.d'.
>>
>>>> Q: Out of interest what is your /etc/network/interfaces file if it can
>>>> be shared?
>>>> A: Shown below:
>>>>
>>>> auto eth0
>>>> iface eth0 inet static
>>>> address 192.168.0.23
>>>> netmask 255.255.255.0
>>>> gateway 192.168.0.1
>>>> dns-nameservers 8.8.8.8 8.8.4.4
>>>> dns-search whatever.local
>>>>
>>> Looks pretty good to me.
>>>
>>>> Thanks,
>>>> Dave
>>>>
>>>>
>>>> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>> Hi Dave,
>>>>>
>>>>> On Tue, Sep 20, 2016 at 4:40 PM, David Henderson
>>>>> <dhender...@digital-pipe.com> wrote:
>>>>>> That's what my research has yielded as well, however, it doesn't
>>>>>> appear that /var/run/ifstate is getting written to.  I check the
>>>>>> ownership/permissions of the file:
>>>

Re: additional ifupdown problems

2016-09-21 Thread David Henderson
Hey Martin,

On 9/21/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi Dave,
>
> On Wed, Sep 21, 2016 at 2:06 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Good morning everyone!  I'll add each question with the answer below:
>>
>> Q: maybe because something in if-pre-up.d fails?
>> A: there is only that one test script in if-up.d, no others so nothing
>> there to fail.  And judging by the output from 'ifup', it doesn't even
>> appear that the parsing of the if-up.d directory is happening, only
>> if-pre-up.d.
> You misread the question, maybe something in if-pre-up.d fails which
> means it doesn't even attempt if-up.d, I don't know the implementation
> that well so I don't know if this would happen.

I think you misread the answer :)  There are no files in any of the
if-*.d directories except the if-up.d directory, and there is only
that one test script that was shown in another thread (which only uses
one 'echo' call and one 'env' call).  There is nothing in any of these
directories to fail.

>> Q: maybe something is overwriting it (do you have inotfiy-watch)?
>> A: I do not have inotify-watch running.  Unless something in BB is
>> happening I have nothing else regarding networking running (e.g.
>> ifplugd, pppd, openvpn, etc).
> inotify-watch is a utility that you could run to determine if the file
> is being overwritten but maybe hard to use during boot anyway.

Got it!  No I don't have that running.  However, as specified, unless
there is something in BB that also interacts with that file, there is
no other services running that would even care about the
/var/run/ifstate file.  Only 'ifup -a' is called during bootup that is
regarding networking.  The only other software that is installed that
interacts with networking is the wpa suite, but afaik, it doesn't
bother with that file.  Also, wpa currently isn't even being executed
because interaction has been with the wired side.  Would the absence
of a physical connection cause any issues?  It doesn't seem to bother
whether the network adapter is configured or not in the software
(using a static IP address as shown below).

>> Q: permissions?
>> A: file has been adjusted during the boot process (before 'ifup -a' is
>> called) to become: root:staff 664.  Additionally I have tried changing
>> to my own user account with the 'staff' group and 777 - no difference.
>>
> I had a quick look through the code and as ifup is failing it is not
> writing out the new interface to ifstate so you need to find out why
> ifup is not working.
>
> As a test you could move all scripts out of if-pre-up.d and see if
> your test script gets called this will confirm whether something in
> if-pre-up.d is the problem.  If so move them back in one at a time
> until it breaks again.  Otherwise I'm out of ideas I'm afraid.

Again, there are no other scripts in any of those directories to fail
and the one that is in there isn't even getting processed based on the
'ifup' output - it's in 'if-up.d', not 'if-pre-up.d'.

>> Q: Out of interest what is your /etc/network/interfaces file if it can
>> be shared?
>> A: Shown below:
>>
>> auto eth0
>> iface eth0 inet static
>> address 192.168.0.23
>> netmask 255.255.255.0
>> gateway 192.168.0.1
>> dns-nameservers 8.8.8.8 8.8.4.4
>> dns-search whatever.local
>>
> Looks pretty good to me.
>
>> Thanks,
>> Dave
>>
>>
>> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Hi Dave,
>>>
>>> On Tue, Sep 20, 2016 at 4:40 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> That's what my research has yielded as well, however, it doesn't
>>>> appear that /var/run/ifstate is getting written to.  I check the
>>>> ownership/permissions of the file:
>>>>
>>>> root:root 644
>>>>
>>>> I since changed it to mimic yours and attempted an 'ifup' again - no
>>>> luck, same message.  I then tried adding the 'eth0=eth0' to the file
>>>> and calling 'ifdown eth0' which worked like a charm.  So it appears
>>>> that the problem lies with 'ifup'?  Also, the 'ifstate' file is
>>>> dynamically being created during the boot cycle (most likely by the
>>>> 'ifup -a' call during boot), so I'm assuming the file ownership and
>>>> permissions are getting set there.
>>>>
>>>> Thanks,
>>>> Dave
>>>>
>>>>
>>>> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>>>> Hi David,
>>>>>
>>>>> On Tue, Sep 20, 2016 at 4:03 PM, David Henderson

Re: additional ifupdown problems

2016-09-21 Thread David Henderson
Good morning everyone!  I'll add each question with the answer below:

Q: maybe because something in if-pre-up.d fails?
A: there is only that one test script in if-up.d, no others so nothing
there to fail.  And judging by the output from 'ifup', it doesn't even
appear that the parsing of the if-up.d directory is happening, only
if-pre-up.d.

Q: maybe something is overwriting it (do you have inotfiy-watch)?
A: I do not have inotify-watch running.  Unless something in BB is
happening I have nothing else regarding networking running (e.g.
ifplugd, pppd, openvpn, etc).

Q: permissions?
A: file has been adjusted during the boot process (before 'ifup -a' is
called) to become: root:staff 664.  Additionally I have tried changing
to my own user account with the 'staff' group and 777 - no difference.

Q: Out of interest what is your /etc/network/interfaces file if it can
be shared?
A: Shown below:

auto eth0
iface eth0 inet static
address 192.168.0.23
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8 8.8.4.4
dns-search whatever.local

Thanks,
Dave


On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi Dave,
>
> On Tue, Sep 20, 2016 at 4:40 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> That's what my research has yielded as well, however, it doesn't
>> appear that /var/run/ifstate is getting written to.  I check the
>> ownership/permissions of the file:
>>
>> root:root 644
>>
>> I since changed it to mimic yours and attempted an 'ifup' again - no
>> luck, same message.  I then tried adding the 'eth0=eth0' to the file
>> and calling 'ifdown eth0' which worked like a charm.  So it appears
>> that the problem lies with 'ifup'?  Also, the 'ifstate' file is
>> dynamically being created during the boot cycle (most likely by the
>> 'ifup -a' call during boot), so I'm assuming the file ownership and
>> permissions are getting set there.
>>
>> Thanks,
>> Dave
>>
>>
>> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Hi David,
>>>
>>> On Tue, Sep 20, 2016 at 4:03 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> Good morning everyone!  During the boot of the OS, an 'ifup -a' is
>>>> called to bring all the configured adapters online via the
>>>> /etc/network/interfaces file.  Once the device is up and running, I
>>>> can see the proper configurations via an 'ifconfig' call.  However,
>>>> when I issue an 'ifdown eth0' call, I get the following error:
>>>>
>>>> ifdown: interface eth0 not configured
>>>>
>>>> Checking with the 'ifconfig' confirms that no action was taken and
>>>> that the adapter is still up and running.  Running an 'ifdown -f eth0'
>>>> achieves the desired goals, but why do I need to force this?  Checking
>>>> the /var/run/ifstate file shows that it is 0 bytes at all times (e.g.
>>>> right after a reboot, after tinkering with ifup/down, etc).  Also,
>>>> once the configuration is removed and an 'ifup -v eth0' is called,
>>>> here's what I get:
>>>>
>>>> run-parts /etc/network/if-pre-up.d
>>>> ip addr add 192.168.0.25/22 dev eth0 label eth0
>>>> ip link setup eth0 up
>>>> ip route add default via 192.168.0.1 dev eth0
>>>> ip: RTNETLINK answers: File exists
>>>>
>>>> I've tried calling a "ip addr flush dev eth0" to see if that would
>>>> resolve the problem, but didn't work.  Also keep in mind that I can
>>>> not run an 'strace' since the machine I'm working on (or more
>>>> precisely developing on) does NOT have a current Internet connection.
>>>>
>>>> As a side note to one of my other posts, it doesn't appear that any
>>>> other if-*.d directories are getting processed (which would explain
>>>> why my test script isn't being called).  Is this due to the error
>>>> preventing further processing, or are the other directories getting
>>>> skipped for some other reason?
>>>>
>>>> Thanks,
>>>> Dave
>>>> ___
>>>> busybox mailing list
>>>> busybox@busybox.net
>>>> http://lists.busybox.net/mailman/listinfo/busybox
>>>
>>>
>>> I'm sure that /var/run/ifstate must contain the name of the currently
>>> configured network interfaces otherwise ifdown will not work so I
>>> would start there.   On my system /var/run is in tmpfs and is a link
>>> to /run as should have 777 permissions.
>>>  df

Re: ifupdown problem

2016-09-21 Thread David Henderson
On 9/20/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> On Tue, Sep 20, 2016 at 8:33 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>>> General idea is described here:
>>> https://busybox.net/~vda/no_ifup.txt
>>
>> Looked at it, wouldn't this be the same thing as scripts in
>> /etc/network/if-*.d directories?
>
> It won't be the same, and the document explains why.
> You did not understand it.
> Example #1: the "ifup -a hangs at boot" case
> Example #2: "ifup eth0" + pppd in parallel simultaneously upping ppp0.
> What will be the default route in "ifup" world?

So the only difference is to not pass the '-a' switch, but instead to
pass the direct name of the adapter?  You're telling me that by doing
the latter over the former will make things faster, safer?  Also, I'm
not a fan really of monolithic approaches.  Modular typically yields
better results.

Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: additional ifupdown problems

2016-09-20 Thread David Henderson
Additionally, I have tried to remove the /var/run/ifstate file before
running 'ifup' - same failed result.  What exact file is the following
line referring to?

ip: RTNETLINK answers: File exists

Thanks,
Dave


On 9/20/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Aside from ownership/permissions, can anyone think of why 'ifup' does
> not write to this file?  Regression on BB code perhaps?  Can any
> confirm theirs actuallys writes to this file?
>
> Thanks,
> Dave
>
>
> On 9/20/16, David Henderson <dhender...@digital-pipe.com> wrote:
>> That's what my research has yielded as well, however, it doesn't
>> appear that /var/run/ifstate is getting written to.  I check the
>> ownership/permissions of the file:
>>
>> root:root 644
>>
>> I since changed it to mimic yours and attempted an 'ifup' again - no
>> luck, same message.  I then tried adding the 'eth0=eth0' to the file
>> and calling 'ifdown eth0' which worked like a charm.  So it appears
>> that the problem lies with 'ifup'?  Also, the 'ifstate' file is
>> dynamically being created during the boot cycle (most likely by the
>> 'ifup -a' call during boot), so I'm assuming the file ownership and
>> permissions are getting set there.
>>
>> Thanks,
>> Dave
>>
>>
>> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Hi David,
>>>
>>> On Tue, Sep 20, 2016 at 4:03 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> Good morning everyone!  During the boot of the OS, an 'ifup -a' is
>>>> called to bring all the configured adapters online via the
>>>> /etc/network/interfaces file.  Once the device is up and running, I
>>>> can see the proper configurations via an 'ifconfig' call.  However,
>>>> when I issue an 'ifdown eth0' call, I get the following error:
>>>>
>>>> ifdown: interface eth0 not configured
>>>>
>>>> Checking with the 'ifconfig' confirms that no action was taken and
>>>> that the adapter is still up and running.  Running an 'ifdown -f eth0'
>>>> achieves the desired goals, but why do I need to force this?  Checking
>>>> the /var/run/ifstate file shows that it is 0 bytes at all times (e.g.
>>>> right after a reboot, after tinkering with ifup/down, etc).  Also,
>>>> once the configuration is removed and an 'ifup -v eth0' is called,
>>>> here's what I get:
>>>>
>>>> run-parts /etc/network/if-pre-up.d
>>>> ip addr add 192.168.0.25/22 dev eth0 label eth0
>>>> ip link setup eth0 up
>>>> ip route add default via 192.168.0.1 dev eth0
>>>> ip: RTNETLINK answers: File exists
>>>>
>>>> I've tried calling a "ip addr flush dev eth0" to see if that would
>>>> resolve the problem, but didn't work.  Also keep in mind that I can
>>>> not run an 'strace' since the machine I'm working on (or more
>>>> precisely developing on) does NOT have a current Internet connection.
>>>>
>>>> As a side note to one of my other posts, it doesn't appear that any
>>>> other if-*.d directories are getting processed (which would explain
>>>> why my test script isn't being called).  Is this due to the error
>>>> preventing further processing, or are the other directories getting
>>>> skipped for some other reason?
>>>>
>>>> Thanks,
>>>> Dave
>>>> ___
>>>> busybox mailing list
>>>> busybox@busybox.net
>>>> http://lists.busybox.net/mailman/listinfo/busybox
>>>
>>>
>>> I'm sure that /var/run/ifstate must contain the name of the currently
>>> configured network interfaces otherwise ifdown will not work so I
>>> would start there.   On my system /var/run is in tmpfs and is a link
>>> to /run as should have 777 permissions.
>>>  df -h /var/run
>>> Filesystem  Size  Used Avail Use% Mounted on
>>> tmpfs   503M  8.5M  495M   2% /run
>>> ls -al /var/run
>>> lrwxrwxrwx 1 root root 6 Sep 19 17:28 /var/run -> ../run
>>>
>>> Is there anything in dmesg about ifstate?  can you write to ifstate
>>>
>>> echo "eth0=eth0" > /var/run/ifstate
>>> if so does ifdown now work?
>>>
>>> -Martin
>>>
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: additional ifupdown problems

2016-09-20 Thread David Henderson
Aside from ownership/permissions, can anyone think of why 'ifup' does
not write to this file?  Regression on BB code perhaps?  Can any
confirm theirs actuallys writes to this file?

Thanks,
Dave


On 9/20/16, David Henderson <dhender...@digital-pipe.com> wrote:
> That's what my research has yielded as well, however, it doesn't
> appear that /var/run/ifstate is getting written to.  I check the
> ownership/permissions of the file:
>
> root:root 644
>
> I since changed it to mimic yours and attempted an 'ifup' again - no
> luck, same message.  I then tried adding the 'eth0=eth0' to the file
> and calling 'ifdown eth0' which worked like a charm.  So it appears
> that the problem lies with 'ifup'?  Also, the 'ifstate' file is
> dynamically being created during the boot cycle (most likely by the
> 'ifup -a' call during boot), so I'm assuming the file ownership and
> permissions are getting set there.
>
> Thanks,
> Dave
>
>
> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>> Hi David,
>>
>> On Tue, Sep 20, 2016 at 4:03 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> Good morning everyone!  During the boot of the OS, an 'ifup -a' is
>>> called to bring all the configured adapters online via the
>>> /etc/network/interfaces file.  Once the device is up and running, I
>>> can see the proper configurations via an 'ifconfig' call.  However,
>>> when I issue an 'ifdown eth0' call, I get the following error:
>>>
>>> ifdown: interface eth0 not configured
>>>
>>> Checking with the 'ifconfig' confirms that no action was taken and
>>> that the adapter is still up and running.  Running an 'ifdown -f eth0'
>>> achieves the desired goals, but why do I need to force this?  Checking
>>> the /var/run/ifstate file shows that it is 0 bytes at all times (e.g.
>>> right after a reboot, after tinkering with ifup/down, etc).  Also,
>>> once the configuration is removed and an 'ifup -v eth0' is called,
>>> here's what I get:
>>>
>>> run-parts /etc/network/if-pre-up.d
>>> ip addr add 192.168.0.25/22 dev eth0 label eth0
>>> ip link setup eth0 up
>>> ip route add default via 192.168.0.1 dev eth0
>>> ip: RTNETLINK answers: File exists
>>>
>>> I've tried calling a "ip addr flush dev eth0" to see if that would
>>> resolve the problem, but didn't work.  Also keep in mind that I can
>>> not run an 'strace' since the machine I'm working on (or more
>>> precisely developing on) does NOT have a current Internet connection.
>>>
>>> As a side note to one of my other posts, it doesn't appear that any
>>> other if-*.d directories are getting processed (which would explain
>>> why my test script isn't being called).  Is this due to the error
>>> preventing further processing, or are the other directories getting
>>> skipped for some other reason?
>>>
>>> Thanks,
>>> Dave
>>> ___
>>> busybox mailing list
>>> busybox@busybox.net
>>> http://lists.busybox.net/mailman/listinfo/busybox
>>
>>
>> I'm sure that /var/run/ifstate must contain the name of the currently
>> configured network interfaces otherwise ifdown will not work so I
>> would start there.   On my system /var/run is in tmpfs and is a link
>> to /run as should have 777 permissions.
>>  df -h /var/run
>> Filesystem  Size  Used Avail Use% Mounted on
>> tmpfs   503M  8.5M  495M   2% /run
>> ls -al /var/run
>> lrwxrwxrwx 1 root root 6 Sep 19 17:28 /var/run -> ../run
>>
>> Is there anything in dmesg about ifstate?  can you write to ifstate
>>
>> echo "eth0=eth0" > /var/run/ifstate
>> if so does ifdown now work?
>>
>> -Martin
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifupdown scripts

2016-09-20 Thread David Henderson
Does BB require certain permissions or ownership of the
scripts/directories for this to get called?

Dave


On 9/20/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Hey Martin, thanks for your help!  I tried renaming the file as you
> requested, but it is still not being called.  I did just submit a new
> post regarding additional problems with ifup/down.  Perhaps something
> in there can help with a resolution here - in short running an 'ifup
> -v eth0' doesn't appear to ever get to looking inside the if-up.d
> directory, only if-pre-up.d.
>
> Thanks,
> Dave
>
>
> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>> Hi David,
>>
>> Does it work if you drop the .conf?
>> /etc/network/if-up.d/000_resolv
>>
>> -Martin
>>
>> On Mon, Sep 19, 2016 at 9:59 PM, David Henderson
>> <dhender...@digital-pipe.com> wrote:
>>> Good afternoon all!  I have been continuing to work with the
>>> networking in BB and have added a single script
>>> '/etc/network/if-up.d/000_resolv.conf' that does not seem to be called
>>> when 'ifup -a' is called during the boot process.  The script has a
>>> permission of 755 and ownership of root:root.  The contents are as
>>> follows:
>>>
>>> #!/bin/sh
>>> echo 'resolv.conf' > /tmp/debug.txt
>>> env >> /tmp/debug.txt
>>>
>>>
>>> Any thoughts on what is going on?
>>>
>>> Thanks,
>>> Dave
>>> ___
>>> busybox mailing list
>>> busybox@busybox.net
>>> http://lists.busybox.net/mailman/listinfo/busybox
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifupdown problem

2016-09-20 Thread David Henderson
On 9/20/16, Denys Vlasenko  wrote:
> On Tue, Sep 20, 2016 at 5:44 PM, Martin Townsend
>  wrote:
 +++ busybox-1.24.1/networking/ifupdown.c 2016-09-06 13:39:59.288380571
 +0100
 @@ -501,7 +501,7 @@
  {
   int result;
  # if ENABLE_FEATURE_IFUPDOWN_IP
 - result = execute("ip addr flush dev %iface%", ifd, exec);
 + result = execute("ip addr flush dev %iface% [[ label %label%]]", ifd,
 exec);
   result += execute("ip link set %iface% down", ifd, exec);
  # else
   /* result = execute("[[route del default gw %gateway% %iface%]]",
 ifd, exec); */
>>>
>>> This looks correct, applied to git.
>>>
>>> However, the entire ifup/down thing is a bad idea.
>>> It's too inflexible. I suggest using something else.
>>
>> I'm using ifplugd which uses ifup/down it does seem to now work but
>> out of interest what are the alternatives? and I will take a look at
>> them as I have to support an Ethernet gadget interface soon so I have
>> the option of moving to something different.
>
> Everyone seems to be inventing their own ways of dealing with
> the problem of setting up complex networks.

I'm just trying to get BB working with an /etc/network/interfaces
file!  I can't get ifup to properly edit the /var/run/ifstate file.

> Fedora has it's (in)famous NetworkManager. I'm not too familiar with that.

I don't want to add additional software other than what is present in
BB to keep the size of the OS down.

> I dealt with it by hooking necessary daemons into the service manager
> I use, runsvdir.

Presently I don't use runsvdir, but have it planned at some point in the future.

> General idea is described here:
> https://busybox.net/~vda/no_ifup.txt

Looked at it, wouldn't this be the same thing as scripts in
/etc/network/if-*.d directories?  Plus using those directories with
small scripts is modular instead of one big script as mentioned in the
link that can quickly get out of hand.

> Implementation details: some examples of my runsvdir setup are
> in examples/var_service/* in busybox source tree. See README file there.
>
> Specific examples in subdirectories are:
> - DHCP configured interface
> - interface watched by ifplugd (plug/unplug detection, DHCP does not do
> that)
> - add/maintain a ZeroConf IP address
> - watchdog service which tests (pings router) and resets iface
> - "reconfigure me" one-shot "service" which handles the case when
>   IP is static (and more: it is used by other networking services;
>   also it configures iptables)
>
> They can all be present at once, or only a subset of them.
>
> I probably need to add a WPA supplicant service example. I used to use
> openvpn, ppp, and vpnc-managed connections similarly to dhcp
> (by creating a service for them).

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-20 Thread David Henderson
Thanks for your help with this too Denys.  Answers are inline...


On 9/20/16, Denys Vlasenko <vda.li...@googlemail.com> wrote:
> On Tue, Sep 20, 2016 at 5:31 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Hey Martin, thanks again for your help!  So I had to bring back
>> 'sneaker-net' to get strace on the machine via flash drive (after
>> locating one), but it is now on the machine!  I could not see anything
>> in the 'ps' output (and it is the GNU version) regarding what was
>> being called for contacting a DHCP server for the adapter.  I also
>> tried running the command that Peter suggested, but the command he
>> listed has invalid syntax.
>
> An examlpe run works for me:
>
> $ strace -f -e execve sh -c /bin/pwd
> execve("/usr/bin/sh", ["sh", "-c", "/bin/pwd"], [/* 52 vars */]) = 0
> execve("/bin/pwd", ["/bin/pwd"], [/* 52 vars */]) = 0
> /tmp
> +++ exited with 0 +++
>
> You might have an old version of strace.

Possibly, it chokes with the 'execve' parameter as it's not valid in
my 'strace'.


>> After a few more calls and a ton of goop
>> from 'strace'
>
> We need the entire "ton of goop" from strace.
> For example, the "strace -oLOG -f -tt -s99 COMMAND" is my favorite.
>
>
>>, it appears that 'udhcpc' was being called as follows
>> (at least on my dev machine):
>>
>> udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
>>
>> (Just in case anyone else comes across this post)
>>
>> Now that I know what is being called, can anyone help with the other
>> part of the original question?
>
> Ok, the question:
>
>> scripts that are run in the /etc/network/if-{,pre-,post-}{up,down}.d/
>> directories.  Can/should I specify a script in the proper directory to
>> execute the udhcpc binary (or another binary for that matter) with my
>> own parameters for the interface without BB trying to use its own
>> methods of obtaining an IP address automatically - effectively
>> preventing the duplication of requests to the DHCP server for that
>> interface?
>
> My personal opinion is that as soon as "simple" ifup/ifdown setup
> is too primitive for your needs, e.g.:
> - you need many IPs on one iface,
> - you need dynamical ifaces (ppp, vpn), and you need to redefine
>   routing/firewalling based on what's up and what isn't,
> - you need additional things to be started/stopped
>   (WPA supplicant, babysitter)
>
> at this point ifup becomes more PITA than help. It forces you
> to do stuff in awkward ways.

So can I perform my own methods via the scripts to prevent BB from
attempting its own 'udhcpc' calls?  I don't want duplicate calls to
the same DHCP server.

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-20 Thread David Henderson
Yes, I'm interested to know if those parameters can be set, or if I
can just use the scripts in the if-*.d directories instead of the
build-in call BB is making to the DHCP (to prevent duplicate calls to
that server - one from BB, one from my scripts).

Thanks,
Dave


On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi Dave,
>
> On Tue, Sep 20, 2016 at 4:31 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Hey Martin, thanks again for your help!  So I had to bring back
>> 'sneaker-net' to get strace on the machine via flash drive (after
>> locating one), but it is now on the machine!  I could not see anything
>> in the 'ps' output (and it is the GNU version) regarding what was
>> being called for contacting a DHCP server for the adapter.  I also
>> tried running the command that Peter suggested, but the command he
>> listed has invalid syntax.  After a few more calls and a ton of goop
>> from 'strace', it appears that 'udhcpc' was being called as follows
>> (at least on my dev machine):
>>
>> udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
>>
>> (Just in case anyone else comes across this post)
>>
>> Now that I know what is being called, can anyone help with the other
>> part of the original question?
>>
>> Thanks,
>> Dave
>>
>>
>> On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
>>> Hi David,
>>>
>>> I've had a quick look through the ifupdown code what DHCP binary gets
>>> called and with what parameters is specific to how you've configured
>>> busybox.
>>> If you have the full version of ps you may be able to see the full
>>> command line using ps aux.  Maybe the busybox version will show this
>>> information as well.
>>> Another way which would be hard to capture is
>>> cat /proc/pid/cmdline
>>> but the problem is obtaining pid and then performing the cat command.
>>> If you kick off the DHCP without a network cable plugged in, the
>>> process should hang around a whilst it's sending it's DISCOVER
>>> messages.
>>>
>>> If this fails I would try and get strace on the board.  Can't you run
>>> udhcpc/dhclient with the board connected to a network with a DHCP
>>> server? USB Memory Stick?
>>>
>>> -Martin.
>>>
>>>
>>> On Tue, Sep 20, 2016 at 2:54 PM, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>> Good morning all, I was just following up with this.
>>>>
>>>> Thanks,
>>>> Dave
>>>>
>>>>
>>>> On 9/19/16, David Henderson <dhender...@digital-pipe.com> wrote:
>>>>> Plus that would only answer part of the original question.  Any input
>>>>> on that second part?
>>>>>
>>>>> Thanks,
>>>>> Dave
>>>>>
>>>>>
>>>>> On 9/19/16, David Henderson <dhender...@digital-pipe.com> wrote:
>>>>>> Thanks again for your continued help Peter!  Unfortunately the
>>>>>> machine
>>>>>> that I'm working on doesn't currently have a network connection since
>>>>>> I've been fiddling with things so strace can't be installed.
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>>
>>>>>> On 9/19/16, Peter Korsgaard <pe...@korsgaard.com> wrote:
>>>>>>>>>>>> "David" == David Henderson <dhender...@digital-pipe.com>
>>>>>>>>>>>> writes:
>>>>>>>
>>>>>>>  > Good morning Peter, thanks for your reply.  C/C++ is not my forte
>>>>>>> and
>>>>>>>  > while it may be readable for you, it may not be for others.
>>>>>>>
>>>>>>> Then use strace as I suggested.
>>>>>>>
>>>>>>> --
>>>>>>> Bye, Peter Korsgaard
>>>>>>>
>>>>>>
>>>>>
>>>> ___
>>>> busybox mailing list
>>>> busybox@busybox.net
>>>> http://lists.busybox.net/mailman/listinfo/busybox
>>>
>
> If I'm reading the question right you want to use different command
> line options to udhcpc?
> in ifupdown.c there is the following line
> #define UDHCPC_CMD_OPTIONS CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS
>
> So I assume there is a busybox configuration paramter
> CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS which you can be set?
>
> - Martin.
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: additional ifupdown problems

2016-09-20 Thread David Henderson
That's what my research has yielded as well, however, it doesn't
appear that /var/run/ifstate is getting written to.  I check the
ownership/permissions of the file:

root:root 644

I since changed it to mimic yours and attempted an 'ifup' again - no
luck, same message.  I then tried adding the 'eth0=eth0' to the file
and calling 'ifdown eth0' which worked like a charm.  So it appears
that the problem lies with 'ifup'?  Also, the 'ifstate' file is
dynamically being created during the boot cycle (most likely by the
'ifup -a' call during boot), so I'm assuming the file ownership and
permissions are getting set there.

Thanks,
Dave


On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi David,
>
> On Tue, Sep 20, 2016 at 4:03 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Good morning everyone!  During the boot of the OS, an 'ifup -a' is
>> called to bring all the configured adapters online via the
>> /etc/network/interfaces file.  Once the device is up and running, I
>> can see the proper configurations via an 'ifconfig' call.  However,
>> when I issue an 'ifdown eth0' call, I get the following error:
>>
>> ifdown: interface eth0 not configured
>>
>> Checking with the 'ifconfig' confirms that no action was taken and
>> that the adapter is still up and running.  Running an 'ifdown -f eth0'
>> achieves the desired goals, but why do I need to force this?  Checking
>> the /var/run/ifstate file shows that it is 0 bytes at all times (e.g.
>> right after a reboot, after tinkering with ifup/down, etc).  Also,
>> once the configuration is removed and an 'ifup -v eth0' is called,
>> here's what I get:
>>
>> run-parts /etc/network/if-pre-up.d
>> ip addr add 192.168.0.25/22 dev eth0 label eth0
>> ip link setup eth0 up
>> ip route add default via 192.168.0.1 dev eth0
>> ip: RTNETLINK answers: File exists
>>
>> I've tried calling a "ip addr flush dev eth0" to see if that would
>> resolve the problem, but didn't work.  Also keep in mind that I can
>> not run an 'strace' since the machine I'm working on (or more
>> precisely developing on) does NOT have a current Internet connection.
>>
>> As a side note to one of my other posts, it doesn't appear that any
>> other if-*.d directories are getting processed (which would explain
>> why my test script isn't being called).  Is this due to the error
>> preventing further processing, or are the other directories getting
>> skipped for some other reason?
>>
>> Thanks,
>> Dave
>> ___
>> busybox mailing list
>> busybox@busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>
>
> I'm sure that /var/run/ifstate must contain the name of the currently
> configured network interfaces otherwise ifdown will not work so I
> would start there.   On my system /var/run is in tmpfs and is a link
> to /run as should have 777 permissions.
>  df -h /var/run
> Filesystem  Size  Used Avail Use% Mounted on
> tmpfs   503M  8.5M  495M   2% /run
> ls -al /var/run
> lrwxrwxrwx 1 root root 6 Sep 19 17:28 /var/run -> ../run
>
> Is there anything in dmesg about ifstate?  can you write to ifstate
>
> echo "eth0=eth0" > /var/run/ifstate
> if so does ifdown now work?
>
> -Martin
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-20 Thread David Henderson
Hey Martin, thanks again for your help!  So I had to bring back
'sneaker-net' to get strace on the machine via flash drive (after
locating one), but it is now on the machine!  I could not see anything
in the 'ps' output (and it is the GNU version) regarding what was
being called for contacting a DHCP server for the adapter.  I also
tried running the command that Peter suggested, but the command he
listed has invalid syntax.  After a few more calls and a ton of goop
from 'strace', it appears that 'udhcpc' was being called as follows
(at least on my dev machine):

udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0

(Just in case anyone else comes across this post)

Now that I know what is being called, can anyone help with the other
part of the original question?

Thanks,
Dave


On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi David,
>
> I've had a quick look through the ifupdown code what DHCP binary gets
> called and with what parameters is specific to how you've configured
> busybox.
> If you have the full version of ps you may be able to see the full
> command line using ps aux.  Maybe the busybox version will show this
> information as well.
> Another way which would be hard to capture is
> cat /proc/pid/cmdline
> but the problem is obtaining pid and then performing the cat command.
> If you kick off the DHCP without a network cable plugged in, the
> process should hang around a whilst it's sending it's DISCOVER
> messages.
>
> If this fails I would try and get strace on the board.  Can't you run
> udhcpc/dhclient with the board connected to a network with a DHCP
> server? USB Memory Stick?
>
> -Martin.
>
>
> On Tue, Sep 20, 2016 at 2:54 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Good morning all, I was just following up with this.
>>
>> Thanks,
>> Dave
>>
>>
>> On 9/19/16, David Henderson <dhender...@digital-pipe.com> wrote:
>>> Plus that would only answer part of the original question.  Any input
>>> on that second part?
>>>
>>> Thanks,
>>> Dave
>>>
>>>
>>> On 9/19/16, David Henderson <dhender...@digital-pipe.com> wrote:
>>>> Thanks again for your continued help Peter!  Unfortunately the machine
>>>> that I'm working on doesn't currently have a network connection since
>>>> I've been fiddling with things so strace can't be installed.
>>>>
>>>> Dave
>>>>
>>>>
>>>> On 9/19/16, Peter Korsgaard <pe...@korsgaard.com> wrote:
>>>>>>>>>> "David" == David Henderson <dhender...@digital-pipe.com> writes:
>>>>>
>>>>>  > Good morning Peter, thanks for your reply.  C/C++ is not my forte
>>>>> and
>>>>>  > while it may be readable for you, it may not be for others.
>>>>>
>>>>> Then use strace as I suggested.
>>>>>
>>>>> --
>>>>> Bye, Peter Korsgaard
>>>>>
>>>>
>>>
>> ___
>> busybox mailing list
>> busybox@busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifupdown scripts

2016-09-20 Thread David Henderson
Hey Martin, thanks for your help!  I tried renaming the file as you
requested, but it is still not being called.  I did just submit a new
post regarding additional problems with ifup/down.  Perhaps something
in there can help with a resolution here - in short running an 'ifup
-v eth0' doesn't appear to ever get to looking inside the if-up.d
directory, only if-pre-up.d.

Thanks,
Dave


On 9/20/16, Martin Townsend <mtownsend1...@gmail.com> wrote:
> Hi David,
>
> Does it work if you drop the .conf?
> /etc/network/if-up.d/000_resolv
>
> -Martin
>
> On Mon, Sep 19, 2016 at 9:59 PM, David Henderson
> <dhender...@digital-pipe.com> wrote:
>> Good afternoon all!  I have been continuing to work with the
>> networking in BB and have added a single script
>> '/etc/network/if-up.d/000_resolv.conf' that does not seem to be called
>> when 'ifup -a' is called during the boot process.  The script has a
>> permission of 755 and ownership of root:root.  The contents are as
>> follows:
>>
>> #!/bin/sh
>> echo 'resolv.conf' > /tmp/debug.txt
>> env >> /tmp/debug.txt
>>
>>
>> Any thoughts on what is going on?
>>
>> Thanks,
>> Dave
>> ___
>> busybox mailing list
>> busybox@busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifupdown scripts

2016-09-20 Thread David Henderson
And with this.

Thanks,
Dave


On 9/19/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Good afternoon all!  I have been continuing to work with the
> networking in BB and have added a single script
> '/etc/network/if-up.d/000_resolv.conf' that does not seem to be called
> when 'ifup -a' is called during the boot process.  The script has a
> permission of 755 and ownership of root:root.  The contents are as
> follows:
>
> #!/bin/sh
> echo 'resolv.conf' > /tmp/debug.txt
> env >> /tmp/debug.txt
>
>
> Any thoughts on what is going on?
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-20 Thread David Henderson
Good morning all, I was just following up with this.

Thanks,
Dave


On 9/19/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Plus that would only answer part of the original question.  Any input
> on that second part?
>
> Thanks,
> Dave
>
>
> On 9/19/16, David Henderson <dhender...@digital-pipe.com> wrote:
>> Thanks again for your continued help Peter!  Unfortunately the machine
>> that I'm working on doesn't currently have a network connection since
>> I've been fiddling with things so strace can't be installed.
>>
>> Dave
>>
>>
>> On 9/19/16, Peter Korsgaard <pe...@korsgaard.com> wrote:
>>>>>>>> "David" == David Henderson <dhender...@digital-pipe.com> writes:
>>>
>>>  > Good morning Peter, thanks for your reply.  C/C++ is not my forte and
>>>  > while it may be readable for you, it may not be for others.
>>>
>>> Then use strace as I suggested.
>>>
>>> --
>>> Bye, Peter Korsgaard
>>>
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


ifupdown scripts

2016-09-19 Thread David Henderson
Good afternoon all!  I have been continuing to work with the
networking in BB and have added a single script
'/etc/network/if-up.d/000_resolv.conf' that does not seem to be called
when 'ifup -a' is called during the boot process.  The script has a
permission of 755 and ownership of root:root.  The contents are as
follows:

#!/bin/sh
echo 'resolv.conf' > /tmp/debug.txt
env >> /tmp/debug.txt


Any thoughts on what is going on?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-19 Thread David Henderson
Plus that would only answer part of the original question.  Any input
on that second part?

Thanks,
Dave


On 9/19/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Thanks again for your continued help Peter!  Unfortunately the machine
> that I'm working on doesn't currently have a network connection since
> I've been fiddling with things so strace can't be installed.
>
> Dave
>
>
> On 9/19/16, Peter Korsgaard <pe...@korsgaard.com> wrote:
>>>>>>> "David" == David Henderson <dhender...@digital-pipe.com> writes:
>>
>>  > Good morning Peter, thanks for your reply.  C/C++ is not my forte and
>>  > while it may be readable for you, it may not be for others.
>>
>> Then use strace as I suggested.
>>
>> --
>> Bye, Peter Korsgaard
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-19 Thread David Henderson
Thanks again for your continued help Peter!  Unfortunately the machine
that I'm working on doesn't currently have a network connection since
I've been fiddling with things so strace can't be installed.

Dave


On 9/19/16, Peter Korsgaard <pe...@korsgaard.com> wrote:
>>>>>> "David" == David Henderson <dhender...@digital-pipe.com> writes:
>
>  > Good morning Peter, thanks for your reply.  C/C++ is not my forte and
>  > while it may be readable for you, it may not be for others.
>
> Then use strace as I suggested.
>
> --
> Bye, Peter Korsgaard
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-19 Thread David Henderson
Good morning Peter, thanks for your reply.  C/C++ is not my forte and
while it may be readable for you, it may not be for others.

Dave


On 9/19/16, Peter Korsgaard <jac...@sunsite.dk> wrote:
>>>>>> "David" == David Henderson <dhender...@digital-pipe.com> writes:
>
>  > Good morning all, just following up with this!
>
> Please just have a look at networking/ifupdown.c, it is IMHO quite
> readable.
>
> Alternative, run strace -f -e execve ifup  to see the exact
> commands executed.
>
> --
> Bye, Peter Korsgaard
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: dhcp with /etc/network/interfaces

2016-09-19 Thread David Henderson
Good morning all, just following up with this!

Thanks,
Dave


On 9/16/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Good afternoon all!  I was interested in knowing if I specify an
> interface to use dhcp in the /etc/network/interfaces file, what binary
> and parameters are used by busybox to achieve this:
>
> auto eth0
> iface eth0 inet dhcp
>
> Talking with Isaac in the previous thread, he made mention of the
> scripts that are run in the /etc/network/if-{,pre-,post-}{up,down}.d/
> directories.  Can/should I specify a script in the proper directory to
> execute the udhcpc binary (or another binary for that matter) with my
> own parameters for the interface without BB trying to use its own
> methods of obtaining an IP address automatically - effectively
> preventing the duplication of requests to the DHCP server for that
> interface?
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: ifup dependency

2016-09-16 Thread David Henderson
Hey Peter, thanks for the reply.  I was more or less referring to
should the 'menuconfig' portion of BB automatically add that in as a
dependency if ifup/down has been selected, and not should I add this
applet into my BB compile.  I was just letting the community know
about the "problem".

Dave


On 9/16/16, Peter Korsgaard <jac...@sunsite.dk> wrote:
>>>>>> "David" == David Henderson <dhender...@digital-pipe.com> writes:
>
>  > Good afternoon all, I had re-compiled my busybox to add in the some
>  > commands including the ifup/down.  When I attempted to run that
>  > applet, it said that 'run-parts' was not installed.  Should this
>  > applet the automatically added to the config when the ifup/down
>  > commands were added?
>
> As the errors executing run-parts aren't ignored, I would say yes.
>
> --
> Bye, Peter Korsgaard
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


dhcp with /etc/network/interfaces

2016-09-16 Thread David Henderson
Good afternoon all!  I was interested in knowing if I specify an
interface to use dhcp in the /etc/network/interfaces file, what binary
and parameters are used by busybox to achieve this:

auto eth0
iface eth0 inet dhcp

Talking with Isaac in the previous thread, he made mention of the
scripts that are run in the /etc/network/if-{,pre-,post-}{up,down}.d/
directories.  Can/should I specify a script in the proper directory to
execute the udhcpc binary (or another binary for that matter) with my
own parameters for the interface without BB trying to use its own
methods of obtaining an IP address automatically - effectively
preventing the duplication of requests to the DHCP server for that
interface?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


ifup dependency

2016-09-16 Thread David Henderson
Good afternoon all, I had re-compiled my busybox to add in the some
commands including the ifup/down.  When I attempted to run that
applet, it said that 'run-parts' was not installed.  Should this
applet the automatically added to the config when the ifup/down
commands were added?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Fwd: arrays

2016-08-04 Thread David Henderson
-- Forwarded message --
From: David Henderson <dhender...@digital-pipe.com>
Date: Thu, 4 Aug 2016 14:41:25 -0400
Subject: Re: arrays
To: Jody Lee Bruchon <j...@jodybruchon.com>

Thanks for the response Jody!  I understand that BB is POSIX
compliant, but didn't realize that arrays are not part of POSIX.  Is
there any chance or interest in adding slightly more than that
standard in BB?  The reason I ask is that, based on the response below
(and most likely any other responses too), the options are to bloat
(and create less readability) the shell scripts with insecure eval
statements and tons of loops to create and process individual
variables, or to bloat the OS by adding additional software (which
could also be a security risk due to the bugs in that additional
software).  Neither of those seems like a good choice.  Arrays are
commonly used today, perhaps not in the 70's :), but today they are.

Dave


On 8/4/16, Jody Lee Bruchon <j...@jodybruchon.com> wrote:
> ash (the BusyBox shell) is POSIX compliant but is not Bash compatible. To
> use arrays, you have to do some trickery with the eval command to simulate
> them with normal variables. It is not nearly as convenient as Bash arrays
> nor as easy to read, but it is workable. Essentially you maintain a counter
> yourself and when you need to refer to an array variable you do something
> like
>
> eval DRIVE$CNT=123
> eval echo DRIVE$CNT
>
> Which uses the value in CNT as part of the variable name being referenced.
>
> I haven't done this in a while so I may have something wrong, but that's the
> general idea. The alternative is of course to install Bash and not need to
> do this in the first place.
>
> On August 4, 2016 9:57:15 AM EDT, David Henderson
> <dhender...@digital-pipe.com> wrote:
>>So I'm trying to process the attached storage devices and their
>>partitions (which get stored in arrays since the data is referenced
>>multiple times).  Since I don't know what any one particular user will
>>have, I can't create individual variables for this and use arrays.
>>I'm still looking for help with this.
>>
>>Thanks,
>>Dave
>>
>>
>>On 8/2/16, David Henderson <dhender...@digital-pipe.com> wrote:
>>> Good morning all!  I have a script that uses arrays, but I can't seem
>>> to figure out what's going on with /bin/sh in handling them.  Is
>>there
>>> a specific way to initialize them or use them with busybox?
>>>
>>> Thanks,
>>> Dave
>>>
>>___
>>busybox mailing list
>>busybox@busybox.net
>>http://lists.busybox.net/mailman/listinfo/busybox
>
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: arrays

2016-08-04 Thread David Henderson
Thanks for the continued replies Jody :)

I would love to, but I'm not very effective at that low level of
programming.  More of a shell and web-based programmer...

Rob Landley, do you have any plans on implementing arrays in the toolbox shell?

Thanks,
Dave


On 8/4/16, Jody Lee Bruchon <j...@jodybruchon.com> wrote:
> I don't know if there is interest in adding arrays to BusyBox ash. I would
> imagine that if it was removable at compile time and was Bash-compatible
> that it would certainly be accepted as a patch for BusyBox. There are
> already plenty of Bashisms supported by ash as implemented in BusyBox, and
> arrays certainly are super useful. Someone would have to code it in though,
> and that's the hard part. ;-)
>
> On August 4, 2016 2:41:25 PM EDT, David Henderson
> <dhender...@digital-pipe.com> wrote:
>>Thanks for the response Jody!  I understand that BB is POSIX
>>compliant, but didn't realize that arrays are not part of POSIX.  Is
>>there any chance or interest in adding slightly more than that
>>standard in BB?  The reason I ask is that, based on the response below
>>(and most likely any other responses too), the options are to bloat
>>(and create less readability) the shell scripts with insecure eval
>>statements and tons of loops to create and process individual
>>variables, or to bloat the OS by adding additional software (which
>>could also be a security risk due to the bugs in that additional
>>software).  Neither of those seems like a good choice.  Arrays are
>>commonly used today, perhaps not in the 70's :), but today they are.
>>
>>Dave
>>
>>
>>On 8/4/16, Jody Lee Bruchon <j...@jodybruchon.com> wrote:
>>> ash (the BusyBox shell) is POSIX compliant but is not Bash
>>compatible. To
>>> use arrays, you have to do some trickery with the eval command to
>>simulate
>>> them with normal variables. It is not nearly as convenient as Bash
>>arrays
>>> nor as easy to read, but it is workable. Essentially you maintain a
>>counter
>>> yourself and when you need to refer to an array variable you do
>>something
>>> like
>>>
>>> eval DRIVE$CNT=123
>>> eval echo DRIVE$CNT
>>>
>>> Which uses the value in CNT as part of the variable name being
>>referenced.
>>>
>>> I haven't done this in a while so I may have something wrong, but
>>that's the
>>> general idea. The alternative is of course to install Bash and not
>>need to
>>> do this in the first place.
>>>
>>> On August 4, 2016 9:57:15 AM EDT, David Henderson
>>> <dhender...@digital-pipe.com> wrote:
>>>>So I'm trying to process the attached storage devices and their
>>>>partitions (which get stored in arrays since the data is referenced
>>>>multiple times).  Since I don't know what any one particular user
>>will
>>>>have, I can't create individual variables for this and use arrays.
>>>>I'm still looking for help with this.
>>>>
>>>>Thanks,
>>>>Dave
>>>>
>>>>
>>>>On 8/2/16, David Henderson <dhender...@digital-pipe.com> wrote:
>>>>> Good morning all!  I have a script that uses arrays, but I can't
>>seem
>>>>> to figure out what's going on with /bin/sh in handling them.  Is
>>>>there
>>>>> a specific way to initialize them or use them with busybox?
>>>>>
>>>>> Thanks,
>>>>> Dave
>>>>>
>>>>___
>>>>busybox mailing list
>>>>busybox@busybox.net
>>>>http://lists.busybox.net/mailman/listinfo/busybox
>>>
>>> --
>>> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>>>
>
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: arrays

2016-08-04 Thread David Henderson
So I'm trying to process the attached storage devices and their
partitions (which get stored in arrays since the data is referenced
multiple times).  Since I don't know what any one particular user will
have, I can't create individual variables for this and use arrays.
I'm still looking for help with this.

Thanks,
Dave


On 8/2/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Good morning all!  I have a script that uses arrays, but I can't seem
> to figure out what's going on with /bin/sh in handling them.  Is there
> a specific way to initialize them or use them with busybox?
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


arrays

2016-08-02 Thread David Henderson
Good morning all!  I have a script that uses arrays, but I can't seem
to figure out what's going on with /bin/sh in handling them.  Is there
a specific way to initialize them or use them with busybox?

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: make menuconfig deps

2016-07-22 Thread David Henderson
lol it does seem to work just fine though.  I made a wrapper script so
I didn't have to remember it. :)

Dave


On 7/22/16, ..mg..  wrote:
>
> On Thu, Jul 21, 2016 at 09:40:21PM +0200, Laurent Bercot wrote:
>>
>>  make menuconfig \
>> HOST_EXTRACFLAGS='-I/opt/ncurses/include -DKBUILD_NO_NLS
>> -DCURSES_LOC=""' \
>> HOST_LOADLIBES='-L/opt/ncurses/lib -static -lncurses'
>>
>>  Yes, that's HOST_LOADLIBES with an 'E'.
>
>
> Ah!  That's obnoxiously obscure, but probably better than my trick of
> putting loader flags in CC.
>
> -mg
>
>>
>> --
>>  Laurent
>>
>> ___
>> busybox mailing list
>> busybox@busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: make menuconfig deps

2016-07-22 Thread David Henderson
Hey Stephen!  The version of gcc I'm using is actually 5.2.0 and I
don't think the OS is configured incorrectly, that's just how TC was
designed to run.  Instead of installing packages in a traditional
means like Debian, TC uses squashfs files and symlinks its contents to
the /usr/local/ area of the system.  I haven't had any issues with
compiling other software, just the BB source.  Thanks for the info
though!

Dave


On 7/22/16, Stephen Beckwith  wrote:
> I ran into a similar issue with menuconfig not finding ncurses library as
> well.  After talking with IT folks, we used HOSTCC='gcc -Wl, -llibtinfo' to
> get it to work - initially - the menu was "horrible". . . .
> After some debugging of other problems, I discovered that there were 2
> different compilers available on our systems:
> path1:  GCC 4.2.1 - which had the problems
> path2:  GCC 4.4.7 - which solved this and other problems.
> So it might be that the linux distro being used is not quite setup
> correctly  Or it's a very old compiler?
> My situation is that the IT folks have tried to turn a Linux distro
> (RHEL6.4) into a BSD Variant-looking-messed-up-sort-of-thing. . . .
> NEVER had an issue running on FedoraCore22 in a VM on my MAC :)
>
> Regards,
> Stephen
>
> On Fri, Jul 22, 2016 at 12:48 PM, ..mg..  wrote:
>
>>
>> On Thu, Jul 21, 2016 at 09:40:21PM +0200, Laurent Bercot wrote:
>> >
>> >  make menuconfig \
>> > HOST_EXTRACFLAGS='-I/opt/ncurses/include -DKBUILD_NO_NLS
>> -DCURSES_LOC=""' \
>> > HOST_LOADLIBES='-L/opt/ncurses/lib -static -lncurses'
>> >
>> >  Yes, that's HOST_LOADLIBES with an 'E'.
>>
>>
>> Ah!  That's obnoxiously obscure, but probably better than my trick of
>> putting loader flags in CC.
>>
>> -mg
>>
>> >
>> > --
>> >  Laurent
>> >
>> > ___
>> > busybox mailing list
>> > busybox@busybox.net
>> > http://lists.busybox.net/mailman/listinfo/busybox
>> ___
>> busybox mailing list
>> busybox@busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: make menuconfig deps

2016-07-22 Thread David Henderson
Hmmm, I'll have to try that next time to see if it works for me.  I'm
using glibc at the moment since that is what TinyCoreLinux uses (and
our fork of that OS - XiniX), but long term I have plans to move to
musl (which is why I asked Rob Landley how his projects were coming).
That's just more work than I can do at the moment with all the other
odds and ends of forking.

Thanks,
Dave


On 7/22/16, ..mg.. <shoema...@riseup.net> wrote:
>
> On Fri, Jul 22, 2016 at 11:11:23AM -0400, David Henderson wrote:
>> Thanks for the tip MG, but unfortunately this did not work...
>>
>> Dave
>
> Sorry, I'm getting confused with my library-finding tricks.
> LD_LIBRARY_PATH is for runtime.  This trick works for me (tested)
> with ncurses in a non-standard location:
>
> $ make menuconfig HOSTCC="gcc -L/usr/local/lib -lncurses"
>
> But long-term, you might want to teach your compiler about libraries
> in /usr/local/lib.  I'm using musl, so I use /etc/ld-musl-i386.path,
> glibc is I think /etc/ld.so.conf.
>
> HTH,
>
> -mg
>
>
>
>>
>>
>> On 7/21/16, ..mg.. <shoema...@riseup.net> wrote:
>> > On Thu, Jul 21, 2016 at 11:41:10AM -0400, David Henderson wrote:
>> >
>> >> lrwxrwxrwx1 root root47 Jul 21 08:59
>> >> /usr/local/lib/libncurses.so ->
>> >> /tmp/tcloop/ncurses/usr/local/lib/libncurses.so
>> >
>> >
>> >>
>> >> I don't see a libcurses.so file, but you may have meant libncurses.so
>> >> which is present.  Let me know!
>> >>
>> >
>> > That should do.  I'm noticing that it's in /usr/local/lib, which
>> > might not be in your search path.  Does this work?
>> >
>> > $ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
>> > $ make menuconfig
>> >
>> > -mg
>> >
>> >> Thanks,
>> >> Dave
>> >>
>> >>
>> >> On 7/21/16, ..mg.. <shoema...@riseup.net> wrote:
>> >> > On Thu, Jul 21, 2016 at 09:07:09AM -0400, David Henderson wrote:
>> >> >> No problem, here's the entire output:
>> >> >
>> >> > [snip...]
>> >> >>   HOSTCC  scripts/kconfig/zconf.tab.o
>> >> >> In file included from scripts/kconfig/zconf.tab.c:152:0:
>> >> >> scripts/kconfig/zconf.hash.c:155:43: warning:
>> >> >> 'kconf_id_strings_contents' is static but used in inline function
>> >> >> 'kconf_id_lookup' which is not static
>> >> >>  #define kconf_id_strings ((const char *)
>> >> >> _id_strings_contents)
>> >> >>^
>> >> >> scripts/kconfig/zconf.hash.c:222:44: note: in expansion of macro
>> >> >> 'kconf_id_strings'
>> >> >>register const char *s = o + kconf_id_strings;
>> >> >> ^
>> >> >> scripts/kconfig/zconf.hash.c:215:26: warning: 'kconf_id_hash' is
>> >> >> static but used in inline function 'kconf_id_lookup' which is not
>> >> >> static
>> >> >>register int key = kconf_id_hash (str, len);
>> >> >>   ^
>> >> >> scripts/kconfig/zconf.hash.c:171:26: warning: 'wordlist' is static
>> >> >> but
>> >> >> declared in inline function 'kconf_id_lookup' which is not static
>> >> >>static struct kconf_id wordlist[] =
>> >> >
>> >> >
>> >> > These are just warnings, you should be able to ignore them.
>> >> >
>> >> >>   HOSTLD  scripts/kconfig/mconf
>> >> >>   HOSTCC  scripts/kconfig/lxdialog/checklist.o
>> >> >>   HOSTCC  scripts/kconfig/lxdialog/inputbox.o
>> >> >>   HOSTCC  scripts/kconfig/lxdialog/lxdialog.o
>> >> >>   HOSTCC  scripts/kconfig/lxdialog/menubox.o
>> >> >>   HOSTCC  scripts/kconfig/lxdialog/msgbox.o
>> >> >>   HOSTCC  scripts/kconfig/lxdialog/textbox.o
>> >> >>   HOSTCC  scripts/kconfig/lxdialog/util.o
>> >> >>   HOSTCC  scripts/kconfig/lxdialog/yesno.o
>> >> >>   HOSTLD  scripts/kconfig/lxdialog/lxdialog
>> >> >> scripts/kconfig/lxdialog/checklist.o: In function `print_arrows':
>> >> >> checklist.c:(.text+0x29): undefined reference to `wmove'
>> >> >
>> >> > [ snip many more 'undefined references

Re: make menuconfig deps

2016-07-22 Thread David Henderson
Thanks Laurent, after some tweaking to the values this ended up
working out just fine!  I appreciate everyone's help so that I could
get this going!

Thanks,
Dave


On 7/21/16, Laurent Bercot  wrote:
>
>   Kbuild, be it the kernel's or busybox, assumes that ncurses is available
> in /usr or /usr/local, and nowhere else. To override those assumptions if
> your ncurses package isn't installed in a "standard" location, you need
> a few workarounds, as in manual make variables.
>
>   My hand-built ncurses is installed in /opt/ncurses (.../include and
> .../lib).
> For it to be found, I invoke make menuconfig this way:
>
>   make menuconfig \
>  HOST_EXTRACFLAGS='-I/opt/ncurses/include -DKBUILD_NO_NLS
> -DCURSES_LOC=""' \
>  HOST_LOADLIBES='-L/opt/ncurses/lib -static -lncurses'
>
>   Yes, that's HOST_LOADLIBES with an 'E'.
>   Replace /opt/ncurses with the full path to your ncurses installation.
>   Feel free to remove -static if you're using glibc and/or don't mind
> configuring your dynamic linker so that it knows how to find your
> libncurses.so library.
>
> --
>   Laurent
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: make menuconfig deps

2016-07-22 Thread David Henderson
Thanks for the tip MG, but unfortunately this did not work...

Dave


On 7/21/16, ..mg.. <shoema...@riseup.net> wrote:
> On Thu, Jul 21, 2016 at 11:41:10AM -0400, David Henderson wrote:
>
>> lrwxrwxrwx1 root root47 Jul 21 08:59
>> /usr/local/lib/libncurses.so ->
>> /tmp/tcloop/ncurses/usr/local/lib/libncurses.so
>
>
>>
>> I don't see a libcurses.so file, but you may have meant libncurses.so
>> which is present.  Let me know!
>>
>
> That should do.  I'm noticing that it's in /usr/local/lib, which
> might not be in your search path.  Does this work?
>
> $ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
> $ make menuconfig
>
> -mg
>
>> Thanks,
>> Dave
>>
>>
>> On 7/21/16, ..mg.. <shoema...@riseup.net> wrote:
>> > On Thu, Jul 21, 2016 at 09:07:09AM -0400, David Henderson wrote:
>> >> No problem, here's the entire output:
>> >
>> > [snip...]
>> >>   HOSTCC  scripts/kconfig/zconf.tab.o
>> >> In file included from scripts/kconfig/zconf.tab.c:152:0:
>> >> scripts/kconfig/zconf.hash.c:155:43: warning:
>> >> 'kconf_id_strings_contents' is static but used in inline function
>> >> 'kconf_id_lookup' which is not static
>> >>  #define kconf_id_strings ((const char *) _id_strings_contents)
>> >>^
>> >> scripts/kconfig/zconf.hash.c:222:44: note: in expansion of macro
>> >> 'kconf_id_strings'
>> >>register const char *s = o + kconf_id_strings;
>> >> ^
>> >> scripts/kconfig/zconf.hash.c:215:26: warning: 'kconf_id_hash' is
>> >> static but used in inline function 'kconf_id_lookup' which is not
>> >> static
>> >>register int key = kconf_id_hash (str, len);
>> >>   ^
>> >> scripts/kconfig/zconf.hash.c:171:26: warning: 'wordlist' is static but
>> >> declared in inline function 'kconf_id_lookup' which is not static
>> >>static struct kconf_id wordlist[] =
>> >
>> >
>> > These are just warnings, you should be able to ignore them.
>> >
>> >>   HOSTLD  scripts/kconfig/mconf
>> >>   HOSTCC  scripts/kconfig/lxdialog/checklist.o
>> >>   HOSTCC  scripts/kconfig/lxdialog/inputbox.o
>> >>   HOSTCC  scripts/kconfig/lxdialog/lxdialog.o
>> >>   HOSTCC  scripts/kconfig/lxdialog/menubox.o
>> >>   HOSTCC  scripts/kconfig/lxdialog/msgbox.o
>> >>   HOSTCC  scripts/kconfig/lxdialog/textbox.o
>> >>   HOSTCC  scripts/kconfig/lxdialog/util.o
>> >>   HOSTCC  scripts/kconfig/lxdialog/yesno.o
>> >>   HOSTLD  scripts/kconfig/lxdialog/lxdialog
>> >> scripts/kconfig/lxdialog/checklist.o: In function `print_arrows':
>> >> checklist.c:(.text+0x29): undefined reference to `wmove'
>> >
>> > [ snip many more 'undefined references'... ]
>> >
>> > 'wmove' (and most -- maybe all -- of the other undefined references)
>> > come from the curses library.  Compilation worked, so the header files
>> > were found, but the linker couldn't find the libcurses.so library file.
>> >
>> > If you run:
>> >
>> > find / -name '*curses*' | xargs ls -ld
>> >
>> > what's the output?
>> >
>> > -mg
>> >
>> >
>> >
>> >> collect2: error: ld returned 1 exit status
>> >> scripts/Makefile.host:113: recipe for target
>> >> 'scripts/kconfig/lxdialog/lxdialog' failed
>> >> make[2]: *** [scripts/kconfig/lxdialog/lxdialog] Error 1
>> >> /opt/staging/busybox-1.24.1/scripts/kconfig/Makefile:14: recipe for
>> >> target 'menuconfig' failed
>> >> make[1]: *** [menuconfig] Error 2
>> >> Makefile:443: recipe for target 'menuconfig' failed
>> >> make: *** [menuconfig] Error 2
>> >>
>> >
>> >
>> >
>> >>
>> >>
>> >>
>> >> On 7/20/16, Rob Landley <r...@landley.net> wrote:
>> >> > On 07/20/2016 03:49 PM, David Henderson wrote:
>> >> >> msgbox.c:(.text+0x130): undefined reference to `waddch'
>> >> >> msgbox.c:(.text+0x160): undefined reference to `wrefresh'
>> >> >> msgbox.c:(.text+0x190): undefined reference to `wgetch'
>> >> >> msgbox.c:(.text+0x1a1): undefined reference to `delwin'
>> >> >> msgbox.c:(.text+0x1f5):

Re: make menuconfig deps

2016-07-21 Thread David Henderson
I'll need a little help with your suggestion.  Where do I find that line?

Thanks,
Dave


On 7/21/16, Bernhard Reutner-Fischer <rep.dot@gmail.com> wrote:
> On July 21, 2016 5:41:10 PM GMT+02:00, David Henderson
> <dhender...@digital-pipe.com> wrote:
>>Thanks MG for the continued help.  The results of the find call are as
>>shown below:
>
>>lrwxrwxrwx1 root root47 Jul 21 08:59
>>/usr/local/lib/libncurses.so ->
>>/tmp/tcloop/ncurses/usr/local/lib/libncurses.so
>
> So in theory you do have one.
> What's the lxdialog link line for "make V=1" ?
>
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: make menuconfig deps

2016-07-21 Thread David Henderson
No problem :)


On 7/21/16, Rich Mahn <r...@lat.com> wrote:
> David Henderson <dhender...@digital-pipe.com> wrote:
>
>> Good morning Rich, thanks for the response.  I have ncurses-dev
>> already installed.  I'm surprised BB required qt and kmod dev packages
>> installed to use the menuconfig.  I don't recall installing those
>> packages before when I recompiled BB.  Tinycore does have a qt-dev
>> package, but no kmod...
>>
>> Thanks,
>> Dave
> Dave,
>
> You are correct.  I need the qt and kmod for compiling a kernel.  Thanks
> for the correction.
>
> Rich
>
>>
>>
>> On 7/20/16, Rich Mahn <r...@lat.com> wrote:
>> > Rob Landley <r...@landley.net> wrote:
>> >
>> >> On 07/20/2016 10:45 AM, David Henderson wrote:
>> >> > Good morning everyone.  I'm trying to run the 'make menuconfig' to
>> >> > configure BB but I keep getting a 'collect2: error:'.  What are the
>> >> > dependencies that are necessary to get this going?  Currently I have
>> >> > the basics like gcc, ncurses-dev, ncurses, etc.
>> >>
>> >> collect2 is a wrapper around ld that handles C++ global initializers.
>> >> It's been part of binutils for over a decade, and should be in your
>> >> $PATH if you have binutils installed.
>> >>
>> >> What toolchain are you using, and can it build and run "hello world"?
>> >>
>> >> Rob
>> >
>> > In Centos 7 I've found I need to add qt-devel, kmod-devel, and
>> > ncurses-devel for the functions I need to compile in busybox.  I
>> > believe
>> > the ncurses-devel was required to use 'make menuconfig'.
>> >
>> > Rich
>> > ___
>> > busybox mailing list
>> > busybox@busybox.net
>> > http://lists.busybox.net/mailman/listinfo/busybox
>> >
>> ___
>> busybox mailing list
>> busybox@busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: make menuconfig deps

2016-07-21 Thread David Henderson
p/ncurses-dev/usr/local/lib/libncurses_g.a
lrwxrwxrwx1 root root51 Jul 21 08:59
/usr/local/lib/libncursesw.a ->
/tmp/tcloop/ncurses-dev/usr/local/lib/libncursesw.a
lrwxrwxrwx1 root root48 Jul 21 08:59
/usr/local/lib/libncursesw.so ->
/tmp/tcloop/ncurses/usr/local/lib/libncursesw.so
lrwxrwxrwx1 root root50 Jul 21 08:59
/usr/local/lib/libncursesw.so.5 ->
/tmp/tcloop/ncurses/usr/local/lib/libncursesw.so.5
lrwxrwxrwx1 root root52 Jul 21 08:59
/usr/local/lib/libncursesw.so.5.9 ->
/tmp/tcloop/ncurses/usr/local/lib/libncursesw.so.5.9
lrwxrwxrwx1 root root53 Jul 21 08:59
/usr/local/lib/libncursesw_g.a ->
/tmp/tcloop/ncurses-dev/usr/local/lib/libncursesw_g.a
lrwxrwxrwx1 root root61 Jul 21 08:59
/usr/local/lib/pkgconfig/ncurses++w.pc ->
/tmp/tcloop/ncurses-dev/usr/local/lib/pkgconfig/ncurses++w.pc
lrwxrwxrwx1 root root59 Jul 21 08:59
/usr/local/lib/pkgconfig/ncursesw.pc ->
/tmp/tcloop/ncurses-dev/usr/local/lib/pkgconfig/ncursesw.pc
-rw-r--r--1 tc   staff0 Jul 21 08:59
/usr/local/tce.installed/ncurses
-rw-r--r--1 tc   staff0 Jul 21 08:59
/usr/local/tce.installed/ncurses-dev

I don't see a libcurses.so file, but you may have meant libncurses.so
which is present.  Let me know!

Thanks,
Dave


On 7/21/16, ..mg.. <shoema...@riseup.net> wrote:
> On Thu, Jul 21, 2016 at 09:07:09AM -0400, David Henderson wrote:
>> No problem, here's the entire output:
>
> [snip...]
>>   HOSTCC  scripts/kconfig/zconf.tab.o
>> In file included from scripts/kconfig/zconf.tab.c:152:0:
>> scripts/kconfig/zconf.hash.c:155:43: warning:
>> 'kconf_id_strings_contents' is static but used in inline function
>> 'kconf_id_lookup' which is not static
>>  #define kconf_id_strings ((const char *) _id_strings_contents)
>>^
>> scripts/kconfig/zconf.hash.c:222:44: note: in expansion of macro
>> 'kconf_id_strings'
>>register const char *s = o + kconf_id_strings;
>> ^
>> scripts/kconfig/zconf.hash.c:215:26: warning: 'kconf_id_hash' is
>> static but used in inline function 'kconf_id_lookup' which is not
>> static
>>register int key = kconf_id_hash (str, len);
>>   ^
>> scripts/kconfig/zconf.hash.c:171:26: warning: 'wordlist' is static but
>> declared in inline function 'kconf_id_lookup' which is not static
>>static struct kconf_id wordlist[] =
>
>
> These are just warnings, you should be able to ignore them.
>
>>   HOSTLD  scripts/kconfig/mconf
>>   HOSTCC  scripts/kconfig/lxdialog/checklist.o
>>   HOSTCC  scripts/kconfig/lxdialog/inputbox.o
>>   HOSTCC  scripts/kconfig/lxdialog/lxdialog.o
>>   HOSTCC  scripts/kconfig/lxdialog/menubox.o
>>   HOSTCC  scripts/kconfig/lxdialog/msgbox.o
>>   HOSTCC  scripts/kconfig/lxdialog/textbox.o
>>   HOSTCC  scripts/kconfig/lxdialog/util.o
>>   HOSTCC  scripts/kconfig/lxdialog/yesno.o
>>   HOSTLD  scripts/kconfig/lxdialog/lxdialog
>> scripts/kconfig/lxdialog/checklist.o: In function `print_arrows':
>> checklist.c:(.text+0x29): undefined reference to `wmove'
>
> [ snip many more 'undefined references'... ]
>
> 'wmove' (and most -- maybe all -- of the other undefined references)
> come from the curses library.  Compilation worked, so the header files
> were found, but the linker couldn't find the libcurses.so library file.
>
> If you run:
>
> find / -name '*curses*' | xargs ls -ld
>
> what's the output?
>
> -mg
>
>
>
>> collect2: error: ld returned 1 exit status
>> scripts/Makefile.host:113: recipe for target
>> 'scripts/kconfig/lxdialog/lxdialog' failed
>> make[2]: *** [scripts/kconfig/lxdialog/lxdialog] Error 1
>> /opt/staging/busybox-1.24.1/scripts/kconfig/Makefile:14: recipe for
>> target 'menuconfig' failed
>> make[1]: *** [menuconfig] Error 2
>> Makefile:443: recipe for target 'menuconfig' failed
>> make: *** [menuconfig] Error 2
>>
>
>
>
>>
>>
>>
>> On 7/20/16, Rob Landley <r...@landley.net> wrote:
>> > On 07/20/2016 03:49 PM, David Henderson wrote:
>> >> msgbox.c:(.text+0x130): undefined reference to `waddch'
>> >> msgbox.c:(.text+0x160): undefined reference to `wrefresh'
>> >> msgbox.c:(.text+0x190): undefined reference to `wgetch'
>> >> msgbox.c:(.text+0x1a1): undefined reference to `delwin'
>> >> msgbox.c:(.text+0x1f5): undefined reference to `wrefresh'
>> >> msgbox.c:(.text+0x201): undefined reference to `delwin'
>> >> collect2: e

Re: make menuconfig deps

2016-07-21 Thread David Henderson
): undefined reference to `waddch'
util.c:(.text+0x7e8): undefined reference to `waddnstr'
scripts/kconfig/lxdialog/util.o: In function `draw_box':
util.c:(.text+0x84f): undefined reference to `wmove'
util.c:(.text+0x88a): undefined reference to `waddch'
util.c:(.text+0x8ba): undefined reference to `acs_map'
util.c:(.text+0x8c1): undefined reference to `waddch'
util.c:(.text+0x8ea): undefined reference to `acs_map'
util.c:(.text+0x8f1): undefined reference to `waddch'
util.c:(.text+0x90c): undefined reference to `acs_map'
util.c:(.text+0x913): undefined reference to `waddch'
util.c:(.text+0x928): undefined reference to `acs_map'
util.c:(.text+0x92f): undefined reference to `waddch'
util.c:(.text+0x944): undefined reference to `acs_map'
util.c:(.text+0x94b): undefined reference to `waddch'
util.c:(.text+0x960): undefined reference to `acs_map'
util.c:(.text+0x967): undefined reference to `waddch'
scripts/kconfig/lxdialog/util.o: In function `draw_shadow':
util.c:(.text+0x9a4): undefined reference to `has_colors'
util.c:(.text+0x9cc): undefined reference to `wmove'
util.c:(.text+0x9e5): undefined reference to `winch'
util.c:(.text+0x9f3): undefined reference to `waddch'
util.c:(.text+0xa15): undefined reference to `wmove'
util.c:(.text+0xa1d): undefined reference to `winch'
util.c:(.text+0xa2b): undefined reference to `waddch'
util.c:(.text+0xa33): undefined reference to `winch'
util.c:(.text+0xa41): undefined reference to `waddch'
scripts/kconfig/lxdialog/util.o: In function `attr_clear':
util.c:(.text+0x113): undefined reference to `wtouchln'
scripts/kconfig/lxdialog/util.o: In function `end_dialog':
util.c:(.text+0x281): undefined reference to `endwin'
scripts/kconfig/lxdialog/util.o: In function `print_title':
util.c:(.text+0x326): undefined reference to `waddch'
scripts/kconfig/lxdialog/util.o: In function `print_button':
util.c:(.text+0x74a): undefined reference to `wmove'
scripts/kconfig/lxdialog/util.o: In function `draw_shadow':
util.c:(.text+0xa59): undefined reference to `wnoutrefresh'
scripts/kconfig/lxdialog/lxdialog.o: In function `main':
lxdialog.c:(.text.startup+0x212): undefined reference to `COLS'
lxdialog.c:(.text.startup+0x218): undefined reference to `LINES'
lxdialog.c:(.text.startup+0x21e): undefined reference to `stdscr'
lxdialog.c:(.text.startup+0x22a): undefined reference to `stdscr'
lxdialog.c:(.text.startup+0x22f): undefined reference to `wrefresh'
lxdialog.c:(.text.startup+0x245): undefined reference to `stdscr'
lxdialog.c:(.text.startup+0x24a): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/msgbox.o: In function `dialog_msgbox':
msgbox.c:(.text+0x10): undefined reference to `COLS'
msgbox.c:(.text+0x20): undefined reference to `LINES'
msgbox.c:(.text+0x3a): undefined reference to `stdscr'
msgbox.c:(.text+0x50): undefined reference to `newwin'
msgbox.c:(.text+0x5c): undefined reference to `keypad'
msgbox.c:(.text+0xd8): undefined reference to `wmove'
msgbox.c:(.text+0xe7): undefined reference to `acs_map'
msgbox.c:(.text+0xee): undefined reference to `waddch'
msgbox.c:(.text+0x105): undefined reference to `acs_map'
msgbox.c:(.text+0x10c): undefined reference to `waddch'
msgbox.c:(.text+0x129): undefined reference to `acs_map'
msgbox.c:(.text+0x130): undefined reference to `waddch'
msgbox.c:(.text+0x160): undefined reference to `wrefresh'
msgbox.c:(.text+0x190): undefined reference to `wgetch'
msgbox.c:(.text+0x1a1): undefined reference to `delwin'
msgbox.c:(.text+0x1f5): undefined reference to `wrefresh'
msgbox.c:(.text+0x201): undefined reference to `delwin'
collect2: error: ld returned 1 exit status
scripts/Makefile.host:113: recipe for target
'scripts/kconfig/lxdialog/lxdialog' failed
make[2]: *** [scripts/kconfig/lxdialog/lxdialog] Error 1
/opt/staging/busybox-1.24.1/scripts/kconfig/Makefile:14: recipe for
target 'menuconfig' failed
make[1]: *** [menuconfig] Error 2
Makefile:443: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2




On 7/20/16, Rob Landley <r...@landley.net> wrote:
> On 07/20/2016 03:49 PM, David Henderson wrote:
>> msgbox.c:(.text+0x130): undefined reference to `waddch'
>> msgbox.c:(.text+0x160): undefined reference to `wrefresh'
>> msgbox.c:(.text+0x190): undefined reference to `wgetch'
>> msgbox.c:(.text+0x1a1): undefined reference to `delwin'
>> msgbox.c:(.text+0x1f5): undefined reference to `wrefresh'
>> msgbox.c:(.text+0x201): undefined reference to `delwin'
>> collect2: error: ld returned 1 exit status
>
> That's not a failure to find collect2, that's an error message returned
> _from_ collect2, saying its attempt to link couldn't find symbols the
> program referred to.
>
> Googling for delwin found:
>
> http://linux.die.net/man/3/delwin
>
> And it's a curses function. Looks like it's not finding the curses
> library, although if it attempted to link a library that it couldn't
> find that would yet aga

Re: make menuconfig deps

2016-07-21 Thread David Henderson
Good morning Rich, thanks for the response.  I have ncurses-dev
already installed.  I'm surprised BB required qt and kmod dev packages
installed to use the menuconfig.  I don't recall installing those
packages before when I recompiled BB.  Tinycore does have a qt-dev
package, but no kmod...

Thanks,
Dave


On 7/20/16, Rich Mahn <r...@lat.com> wrote:
> Rob Landley <r...@landley.net> wrote:
>
>> On 07/20/2016 10:45 AM, David Henderson wrote:
>> > Good morning everyone.  I'm trying to run the 'make menuconfig' to
>> > configure BB but I keep getting a 'collect2: error:'.  What are the
>> > dependencies that are necessary to get this going?  Currently I have
>> > the basics like gcc, ncurses-dev, ncurses, etc.
>>
>> collect2 is a wrapper around ld that handles C++ global initializers.
>> It's been part of binutils for over a decade, and should be in your
>> $PATH if you have binutils installed.
>>
>> What toolchain are you using, and can it build and run "hello world"?
>>
>> Rob
>
> In Centos 7 I've found I need to add qt-devel, kmod-devel, and
> ncurses-devel for the functions I need to compile in busybox.  I believe
> the ncurses-devel was required to use 'make menuconfig'.
>
> Rich
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: make menuconfig deps

2016-07-20 Thread David Henderson
You're absolutely right Waldemar, sorry!  Here's the snippet from the
compile output:

util.c:(.text+0x326): undefined reference to `waddch'
scripts/kconfig/lxdialog/util.o: In function `print_button':
util.c:(.text+0x74a): undefined reference to `wmove'
scripts/kconfig/lxdialog/util.o: In function `draw_shadow':
util.c:(.text+0xa59): undefined reference to `wnoutrefresh'
scripts/kconfig/lxdialog/lxdialog.o: In function `main':
lxdialog.c:(.text.startup+0x212): undefined reference to `COLS'
lxdialog.c:(.text.startup+0x218): undefined reference to `LINES'
lxdialog.c:(.text.startup+0x21e): undefined reference to `stdscr'
...snip...
msgbox.c:(.text+0x130): undefined reference to `waddch'
msgbox.c:(.text+0x160): undefined reference to `wrefresh'
msgbox.c:(.text+0x190): undefined reference to `wgetch'
msgbox.c:(.text+0x1a1): undefined reference to `delwin'
msgbox.c:(.text+0x1f5): undefined reference to `wrefresh'
msgbox.c:(.text+0x201): undefined reference to `delwin'
collect2: error: ld returned 1 exit status
scripts/Makefile.host:113: recipe for target
'scripts/kconfig/lxdialog/lxdialog' failed
make[2]: *** [scripts/kconfig/lxdialog/lxdialog] Error 1
/opt/staging/busybox-1.24.1/scripts/kconfig/Makefile:14: recipe for
target 'menuconfig' failed
make[1]: *** [menuconfig] Error 2
Makefile:443: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2


On 7/20/16, Waldemar Brodkorb <w...@openadk.org> wrote:
> Hi,
> David Henderson wrote,
>
>> Hey Rob, thanks for getting back to me on this!  How's all your projects
>> going?
>>
>> I'm currently using TinyCoreLinux v7.x to compile BB and have not had
>> problems compiling other software such as ssmtp, sshpass, wmctrl,
>> dvb-apps, etc so there isn't a problem with compiling per se which is
>> why I'm left scratching my head.  Some other errors I'm getting are
>> 'undefined reference to ...' along with the collect2 error message.
>> I've checked that binutils are installed.  Some package seems like it
>> is missing, I just have no clue which one.  Thoughts?
>
> It would be simpler to help, if you paste complete output of the
> error messages you get. It's the second time you cut off the
> interesting part of the error.
>
> best regards and good luck,
>  Waldemar
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: make menuconfig deps

2016-07-20 Thread David Henderson
Hey Rob, thanks for getting back to me on this!  How's all your projects going?

I'm currently using TinyCoreLinux v7.x to compile BB and have not had
problems compiling other software such as ssmtp, sshpass, wmctrl,
dvb-apps, etc so there isn't a problem with compiling per se which is
why I'm left scratching my head.  Some other errors I'm getting are
'undefined reference to ...' along with the collect2 error message.
I've checked that binutils are installed.  Some package seems like it
is missing, I just have no clue which one.  Thoughts?

Thanks,
Dave


On 7/20/16, Rob Landley <r...@landley.net> wrote:
> On 07/20/2016 10:45 AM, David Henderson wrote:
>> Good morning everyone.  I'm trying to run the 'make menuconfig' to
>> configure BB but I keep getting a 'collect2: error:'.  What are the
>> dependencies that are necessary to get this going?  Currently I have
>> the basics like gcc, ncurses-dev, ncurses, etc.
>
> collect2 is a wrapper around ld that handles C++ global initializers.
> It's been part of binutils for over a decade, and should be in your
> $PATH if you have binutils installed.
>
> What toolchain are you using, and can it build and run "hello world"?
>
> Rob
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


make menuconfig deps

2016-07-20 Thread David Henderson
Good morning everyone.  I'm trying to run the 'make menuconfig' to
configure BB but I keep getting a 'collect2: error:'.  What are the
dependencies that are necessary to get this going?  Currently I have
the basics like gcc, ncurses-dev, ncurses, etc.

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: /etc/network/interfaces declarations

2016-04-05 Thread David Henderson
Awesome, thanks for the additional info Isaac!  I'll begin playing
around with things and see if I can get it going!

Dave


On 4/4/16, Isaac Dunham <ibid...@gmail.com> wrote:
> Replying to this email and your other email.
>
> Clarifying plugins:
> ifup runs *all* scripts in /etc/network/if-*.d, with the time depending
> on the directory.
> Plugins are simply scripts dropped into the right directories, that use
> the environment variables set by ifup.
> As a result, the line
>   dns-nameservers 8.8.8.8 4.4.4.4
>
> would result in every script in /etc/network/if-*.d/ getting the variable:
> IF_DNS_NAMESERVERS="8.8.8.8 4.4.4.4"
>
> So it doesn't matter what the name of the script is. (It could be
> 'nameservers', 'resolvconf', or even 'foobar'.)
>
> On a computer with a working /etc/network/interfaces configuration, you
> can switch to busybox ifup and it should continue working.
>
> On a system with just busybox ifup/ifdown, you would need to install
> resolvconf and wpa_supplicant, making sure that there are scripts in
> /etc/network/if-*.d/.
>
> On Mon, Apr 04, 2016 at 04:03:55PM -0400, David Henderson wrote:
>> >> And I just wanted to make sure that I could use something like:
>> >>
>> >> ifup -i /etc/network/interfaces eth0
>> >>
>> >> will process that file as is defined (like the example provided
>> >> below).  There isn't anythink like this with just ifconfig correct?
>> > No, ifconfig doesn't do all that.
>> >
>> >
>> > The 'example provided' is only a list of options.
>> >
>> > If I'm understanding correctly, you're probably thinking of something
>> > more like this:
>> > ===
>> > # eth0 here is manually configured ethernet, brought up by hand
>> > iface eth0 inet static
>> >address 192.168.0.10
>> >netmask 255.255.255.0
>> >gateway 192.168.0.1
>> >dns-nameservers 1.1.1.1 1.1.1.2 1.1.1.3
>> >dns-search newdomain.local olddomain.local outside.com
>> >
>> > # wlan0 is wireless auto-configured by dhcp, brought up automatically
>> > auto wlan0
>> > iface wlan0 inet dhcp
>> >wpa-conf /etc/wpa_supplicant.conf
>> > ===
>>
>> Yeah, sorry about that, but you are correct in your assumption.
>>
>>
>> > Assuming you have resolvconf and wpa-supplicant installed, it should
>> > work.
>> > But unless you use wireless in a stationary PC, you would do better to
>> > use 'wpa-roam':
>> > ===
>> > # 'default' should not be marked 'auto'; IT IS MAGIC!! ;)
>> > # the wpa_supplicant plugin will bring up the logical interface
>> > specified
>> > # by 'id_str' in wpa_supplicant.conf, or 'default' if id_str is not
>> > # configured.
>> > # The physical interface you run wpa_supplicant on will be used for
>> > # any logical interfaces.
>> >
>> > iface default inet dhcp
>> >
>> > auto wlan0
>> > iface wlan0 inet manual
>> >wpa-roam /etc/wpa_supplicant.conf
>> > ===
>> >
>> > "-i CONFIGFILE" is optional; it defaults to /etc/network/interfaces.
>>
>> What's the advantage to using 'wpa-roam' vs 'wpa-conf'?
>
> 'wpa-conf' will run wpa_supplicant, then assume that there's a connection
> and continue, starting the DHCP client or running the manual config.
>
> 'wpa-roam' will run wpa_supplicant, listen until wpa_supplicant reports a
> connection, and then apply the appropriate configuration for the network.
>
> As a result, wpa-conf has a tendency to cause hangs in the boot process,
> while wpa-roam yields faster starts and works better with switching
> networks.
> (In some cases, buggy out-of-tree drivers can panic the kernel with
> wpa-conf; several years ago I noticed that madwifi liked to panic if the
> dhcp client started before the connection was complete.)
>
> HTH,
> Isaac Dunham
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: /etc/network/interfaces declarations

2016-04-04 Thread David Henderson
>> And I just wanted to make sure that I could use something like:
>>
>> ifup -i /etc/network/interfaces eth0
>>
>> will process that file as is defined (like the example provided
>> below).  There isn't anythink like this with just ifconfig correct?
> No, ifconfig doesn't do all that.
>
>
> The 'example provided' is only a list of options.
>
> If I'm understanding correctly, you're probably thinking of something
> more like this:
> ===
> # eth0 here is manually configured ethernet, brought up by hand
> iface eth0 inet static
>   address 192.168.0.10
>   netmask 255.255.255.0
>   gateway 192.168.0.1
>   dns-nameservers 1.1.1.1 1.1.1.2 1.1.1.3
>   dns-search newdomain.local olddomain.local outside.com
>
> # wlan0 is wireless auto-configured by dhcp, brought up automatically
> auto wlan0
> iface wlan0 inet dhcp
>   wpa-conf /etc/wpa_supplicant.conf
> ===

Yeah, sorry about that, but you are correct in your assumption.


> Assuming you have resolvconf and wpa-supplicant installed, it should work.
> But unless you use wireless in a stationary PC, you would do better to
> use 'wpa-roam':
> ===
> # 'default' should not be marked 'auto'; IT IS MAGIC!! ;)
> # the wpa_supplicant plugin will bring up the logical interface specified
> # by 'id_str' in wpa_supplicant.conf, or 'default' if id_str is not
> # configured.
> # The physical interface you run wpa_supplicant on will be used for
> # any logical interfaces.
>
> iface default inet dhcp
>
> auto wlan0
> iface wlan0 inet manual
>   wpa-roam /etc/wpa_supplicant.conf
> ===
>
> "-i CONFIGFILE" is optional; it defaults to /etc/network/interfaces.

What's the advantage to using 'wpa-roam' vs 'wpa-conf'?


>> On 3/24/16, David Henderson <dhender...@digital-pipe.com> wrote:
>> > Good morning all!  I am working with the /etc/network/interfaces file
>> > and was curious what declarations are available to busybox.  So far
>> > I'm interested in using the following:
>> >
>> > address 192.168.0.10
>> > netmask 255.255.255.0
>> > gateway 192.168.0.1
>> > dns-nameservers 1.1.1.1 1.1.1.2 1.1.1.3
>> > dns-search newdomain.local olddomain.local outside.com
>> > wpa-conf /etc/wpa_supplicant.conf

Thanks again,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: /etc/network/interfaces declarations

2016-04-04 Thread David Henderson
Thanks for the help Isaac!  Replies are inline...


>> Good morning all!  I am working with the /etc/network/interfaces file
>> and was curious what declarations are available to busybox.  So far
>
> Test it out; this is usually the fastest way to find out.

Unfortunately in this situation I think that would have just been a
giant waste of time.  Seeing as how this setup needs 'plugins', I
would never have gotten this to work. :)  Just as a side question, why
doesn't someone update the BB website to include more information like
this?


> As a general rule, anything that doesn't require a plugin should work.
> This is roughly 'allow-*' and anything that's not separated by '-'/'_'.
> Anything that requires a plugin will require the appropriate package
> and script.

I would assume that BB doesn't look for the appropriate package, but
just the appropriately named script under /etc/network/if-*.d and
executes it.  And if the proper binaries aren't installed it will
fail.  So, for example, if I have a 'dns-nameservers' declaration, I
should have a file named /etc/network/if-up.d/dns-nameservers?  Or
should that just be /etc/network/if-up.d/nameservers?


>> I'm interested in using the following:
>>
>> address 192.168.0.10
>> netmask 255.255.255.0
>> gateway 192.168.0.1
> Standard.
> (I don't see code *explicitly* handling 'gateway', but I think there's
> some trick such that it gets handled.)
>
>> dns-nameservers 1.1.1.1 1.1.1.2 1.1.1.3
>> dns-search newdomain.local olddomain.local outside.com
>
> I think these are handled by an ifup plugin, given the hyphen.
> They would become IF_DNS_NAMESERVERS/IF_DNS_SEARCH for scripts in
> /etc/network/*.d/
> ...Ah, they are handled by the resolvconf ifup plugin.

So that would be the variable names in a shell script?  For example:

#!/bin/sh
[ "$IF_DNS_NAMESERVERS" != '' ]; then echo 'we have name servers!'; fi

Does that also mean that these particular declarations need to have a
'plugin' called 'resolvconf' or does it need to be 'dns-nameservers'
or just 'nameservers'.  I'm a bit confused...  And are there any other
special naming cases like this?


>> wpa-conf /etc/wpa_supplicant.conf
>
> Handled by the wpa_supplicant ifup plugin (IF_WPA_CONF).
>
> These 'plugins' I refer to are scripts in
> /etc/network/if-{,pre-,post-}{up,down}.d/
> Depending on the directory, they will be executed before or after
> interfaces go up or down.
>
>> A list of available, working declarations would be greatly appreciated!

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


/etc/network/interfaces declarations

2016-03-24 Thread David Henderson
Good morning all!  I am working with the /etc/network/interfaces file
and was curious what declarations are available to busybox.  So far
I'm interested in using the following:

address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 1.1.1.1 1.1.1.2 1.1.1.3
dns-search newdomain.local olddomain.local outside.com
wpa-conf /etc/wpa_supplicant.conf

A list of available, working declarations would be greatly appreciated!

Thanks,
Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: /etc/network/interfaces declarations

2016-03-24 Thread David Henderson
And I just wanted to make sure that I could use something like:

ifup -i /etc/network/interfaces eth0

will process that file as is defined (like the example provided
below).  There isn't anythink like this with just ifconfig correct?

Thanks,
Dave


On 3/24/16, David Henderson <dhender...@digital-pipe.com> wrote:
> Good morning all!  I am working with the /etc/network/interfaces file
> and was curious what declarations are available to busybox.  So far
> I'm interested in using the following:
>
> address 192.168.0.10
> netmask 255.255.255.0
> gateway 192.168.0.1
> dns-nameservers 1.1.1.1 1.1.1.2 1.1.1.3
> dns-search newdomain.local olddomain.local outside.com
> wpa-conf /etc/wpa_supplicant.conf
>
> A list of available, working declarations would be greatly appreciated!
>
> Thanks,
> Dave
>
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: case passthru

2016-02-18 Thread David Henderson
On 2/18/16, Mike Frysinger <vap...@gentoo.org> wrote:
> On 18 Feb 2016 11:04, David Henderson wrote:
>> Good morning everyone, I am working with a shell script (#!/bin/sh)
>> that utilizes a case statement to implement updates:
>>
>> case "$(cat /tmp/md5.txt)" in
>> '123456')
>> ...implement updates for this particular version...
>> ;;
>> '234567')
>> ...implement updates for this particular version...
>> ;;
>> esac
>>
>> Using this syntax, I would have to reboot several times in order for
>> all consecutive patches to be implemented.  In bash I can use ;&
>> instead of ;; to allow for continuing from one match to all that
>> follow, but I can't figure it out with the BB shell.  I've tried
>> omitting the ;; characters, but that doesn't work either.  Any info
>> would be appreciated!
>
> as mentioned, this is a seldom used bash extension.  we have added them
> in the past behind config knobs when people felt up to the task.  feel
> free to log a bug at bugs.busybox.net, but most likely it'll need you
> to actually write/submit the patch ;).

Thanks for the info Mike!  I'm not a very good c/c++ coder, so this
would not really work for me.  Currently I'm using the work around
suggested by Bastian, but I do appreciate your assistance.

Dave
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: case passthru

2016-02-18 Thread David Henderson
On 2/18/16, Bastian Bittorf <bitt...@bluebottle.com> wrote:
> * David Henderson <dhender...@digital-pipe.com> [18.02.2016 17:14]:
>> case "$(cat /tmp/md5.txt)" in
>> '123456')
>> ...implement updates for this particular version...
>> ;;
>> '234567')
>> ...implement updates for this particular version...
>> ;;
>> esac
>
> this is not POSIX and you can work around with e.g.:
>
> #!/bin/sh
> while read -r CRC; do
>   case "$CRC" in
> '1234')
>   ...
> ;;
> '5678')
>   ...
> ;;
>   esac
> done http://lists.busybox.net/mailman/listinfo/busybox


  1   2   >