LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to create a linux firmware? (https://www.linuxquestions.org/questions/linux-general-1/how-to-create-a-linux-firmware-4175660653/)

evgenius8888 09-10-2019 05:48 AM

How to create a linux firmware?
 
Hello everyone,

I'm looking for some help. I'm not a Linux newbie, more of a regular user. I'm not really experienced in C-programming (have done it as university course, but not much), but willing to learn and improve.

What I want is to create a custom Linux-based firmware for one of my e-readers. It's now running Android, bootloader is unlocked, so, I suppose, it's generally possible. Could anyone, please, help me with directions where to start? I've heard about LFS, but not sure if it's my case. Or I should get some test boards first and try with them? Maybe anyone of you have already done something similar and may share his/her experience?

I don't mind spending year or two for this project. I just want to complete it. Kinda challenge for myself. The result might not be factory-quality. I don't care much about this e-reader, but it'd have been nice to keep it alive (but it'll, probably, depend mostly on me)

Firerat 09-10-2019 08:03 AM

it is not really 'firmware' that you are describing
it s the OS ( operating system )

a custom andoid is probably the easiest place to start

LFS is great if you want to learn how to build a Linux system From Sratch

I'm not sure LFS has an arm ( the likely architecture of your e-reader ) target
it might be in clfs
yeah, arm has a mention there.

You could also draw from the SBC community ( the likes of Raspberry Pi )

the biggest problem you will have is getting drivers for the hardware, documentation may be lacking and available source code ( and needed firmware blobs ) may be only available for older ( or just plain old ) Linux kernels

berndbausch 09-10-2019 09:25 AM

You can only write firmware if you have the precise specs of the device.

First, you need to know the CPU, so that you can properly compile the kernel and Busybox (if you use Busybox), and any other software that will run on the device.

Then, you have to know the precise nature of the device's IO system. I have no experience with it, but as an example, the Odroid I own doesn't have a PCI bus, so that the usual way of discovering the systems's hardware may not work. You may have to write drivers for exotic hardware, e.g. whatever the device's non-PCI IO bus or the touchscreen of your reader.

As far as further resources are concerned, you may get information on elinux.org, a wiki dedicated to embedded Linux systems.

jefro 09-16-2019 03:12 PM

While we generally think of android being built on top of linux that may be quite a simplified statement.
I assume you want to build some version of linux to replace this. Unless you have lucky or quite skilled, the task will be a challenge. There are millions of small devices that have little to no documentation for you to use in order to create a distro.

Instead of you trying to make a from scratch install it may be possible that someone in one of the current alternative embedded solutions has something close. I'd think that working on something close would be better than full out. (it will be easy to brick this by the way)

Some ideas to start.
https://itsfoss.com/open-source-alternatives-android/
https://en.wikipedia.org/wiki/Ubuntu_Touch
https://beebom.com/android-alternative/
https://replicant.us/
https://en.wikipedia.org/wiki/LineageOS


What I would do is make an image of the current OS. I'd also use tools to discover the hardware that is currently used and the settings in place for it.




Might also peek at QNX even in all this. It is possible that some version of other OS's like windows embedded or BSD to this device.

Personally I'd think it would be quite a task for me to take any generic device and successfully install some alternative OS and be 100% working but I encourage you to try. The limits of your hardware will have to be known. Read all you can about your hardware. If you can't find enough like examples on the web then it may be a waste of effort. Might buy a supported device and put on some OS.


All times are GMT -5. The time now is 08:34 AM.