Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Mon Jul 28, 2014 7:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Busybox
PostPosted: Thu Dec 21, 2006 10:20 am 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
As part of the work to get the OpenTera version of firmware produced I have been doing an analysis of busybox usage between different firmware releases. Initially I have compared a standard teraStation build (v2.11) against OpenLink (v0.73b) on a LS1 to see what commands use busybox and interestingly enough the TeraStation uses it more widely than the LinkStation builds. My guess is that the LinkStation could use it more widely as well - I just suspect that the Buffalo support never got around to making the requisite changes!

I have produced a spreadsheet that is at http://buffalo.nas-central.org/download/terastation/uploads/ for the results of this analysis. I am now working on filling in the TeraStation Home Server and TeraStation Pro columns. The column for the OpenTera release is still tentative and will depend on testing and checking against the Home Server & Pro analysis. However Mindbender has already produced an enhanced busybox binary (same location as above) which appears to have additional busybox commands added.

Someone else might to look at filling in the columns for different variants of the LinkStation?
I have also color coded some options for possible wider use of busybox - it will be interesting to see if anyone has any comments?


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Fri Dec 29, 2006 12:54 am 
Offline
Site Admin
User avatar

Joined: Mon Jul 11, 2005 7:19 am
Posts: 7702
Location: Austria, Vienna
i will have a look at the table and fill in all i know.

_________________
LS1 (2.6 kernel, foonas svn1062, 750 GB, UBoot 1.2) & LS Pro (FreeLink/jtymod/GenLink, changes all the time)
Thx to all donators!


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Mon Jan 22, 2007 12:40 pm 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
I was having problems trying to build a statically linked version of busybox. I have since spotted that the busybox changelog states that busybox 1.2.2.1 and later will not let you statically link busybox if using glibc - apparently it produces buggy executables! It is possible to over-ride this, but it may not be agood idea!

As a side issue if you want to try and build busybox on a TeraStation you will need the 'od' executable from a LinkStation as it is not on the TeraStation, and not included in the PPC_Tools_2.1 package.

For OpenTera purposes I will see if building the od applet into an enhanced busybox gives sufficient od options to satisfy the need for building busybox itself!.


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Mon Jan 22, 2007 12:52 pm 
Offline
Site Admin
User avatar

Joined: Mon Jul 11, 2005 7:19 am
Posts: 7702
Location: Austria, Vienna
itimpi wrote:
apparently it produces buggy executables! It is possible to over-ride this, but it may not be agood idea!

i am compiling a static one anyway. have you found out what the problem is?

i just did what the warning told me to override this.

i successfully built 1.4, i am currently compiling your config from:
http://buffalo.nas-central.org/download/terastation/uploads/busybox_itimpi_config

_________________
LS1 (2.6 kernel, foonas svn1062, 750 GB, UBoot 1.2) & LS Pro (FreeLink/jtymod/GenLink, changes all the time)
Thx to all donators!


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Mon Jan 22, 2007 1:14 pm 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
mindbender wrote:
i am compiling a static one anyway. have you found out what the problem is?

I had not followed the instructions on how to over-ride the warning!


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Mon Jan 22, 2007 1:24 pm 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
mindbender wrote:
i successfully built 1.4, i am currently compiling your config from:
http://buffalo.nas-central.org/download/terastation/uploads/busybox_itimpi_config


That config has virtually all the commands I could see anyone wanting, plus a few where the full program is currently installed but I think we might get away with the busybox variant. I would expect that the extra commands would subsequently be removed where it is decided that the free-standing version of the command should be kept. However it would not be a disaster to have some commands built in that we do not actually link to and thus do not use except for a small penalty on the busybox binary size.

We should see if we can come up with a common set of commands to use in an enhanced busybox for both OpenTera and OpenLink so that we can have a common busybox binary for the two systems? You might therefore want to review and/or comment on the config I sent through?


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Mon Jan 22, 2007 2:48 pm 
Offline
Site Admin
User avatar

Joined: Mon Jul 11, 2005 7:19 am
Posts: 7702
Location: Austria, Vienna
sorry for not answering earlier. i will have to modify the config a little as "ip" does not work with busybox 1.4.0

