Bifferboard and auto-usb mounting

130 views
Skip to first unread message

lee jones

unread,
Sep 11, 2012, 4:37:02 PM9/11/12
to biffe...@googlegroups.com
Hello all :)

A While back I posted here (some months back possibly at the start of the year) I was having communiction problems with my BB. Well, to cut a long story short I managed to get a new serial cable and everything seems to be ok again. I was also going to run slackware off a USB stick instead of using the openwrt on flash but I'm finding openwrt might need to do what I need in the end without running slackware.

(Note: old message can be found here http://groups.google.com/group/bifferboard/browse_thread/thread/12064f1914cdbb1b/580dbe50e8db0d77?q=ljones&lnk=ol& and here http://groups.google.com/group/bifferboard/browse_thread/thread/76ecd90271f7a812/dd4d6c5389e43f18?lnk=gst&q=ljones#dd4d6c5389e43f18 ) .

The original idea was to install slackware, then lighttpd, sqlite, php and chyrp. However I now see that openwrt already has a http server running and set up as default, it uses uhttpd, so all I need now is squite, php and chyrp. :)

However the BB's storage on flash is pretty small so I'm wanting to use an external USB stick to hold data -- mainly for the web server uhttpd. Uhttpd however on the BB seems to hold its dats in /www, which is on the flash chip (and dosen't have much space!).

What I'm hoping to do is to create a symbolic link over across to the USB stick so that /www on the flash memory points to somewhere on a USB stick. The only problem I'm having is I'm not sure on how to have the USB stick automount.

I've tried mounting it in /etc/rc.local but have a problem -- because it takes some time for the BB to recognise the USB stick it gets found by the BB too late. I think what is happening is uhttpd is starting up before the USB stick is found so uhttpd never finds its /www  ( the /www directory on the BB flash is linked over to the USB stick which shows up on the BB as /dev/sda1).

Which file should I modify to wait for the USB stick and then auto mount it? :)

thanks

ljones

Kyle Gordon

unread,
Sep 11, 2012, 5:00:00 PM9/11/12
to biffe...@googlegroups.com
I use the following in /etc/config/fstab to automount a memory stick...

root@weather1:~# cat /etc/config/fstab
config global automount
option from_fstab 1
option anon_mount 1

config global autoswap
option from_fstab 1
option anon_swap 0

config mount
option target /home
option device /dev/sda1
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 0

It's always been there when I need it... I don't know what delays are
involved but it might be worth a shot. The info comes from
http://wiki.openwrt.org/doc/uci/fstab if that's of any use.

Regards

Kyle
> --
> To unsubscribe send email to bifferboard...@googlegroups.com



--
Kyle Gordon - 2M1DIQ
Web: http://lodge.glasgownet.com
Jabber/Email/SIP: ky...@lodge.glasgownet.com

lee jones

unread,
Sep 12, 2012, 6:13:04 AM9/12/12
to biffe...@googlegroups.com
Only snag there is that the fstab needs something called "block-mount"
which can't be installed.

Here's what I get;


root@OpenWrt:/tmp# opkg install block-mount
Installing block-mount (0.2.0-8) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/rdc/packages/block-mount_0.2.0-8_rdc.ipk.
Installing blkid (2.21.2-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/rdc/packages/blkid_2.21.2-1_rdc.ipk.
Collected errors:
* check_data_file_clashes: Package blkid wants to install file /sbin/blkid
But that file is already provided by package * busybox
* opkg_install_cmd: Cannot install package block-mount.
root@OpenWrt:/tmp#


The BB software already has blkid, but not block-mount (and /etc/init.d/fstab !)

ljones
:)

SP

lee jones

unread,
Sep 20, 2012, 1:43:44 PM9/20/12
to biffe...@googlegroups.com
Anyone got any ideas about this at all? Prehaps I have an old version.
Or maybe there's some way of running openwrt straight off USB?

ljones
--
:)

SP

Nicolas Le Falher

unread,
Sep 20, 2012, 2:46:29 PM9/20/12
to biffe...@googlegroups.com
Hi,

Are you using factory image ?
If yes, why not try to compile your own image (from BB git or from Openwrt trunk) ?

Nicolas

lee jones

