uboot a mostly unknow device with onwn kernel + rootfs , possible?
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
uboot a mostly unknow device with onwn kernel + rootfs , possible?
I have a small board on my table and the only thing I know is the processor, freescale iMX28
I can ()u)boot the device and have the debug console, so a serial connetion is available, also ethernet works.
(I have setup a tftp server and can run tftpboot what will download a kernel)
is it possible to boot this device with my own kernel + rootfs ?
for example to use with the freescale iMX28 SDK
ps: being a developer my general knowledge about setup a SoC is rather low, so if I have to explain something special please tell me
It is probable that you can boot Linux, however, if you want all of the peripherals on the SoC to be functional, you will have to know what they are and build the accordant drivers. Maybe post a picture of the device and someone will be able to identify it and suggest a source for a working kernel + drivers. uBoot is commonly used to boot Linux, so I would speculate that a working kernel does exist. If you can identify the vendor, it seems quite possible that there is a supported kernel available from the vendor.
uboot is what arm devices use to boot linux images. You should probably start with a supplied image for the device to know how it works first. Copy the /boot/config and other device specific things as a base.
I have used the SDK for the iMX28 to build the kernel,
I do not know how to copy /boot/config without destroying (overwriting) the existing nand.
so I thought I could load the kernel I have built via network and test it.
I have a nfs setup, but this seems to be total wrong
full working peripherials are not important at the moment
...it stops and does nothing.
so I assume that I do something wrong... but what
Not so fast.
What does the kernel you've loaded use as a console? If there is no built-in driver for whatever the console device is, then you won't see anything. Even if the driver is there, the default configuration may be to use a device you've not hooked up. I assume you're looking at a serial port to see the uboot console. You may have to use uboot to specify the correct console parameters; device name and possibly configuration parameters like baud, parity etc if it's a serial console. That's why you need to know some things about the hardware and the peripherals included.
Do you have a root filesystem to boot? The kernel may actually be running, trying to find it's root filesystem. Is there a built-in initramfs/initrd? I don't see anything in your uboot commands to specify a root filesystem or init process.
well, there was a rootfs in the nand, but I destroyed it with uploading a new one :-(
Code:
ubifsmount rootfs
UBIFS error (pid 0): ubifs_read_node: bad node type (0 but expected 6)
UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
Error reading superblock on volume 'ubi:rootfs'!
console=ttyAMA0 and baudrate=115200 are setup in the uboot environment (variables)
--
just found the kernel config and a device tree file for the device
I have to update the kernel to an other version and see if this works
I do not know how to copy /boot/config without destroying (overwriting) the existing nand.
If the device is network capable and you have other hardware you can use netcat to send a file.
$ nc -v -l -p 31337 > file.ext
(on the receiving end)
$ nc -n <ip of destination> <port> < input_file
(on the sending end)
nc doesn't know when the transfer is complete and keeps listening until the listening end is stopped. And various other methods via ftp or other options available on most linux's by default. As long as the firewalls don't block it. Or as long as both devices have displays you can cat | less the file and manually duplicate it. Various means to an end. USB sticks and other options. All of which implies an already working linux.
Shadow_7, I think I'm missing the point of doing that. Are you suggesting that netcat can somehow be embedded in or run from uboot? If not, then why would one choose to use netcat for file transfer, as opposed to any other dedicated file transfer mechanisms (sftp, scp, even ftp, or tftp)? If availability is the question, and if a working network and stack exists, then surely at least one of those or something similar would also be present. What's to say netcat would be available in the absence of a 'real' file transfer protocol implementation?
For one offs it's a lot simpler than installing and configuring an ftp or sftp server. In your case that device has like 64MB of RAM, which isn't a lot of wiggle room for servers and the likes. It's just one option of many and offers a fairly consistent option across multiple platforms.
my uboot here has no netcat,
I can load files via tftp and nfs to ram, and write to nand,
(what I did with the rootfs (ubi image) and what ended bad :-( ->kaputt)
now I would like to restore the thing somehow. as said, I have the kernel config and the device tree file at the moment.
Last edited by a4z; 03-21-2014 at 06:34 AM.
Reason: typo sad -> said
There should be an "image" that you can put onto the nand which is a flavor of linux. That flavor should have the nc and config and other things that you need to do useful things. uboot is like grub for arm. But I'm not familiar with it and don't know if it does much if anything more than boot what is on the nand and only on the nand. With maybe some tools to make the nand NOT blank. It's a devkit so you'd think that it'd be semi-brick proof.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.