Lavrentiy Ivanov | 27 Nov 17:09 2014
Picon

Re: Writing unicode ncurses applications for busybox

Thank you a lot for your help.
After stracing on different machines, I found the problem - lack of fonts
So the correct chain to make busybox support specific language with ncurses:

ash.c patch you provided
correct terminfo database (linux works fine for me)
correct font, for example Lat15-Fixed16.psf or cyr-sun16.psfu etc

On 18.11.2014 16:31, Richard Moore wrote:
Hi,

Sorry then I don't know the answer - I spent a long time getting UTF to work.

This was my writeup , maybe you can find something useful in it.

http://www.richud.com/wiki/WHDD_Live_ISO_Boot_CD

(Note that setting the LANG in rcS only works when WHDD fires up, if WHDD is exited and then restarted UTF support won't work as the variable is then no longer set in that terminal.)

This was my BB mailing list mail with patch attached

http://lists.busybox.net/pipermail/busybox/2014-June/081021.html

Cheers

Rich


On 18/11/14 13:17, Lavrentiy Ivanov wrote:
It didn't do the trick fr some reason.. here is my config:

CONFIG_UNICODE_SUPPORT=y
# CONFIG_UNICODE_USING_LOCALE is not set
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
CONFIG_UNICODE_COMBINING_WCHARS=y
CONFIG_UNICODE_WIDE_WCHARS=y
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
CONFIG_UNICODE_PRESERVE_BROKEN=y


I also tested with CONFIG_UNICODE_USING_LOCALE enabled with the same result.
Can it be because of bad terminal set in TERM envvar? Only linux2.2 make TUI looks as it designed.


On 18.11.2014 14:06, Richard Moore wrote:
Hi,

It wont work if set in init, it needs to be set after the shell is started.

(I made a patch ash.c to force it to always be set though if that is helpful, if you look at the mailing list archive it should be there)

Regards

Rich



On 18/11/14 11:02, Lavrentiy Ivanov wrote:
I tested with
export ru_RU.UTF-8
This was set in init script
I created file with russian chars in it and it also displayed as ???? but it seems to be ls-related. I saw uch an issues in mailing list
In my case it is not displayed at all

On 18.11.2014 13:25, Richard Moore wrote:
Hi,

You need to set LANG, and it needs to be set in the controlling terminal, e.g.

export LANG=en_US.UTF-8


Cheers

Rich



On 18/11/14 09:47, Pugnator wrote:
Hi all,
I write ncurses based application which utilizes  russian characters. It looks like this:

wchar_t *unicode_string = L"Это юникод";
mvwprintw(stdscr,1,5,"%ls", unicode_string);   

And it works pretty well on my desktop.
I enabled all UNCIODE_ config options I found

I enabled terminal: export TERM="linux2.2"

I copied terminfo into my busybox system (kernel 3.2)
When I run my application, only ascii is printed. Unicode chars are absent: no garbage or whatever.

How it can be workarounded if it is possible. Application is dynamically linked and all libraries were transferred too


_______________________________________________ busybox mailing list busybox <at> busybox.net http://lists.busybox.net/mailman/listinfo/busybox






_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Akhilesh kumar | 27 Nov 07:02 2014
Picon

(unknown)

Hi all

I have solved all problems till my last conversation. Here comes the next problem.

I am writing a C code by taking the apis of net-snmp to create my own app similar to snmpset. I want to set the integer value for 10 number of OIDs. I have done till following :

                init_snmp("my_snmpset");
                snmp_sess_init( &session );
                session.version = SNMP_VERSION_1;
                session.community = "private";
                session.community_len = strlen(session.community);
                session.peername = argv[1];
                sess_handle = snmp_open(&session);
                pdu = snmp_pdu_create(SNMP_MSG_SET);


Till here i have created the PDU for set. Now which api/function to take (to pass my OID and the value by which i want to set it). Next i cant understand. Kindly suggest me.
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Marcel Rodrigues | 26 Nov 19:39 2014
Picon

[PATCH] man: allow multiple paths in MANPATH

Hi,

BusyBox's man is reading both /etc/man.config and $MANPATH to search for man-pages, but currently it assumes $MANPATH contains only a single path.

The MANPATH environment variable may hold a colon-separated list of directories to be searched by man. The same rationale for PATH
applies here: packages installed on different prefixes may coexist on the same system.

For more information, please see the section "Search Path For Manual Pages" in manpath(1).

Signed-off-by: Marcel Rodrigues <marcelgmr <at> gmail.com>
---
 miscutils/man.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/miscutils/man.c b/miscutils/man.c
index 5c1fa2c..8412778 100644
--- a/miscutils/man.c
+++ b/miscutils/man.c
<at> <at> -153,6 +153,7 <at> <at> int man_main(int argc UNUSED_PARAM, char **argv)
  parser_t *parser;
  const char *pager = ENABLE_LESS ? "less" : "more";
  char **man_path_list;
+ char *man_paths;
  char *sec_list;
  char *cur_path, *cur_sect;
  int count_mp, cur_mp;
<at> <at> -167,11 +168,15 <at> <at> int man_main(int argc UNUSED_PARAM, char **argv)
  /* Last valid man_path_list[] is [0x10] */
  count_mp = 0;
  man_path_list = xzalloc(0x11 * sizeof(man_path_list[0]));
- man_path_list[0] = getenv("MANPATH");
- if (!man_path_list[0]) /* default, may be overridden by /etc/man.conf */
- man_path_list[0] = (char*)"/usr/man";
- else
+ man_paths = xstrdup(getenv("MANPATH"));
+ man_path_list[0] = strtok(man_paths, ":");
+ while(man_path_list[count_mp]) {
  count_mp++;
+ man_path_list = xrealloc_vector(man_path_list, 4, count_mp);
+ man_path_list[count_mp] = strtok(NULL, ":");
+ }
+ if (!count_mp) /* default, may be overridden by /etc/man.conf */
+ man_path_list[0] = (char*)"/usr/man";
 
  /* Parse man.conf[ig] or man_db.conf */
  /* man version 1.6f uses man.config */
<at> <at> -287,6 +292,7 <at> <at> int man_main(int argc UNUSED_PARAM, char **argv)
  next_arg:
  argv++;
  } while (*argv);
