Angeli Janos | 18 May 2013 23:33
Picon

[PATCH] BusyBox coreutils stty add RS485 config options

Dear Denys,

I've attached my fixed patches for adding RS-485 configuration options 
to BusyBox coreutils stty. The previous version can't compiled with old 
(pre 2.6.35) linux kernel headers. The two patches are for the latest 
stable 1.21.0 and the current git master version.

Best Regards,
Janos Angeli

_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Denys Vlasenko | 17 May 2013 15:29

Re: Patch for udhcpc hwtype

On Wed, May 8, 2013 at 11:11 AM, Sam Liddicott <sam <at> liddicott.com> wrote:
> However I still question if this fix should also have been applied further
> down the function; the line:
>
>                         memcpy(existing->data + OPT_DATA + old_len, buffer,
> length);
>
> possibly should also be
>
>                         memcpy(existing->data + OPT_DATA + old_len,
> allocated ? allocated : buffer, length);

Yes, looks like it should be.
Fixed in git.
Thanks!
Sam Liddicott | 16 May 2013 17:40

Re: Compiling using LLVM Clang : Nested functions

_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Benjamin Lee | 15 May 2013 14:07

Compiling using LLVM Clang : Nested functions

Dear all, a quick question...

While trying to compile the latest busybox git version using clang
3.2-2+b1, I quickly discovered a nested function in the code...
apparently the only one. ;-) See below.

My question is... does anyone know how much bigger (approximately) the
code is without such a nested function?

Thanks in advance.

Cheers! :-)
Ben.

-       /* This is the only place in busybox where we use nested function.
-        * So far more standard alternatives were bigger. */
-       /* Auto decl suppresses "func without a prototype" warning: */
-       auto action* alloc_action(int sizeof_struct, action_fp f);
-       action* alloc_action(int sizeof_struct, action_fp f)
-       {
-               action *ap;
-               appp[cur_group] = xrealloc(appp[cur_group], (cur_action+2) * sizeof(*appp));
-               appp[cur_group][cur_action++] = ap = xzalloc(sizeof_struct);
-               appp[cur_group][cur_action] = NULL;
-               ap->f = f;
-               IF_FEATURE_FIND_NOT( ap->invert = invert_flag; )
-               IF_FEATURE_FIND_NOT( invert_flag = 0; )
-               return ap;
-       }

--

-- 
Benjamin Lee                           mailto:benjamin.lee <at> realthought.net
Melbourne, Australia                            http://www.realthought.net
Linux / BSD / GNU                                     tel:+61 4 16 BEN LEE

Open Source               "invest in your world"
__________________________________________________________________________
From the cradle to the coffin underwear comes first.
		-- Bertolt Brecht
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Bartosz Golaszewski | 14 May 2013 23:01
Picon

[PATCH] grep: Don't bail out on first mismatch if '-w' option is set

This fixes bug 4520: 'grep -w fails when pattern is a strict substring
of a word'. If '-w' option is set - grep will retry to match against
the rest of the string after it finds a match not enclosed by delimiting
symbols.

Signed-off-by: Bartosz Golaszewski <bartekgola <at> gmail.com>
---
 findutils/grep.c |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/findutils/grep.c b/findutils/grep.c
index 70f3516..fe8dab8 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
 <at>  <at>  -312,10 +312,9  <at>  <at>  static int grep_file(FILE *file)
 	smalluint found;
 	int linenum = 0;
 	int nmatches = 0;
-#if !ENABLE_EXTRA_COMPAT
-	char *line;
-#else
 	char *line = NULL;
+	char *lineptr = NULL;
+#if ENABLE_EXTRA_COMPAT
 	ssize_t line_len;
 	size_t line_alloc_len;
 # define rm_so start[0]
 <at>  <at>  -388,32 +387,36  <at>  <at>  static int grep_file(FILE *file)
 				gl->matched_range.rm_so = 0;
 				gl->matched_range.rm_eo = 0;
 #endif