unread,
Sep 20, 2012, 5:01:25 PM9/20/12
to biffe...@googlegroups.com
Yep using the factory image.....Intresting didn't know I could do
that. Can I just do this on a normal linux 64-bit x86 box at all?

ljones

Nicolas Le Falher

unread,
Sep 20, 2012, 5:34:47 PM9/20/12
to biffe...@googlegroups.com
>Can I just do this on a normal linux 64-bit x86 box at all?
Sure.
Here documentation for Biff git : https://sites.google.com/site/bifferboard/Home/openwrt-git
Openwrt build doc : http://wiki.openwrt.org/doc/howto/build

If you need to use Openwrt trunk (support kernel 3.3.8), take a look at https://dev.openwrt.org/ticket/11701
Otherwise I'm on irc channel if you need help.

Nicolas

2012/9/20 lee jones <slot...@gmail.com>

ljones

lee jones

unread,
Sep 23, 2012, 2:23:51 PM9/23/12
to biffe...@googlegroups.com
I managed to compile some sort of image file! :) -- though I am not
sure exactly just what to include and to put into it. I followed the
instructions at
https://sites.google.com/site/bifferboard/Home/openwrt-git but on my
first attempt got an error (I can't remember what it was now, I think
it was something to do with gcc versions) so I found I had to do the
following;

1. Go to openwrt/tools/mllibs/include directory
2. Edit the file "elf.h" and add this line -- #include <unistd.h>

I could compile ok after that. The bb images I found are in
openwrt/bin/rdc . I could also "run" the image by issuing make run.

Only snag is that the openwrt build program uses the same sort of menu
driven program or interface just like the linux kernel does. It also
uses (I think) a ".config" file as well though I'm not sure which
files/programs I need to choose (and which not to).

Is the .config file for the openwrt build program avaliable anywhere at all?

ljones

On 9/20/12, Nicolas Le Falher <n.lef...@gmail.com> wrote:
>>Can I just do this on a normal linux 64-bit x86 box at all?
> Sure.
> Here documentation for Biff git :
> https://sites.google.com/site/bifferboard/Home/openwrt-git
> Openwrt build doc : http://wiki.openwrt.org/doc/howto/build
>
> If you need to use Openwrt trunk (support kernel 3.3.8), take a look at
> https://dev.openwrt.org/ticket/11701
> Otherwise I'm on irc channel if you need help.
>
> Nicolas
>
> 2012/9/20 lee jones <slot...@gmail.com>
>
>> On 9/20/12, Nicolas Le Falher <n.lef...@gmail.com> wrote:
>> > Hi,
>> >
>> > Are you using factory image ?
>> > If yes, why not try to compile your own image (from BB git or from
>> Openwrt
>> > trunk) ?
>> >
>>
>>
>>
>> Yep using the factory image.....Intresting didn't know I could do
>> that. Can I just do this on a normal linux 64-bit x86 box at all?
>>
>> ljones
>>
>> --
>> To unsubscribe send email to bifferboard...@googlegroups.com
>>
>
> --
> To unsubscribe send email to bifferboard...@googlegroups.com
>


--
:)

SP

biff...@yahoo.co.uk

unread,
Sep 23, 2012, 2:48:11 PM9/23/12
to Bifferboard

On Sep 23, 7:23 pm, lee jones <slothp...@gmail.com> wrote:
> Only snag is that the openwrt build program uses the same sort of menu
> driven program or interface just like the linux kernel does. It also
> uses (I think) a ".config" file as well though I'm not sure which
> files/programs I need to choose (and which not to).

Then don't choose anything! :).

> Is the .config file for the openwrt build program avaliable anywhere at all?

You don't need it. Use the default config for a minimal system, then
add what you want to get the system you want. Not all packages
compile, but there are not so many that are broken. It's been a while
since I tried to compile *everything*.

Biff.

lee jones

unread,
Sep 23, 2012, 4:46:01 PM9/23/12
to biffe...@googlegroups.com
ok I tried flashing an openwrt image I created earlier. It "runs" if I
type make run on my normal PC but if I flash it over to the
bifferboard, it hangs at boot. I have 3 files;

openwrt-rdc-jffs2-64k-bifferboard.img
openwrt-rdc-squashfs-bifferboard.img
openwrt-rdc.bzImage

