Showing posts with label BusyBox. Show all posts
Showing posts with label BusyBox. Show all posts

Tuesday, September 3, 2013

the "vi" built into busybox-1.16.1 on my Synology DiskStation DS213+ just fooled me

I was trying to find an occurrence of /lib/cpp in a log file, and I wanted to avoid using '/' in a regexp, so I tried 'lib.' instead. But that didn't match the obvious occurrence. I executed a ":set magic"; the command got accepted, but that still didn't change its behaviour. Installed VIM, tried the same, and everything worked as expected. Still a little frustrating. It looked like I am loosing even my basic VI competence.

Expecting Sven G.'s "like it" on FB…

Thursday, August 29, 2013

my new "mobile NAS": Synology DS112+

DS112+ Products - Synology Inc. Network Attached Storage


Installation procedure from CD-ROM:
  • you are starting with a DiskStation with a bare disk, i.e. no DSM (the DS Management system)
  • mount the supplied CD-ROM
  • mount DSAssistant-SYNOLOGY_….dmg from the CD-ROM
  • run the assistant App from there
  • the assistant App helps you installing the DSM, either from a  DSM_DS112+_….pat file (around 40 MB large) on the CD-ROM (it comes with DSM-4.1) or from a file you download from the Synology website (bleeding edge: DSM-4.3)
  • that includes formatting the hard disk
Installation procedure following following the quick set up leaflet:
  • surf to find.synology.com
  • it is meant to discover all reachable Synology DiskStations
  • in this situation it does not find the DiskStation in question (running a DSM)
  • it points you to DSAssistant-SYNOLOGY_….dmg, to be downloaded from the Synology website
  • mount the downloaded DSAssistant-SYNOLOGY_….dmg
  • run the assistant App from there
Because I had temporary trouble accessing the supplied CD-ROM, I had to download the DSAssistant…, but I used the DSM-4.1 on the CD-ROM. That decision was unreasonable and done a little too fast, as I seriously intended to operate using DSM-4.3. So in the meantime I downloaded DSM-4.3, and after having set up DSM-4.1 entirely and properly, I set up DSM-4.3.

Further steps:
  • setting up a personal user account
  • allowing SSH access
  • SSH log-in in using the root account
  • modifying /etc/passwd to allow shell login for the user accounts in question (the resp. record has a "nologin" instead of a proper shell path)
Further steps:
  • I followed the instructions listed in my own "my new NAS (…): Synology DS213+" (taken from somewhere else and my own experience)
  • install the ipkg installation system
  • install a proper rsync through ipkg; I will have to call this rsync as /opt/bin/rsync from now on
  • "standard standard" installation is broken for the DS112+, but the wiki page describes the actual standard procedure including a fix in some bootstrap.sh
  • commenting out the standard PATH setting in ~root/.profile and ~MY_ACCOUNT/.profile
  • my first personal rsync-s to the DiskStation

Saturday, March 2, 2013

my new NAS (and so much more): Synology DS213+

DS213+ Products - Synology Inc. Network Attached Storage

The box makes itself known as diskstation.local resp. DiskStation on my LAN. (Reliability …)

Of course it deserves a "1 Gbit/s" on my FRITZ!Box.

The box's OS is BusyBox; here are a few more details:


DiskStation> uname -a
Linux DiskStation 2.6.32.12 #2668 SMP Tue Dec 11 13:01:16 CST 2012 ppc GNU/Linux synology_qoriq_213+


I enabled SSH access for my personal user account rather soon, but the SSH login was not instantly successful. I tried "ssh -v", and from there the login seriously looked, as if it was almost successful. My web research wasn't successful either. Rather desperately I enabled "telnet access"; I tried to log in, and this was the result:
login: can't run /sbin/nologin: No such file or directory
It was clear then, that the default shell in the /etc/passwd entry for my user account was in my way /sbin/nologin so far. I made /bin/ash the default shell and everything was fine. Of course, I disabled telnet access again thereafter. And of course, once I added "nologin" to my web query, I found a few articles describing the issue.

SCP works; "rsync over ssh" (with my personal user account) does not work yet:

$ rsync -va --rsh='ssh -l root' /etc/motd diskstation:tmp/ # works$ rsync -va /etc/motd diskstation:tmp/ # fails
sending incremental file list
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(1034) [Receiver=3.0.8]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.8]
Fiddling with /etc/ssh/sshd_config – I really don't know, what to change in order to overcome this obstacle.


Perl is not part of its standard equipment, but Python apparently is,

Through their Download Center I found this FTP server link. You can find various software for their boxes on their. There are also Perl installation packages, but the ones I tried are not for the current firmware release of "my" box, and in a way I am not up for an upgrade to beta software for my NAS.

(For now I summarised here everything I have tried so far, so I will be able to procede from here.)

A few more links:
There are suggestions on the wiki(s) to install ipkg (yet another packaging system, not officially supported by Synology), and to install another rsync through ipkg. I may consider this, but I am not yet sure. I am quite able to use rsync (over ssh) as user root, but I am not with my personal account. I have no clue, what rights it needs, to allow my personal account to work as smoothly as user root. (To Be Solved!)