+				lineptr = line;
+ opt_w_again:
 				if (
 #if !ENABLE_EXTRA_COMPAT
-					regexec(&gl->compiled_regex, line, 1, &gl->matched_range, 0) == 0
+					regexec(&gl->compiled_regex, lineptr, 1, &gl->matched_range, 0) == 0
 #else
-					re_search(&gl->compiled_regex, line, line_len,
+					re_search(&gl->compiled_regex, lineptr, line_len,
 							/*start:*/ 0, /*range:*/ line_len,
 							&gl->matched_range) >= 0
 #endif
 				) {
 					if (option_mask32 & OPT_x) {
 						found = (gl->matched_range.rm_so == 0
-						         && line[gl->matched_range.rm_eo] == '\0');
+								 && lineptr[gl->matched_range.rm_eo] == '\0');
 					} else
 					if (!(option_mask32 & OPT_w)) {
 						found = 1;
 					} else {
 						char c = ' ';
 						if (gl->matched_range.rm_so)
-							c = line[gl->matched_range.rm_so - 1];
+							c = lineptr[gl->matched_range.rm_so - 1];
 						if (!isalnum(c) && c != '_') {
-							c = line[gl->matched_range.rm_eo];
-							if (!c || (!isalnum(c) && c != '_'))
+							c = lineptr[gl->matched_range.rm_eo];
+							if (!c || (!isalnum(c) && c != '_')) {
 								found = 1;
+							} else {
+								lineptr += gl->matched_range.rm_eo;
+								goto opt_w_again;
+							}
 						}
-//BUG: "echo foop foo | grep -w foo" should match, but doesn't:
-//we bail out on first "mismatch" because it's not a word.
 					}
 				}
 			}
--

-- 
1.7.10.4
Bartosz Gołaszewski | 12 May 2013 17:28
Picon

[PATCH] Support for '-v' argument for gzip and bzip2

Attachment (gzip_verbose.patch): application/octet-stream, 9 KiB
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Michael D. Setzer II | 12 May 2013 07:00

Setting up to load firmware?

Is there some documentation to show the steps needed to support 
loading firmware? 

I'm the current maintainer of the G4L project, and it includes 9 
kernels in the cd image, but the required firmware from users has 
been very limited, so it has just been building them into each 
kernel, but just had a situation were adding signal files didn't solve 
the problem. So, just added all the firmware from the bnx2x 
directory of the lnux-firmware to the kernel build and that did work, 
but it increased the kernel size from 8.7M to 12.5M. 

Once before I had tried to put firmware on the filesystem, but in 
the test it then didn't find it, so went back to what had worked by 
putting it in the kernel itself.

Don't know if it is a kernel option I have set or not set correctly?
If it is a busybox setting that isn't set correctly?
If it is something missing in the init.d rcS script?

I don't have any hardware that requires firmware, so setting up 
test is difficult. 

Thanks.

+----------------------------------------------------------+
  Michael D. Setzer II -  Computer Science Instructor      
  Guam Community College  Computer Center                  
  mailto:mikes <at> kuentos.guam.net                            
  mailto:msetzerii <at> gmail.com
  http://www.guam.net/home/mikes
  Guam - Where America's Day Begins                        
  G4L Disk Imaging Project maintainer 
  http://sourceforge.net/projects/g4l/
+----------------------------------------------------------+

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

BOINC <at> HOME CREDITS
SETI        14741189.522008   |   EINSTEIN    11242028.609852
ROSETTA      7253471.928790   |   ABC         15959224.973599
Denys Vlasenko | 12 May 2013 02:05

Re: BusyBox telnet doesn't pass Ctrl-j anymore.

On Saturday 11 May 2013 15:35, Norm Pierce wrote:
> Using v1.21.0 of BusyBox, the telnet applet sends Ctrl-m when I press
> Ctrl-j.  Obviously, this creates problems for an application that expects
> to receive Ctrl-j when I press Ctrl-j.
> 
> Former versions of BusyBox did not have this problem.

Which version of non-busybox telnet passes ^J verbatim?

