Prashant | 1 Oct 2010 05:21
Picon

Re: Disable kernel messages

Thanks Stuart and Pankaj.

On Wed, Sep 29, 2010 at 6:51 PM, Stuart Longland <redhatter <at> gentoo.org> wrote:
>
> Starting klogd and syslogd is usually enough.  Then there's
> /proc/sys/kernel/printk.  IIRC that's how I did it with a hand-coded
> distribution I'm running on some ARM modules.

Starting klogd worked. This is what I wanted.

Thanks.
Stefan Tomanek | 1 Oct 2010 17:27
Picon
Gravatar

[PATCH] free: format output as byte, KB, MB or GB

This patch adds the familiar command line switches -b, -k, -m and -g to the
free command. Its far easier to use "-m" to check whether the system logged
into has 20 MB, 200 MB or 2 GB of RAM.

I also put up the commit on github:
http://github.com/wertarbyte/busybox/commit/0c41db201d4467290daddb23bfb3bfc07a725d1d
---
 include/usage.src.h |    8 +++++-
 procps/free.c       |   75 ++++++++++++++++++++++++++++++---------------------
 2 files changed, 51 insertions(+), 32 deletions(-)

diff --git a/include/usage.src.h b/include/usage.src.h
index c26ed8b..f4b8ac7 100644
--- a/include/usage.src.h
+++ b/include/usage.src.h
 <at>  <at>  -1303,7 +1303,13  <at>  <at>  INSERT
 #define free_trivial_usage \
        ""
 #define free_full_usage "\n\n" \
-       "Display the amount of free and used system memory"
+       "Display the amount of free and used system memory" \
+     "\nOptions:" \
+     "\n	-b	show output in bytes" \
+     "\n	-k	show output in KB" \
+     "\n	-m	show output in MB" \
+     "\n	-g	show output in GB" \
+
 #define free_example_usage \
        "$ free\n" \
        "              total         used         free       shared      buffers\n" \
(Continue reading)

Tito | 1 Oct 2010 20:50
Picon
Favicon

Re: [PATCH] free: format output as byte, KB, MB or GB

HI,
just a hint, you could use getopt32 for command line parsing.

Ciao,
Tito

On Friday 01 October 2010 17:27:45 Stefan Tomanek wrote:
> This patch adds the familiar command line switches -b, -k, -m and -g to the
> free command. Its far easier to use "-m" to check whether the system logged
> into has 20 MB, 200 MB or 2 GB of RAM.
> 
> I also put up the commit on github:
> http://github.com/wertarbyte/busybox/commit/0c41db201d4467290daddb23bfb3bfc07a725d1d
> ---
>  include/usage.src.h |    8 +++++-
>  procps/free.c       |   75 ++++++++++++++++++++++++++++++---------------------
>  2 files changed, 51 insertions(+), 32 deletions(-)
> 
> diff --git a/include/usage.src.h b/include/usage.src.h
> index c26ed8b..f4b8ac7 100644
> --- a/include/usage.src.h
> +++ b/include/usage.src.h
>  <at>  <at>  -1303,7 +1303,13  <at>  <at>  INSERT
>  #define free_trivial_usage \
>         ""
>  #define free_full_usage "\n\n" \
> -       "Display the amount of free and used system memory"
> +       "Display the amount of free and used system memory" \
> +     "\nOptions:" \
> +     "\n	-b	show output in bytes" \
(Continue reading)

Denys Vlasenko | 1 Oct 2010 21:59

Re: [PATCH] free: format output as byte, KB, MB or GB

On Friday 01 October 2010 17:27, Stefan Tomanek wrote:
> This patch adds the familiar command line switches -b, -k, -m and -g to the
> free command. Its far easier to use "-m" to check whether the system logged
> into has 20 MB, 200 MB or 2 GB of RAM.
> 
> I also put up the commit on github:
> http://github.com/wertarbyte/busybox/commit/0c41db201d4467290daddb23bfb3bfc07a725d1d
> ---
>  include/usage.src.h |    8 +++++-
>  procps/free.c       |   75 ++++++++++++++++++++++++++++++---------------------
>  2 files changed, 51 insertions(+), 32 deletions(-)
> 
> diff --git a/include/usage.src.h b/include/usage.src.h
> index c26ed8b..f4b8ac7 100644
> --- a/include/usage.src.h
> +++ b/include/usage.src.h
>  <at>  <at>  -1303,7 +1303,13  <at>  <at>  INSERT
>  #define free_trivial_usage \
>         ""
>  #define free_full_usage "\n\n" \
> -       "Display the amount of free and used system memory"
> +       "Display the amount of free and used system memory" \
> +     "\nOptions:" \
> +     "\n	-b	show output in bytes" \
> +     "\n	-k	show output in KB" \
> +     "\n	-m	show output in MB" \
> +     "\n	-g	show output in GB" \
> +
>  #define free_example_usage \
>         "$ free\n" \
(Continue reading)

Dan Fandrich | 1 Oct 2010 22:41
Favicon

Re: [PATCH] Marked some more applets NOEXEC/NOFORK

I marked unix2dos as NOEXEC but forgot about dos2unix. This patch adds that
one, too.

>>> Dan
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Denys Vlasenko | 1 Oct 2010 23:36

Re: [PATCH] Marked some more applets NOEXEC/NOFORK

