Discussion:
Mirabox kernel help needed
amon
2018-02-01 06:50:46 UTC
Permalink
I've been mostly a listener for about the last 5 years, and now
finally have a project that is moving forward that is using a
Mirabox as the prototype hardware.

The problem is, as anyone who knows this piece of kit has seen,
is that it uses a desperately pared down kernel and all sorts
of special tricks/software to upgrade.

What I really want is to just build some drivers for it,
specifically the usbserial and the firewalling related ones.
The ideal would be if I knew how to just compile those against
the kernel that is on board so that I do not have to even touch
the NVRAM and what from my readings so far looks like a room
full of twisty turny passages, all the same... and mostly with
dragons at the other end.

Are there folks here who have mastered this beast at the
ko file level or if necessary at the uboot and kernel build
level? I seriously need to find someone who can answer stupid
obvious questions that then aim me in the correct direction
to make the next mistake on my way up the learning curve.

It looks vertical from where I sit right now...

I am working with units using the 3.2.36 kernels, although I
do also have some older ones which may have an older kernel
and which have a wifi chip that is too primitive for my
prototype project and so could be used where bricking is a
risk.
--
+---------------------------------------------------------------+
| Dale Amon Immortal Data |
| CEO Midland International Air and Space Port |
| ***@vnl.com "Data Systems for Deep Space and Time" |
+---------------------------------------------------------------+
Leigh Brown
2018-02-01 10:00:38 UTC
Permalink
Hi Dale,
Post by amon
I've been mostly a listener for about the last 5 years, and now
finally have a project that is moving forward that is using a
Mirabox as the prototype hardware.
The problem is, as anyone who knows this piece of kit has seen,
is that it uses a desperately pared down kernel and all sorts
of special tricks/software to upgrade.
Well, it's not that bad.
Post by amon
What I really want is to just build some drivers for it,
specifically the usbserial and the firewalling related ones.
The ideal would be if I knew how to just compile those against
the kernel that is on board so that I do not have to even touch
the NVRAM and what from my readings so far looks like a room
full of twisty turny passages, all the same... and mostly with
dragons at the other end.
Everything's like that until you know what you are doing.
Post by amon
Are there folks here who have mastered this beast at the
ko file level or if necessary at the uboot and kernel build
level? I seriously need to find someone who can answer stupid
obvious questions that then aim me in the correct direction
to make the next mistake on my way up the learning curve.
There's no such thing as a stupid question, as they say...
Post by amon
It looks vertical from where I sit right now...
I am working with units using the 3.2.36 kernels, although I
do also have some older ones which may have an older kernel
and which have a wifi chip that is too primitive for my
prototype project and so could be used where bricking is a
risk.
Actually, the situation (for the kernel at least) for the Mirabox
is pretty good. I use a pretty stock Linux kernel on my Mirabox:

***@mirabox:~# cat /proc/version
Linux version 4.14.15+ (***@dish) (gcc version 6.4.0 (crosstool-NG
crosstool-ng-1.23.0-152-g73e8b0b2)) #5 Thu Feb 1 09:36:51 GMT 2018
***@mirabox:~# cat /etc/debian_version
9.3