but that does not matter, i can use "ifconfig" + "route" for "ifupdown" instead of "ip".

i will upload the binary as soon as i finished compiling.

_________________
LS1 (2.6 kernel, foonas svn1062, 750 GB, UBoot 1.2) & LS Pro (FreeLink/jtymod/GenLink, changes all the time)
Thx to all donators!


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Mon Jan 22, 2007 3:28 pm 
Offline
Site Admin
User avatar

Joined: Mon Jul 11, 2005 7:19 am
Posts: 7702
Location: Austria, Vienna
here is the binary:
http://buffalo.nas-central.org/download/terastation/uploads/busybox_1.4.0_enhanced_static_v2

here is the config (not that important, applet bbconfig prints the config anyway):
http://buffalo.nas-central.org/download/terastation/uploads/busybox_1.4.0_enhanced_static_v2_config

this busybox binary should work in any ppc-box regardless which firmware it uses.

Quote:
root@LINKSTATION:/mnt/ls_config/COMPILING/busybox-1.4.0# file busybox
busybox: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.2.0, statical
ly linked
, stripped
root@LINKSTATION:/mnt/ls_config/COMPILING/busybox-1.4.0# ./busybox
BusyBox v1.4.0 (2007-01-22 07:02:19 CST) multi-call binary
Copyright (C) 1998-2006 Â Erik Andersen, Rob Landley, and others.
Licensed under GPLv2. Â See source distribution for full notice.

Usage: busybox [function] [arguments]...
or: [function] [arguments]...

BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as!