I tried flashing the first two onto the bb, but it just hangs if I try
to boot. All I get is something like this;

..
..
Programmed chunk at offset 281
Programmed chunk at offset 282
Done programming, Press '4' to boot kernel
4
Booting...
00100000 loaded from flash.
Booting Linux with:

And nothing else happens x.x . Maybe I'm missing something?

ljones

Nicolas Le Falher

unread,
Sep 23, 2012, 5:04:38 PM9/23/12
to biffe...@googlegroups.com
> And nothing else happens x.x . Maybe I'm missing something?
Check your cmndline in Biffboot.
cmndline:    console=uart,io,0x3f8 rootfstype=squashfs,jffs2

Nicolas

lee jones

unread,
Sep 23, 2012, 5:28:39 PM9/23/12
to biffe...@googlegroups.com
not sure how to check the cmdline directly off biffboot off the bb
itself .... but it should be working.

If I flash the default bb image from the bb website (
openwrt-rdc-jffs2-64k-bifferboard.img ) that works ok, if I flash the
version I compiled it hangs. Thinking I'm missing something but
without knowing which packages to add....x.x !

ljones

Nicolas Le Falher

unread,
Sep 23, 2012, 5:36:31 PM9/23/12
to biffe...@googlegroups.com
Because factory image embed cmndline, not in Git.
So you need to pass config to kernel from Biffboot.

At boot, stop boot with escape for get Biffboot prompt.
Then, change cmnd_line variable to console=uart,io,0x3f8 rootfstype=squashfs,jffs2

Nicolas

lee jones

unread,
Sep 23, 2012, 6:59:24 PM9/23/12
to biffe...@googlegroups.com
Just a quick update -- I noticed "my" image file is a little under
half as big as the normal default BB image so I'm thinking I'm missing
*lots* of stuff. Though I cannot tell what I am missing -- prehaps I
need to put the kerenel file into the image in some way?

ljones
--
:)

SP

Nicolas Le Falher

unread,
Sep 24, 2012, 4:00:47 AM9/24/12
to biffe...@googlegroups.com
>I noticed "my" image file is a little under half as big as the normal default BB image so I'm thinking I'm missing *lots* of stuff.
Because it's a minimal image without stuff included in Factory image.
Take a look at http://wiki.openwrt.org/doc/howto/build#updating.feeds


>Though I cannot tell what I am missing -- prehaps I need to put the kerenel file into the image in some way?
openwrt-rdc-jffs*img include kernel and rootfs, so no.

Nicolas

Andrew Scheller

unread,
Sep 24, 2012, 6:01:44 AM9/24/12
to biffe...@googlegroups.com
> Is the .config file for the openwrt build program avaliable anywhere at all?

I'm not sure how useful you'll find it, but I *think* this is the
openwrt config for the "factory firmware" image:
https://github.com/bifferos/openwrt/blob/master/bifferboard_example_config
(or possibly something very close)

Lurch

lee jones

unread,
Sep 24, 2012, 3:29:42 PM9/24/12
to biffe...@googlegroups.com
intresting, btw I found the following thread;

https://groups.google.com/group/bifferboard/tree/browse_frm/month/2011-06/140ce2d0d037acc3?rnum=1&_done=/group/bifferboard/browse_frm/month/2011-06?&pli=1

In particular this point --

I think the confusion is because
http://sites.google.com/site/bifferboard/Home/factory-firmware
has the command-line compiled into the kernel (and so the biffboot
cmdline should be blank), whereas
http://sites.google.com/site/bifferboard/Home/openwrt-git
actually reads the cmdline from biffboot (and so the compiled-in
cmdline should be blank).

Prehaps I have a similar problem (not sure how t o fix!)

ljones

Nicolas Le Falher

unread,
Sep 24, 2012, 3:37:02 PM9/24/12
to biffe...@googlegroups.com
>Prehaps I have a similar problem (not sure how t o fix!)
Set cmndline in Biffboot with "console=uart,io,0x3f8 rootfstype=squashfs,jffs2"
https://sites.google.com/site/bifferboard/Home/bootloader/changelog/3-2-screenshots

or