I use the provided u-boot, however, as I couldn't get the mainline
u-boot to work. However, it's good enough for me. I boot from the
SD card for ease (although it's slightly slower).

If you have a cross-compiler then it's pretty easy to build a kernel
that works. I guess compiling on the Mirabox itself is possible but
you'd need external storage and it would be very slow.

My kernel config:

https://www.solinno.co.uk/public/mirabox/config-mirabox-4.14.15

A tiny patch to avoid an issue with Bluetooth:

https://www.solinno.co.uk/public/mirabox/mirabox-sdio.patch

If you need any more assistance, let me know.

Regards,

Leigh.
amon
2018-02-02 05:45:31 UTC
Permalink
Thanks for getting back to me. I hope you are right. What little
I have found via searches with Google were not comforting, to
say the least.

I can't do a boot from the sdcard for this application as I
will probably be using it for something else. I think that is
why I was thinking I need to do something with uboot.

I don't have a cross compiler, although I have heard there
might be one at Globalscale. I have built cross-compilers
but not since I did one to build m68000 code for a NeXT from
an i486... needless to say, it took several days to do the
3 compiles to generate it. I hope the world has gotten easier
in the ensuing two decades.

I'm working on some stuff where I have to be quite conservative
as I hope to put it into a cubesat someday if we can raise the
cash for it.
--
+---------------------------------------------------------------+
| Dale Amon Immortal Data |
| CEO Midland International Air and Space Port |
| ***@vnl.com "Data Systems for Deep Space and Time" |
+---------------------------------------------------------------+
amon
2018-02-02 05:50:14 UTC
Permalink
Another question: I loaded a package set for a full development
environment on one of my Miraboxes. I presume that I could just
do the kernel build directly on the target hardware? I would
think so, but I've not heard anyone else say they did it that
way. Slow does not matter that much. It can run over the weekend
if it has to.
--
+---------------------------------------------------------------+
| Dale Amon Immortal Data |
| CEO Midland International Air and Space Port |
| ***@vnl.com "Data Systems for Deep Space and Time" |
+---------------------------------------------------------------+
amon
2018-02-02 16:23:54 UTC
Permalink
Okay, I hadn't been thinking in those terms because in my mind
I already had the sdcard 'allocated'. That is useful. Bricking
GlobalScale units is definitely a thing... I managed to do it
to one of there Guru boxes back in 2012. Never had time to
fix it; at those prices it was cheaper to bin it than have them
pay me to figure it out!

As to the development, I can do both. I have a full set of the
packages for the release on the Miraboxes (7.1) ... it is an old
release but they have stayed with it for years and but for the
kernel it serves my purposes. I have one of the test units
designated as the development system for my own debian packages
anyway and I've already got gcc and all of the debian helper
package tool chain on it.

Also, I have several 256 GB USB 3.0 sticks laying around my lab
bench, so no problem.

I am really glad to hear that cross compilers have been
simplified. Walking 10 miles to school in deep snow, up hill
both ways, is best left in the past.

I'm hoping to come out of this with a simple, replicable
install sequence using the newly built kernel and module
set... I will have to replicate this on at least 4 other
units. It would also be nice if I can breath life into 4
old units I have and be able to describe the process to a
couple of folks who work with me remotely on occasion so
they can upgrade as well.
--
+---------------------------------------------------------------+
| Dale Amon Immortal Data |
| CEO Midland International Air and Space Port |
| ***@vnl.com "Data Systems for Deep Space and Time" |
+---------------------------------------------------------------+
Leigh Brown
2018-02-04 19:58:14 UTC
Permalink
Hi Dale,
Post by amon
Okay, I hadn't been thinking in those terms because in my mind
I already had the sdcard 'allocated'. That is useful. Bricking
GlobalScale units is definitely a thing... I managed to do it
to one of there Guru boxes back in 2012. Never had time to
fix it; at those prices it was cheaper to bin it than have them
pay me to figure it out!
As to the development, I can do both. I have a full set of the
packages for the release on the Miraboxes (7.1) ... it is an old
release but they have stayed with it for years and but for the
kernel it serves my purposes. I have one of the test units
designated as the development system for my own debian packages
anyway and I've already got gcc and all of the debian helper
package tool chain on it.
Also, I have several 256 GB USB 3.0 sticks laying around my lab
bench, so no problem.
I am really glad to hear that cross compilers have been
simplified. Walking 10 miles to school in deep snow, up hill
both ways, is best left in the past.
I'm hoping to come out of this with a simple, replicable
install sequence using the newly built kernel and module
set... I will have to replicate this on at least 4 other
units. It would also be nice if I can breath life into 4
old units I have and be able to describe the process to a
couple of folks who work with me remotely on occasion so
they can upgrade as well.
I have had a little time over the weekend so I have created a
(lightly tested) procedure to build an SD Card image from a
system running 32-bit or 64-bit Debian (Stretch) on an Intel PC.

https://www.solinno.co.uk/public/mirabox/debian_cross_compile.html

Please try it out and let me know if anything isn't clear or
you have any issues. It should be simple to extend the procedure
to flash the kernel and initrd onto the NAND and transfer the root
filesystem from the SD Card to the on-board UBIFS filesystem. I'll
do that next time I have some free time.

Regards,

Leigh.
amon
2018-02-05 01:30:28 UTC
Permalink
Got it and printed a copy for annotation when I get to the
lab tomorrow. Thanks much.
--
+---------------------------------------------------------------+
| Dale Amon Immortal Data |
| CEO Midland International Air and Space Port |
| ***@vnl.com "Data Systems for Deep Space and Time" |
+---------------------------------------------------------------+
Leigh Brown
2018-02-05 14:50:11 UTC
Permalink
Post by amon
Got it and printed a copy for annotation when I get to the
lab tomorrow. Thanks much.
I noticed I made a little mistake in step 4. I've corrected it on the
website.

The step to apply the small kernel patch should be as follows:

wget -O- https://www.solinno.co.uk/public/mirabox/mirabox-sdio.patch |
patch -p1

I also added instructions on how to download the SD8787 firmware in step
9.

Regards,

Leigh.
amon
2018-02-09 06:03:33 UTC
Permalink
I have not left the planet :-)