On Friday 01 October 2010 22:41, Dan Fandrich wrote:
> I marked unix2dos as NOEXEC but forgot about dos2unix. This patch adds that
> one, too.

Applied, thanks!
--

-- 
vda
Denys Vlasenko | 2 Oct 2010 00:19

Re: dhcpd user/vendor class support

On Tuesday 07 September 2010 11:16, Smith Will wrote:
> On Mon, Sep 6, 2010 at 7:48 PM, Denys Vlasenko <vda.linux <at> googlemail.com> wrote:
> > On Mon, Sep 6, 2010 at 4:07 PM, Smith Will <smith.rday <at> gmail.com> wrote:
> >> On Mon, Sep 6, 2010 at 5:17 PM, Denys Vlasenko <vda.linux <at> googlemail.com> wrote:
> >> > On Mon, Sep 6, 2010 at 11:14 AM, Smith Will <smith.rday <at> gmail.com> wrote:
> >> >> Hi list,
> >> >> Seems dhcp server within busybox does not yet has support for
> >> >> interpreting user/vendor classes. I checked code for busybox-1.17.2
> >> >
> >> > What do you mean by "interpreting"?
> >> >
> >> Means if the busybox dhcp server understands these options.. :)
> >
> > Aha, you want udhcpd to _analyze_ options sent by clients.
> >
> Correct.
> 
> >> >> Did i miss something or this feature hasnt been looked into yet?
> >> >
> >> > It is somewhat hard to spot. Look into examples/udhcp/udhcpd.conf
> >> > file:
> >> >
> >> > ...
> >> > # Arbitrary option in hex form:
> >> > option  0x08    01020304        # option 8: "cookie server IP addr: 1.2.3.4"
> >> > ...
> >> >
> >> > Basically, if you want udhcpd to advertise an option and it is not
> >> > supported by name, you can still add it with the above format.
> >> > For vendor info element, you need to use
(Continue reading)

Stefan Tomanek | 2 Oct 2010 00:40
Picon
Gravatar

Re: [PATCH] free: format output as byte, KB, MB or GB

OK, I pulled *mem_unit into the format macro to avoid the overflow; now the
memory values get shifted first, which will hopefully avoid the overflow.

---
 include/usage.src.h |    8 +++++-
 procps/free.c       |   74 +++++++++++++++++++++++++++------------------------
 2 files changed, 46 insertions(+), 36 deletions(-)

diff --git a/include/usage.src.h b/include/usage.src.h
index c26ed8b..f4b8ac7 100644
--- a/include/usage.src.h
+++ b/include/usage.src.h
 <at>  <at>  -1303,7 +1303,13  <at>  <at>  INSERT
 #define free_trivial_usage \
        ""
 #define free_full_usage "\n\n" \
-       "Display the amount of free and used system memory"
+       "Display the amount of free and used system memory" \
+     "\nOptions:" \
+     "\n	-b	show output in bytes" \
+     "\n	-k	show output in KB" \
+     "\n	-m	show output in MB" \
+     "\n	-g	show output in GB" \
+
 #define free_example_usage \
        "$ free\n" \
        "              total         used         free       shared      buffers\n" \
diff --git a/procps/free.c b/procps/free.c
index be65f46..5e6cca9 100644
--- a/procps/free.c
(Continue reading)

Denys Vlasenko | 2 Oct 2010 12:57

Re: [PATCH] free: format output as byte, KB, MB or GB

On Saturday 02 October 2010 00:40, Stefan Tomanek wrote:
> OK, I pulled *mem_unit into the format macro to avoid the overflow; now the
> memory values get shifted first, which will hopefully avoid the overflow.

Now they will underflow. Try shifting 500000 right by 20 bits and then
multiplying by 1024. The result is 0. Thus, free -m will show 500
megabytes as 0. Not good.

Please try latest git, I committed a sligtly changed version which should work.
Let me know if it does not.
--

-- 
vda
Rob Landley | 3 Oct 2010 02:35

Re: Bugs in defconfig /bin/sh

On Thursday 30 September 2010 17:15:44 Denys Vlasenko wrote:
> On Thursday 30 September 2010 23:29, Rob Landley wrote:
> > > > (Making {file,file} curly bracket support work would be darn nice
> > > > too, that's the biggest thing I miss.  You can't even follow the
> > > > Linux From Scratch build instructions without that...)
> > >
> > > This is not easy. Consider three commands:
> > >
> > > v='/bin/*'; echo $v
> > > v='/bin/{a,b}*'; echo $v
> > > echo /bin/{a,b}*
> > >
> > > In the first case, unquoted $v is globbed *after* $v value is
> > > substituted, and echo prints long list of filenames in /bin.
> > >
> > > In the second case, echo prints just "/bin/{a,b}*"
> > >
> > > In the third case, echo prints all filenames in /bin which start from a
> > > and b.
> >
> > That's messed up, and it really sounds like the second case is a bug.
> >
> > I just fired up an Aboriginal system image with bash 2.05b (the much less
> > bloated version), and under that the third case _also_ prints
> > "/bin/{a,b}*", so the behavior of this corner case changed between bash
> > versions.  Most likely somebody reported the third case as a bug and they
> > fixed the one defect report without fixing the general case, because
> > they're the FSF and everything is a special case to them.
> >
> > The _important_ test is just:
(Continue reading)


Gmane