+ free(man_paths);
 
  return not_found;
 }
-- 
2.1.3

_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Lauri Kasanen | 25 Nov 18:25 2014

open_transformer fork, depmod

Hi,

Can anyone fill me in on the reason why open_transformer always forks,
instead of straight decompressing?

I found the original commit from 2003:
http://lists.busybox.net/pipermail/busybox-cvs/2003-November/019040.html
But it doesn't explain why the move was done.

I ask because doing a "depmod -a" with gzipped modules results in over
800 forks, which is surely not optimal neither from memory nor from
performance points of view.

In the case of gzip, the uncompressed size is available, so there would
be no RAM waste in allocating the maximum specified 64mb first. For
compression formats that do not include the uncompressed size, the
fork+pipe approach does save RAM, but for gzip it seems to be needless
overhead.

- Lauri

--

-- 
http://www.fastmail.com - Send your email first class
Seth Bollinger | 21 Nov 00:37 2014
Picon

Deadlock in init

Hello All,

We recently ran into a deadlock in init.  The window is small, but I figured I would post to the list anyway.

There are syslog messages in the signal handler for reboot and shutdown.  Internally this function grabs a lock.  If the main loop is trying to grab this lock at exactly the same time (also posting a syslog message), then a deadlock is possible.

Here's a small example program that should demonstrate the issue.

#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
#include <signal.h>

void handler(int sig)
{
        syslog(LOG_INFO, "handler");
}
 
void main(int argc, char **argv)
{
        signal(SIGUSR1, handler);

        while (1)
        {
                syslog(LOG_INFO, "main");
        }
}

while [ true ]; do kill -USR1 PID; done

Thanks,

Seth
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Lavrentiy Ivanov | 18 Nov 14:17 2014
Picon

Re: Writing unicode ncurses applications for busybox

It didn't do the trick fr some reason.. here is my config:

CONFIG_UNICODE_SUPPORT=y
# CONFIG_UNICODE_USING_LOCALE is not set
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
CONFIG_UNICODE_COMBINING_WCHARS=y
CONFIG_UNICODE_WIDE_WCHARS=y
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
CONFIG_UNICODE_PRESERVE_BROKEN=y


I also tested with CONFIG_UNICODE_USING_LOCALE enabled with the same result.
Can it be because of bad terminal set in TERM envvar? Only linux2.2 make TUI looks as it designed.


On 18.11.2014 14:06, Richard Moore wrote:
Hi,

It wont work if set in init, it needs to be set after the shell is started.

(I made a patch ash.c to force it to always be set though if that is helpful, if you look at the mailing list archive it should be there)

Regards

Rich



On 18/11/14 11:02, Lavrentiy Ivanov wrote:
I tested with
export ru_RU.UTF-8
This was set in init script
I created file with russian chars in it and it also displayed as ???? but it seems to be ls-related. I saw uch an issues in mailing list
In my case it is not displayed at all

On 18.11.2014 13:25, Richard Moore wrote:
Hi,

You need to set LANG, and it needs to be set in the controlling terminal, e.g.

export LANG=en_US.UTF-8


Cheers

Rich



On 18/11/14 09:47, Pugnator wrote:
Hi all,
I write ncurses based application which utilizes  russian characters. It looks like this:

wchar_t *unicode_string = L"Это юникод";
mvwprintw(stdscr,1,5,"%ls", unicode_string);   

