heyrick1973 -at- yahoo -dot- co -dot uk

You are not reading my b.log using HTTPS. You can switch to HTTPS by clicking here.

Neuros OSD - geeky tips and tricks

The topic today is a selection of tips and tricks you can perform using the Neuros OSD...

 

Yoo-hoo! Talk to me baby...

For a lot of this, we'll need to access the command line of the OSD. If you aren't a card-carrying geek of some description (yikes! why are you reading this b.log if you aren't a geek!? ☺) then it's pretty much like "the DOS prompt", not that rugrats whizzing around Windows7 and totally pwning their hapless parents will ever appreciate the arrangement of pixels that spells out the C:\> prompt...

There are three ways to access the command line. The first is the advanced tools part of the graphical user interface (hereafter called the "UI"). It has "awesome" factor, name me anything else that lets you prod its innards right there on the telly. Now look carefully at your remote control. Can you really envisage typing out commands using that? No? Me neither.
The second way is via the serial port. It is a basic 115kbit 8N1 link with no handshaking whatsoever. Don't worry if that meant nothing, we're not touching it. Serial link will be useful in the future for some specific boot-up fiddling that is invoked before the operating system proper, but given that an ever-increasing number of computers don't even have a serial port, we'll forget about it for now.

That leaves ethernet. Most modern computers have an ethernet socket. If you are British, it is the one that looks like a bigger version of the plug on the other end of your telephone (i.e. the bit that plugs into the phone, not the wall). If you are American, it looks like a phone socket. If you are something else or confused, it may be any number of cryptic weird symbols that is supposed to represent a network. Easiest advice, look at that big socket on the back of the OSD in the middle. Now find one that looks like it on your computer...
There are several ways you can connect this to your computer, all of which are beyond the scope of this article. The simplest is an ethernet router running a DHCP server - you ought to be able to get one of these for around £20 - but note that plugging the OSD into your ADSL box may well do the exact same thing!

The screenshots/instructions assume you are running the "OSDng" firmware.
The later "Arizona" firmware should be broadly similar, I cannot say about "Torfu" (the original firmware, your OSD may have had this when shipped... it may still...).

Once you have your OSD plugged into the network, the final thing you will need to know is your OSD's IP address. You could ask your router, but it's just as easy to ask the OSD. Just look in ToolsSettingsNetwork ... that means from the base menu of the OSD's interface, go to the Tools option, select the Settings option, then choose the Network option. What you see will look something like this:

The OSD with a DHCP assigned address
The top line is the IP address, the 192.168.0.12 (on my machine, yours may differ slightly). Remember this number!

 

Talk to me - on a budget

You can talk to your OSD with nothing more than a cross-over network cable. Simply set up your OSD to use a fixed IP address, in ToolsSettingsNetwork. Press the right arrow button to Configure network, then choose Specify a static IP address (advanced).

If you do not have any wired networking on your PC, then set the OSD to say the following:

Setting the OSD's IP address
and set your computer to use a fixed IP address to be 192.168.0.8 (actually, the last number can be anything from 1 to 254, except 12). For information on how to do this, under Windows it is best to select the "Help and Support" option of the Start menu, and look up "ip address". Click "Full text search matches" and choose the one that says "Configure TCP/IP for static addressing".
If you already have a wired network, you will need to slot the OSD into the existing setup. This is beyond the scope of this article.

Note that WiFi interfaces, while using TCP/IP networking, are distinct to the wired network, so it is perfectly possible to specify a fixed IP address for the OSD to talk to, while using WiFi for all your internet needs. Actually, that is exactly what I'm doing right now!
If you are unsure of this networking stuff, ask a local friendly geek - it's dead easy to set up a way to get your OSD and your computer talking (in other words: if you get charged anything at all, it should be no more than the cost of a jar of Nescafé...).

Here's a photo of a back-to-back connection. The OSD is directly connected to my computer, and the other box is a video capture box (for the screenshots). All of this is on the living room table.

Neuros OSD, Azumi, and Nyū

 

About the OSD and DHCP

[this section added 2010/09/05]

DHCP, in case you weren't aware, is the protocol by which a computer is automatically assigned an IP address at connection time. Most low-speed dial-up modem internet access works like this, and most WiFi access works like this too.
Your OSD can work with DHCP where getting the OSD on-line is little more than "plug it in".

However, if we want to talk to it, there is a big caveat, as explained by pfft2001 on the Neuros forum:

Let me add that even though your router does give out DHCP addresses (I say this because I don't think there are any routers commercially available that don't), you should always configure the OSD to have a fixed IP address. This is because (AFAICT) the OSD doesn't broadcast a recognizable "NETBIOS" name - so if you set it up with dynamic IP, you may not be able to find it from the other machines on your LAN.
In other words, if you don't know to OSD's IP address, it could be complicated to discover it. It is much better to run the device with a fixed IP address so you will always know where to access it.

[if this paragraph seemed like gibberish, I'll summarise: static IP good, DHCP bad. ☺]

 

Yoo-hoo, actually talk to me!

On Windows, go to the Command Prompt (or press Windows+R to open the "Run" dialogue) and issue the command:
telnet 192.168.0.1
(where 192.168.0.12 is replaced by your OSD's IP address)

All being well, you should see:

neuros login:

You should login, if for the first time, using the user name root and the password pablod

When you're in, it will look like:

neuros login: root
Password:
 
BusyBox v1.6.1 (2009-05-21 23:20:05 PDT) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
 
~ $

 

Change your password NOW!

That the Neuros' default password is pablod is not a secret. If you have the OSD hooked to an intranet router (in other words, to your own computer(s) and nothing else), then this may not be so important; however if your OSD is on an ADSL box, its security and safety are less assured, especially with a known default password and a device that announces exactly what it is...

Once you're logged in, simply issue the command

passwd
to change the root password. You'll need to type your new password twice, and it won't be displayed.
~ $ passwd
Changing password for root
New password:
Retype password:
Password for root changed by root
~ $
ABSOLUTELY do not forget your password!

 

Free space?

When you use the UI, if you Play.Browse you will see a hard-to-read (as in white on lightish-blue) bar showing the free space on the chosen device, be it SD card or USB key. I mean, like this:
Free space on an SD card (not a lot)
and this:
Free space on a USB device

Wouldn't it be nicer to get a slightly more detailed report for everything at once?

Possible!

At the command line, simply issue the command

df -h
and in typical Unixy fashion it will tell you rather more than you wanted to know, but the important stuff is there nonetheless.
~ $ df -h
Filesystem        Size    Used Available Use% Mounted on
none             15.5M    4.0k     15.5M   0% /boot
/dev/hda1       120.3M   77.4M     36.7M  68% /boot/external
/dev/loop0       43.0M   43.0M         0 100% /boot/new_root
/dev/loop1        9.7M    3.2M      6.0M  35% /boot/new_root_storage
/new_root        43.0M   43.0M         0 100% /
/dev/loop2     1003.0k  213.0k    739.0k  22% /mnt/OSD
tmpfs           256.0k   52.0k    204.0k  20% /mnt/tmpfs
/dev/hda1       120.3M   77.4M     36.7M  68% /mnt/tmpfs/mount_CF-card
/dev/mmcblk0p1    3.7G    3.7G     32.6M  99% /mnt/tmpfs/mount_SD-card
/dev/sda          7.5G  751.8M      6.7G  10% /mnt/tmpfs/mount_USB
~ $

The two entries at the end are the important ones. I can tell, just at a glance, that my SD card (3.7Gb, so it'll be a 4Gb card) has a paltry 32.6Mb free space, in other words it is full. My USB device (7.5Gb, so it is an 8Gb flash key) has a whopping 6.7Gb free, with only 10% used. I can record stuff on this...

Pay attention to the /dev/blahblah stuff on the left, because...

 

Device dismount

You can just pull out the USB device, or SD card. But if you end up with damaged files, that's your bad luck. It is always better to dismount the device. The fancy-GUI way is to highlight the device in Play.Browse, press the Xi key and select Eject.
This, of course, presupposes you have a TV on, you are able to change to the OSD's output, you can find the remote...

Enter the "umount" command. You see, "mount", well, mounts devices. It's like mounting a horse really, you stick in your SD card and you tell the machine to sit on it. Actually, the sitting on part happens automatically on the OSD so you don't need to worry about that part. But to unsit on the horse, you need to unmount it.
Now, of course, you might be thinking "if it is a command to unmount, why is it called umount and not unmount?". Very good question. The answer? Because Unix is like that. (the brand of Debian Linux running on the OSD is basically a modern-day Unix-alike) It will drive you insane for the want of one letter.

Remember I said remember the slash-dev stuff from above? You'll need to tell the u(n!)mount command what to unmount by specifying a device, namely:

  • SD card - /dev/mmcblk0p1 (that's zero-pee-one)
  • USB device - /dev/sda
So the command to unmount the USB making it safe to remove is
~ $ umount /dev/sda

Nothing will appear to happen. Don't worry, Unix is like that too. Don't expect cute "it is now safe to remove..." messages. That would be too much like friendly. But if you issue the df -h command again, you'll see it no longer listed.

Now you can remove the device... safely.

 

Radio? Piece of cake...

Well, not so much radio as internet radio. But in a nutshell, if it is on Shoutcast, it can be on your OSD.
While OSDng contains a Shoutcast player, I found the player to be somewhat lacking (limited choice of channels, not to mention frequently hanging). But fear not, there's an easier option!
Just issue the command:
xmms2 add http://server3.kawaii-radio.net:9000
After a few moments, you'll get an acknowledgement. Then say:
xmms2 play
and within moments you'll hear your radio channel.
Accordingly, you can stop the music with:
xmms2 stop

If you wish to see the status, namely the title of the current song, just ask:

xmms2 status
You'll notice that the command line does not come back. You'll be left looking at the status display until you press Ctrl and C (hereafter called ^C).
Note that the status is not entirely correct. The time counts up from when you started playing, and the "of" is always zero. But at least you can see what's playing.

Here's a look at all of this in action:

~ $ xmms2 add http://server3.kawaii-radio.net:9000
Added http://server3.kawaii-radio.net:9000
~ $ xmms2 play
~ $ xmms2 status
 
Playing: [stream] Iwasaki Taku - Kou no Kodou (Angel He...: 02:11 of 00:00
Playing: [stream] Mitsuru Hongo - Bus ha Yuku Yuku Yume...: 06:13 of 00:00
Playing: [stream] Yuzuki - you - Visionen im Spiegel (H...: 09:54 of 00:00
Playing: [stream] Utada Hikaru - Beautiful World (Evang...: 10:16 of 00:00
(remember, ^C to get your command line back)

 

Kawaii-Radio plays Japanese music, with a heavy emphasis on animé tunes. If that isn't your thing, you could always try:

  • Sky.FM 80s - for music from the 80s!
    http://scfire-dtc-aa02.stream.aol.com:80/stream/1013
  • BirdsongRadio - authentic tweety birds all day long!
    http://chill.wavestreamer.com:8062/

How to find the information for a radio channel...
The simplest way, if it is bookmarked on your PC, is to look for the link information in your player (I use WinAMP). This is usually available under something like "Edit bookmarks".
Otherwise, go to the Shoutcast website and look for interesting stations. You see those little yellow "Tune in!" buttons?
Right-click the button and "Save target as" (or similar wording) to save the resultant file to your harddisc. This is important, for if you just click it, your .pls handler will most likely load and tune to that channel automatically.
Go to where your downloads are kept, right-click the file (they're always called "tunein-station.pls") and open it in Notepad (you may need to "Open with..." and choose Notepad.

It will look like this:

   [playlist]
   numberofentries=1
   File1=http://69.162.101.49:8000
   Title1=(#1 - 94/100) AnimeNfo Radio  | Serving you the best Anime music!
   Length1=-1
   Version=2
And there you have it, http://69.162.101.49:8000 - just pass that to xmms2.

 

xmms2 is capable of handling WMA, WAV, Ogg/Vorbis, MP3, MPEG audio (as in DVDs), MP4/AAC, FLAC, and reading ID3 tags, plus popular playlist files (.m3u, .pls...).

xmms2 has a number of playlist features that are woeful when accessed through the UI. I will discuss these at a later time.

 

Reboot your OSD

There's an option to do this somewhere in the UI, but to be honest it is so much simpler to telnet in and say:
reboot

Seriously. That's it!

Wait - why not just pull the power cord? There's a simple reason for this. You wouldn't pull the plug on your computer would you? Doing that could corrupt your harddisc and cause all sorts of chaos.
Well, the thing is once you are using the CF card you are using an actual mounted filesystem instead of simply reading things from Flash. Moreso when using OSDng which resides entirely on read/write storage as a proper filesystem. Don't forget, of course, that a CF card is like a flashised form of an IDE device. So don't assume, just because it is a little thing stuck in your OSD, that is isn't a vulnerable device.
Shut down responsibly.

 

Schedule sanity

One thing that really bugs me is a lot of equipment offers a schedule, but remarkably little equipment offers a way to tell what the schedule is. Consider:
  15/05/2010 20:59 - 22:01 [weekly]
  13/05/2010 22:59 - 00:01 [weekly]
  13/05/2010 21:29 - 22:01 [weekly]
  10/05/2010 20:59 - 22:01 [weekly]
  08/05/2010 20:59 - 22:01 [weekly]
  08/05/2010 17:59 - 18:46 [weekly]
What's wrong? Well, what day is the 10th? What time is it? Okay, now what is it?

Using the OSD, you can assign filenames to recordings, so not only do recordings assume a logical filename (instead of either osd or osd-with-date-suffix), but when looking at the schedule you know immediately what is what...

The OSD's schedule with programme names
(I just wish the regional choices offered options other than the American mm/dd/yyyy format which seems to be fairly well hardwired into the software, just look at setting the date, or a schedule)

Sadly there is (yet?) no way to interrogate or edit the schedule database via telnet.

 

Walk around the filesystem (the painful way)

Telnet in, start looking. ☺

If you're used to the likes of the DOS/Windows system, you'll need to know a few commands. The first is:

ls
This lists the contents of the current folder, or the folder specified. It is akin to the DOS dir command. You can use the options -l to provide a long listing (gives information on the files), and -h to provide human-readable sizes, like "556.3M" instead of "583367939" ... you've seen this already, in the df -h command mentioned above.

If you enter:

ls / -l -h
you will see:
~ $ ls / -l -h
drwxrwxr-x  1 root root   1.1k Jan  1  1970 bin
drwxrwxrwt  7 root root    160 Jan  1  1970 boot
drwxr-xr-x  2 root root   1.0k Jan  1  1970 dev
drwxr-xr-x  4 1000 1000   1.0k May  8 16:10 etc
drwxrwxr-x  1 root root   4.6k Jan  1  1970 lib
lrwxrwxrwx  1 root root     11 Jan  1  1970 linuxrc -> bin/busybox
drwx------  2 root root  12.0k May  8 16:03 lost+found
lrwxrwxrwx  1 root root     16 Jan  1  1970 media -> /mnt/tmpfs/media
drwxr-xr-x  3 root root   1.0k Jan  1  1970 mnt
drwxr-xr-x  3 root root   1.0k May  8 17:11 opt
dr-xr-xr-x 72 root root      0 Jan  1  1970 proc
drwxr-xr-x  2 root root   1.0k May  8 16:11 root
drwxr-xr-x  2 1000 1000   1.0k May  8 16:10 sbin
drwxr-xr-x 10 root root      0 Jan  1  1970 sys
lrwxrwxrwx  1 root root     14 Jan  1  1970 tmp -> /mnt/tmpfs/tmp
drwxr-xr-x  5 1000 1000   1.0k Jun 16  2009 usr
lrwxrwxrwx  1 root root     14 Jan  1  1970 var -> /mnt/tmpfs/var
~ $

The left nonsense is the file permissions. You can mostly ignore this, except for the leftmost character, which is d for a directory (folder), l for a hard link, s for a symbolic link, and - for a file.
Then are numbers and something that'll probably say "root" twice. Ignore this, it's ownership information, not really relevant on the OSD.
Next, the file size. If in 'pretty' form, it will be a managable number followed by k for kilobytes or M for megabytes.
Then follows the date. The start of Unix time is the 1st of January 1970, so files that pretty much don't have a specific time will say this.
Finally, the name of the item in question. Remember, Unix is case sensitive so while "windows", "Windows" and "WINDOWS" may be the same thing on a DOS/Windows computer, it would be three different things on a Unix machine.

But wait, what's that arrow-something-else all about?
Ah... There, my friend, is a symlink (hard or symbolic link). If you've grown up used to the DOS system, this will be new to you. In a nutshell, if you look at the example above you will see that var is followed by /mnt/tmpfs/var which means that if you go to the var directory, you'll be magically teleported to the /mnt/tmpfs/var directory instead.

Wanna have some fun? You can symlink files too. There's a clever bit of software called "Busybox" that does a myriad of different things depending on what you call it. So try:

ls /bin -l
and you will see that most things redirect to the busybox program. This is frequently used in embedded devices as we now only need one progam (which can share a lot of code) to do the job of dozens of disparate programs. There's a fair savings to be had. To give an example from the real ARM Debian... cp = 55052, gzip = 61288, ls = 79920, mount = 75316, tar = 235608... which adds up to 495 kilobytes, which is more than the busybox's meagre 444 kilobytes that does all that plus loads more. I'd estimate you're saving over a megabyte with busybox, which is a lot when you consider the flash is only 16Mb.

Thing is, if you just do:

ls
then nothing happens. What gives?

There's nothing wrong. You are in the /root directory, and it's empty. You are root, /root is your home, where you go to when you log in. That's what the wiggly line (~) means.

In order to break out, try:

cd /
ls
and you will see the short form listing of the root of the filesystem. That's the magic command, cd, meaning Change Directory.

Grew up with DOS? Forget all about it. Under Unix there is no C: and D: and your CD-ROMs won't ever be E: and your SD cards won't be G:.
No. There is only /. That slash is God. From that point lays forth the entire filesystem. It doesn't matter if it is split across partitions or harddiscs (not uncommon) or devices or even networked to the far side of the planet. Hell, it doesn't even have to be in anything even remotely like the same physical format, never mind logical (disc) format. So long as it has files and folders and is understood by the operating system, it all comes to rest under the mighty slash. End of.

Here's a crash course to where you'll find stuff:

/ In the beginning there was lightslash.
/bin Essential user programs everybody needs access to.
/boot Start-up stuff. This is so not a playground.
/dev Unix sees the world through "devices". They're all in here. Most of them aren't real, just a way to interact with the driver of said device.
/etc System-wide configuration stuff. Being Unix, they named it after et cetera instead of something logical like, oh, I dunno... config?
/lib System libraries (for /bin and /sbin).
/lost+found To do with disc integrity scanning (like "scandisk", only it actually works).
/media Mount points for removable media, USB cards and the like.
(it is actually a symlink into...)
/mnt Temporarily mounted filesystems go here.
/opt For "optional" software. The OSD UI is in here.
/proc Like /dev, this is a non-real filesystem that is supposed to provide information on the system as text files... but they're all empty files. It is in /sys now.
/root Your 'home' directory.
/sbin Essential system programs.
/sys Complex yet informative "virtual" filesystem describing the hardware, the processes, and so on.
/tmp Temporary files.
/usr A place to stuff user data and programs so's not to clutter up the base system. Contains:
/usr/bin User programs, the unessential ones.
/usr/lib Libraries for user programs.
/usr/sbin Systems programs, the unessentials...
/var Log files, lock files, status files, and all sorts of variable randomness.

 

Walk around the filesystem (the pretty way)

For looking around, for "seeing what's there", and generally being nosy, you can do better. How about a web server that lists the contents of the directories? Actually... not difficult...

Give the following commands:

cd /etc/lighttpd
vi lighttpd.conf

You should see something more or less like this:

#1.0
server.document-root = "/media/"
server.port = 80
server.errorlog = "/dev/null"
server.follow-symlink = "enable"

mimetype.assign = (
".asc"          =>      "text/plain",
".asf"          =>      "application/vnd.ms-asf",
".asx"          =>      "application/vnd.ms-asf",
".avi"          =>      "video/x-msvideo",
".flv"          =>      "video/x-flv",
".gif"          =>      "image/gif",
".html"         =>      "text/html",
".htm"          =>      "text/html",
".jpeg"         =>      "image/jpeg",
".jpg"          =>      "image/jpeg",
".m4a"          =>      "audio/mp4",
".m4b"          =>      "audio/mp4",
".mov"          =>      "video/quicktime",
".mp3"          =>      "audio/mpeg",
".mp4"          =>      "video/mp4",
".mpeg"         =>      "video/mpeg",
".mpg"          =>      "video/mpeg",
- lighttpd.conf.orig 1/39 2%
Now pay attention because vi is a sod to use. The world on the PC went the route of basic cursor driven editors. The Unix world likes vi, which is extremely powerful, yet extremely frustrating. Like most things Unix.

Move your cursor (using the arrows) until the blinking cursor is below the speech marks at the end of the word "/media/" on the second line.
Press i once. Nothing will appear to happen, but you are now in insert mode.
Press Delete until the word media is gone, and you are left with a single slash character.

Move down to the blank line under "server.follow-symlink" and press Enter once, to add a blank line. Move up so what you write next will follow on from the previous stuff.
Enter, exactly:

dir-listing.activate = "enable"

Your modified file should look like this:

#1.0
server.document-root = "/"
server.port = 80
server.errorlog = "/dev/null"
server.follow-symlink = "enable"
dir-listing.activate = "enable"

mimetype.assign = (
".asc"          =>      "text/plain",
".asf"          =>      "application/vnd.ms-asf",
".asx"          =>      "application/vnd.ms-asf",
".avi"          =>      "video/x-msvideo",
".flv"          =>      "video/x-flv",
".gif"          =>      "image/gif",
".html"         =>      "text/html",
".htm"          =>      "text/html",
".jpeg"         =>      "image/jpeg",
".jpg"          =>      "image/jpeg",
".m4a"          =>      "audio/mp4",
".m4b"          =>      "audio/mp4",
".mov"          =>      "video/quicktime",
".mp3"          =>      "audio/mpeg",
".mp4"          =>      "video/mp4",
".mpeg"         =>      "video/mpeg",
- lighttpd.conf 1/40 2%

Now go down. Down, down, off the screen (it will scroll) until you reach the line where everything else is set to "application/octet-stream".
Go and delete those words. You dont want "application/octet-stream", you want text/plain, so type that in instead. It will now look like:

# make the default mime type application/octet-stream.
""              =>      "text/plain"

Press Esc, then type in exactly:

:wq
and press Enter.

You'll be back at the command prompt. There are two more commands to go. The first is:

cp lighttpd.conf /mnt/OSD/sysconfig/
(remember, case is important so "OSD" must be in caps)

Finally, issue:

reboot
and wait for it to restart.

 

Now point your browser to the OSD...

The OSD's web server showing directories and their contents.

To look at what we actually did...
  • Replacing "/media/" with "/" means we can see/access everything, not just a selected portion.
  • Adding the "dir-listing.activate" means we now see directories when there is nothing else to serve. If you put an index.html file in there, it would be served instead.
  • And finally, the "text/plain" thing is important. It attempts to force the server to send everything otherwise untyped (i.e. not a JPEG or HTML etc) to the server as plain text instead of an octet-stream.
Why does that last one matter? Because for octet streams, you will be offered a download prompt. It is a pain to download, find, and load a script when you just want to read it. By setting the type to text/plain, we are saying to the browser "just show me this". And so it does...
Reading a script file in your browser.

If you happen upon clicking an application, what happens next depends upon your browser. Some will try to show it, some will override the type specified and offer up the "save as" dialogue.
If it looks like gibberish, most likely with the word "ELF" buried in the beginning, it is probably an executable. You can't really read that (well, you can, but there's no point) so hit the back button and pick something else!

 

FAT device verification

One of the annoying things about the OSD is that it has no built-in way to check the integrity of DOS-based filesystems. I say annoying because anybody who uses FAT devices will know that Scandisk is worse than useless, while Chkdsk does let some rather nasty stuff pass - my favourite is a mismatch of the free space map, so Windows will tell you you've got gigabytes free, while everything else will tell you you've got six megabytes free.

Time to fix this.

This modification installs software which can alter critical parts of a FAT based device.
USE IT AT YOUR OWN RISK.

The first step is to install the dosfsck program. Now, if you don't trust me, you should look for the Debian-etch version for the ARM architecture. Then work out how to get it out of a .deb file (for the OSD has no .deb installer).
Or you can download it from here!

This file should be placed in the /sbin directory. There are two ways, depending on whether or not your OSD is online...

If your OSD is online, the following should do it:

cd /sbin
wget http://www.heyrick.co.uk/blog/files/dosfsck

If your OSD is not online, or the above gives weird errors, then download it to your computer as normal. Copy it to the root folder of a USB flash device. Put that flash device into your OSD, then:

cd /media/USB
cp dosfsck /sbin/
cd /sbin

You're not quite ready, the OSD will refuse to run it. To fix this, say:

chmod 775 dosfsck
This alters the file permissions to tell the OSD that it's a file you can run.

The final part of the puzzle is to set up some symlinks. I'm not sure what the purpose of these is, exactly, but it isn't hard to do...

ln -s dosfsck fsck.msdos
ln -s dosfsck fsck.vfat

Okay, you're done. Time to test drive it. If you give the options -v -n, it will simply look (and not alter anything) and report verbosely.
For example:

dosfsck -v -n /dev/mmcblk0p1
(note that you must refer to devices by their device name - use the df command if you don't remember...)
will result in this:
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "        "
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
     32768 bytes per cluster
      6304 reserved sectors
First FAT starts at byte 3227648 (sector 6304)
         2 FATs, 32 bit entries
    483328 bytes per FAT (= 944 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 4194304 (sector 8192)
    120752 data clusters (3956801536 bytes)
63 sectors/track, 128 heads
      8192 hidden sectors
   7736320 sectors total
Checking for unused clusters.
Checking free cluster summary.
/dev/mmcblk0p1: 82 files, 119709/120752 clusters

However, please note that this requires memory for indexing context and content, so if you hit it with a big device, it will fail...

/sbin $ dosfsck -v -n /dev/sda
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "MSDOS5.0"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
      4096 bytes per cluster
        34 reserved sectors
First FAT starts at byte 17408 (sector 34)
         2 FATs, 32 bit entries
   7818752 bytes per FAT (= 15271 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 15654912 (sector 30576)
   1954578 data clusters (8005951488 bytes)
63 sectors/track, 255 heads
         0 hidden sectors
  15667201 sectors total
malloc:Cannot allocate memory
/sbin $
What went wrong? Well, if you look closely the first (4Gb SD) device offers clusters that are 32K in size. There are 120,752 clusters.
The second (8Gb USB) device is more advanced, offering 4K clusters, but with the downside that there's now 1,954,578 - considerably more! And your OSD has how much memory?

It seems to be okay with smaller devices, say 4Mb and under, even if cluttered. To check out those large ones, you'll need to use your desktop machine. If you fancy a fun and frivolous weekend, you can install a complete live working copy of Ubuntu on to a USB device (or SD card, in my case!) and get your computer to boot from it. Geek points a-plenty for that exercise! All that to check out a storage device? Well, why not? It beats reading forums for the day...

This last little exercise is especially impressive as we've cobbled together a precompiled executable for an ARM-based version of Linux within our OSD, and got it to work.
Now, there are a myriad of potential problems as the version of Linux in the OSD runs to around 20Mb, while a real ARM install of Debian runs to 100Mb more than that. So as you can see, a lot of stuff has been pared out of the OSD's version.
That said, there's several thousand software packages. I've got one to work, what will you pick? Begin your adventure! (don't forget, ARM builds only!)

 

Your comments:

Please note that while I check this page every so often, I am not able to control what users write; therefore I disclaim all liability for unpleasant and/or infringing and/or defamatory material. Undesired content will be removed as soon as it is noticed. By leaving a comment, you agree not to post material that is illegal or in bad taste, and you should be aware that the time and your IP address are both recorded, should it be necessary to find out who you are. Oh, and don't bother trying to inline HTML. I'm not that stupid! ☺
 
You can now follow comment additions with the comment RSS feed. This is distinct from the b.log RSS feed, so you can subscribe to one or both as you wish.

No comments yet... why not post one now?

Add a comment (v0.08) [help?] . . . try the comment feed!
Your name
Your email (optional)
Validation Are you real? Please type 04469 backwards.
Your comment
Calendar
«   May 2010   »
MonTueWedThuFriSatSun
     1
34569
1011131516
18192223
242526272930
31      

Japan - can you help?
Japanese Red Cross
日本 赤十字社

Earthquake relief donations have closed.

Read about the JRC
Make a general donation

Last 5 entries

List all b.log entries

Return to the site index

Search

Search Rick's b.log!

Etc...

Thank you:
  • Fred
  • Bernard
  • Michael
  • David

Last read at 08:18 on 2017/11/22.

QR code


Valid HTML 4.01 Transitional
Valid CSS
Valid RSS 2.0

 

© 2010 Rick Murray
This web page is licenced for your personal, private, non-commercial use only. No automated processing by advertising systems is permitted.
RIPA notice: No consent is given for interception of page transmission.

 

Have you noticed the watermarks on pictures?
Next entry - 2010/05/12
Return to top of page