Set CONFIG_CMDLINE in kernel :
#make kernel_menuconfig
   Processor type and features  --->
      [*] Built-in kernel command line
         ( console=uart,io,0x3f8 rootfstype=squashfs,jffs2) Built-in kernel command string

And relaunch "make" for build a new image.

Nicolas
Message has been deleted

lee jones

unread,
Nov 10, 2012, 11:44:29 AM11/10/12
to biffe...@googlegroups.com


On Monday, September 24, 2012 7:37:23 PM UTC, Nicolas Le Falher wrote:
>Prehaps I have a similar problem (not sure how t o fix!)
Set cmndline in Biffboot with "console=uart,io,0x3f8 rootfstype=squashfs,jffs2"
https://sites.google.com/site/bifferboard/Home/bootloader/changelog/3-2-screenshots


If I change cmndline to that, I get the message "Linux version 2.6.32.20 (biff@fonzi) (gcc version 4.1.2) #5 Mon Feb 7 23:21:40 GMT 2011" displayed over and over again.
 
or

Set CONFIG_CMDLINE in kernel :
#make kernel_menuconfig
   Processor type and features  --->
      [*] Built-in kernel command line
         ( console=uart,io,0x3f8 rootfstype=squashfs,jffs2) Built-in kernel command string

And relaunch "make" for build a new image.


Can't find that config option anywhere! here's what I have;

│ │     Target System (RDC 321x)  --->                                       │ │ 
  │ │     Target Profile (Bifferboard)  --->                                   │ │ 
  │ │     Target Images  --->                                                  │ │ 
  │ │     Global build settings  --->                                          │ │ 
  │ │ [ ] Advanced configuration options (for developers) (NEW)  --->          │ │ 
  │ │ [ ] Build the OpenWrt Image Builder (NEW)                                │ │ 
  │ │ [ ] Build the OpenWrt SDK (NEW)                                          │ │ 
  │ │ [ ] Build the OpenWrt based Toolchain (NEW)                              │ │ 
  │ │ [ ] Image configuration (NEW)  --->                                      │ │ 
  │ │     Package features  --->                                               │ │ 
  │ │     Base system  --->                                                    │ │ 
  │ │     IPv6  --->                                                           │ │ 
  │ │     LuCI  --->                                                           │ │ 
  │ │     Kernel modules  --->                                                 │ │ 
  │ │     Boot Loaders  --->                                                   │ │ 
  │ │     Administration  --->                                                 │ │ 
  │ │     Mail  --->                                                           │ │ 
  │ │     Xorg  --->                                                           │ │ 
  │ │     Libraries  --->                                                      │ │ 
  │ │     Network  --->                                                        │ │ 
  │ │     LuCI2  --->                                                          │ │ 
  │ │     Multimedia  --->                                                     │ │ 
  │ │     Utilities  --->                                                      │ │ 
  │ │     Extra packages  --->                                                 │ │ 
  │ │     Development  --->                                                    │ │ 
  │ │     Sound  --->                                                          │ │ 
  │ │     Emulators  --->                                                      │ │ 
  │ │     Languages  --->                                                      │ │ 
  │ │ ---
 

Nicolas

lee jones

unread,
Nov 10, 2012, 12:07:52 PM11/10/12
to biffe...@googlegroups.com
I'm still thinking that the USB device is being detected too slowly. I even get a message about saying "Press enter to activate this console" before USB is detected!

ljones

lee jones

unread,
Nov 10, 2012, 1:14:59 PM11/10/12
to biffe...@googlegroups.com


On Saturday, November 10, 2012 5:07:52 PM UTC, lee jones wrote:
I'm still thinking that the USB device is being detected too slowly. I even get a message about saying "Press enter to activate this console" before USB is detected!

ljones

At the start of this thread I said that I couldn't get auto mounting to work even if I tried putting something into rc.local. Ok well although USB comes in too late, I'm now finding that I can put a mount command into /etc/rc.local  like this ....

mount /dev/sda1 /www

and copy the old BB files from /www into /dev/sda1's root whereby they're mounted into www. A bodge unfortunatly :(

Why it didn't work before I'm not sure. I think the next thing to do is to completely reflash my BB again, modify rc.local and see if it works again.

ljones
Reply all
Reply to author
Forward
0 new messages