Currently defined functions:
[, [[, addgroup, adduser, adjtimex, ar, arping, ash, basename, bbconfig,
bunzip2, bzcat, cal, cat, catv, chgrp, chmod, chown, chroot, chvt, cksum,
clear, cmp, comm, cp, cpio, crond, crontab, cut, date, dc, dd, deallocvt,
delgroup, deluser, df, diff, dirname, dmesg, dnsd, dos2unix, dpkg, dpkg-deb,
du, dumpkmap, echo, ed, eject, env, ether-wake, expr, fakeidentd, false,
fdisk, fold, free, freeramdisk, ftpget, ftpput, fuser, getopt, getty,
head, hexdump, hostid, hostname, httpd, id, ifconfig, ifdown, ifup, install,
ipcalc, ipcrm, ipcs, last, length, less, linux32, linux64, ln, loadfont,
loadkmap, logname, losetup, ls, lzmacat, makedevs, md5sum, mesg, mkdir,
mkfifo, mknod, mkswap, mktemp, more, mount, mountpoint, mv, nameif, nc,
netstat, nice, nohup, nslookup, od, openvt, patch, pidof, ping, ping6,
pipe_progress, pivot_root, printenv, printf, ps, pwd, rdate, readlink,
readprofile, realpath, renice, reset, resize, rm, rmdir, route, rpm, rpm2cpio,
run-parts, rx, sed, seq, setarch, setconsole, setkeycodes, setlogcons,
setsid, sha1sum, sleep, sort, start-stop-daemon, stat, strings, su, sulogin,
sum, swapoff, swapon, switch_root, sync, tail, taskset, tee, telnet, telnetd,
test, tftp, time, top, touch, tr, traceroute, true, tty, umount, uname,
uncompress, uniq, unix2dos, unlzma, unzip, uptime, usleep, uudecode, uuencode,
vi, vlock, watch, watchdog, wc, wget, which, who, whoami, xargs, yes,
zcip

_________________
LS1 (2.6 kernel, foonas svn1062, 750 GB, UBoot 1.2) & LS Pro (FreeLink/jtymod/GenLink, changes all the time)
Thx to all donators!


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Tue Jan 23, 2007 1:55 am 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
Thanks - I will grab that binary and update my shell script for setting up the links to work with this binary. As you say it can then be made available to any PPC box - Linkstation or TeraStation.


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Wed Jan 24, 2007 2:00 pm 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
I have updated my shell script for setting up Busybox links to work with the 1.4.0 binary that mindbender mentions above.

If you want to use this reviised busybox then
1. Get the file 'busybox_1.4.0_enhanced_static_v2' from the http://buffalo.nas-central.org/download/terastation/uploads/ download area
2. Put it in the /bin folder and make sure it is owned by root, and has permissions of 755
3. Get the Update_Busybox.sh_v2 file from the same area
4. Run the script and it will set up links for the options supported by the new busybox

The old busybox is left in place in case anything goes wrong so that you have a recovery path - but I would not expect anything to go wrong as the script runs fine on my systems. It should also run fine on any PPC based LinkStation ssytems if such users want to use the enhanced busybox.

In fact this busybox is bigger than is perhaps necessary as it also provides support for commands which have existing binaries on the teraStation/linkstation. The script does not create busybox links for such commands at the moment. The intention is to allow manual replacement of commands with links to see if the busybox option can replace the free-standing binary, and then if it can at a later date the script will be updated to set up the link in place of the free-standing binary.


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Thu Jan 25, 2007 5:29 am 
Offline
Newbie
User avatar

Joined: Thu Dec 14, 2006 9:24 pm
Posts: 46
Location: United States of America
I downloaded Busybox 1.4.0 and the update script and after I ran the update script I lost connectivity t my HG400LAN from http, telnet, dropbear and the client utility. Could it be something in busybox?


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Thu Jan 25, 2007 7:39 am 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
It obviously did! Did the shell script execute without any apparent error messages?

Something that occurs to me is that the current script removes any existing links for the following commands:
ip, ipaddr, iplink, iproute, iptunnel
This causes no problems on the TeraStation as it never had these commands in the first place, but may matter for the commands you mention. You can check that the original busybox supported them by using the command
Code:
 /bin/busybox

which will list commands supported. As long as they are there you can the try the following:
Code:
cd /bin
ln -s busybox ip
ln -s busybox ipaddr
ln -s busybox iplink
ln -s busybox iproute
ln -s busybox iptunnel


and this will re-instate these commands via the older busybox. However it surprises me that it would affect things like telnet unless it is affecting the allocation of IP address in some way.

Can you actually get in without re-flashing Freelink? If so, please let me know if that fixes things for you as I do not have a HG model to test against? I did test it against one of my LS1 systems and they had no adverse effects. I will anyway remove the commands from the script that removes these links without putting something in their place.


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Thu Jan 25, 2007 8:09 am 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
On further investigation I have found that the busybox upgrade script can fail if the original busybox did not support the 'ln' command. On the systems I was testing on the busybox command did so everything went OK. You would have got lots of error messages about the 'ln' command not being found if you were falling foul of this issue. As this would result in many commands being removed without a new version linked to the new busybox binary being put in their place this would have dire consequences.

I have uploaded a revised script file Update_Busybox.sh_v3 that removes the dependency on this assumption by using the ln support built into the new 1.4.0 binary instead.


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Thu Jan 25, 2007 3:04 pm 
Offline
Newbie
User avatar

Joined: Thu Dec 14, 2006 9:24 pm
Posts: 46
Location: United States of America
I didn't have any error messages while running the script. I had to reflash it though. One thing I noticed is that the Client Utility and the Web interface both found the HG first but the hostname was blank, then when I clicked search on the client utility i lost connectivity completily. I'm learning a lot the hard way!


Top
 Profile  
 
 Post subject: Re: Busybox
PostPosted: Sat Feb 17, 2007 9:18 am 
Offline
Moderator
User avatar

Joined: Tue Jul 26, 2005 5:22 pm
Posts: 1123
Location: United Kingdom
I have put both dynamic and static builds of the busybox 1.4.1 + patches release in the http://buffalo.nas-central.org/download/terastation/uploads/ area. I have also put the Update_Busybox.sh_v4 script there which sets up links using the static build (edit the line near the top to use the dynamic build if wanted)

Mindbender: I have added back the ip commands so that you can check if they are now fixed, but I am not linking them in via the Update_Busybox.sh_v4 script (at the moment at least).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Protected by Anti-Spam ACP
Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group