Just swamped with administrative things that one has
to do in an unfunded small company to keep at least
a nose out of the water.
--
+---------------------------------------------------------------+
| Dale Amon Immortal Data |
| CEO Midland International Air and Space Port |
| ***@vnl.com "Data Systems for Deep Space and Time" |
+---------------------------------------------------------------+
Leigh Brown
2018-02-02 08:33:19 UTC
Permalink
Hi Dale,
Post by amon
Thanks for getting back to me. I hope you are right. What little
I have found via searches with Google were not comforting, to
say the least.
Think positive. If I can do it, anyone can :-)
Post by amon
I can't do a boot from the sdcard for this application as I
will probably be using it for something else. I think that is
why I was thinking I need to do something with uboot.
You can test that way though, and once you have that working you
can get the kernel onto the internal mmc. It's best to take it
one step at a time. The good thing is, even if you brick it, you
can load a u-boot from the serial port and recover.
Post by amon
I don't have a cross compiler, although I have heard there
might be one at Globalscale. I have built cross-compilers
but not since I did one to build m68000 code for a NeXT from
an i486... needless to say, it took several days to do the
3 compiles to generate it. I hope the world has gotten easier
in the ensuing two decades.
I just want to check that you can install Debian on a VM or are
running it on a PC or server somewhere. If that is the case, I
can provide you instructions on installing a cross-compiler.
These are packaged with Debian these days so all the hassle is
gone.

I don't mind installing a development environment on my
Mirabox to build the kernel and sharing the instructions on how
to do it, but we'll both get frustrated with the slow compile
speed. You'd also need a USB drive attached as the kernel source
is big.
Post by amon
I'm working on some stuff where I have to be quite conservative
as I hope to put it into a cubesat someday if we can raise the
cash for it.
Regards,

Leigh.
Paul Wise
2018-02-02 09:10:50 UTC
Permalink
Post by amon
I don't have a cross compiler
Debian has cross-compilers now:

https://wiki.debian.org/CrossCompiling

Not every package can be cross-compiled though:

http://spock.subdivi.de/~helmut/report.html
https://bootstrap.debian.net/cross_all.html
--
bye,
pabs

https://wiki.debian.org/PaulWise
Luke Kenneth Casson Leighton
2018-02-09 08:36:40 UTC
Permalink
Post by amon
Thanks for getting back to me. I hope you are right. What little
I have found via searches with Google were not comforting, to
say the least.
most people are not sufficiently competent on the general internet to know
what they are doing. the mass of unanswered or incompetently answered
questions can be a pain in the add to filter out.

that is your responsibility... and something you just have to accept and be
patient with rather than attach emotional responses to such as "not
comforting" and other such phrases.

find the RIGHT people, ignore the rest, and please DOCUMENT your successes
in STATIC web pages such as a wiki NOT a mailing list, forum or blog post.

why? because YOU will need the documentation in six months time, forget
everyone else that will indirectly benefit!!

that includes where and how you obtained the toolchain, everything.


I can't do a boot from the sdcard for this application as I
Post by amon
will probably be using it for something else. I think that is
why I was thinking I need to do something with uboot.
I don't have a cross compiler, although I have heard there
might be one at Globalscale. I have built cross-compilers
but not since I did one to build m68000 code for a NeXT from
an i486... needless to say, it took several days to do the
3 compiles to generate it. I hope the world has gotten easier
in the ensuing two decades.
I'm working on some stuff where I have to be quite conservative
as I hope to put it into a cubesat someday if we can raise the
cash for it.
--
+---------------------------------------------------------------+
| Dale Amon Immortal Data |
| CEO Midland International Air and Space Port |
+---------------------------------------------------------------+
--
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
Loading...