To be continued …

Monday, October 25, 2010

yet another posting of mine on the FRITZ!Boxes

Somebody asked me a few questions regarding the FRITZ!Boxes, and I think, it makes sense to answer them here on this blog.

No, I haven't been digging into the FRITZ!Boxes "at levels well below the standard web UI".

There is no SSH server, that comes with the FRITZ!Boxes.There are private web-sites, where you can find a ready-made dropbear SSH server. I got mine that way. And a gkrellmd as well.

There should be a way, to create yourself a development system targeted towards the "busybox" on your particular FRITZ!Box, but there are various slightly different processors being employed. I wasn't successful there, when I tried. There is ip-phone-forum.de, where the FRITZ!Boxes get discussed a lot, but the preferred language there is German, although they would most certainly try to answer question, that people ask in English.But the threads are mostly in German. Be aware, that the main community for the FRITZ!Boxes is located in Germany and I guess also in Austria and in Switzlerland. You may also find a HOWTO, that explains how to set up a development environment.
But actually ... - see above!

The "international" 7390 "speaks" English, but I don't think, there a lot on frequent firmware updates for it. They only provide frequent firmware updates for their resp. battleship, and that is "certainly" not the *international* version of the 7390 but the "German" version -- but how do I actually know? I don't own an international 7390, I only brought one to Martinique and saw it working for like 2 weeks.

I assume the firewall on the FRITZ!Boxes is homegrown.

What tools and languages are available?
Well, basically they use the "busybox" software and what is built into that.
Nowadays there is also a "lua" interpreter provided. AVM seem to use that for CGI purposes.
perl etc. are regarded far to resource hungry.

Thursday, October 29, 2009

creating phone book and diary entries from incoming calls on my router

If you read this title, how mad do you think I am? Honest!

Alright, "as you know" (so of course this article only applies to some sort of computer nerds), my router is a FRITZ!Box 7270, it's also the base station for my (wireless) phones, and a lot more ... -- certainly one of my most important toys or gadgets. And I have 2 of them, one for at home, one for anywhere outside, where I can only connect to the Internet through UMTS.

So alright, back to the title of this article!

  • It's nice to record your incoming and outgoing calls in your diary, right? (my diary is emacs style)
  • It's nice to get something descriptive displayed on your phone, when somebody calls, right?
  • It's nice to extend your phone book through time as easily as possible, right?

Well, my router is running Linux as its operating system kernel, and BusyBox on top of it. On each incoming phone call it runs a shell script with a few parameters, of course the caller's phone# (if available) and also the callee's phone#. (I do have more than one phone#, and why not also record the called phone#, just for the record?) It tries to associate a name with the caller's phone#, if there is a matching entry in the phone book.

Quite a while ago I started implementing such a shell script, and obviously (as it is almost an ordinary (bash) shell script), I can develop and test it on any of my computers, that can run shell scripts, like any of my openSuSE computers, any WinXP computer running cygwin, a Mac running OS X, ... . Yes, I cannot create a full blown shell script, I will not pipe a lot through one-liner perl or ruby scripts on my router, but still: it's a handy and useful, not so tiny shell script.

So far it appears to me, as if no such executable gets called on the router for outgoing calls, but I can still mimic this behaviour by calling that script on my main development box.

Having said this, my script (fritz_box_calllog.sh) fulfills all the requirements, that I listed above in that bullet list.
For incoming calls without caller id and/or without a matching entry in the phone book it creates a piece of XML text, that I can paste into my FRITZ!Box XML phone book, and where I can fill in a phone# and a name or any descriptive text, so next time, I want to dial that phone# myself, I can select it from the phone book. And maybe another time that person will call you with caller id, and then you will be able to greet that person with her/his name. Wouldn't that be nice?

The implementation of this software also got inspired by Matthias Hühne's "Dial!Fritz", that I run on my iPhone. But of course his software is far completer and nicer, and it's well integrated.

Thursday, December 18, 2008

a recent book acquisition: Building Embedded Linux Systems

I am quiet curious to use busybox in one of our cars, or just to understand better, how I can make advanced use of the busybox in my DSL router.

Wednesday, December 3, 2008

First steps for Linux on iPhone with BusyBox

After I had read this article last weekend, I forwarded it to one of the engineers at my current customer's company. That company is in an automotive niche market, and he had already spent work time on an attempt establishing Linux within one of their projects. Actually Linux is being employed in one of the screen based user interfaces on a car, but as opposed to the Linux iPhone approach it's not BusyBox based.

I actually came across BusyBox only this year, but that's only because embedded programming hasn't been on my agenda for a while.
That other context, where BusyBox is being employed, is my Internet router, an AVM 7270, actually also serving as cordless phone (DEC) base station, Fax recipient and PDF converter, WLAN access point, ...
So that box is also BusyBox based, and I can connect to it using telnet, and I can store and read data on it, and I like that.

If you are interested in Building Embedded Linux Systems, have a look at this nice book published by O'Reilly!