And it works pretty well on my desktop.
I enabled all UNCIODE_ config options I found

I enabled terminal: export TERM="linux2.2"

I copied terminfo into my busybox system (kernel 3.2)
When I run my application, only ascii is printed. Unicode chars are absent: no garbage or whatever.

How it can be workarounded if it is possible. Application is dynamically linked and all libraries were transferred too


_______________________________________________ busybox mailing list busybox <at> busybox.net http://lists.busybox.net/mailman/listinfo/busybox




_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Lavrentiy Ivanov | 18 Nov 12:02 2014
Picon

Re: Writing unicode ncurses applications for busybox

I tested with
export ru_RU.UTF-8
This was set in init script
I created file with russian chars in it and it also displayed as ???? but it seems to be ls-related. I saw uch an issues in mailing list
In my case it is not displayed at all

On 18.11.2014 13:25, Richard Moore wrote:
Hi,

You need to set LANG, and it needs to be set in the controlling terminal, e.g.

export LANG=en_US.UTF-8


Cheers

Rich



On 18/11/14 09:47, Pugnator wrote:
Hi all,
I write ncurses based application which utilizes  russian characters. It looks like this:

wchar_t *unicode_string = L"Это юникод";
mvwprintw(stdscr,1,5,"%ls", unicode_string);   

And it works pretty well on my desktop.
I enabled all UNCIODE_ config options I found

I enabled terminal: export TERM="linux2.2"

I copied terminfo into my busybox system (kernel 3.2)
When I run my application, only ascii is printed. Unicode chars are absent: no garbage or whatever.

How it can be workarounded if it is possible. Application is dynamically linked and all libraries were transferred too


_______________________________________________ busybox mailing list busybox <at> busybox.net http://lists.busybox.net/mailman/listinfo/busybox


_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Pugnator | 18 Nov 10:47 2014
Picon

Writing unicode ncurses applications for busybox

Hi all,
I write ncurses based application which utilizes  russian characters. It looks like this:

wchar_t *unicode_string = L"Это юникод";
mvwprintw(stdscr,1,5,"%ls", unicode_string);   

And it works pretty well on my desktop.
I enabled all UNCIODE_ config options I found

I enabled terminal: export TERM="linux2.2"

I copied terminfo into my busybox system (kernel 3.2)
When I run my application, only ascii is printed. Unicode chars are absent: no garbage or whatever.

How it can be workarounded if it is possible. Application is dynamically linked and all libraries were transferred too
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
John Spencer | 16 Nov 22:32 2014
Picon

grep -x broken

busybox grep (1.20.2)
$ echo libevent | grep -Fx libev
libevent
$

gnu grep
$ echo libevent | grep -Fx libev
$
valent.turkovic@gmail.com | 16 Nov 14:53 2014
Picon

logger process freezing

Hi,
I'm using few custom scripts and using logger to write messages to
OpenWrt system log.

What sometimes happens it that logger process gets frozen and I don't
see any new messages in OpenWrt system log. I have correlated that
this happens when there are lots of messages from my scripts, so could
this be the reason? Could logger process freeze if too many processes
start logger at the same time?

Is there a way to mitigate this issue? Is this a know issue?

Thanks,
Valent.
Chris McClimans | 13 Nov 16:16 2014

udhcp proxy support

I'm looking to get proxy-DHCP support into udhcp[cd].

With udhcpc the client takes the very first OFFER, rather than the
'may choose to wait for multiple responses' option from rfc2131:

     The client receives one or more DHCPOFFER messages from one or more
     servers.  The client may choose to wait for multiple responses.
     The client chooses one server from which to request configuration
     parameters, based on the configuration parameters offered in the
     DHCPOFFER messages.

I suggest that if udhcpc has --request-options, that the behavior
should be to at least entertain other offers and not take the first
one that comes along. Maybe with a --prefer-my-options-timeout?

On the udhcpd side, proxying is not supported, but a currenty working
implementation is provided by dnsmasq:

From http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

Dnsmasq supports PXE "proxy-DHCP", in this case another DHCP server on
the network is responsible for allocating IP addresses, and dnsmasq
simply provides the information given in pxe-prompt and pxe-service to
allow netbooting. This mode is enabled using the proxy keyword in
dhcp-range.

It is enabled with: dhcp-range=1.1.1.10,proxy,255.255.255.0

Where 1.1.1.10 is the local address that listens for OFFERs and uses
them as a base to send a modified OFFER with extra options.

In udcpcd we could use the first OFFER as the defaults and set any
desired options in our config.
start and end options would be ignored in proxy mode, because we
wouldn't be selecting IPs to hand out.

I haven't looked  very far into the code base, but the client seems
like it would be pretty straight forward.
I'd be thankful for any direction or thoughts on how to go about this.

Cheers,
-chris

Gmane