> I suspect line 204 
> in networking/telnet.c:
> 
> if (c == '\r' || c == '\n') {
> 
> I'd much appreciate it if you have time to look into this.

[Enter] key and Ctrl-J send the same ACSII code.

Relevant docs:

http://www.ietf.org/rfc/rfc1123.txt

"""
3.3.1  Telnet End-of-Line Convention

         The Telnet protocol defines the sequence CR LF to mean "end-
         of-line".  For terminal input, this corresponds to a command-
         completion or "end-of-line" key being pressed on a user
         terminal; on an ASCII terminal, this is the CR key, but it may
         also be labelled "Return" or "Enter".

         When a Server Telnet receives the Telnet end-of-line sequence
         CR LF as input from a remote terminal, the effect MUST be the
         same as if the user had pressed the "end-of-line" key on a
         local terminal.  On server hosts that use ASCII, in particular,
         receipt of the Telnet sequence CR LF must cause the same effect
         as a local user pressing the CR key on a local terminal.  Thus,
         CR LF and CR NUL MUST have the same effect on an ASCII server
         host when received as input over a Telnet connection.

         A User Telnet MUST be able to send any of the forms: CR LF, CR
         NUL, and LF.  A User Telnet on an ASCII host SHOULD have a
         user-controllable mode to send either CR LF or CR NUL when the
         user presses the "end-of-line" key, and CR LF SHOULD be the
         default.
"""

I follow the last paragraph: "CR LF SHOULD be the default"
when user presses the "end-of-line" key.
Mark Jackson | 9 May 2013 16:42
Picon
Favicon

Problem with dual Ethernet network routing and gateways

I have a dual Ethernet AM335x board which I'm trying to set up, as follows:-

$ cat /etc/network/interfaces
auto lo eth0 eth1
iface lo inet loopback
iface eth1 inet static
address 10.0.101.1
netmask 255.255.0.0
gateway 10.0.0.1
iface eth0 inet static
address 10.1.101.1
netmask 255.255.0.0

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:18:31:93:49:34
          inet addr:10.1.101.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:56

eth1      Link encap:Ethernet  HWaddr 00:18:31:93:49:35
          inet addr:10.0.101.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2756 errors:0 dropped:0 overruns:0 frame:0
          TX packets:607 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:465648 (454.7 KiB)  TX bytes:168843 (164.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:50 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4066 (3.9 KiB)  TX bytes:4066 (3.9 KiB)

But my routing table is:-

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.1.0.1        0.0.0.0         UG    0      0        0 eth0
10.0.0.0        *               255.255.0.0     U     0      0        0 eth1
10.1.0.0        *               255.255.0.0     U     0      0        0 eth0

As you can see the gateway for eth1 has not been added to the routing table.

I'm using avahi and udhcpc, and I have done nothing special with the network
config.

So with only eth1 connected, I am unable to ping anything outside my local
network.

Can anyone tell me how to get the correct routing added automatically ?

Cheers
Mark J.
Walter Dnes | 9 May 2013 01:32
Favicon

mdev tmpfs 10 megabyte max limit?

  Hi all.  I run Gentoo linux, with mdev replacing udev.  I
occasionally run a script that does quite a bit of copying back and
forth, and it uses /dev/shm to speed things up.  Yesterday, it started
blowing up on me.  After painfull debugging, I discovered that /dev/shm
is now only 10 megabytes.  The default linux size is 50% of ram.  Since
I have 3 gigabytes, that should allow 1.5 gigabytes in /dev/shm.  I
haven't run this script for a while, so the change may have been a few
months ago.  Is there an option I can set somewhere to override this
limit?  I tried remounting and bindmounting it, without any effect.

Here is my /etc/mtab for diagnostics.  Note the line...
mdev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0

rootfs / rootfs rw 0 0
/dev/root / ext2 rw,noatime,nodiratime,errors=continue 0 0
devtmpfs /dev devtmpfs rw,relatime,size=1551084k,nr_inodes=219109,mode=755 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
tmpfs /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0
openrc /sys/fs/cgroup/openrc cgroup
rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc
0 0
cpuset /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0
cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0
freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
mdev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0
/dev/sda7 /home reiserfs rw,noatime,nodiratime,notail 0 1
/home/bindmounts/opt /opt none rw,bind 0 0
/home/bindmounts/var /var none rw,bind 0 0
/home/bindmounts/usr /usr none rw,bind 0 0
/home/bindmounts/tmp /tmp none rw,bind 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nodev,noexec,nosuid 0 0
devpts /dev/pts devpts rw 0 0

--

-- 
Walter Dnes <waltdnes <at> waltdnes.org>
Oliver Metz | 8 May 2013 20:21
Picon
Picon

[PATCH] volume_id: fix ntfs attribute search

len is declared as uint32_t but le16_to_cpu macro is used

Signed-off-by: Oliver Metz <oliver <at> freetz.org>
---
 util-linux/volume_id/ntfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util-linux/volume_id/ntfs.c b/util-linux/volume_id/ntfs.c
index 7b2612f..0444e54 100644
--- a/util-linux/volume_id/ntfs.c
+++ b/util-linux/volume_id/ntfs.c
 <at>  <at>  -150,7 +150,7  <at>  <at>  int FAST_FUNC volume_id_probe_ntfs(struct volume_id *id /*,uint64_t off*/)

 		attr = (struct file_attribute*) &buf[attr_off];
 		attr_type = le32_to_cpu(attr->type);
-		attr_len = le16_to_cpu(attr->len);
+		attr_len = le32_to_cpu(attr->len);
 		val_off = le16_to_cpu(attr->value_offset);
 		val_len = le32_to_cpu(attr->value_len);
 		attr_off += attr_len;
--

-- 
1.8.2.1

Gmane