2

I need to build a 32 root filesystem for ARM. I've tried using busybox as well as buildroot and both work perfectly as they should. But the problem is I need to have gcc and few other packages as well as libraries in my root file system.

** Update **

I tried to use yocto as suggested and when I build a roots with that I get no logs after a certain point

Following are the kernel logs -

6Waiting 3sec before mounting root device...
3mmc0: error -110 whilst initialising MMC card
6mmc1: new high speed SDHC card at address e624
6mmcblk0: mmc1:e624 SU08G 7.40 GiB 
6 mmcblk0: p1
6EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
6VFS: Mounted root (ext4 filesystem) on device 179:1.
6Freeing unused kernel memory: 84K (c0f00000 - c0f15000)
4mount (146) used greatest stack depth: 6196 bytes left
4rc (149) used greatest stack depth: 6136 bytes left
4rc (148) used greatest stack depth: 6124 bytes left
4init (160) used greatest stack depth: 5644 bytes left
4rc (145) used greatest stack depth: 5436 bytes left

What could be possibly going wrong there?

tshepang
  • 12,111
  • 21
  • 91
  • 136
kimi
  • 315
  • 3
  • 11
  • 2
    Buildroot does give you the option to install gcc and many different libraries in your target though. For libraries that aren't included, you can use the generated toolchain to compile your own libraries. – tangrs Apr 30 '14 at 06:52
  • @tangrs According to the latest document, I think it said that gcc on target has been discontinued. Correct me if I'm wrong. – kimi Apr 30 '14 at 15:32
  • Look into [yocto](https://www.yoctoproject.org/). I believe this does more-or-less what you're trying to do. – beatgammit Apr 30 '14 at 17:57
  • This question appears to be off-topic because it is about building the Linux kernel, and is a better fit for https://unix.stackexchange.com. – beatgammit Apr 30 '14 at 17:58
  • Any thing on [this page](http://en.wikipedia.org/wiki/List_of_Linux_distributions) and [this page](http://elinux.org/Embedded_Linux_Distributions) is a possible answer. As well as klibc, ltib, OpenEmbedded, Linaro, OpenWrt, etc. Do you need X-Windows/Graphics, are you memory constrained, do you want the user to update programs and/or choose there own? There are many choices that depend on the requirements. The *C library* and compiler (gcc/llvm variants) play into the decision. – artless noise Apr 30 '14 at 18:46
  • 2
    Configuring **development tools** of which GCC is clearly an example, is explicitly on topic here. – Chris Stratton Apr 30 '14 at 19:20
  • @artlessnoise I dont need X-Windows/Graphics. I just need to have a few libraries and tools. – kimi Apr 30 '14 at 23:05
  • @ChrisStratton Yes compilers are on topic. I closed voted due to the many different answers. The question is asking for a recommendation on an embedded ARM file system. What compiler you use for your own application is also a criteria; for instance, android uses bionic. Buildroot is usually *uclibc*. Some other C libraries are even smaller, but have more limited support by file system builders and this ties into the compiler you want to use. – artless noise May 01 '14 at 15:09
  • @artlessnoise Agreed the post went off topic, I've edited it and now its particular to Yocto OpenEmbedded FS... – kimi May 01 '14 at 15:37
  • It currently looks like nothing is going wrong. Probably you did not setup `getty` or other to give the correct console. All the messages you have are from the Linux kernel. I think you have processes running in *user space*, just there is no external evidence. You can use a [magic sysrq](http://en.wikipedia.org/wiki/Magic_SysRq_key), if available to try and see the processes. Also, be sure to set *console=ttyXXX,115200n8n* in your linux command line. This gives stdout to `init`. Make sure `/dev/ttyXXX` in the initial fs is proper, especially if you don't have mdev. You can overmount. – artless noise May 01 '14 at 15:49
  • @artlessnoise I did guess that I might not be setting up the getty appropriately. Currently on my system I'm using ARM's DCC as console And I modified the /etc/inittab as follows 1:2345:respawn:/sbin/getty hvc0 but no change, for my kernel bootargs I pass console=hvc0 and looks like it's working fine... – kimi May 01 '14 at 15:58
  • If you really have the console working, then adding `init=/bin/sh` to the kernel command line should give a shell. Instead of running `init`, process 1 will be the shell. If this works, then `init` code or configuration has some issue. – artless noise May 01 '14 at 16:24
  • @artlessnoise Yes, the console works fine, I get all other kernel logs on the ARM DCC console. I changed init=/bin/sh but no change, still the same output.. – kimi May 01 '14 at 16:37
  • No, that *user space* console is not working fine. They are different. You need to run `mknod c XXX xxx /dev/ttyhvc0` or something like that. – artless noise May 01 '14 at 16:42
  • @artlessnoise Fixed the problem, it was missing /dev/hvc0 node and also had to create /etc/init/hvc0.conf (http://www.ndchost.com/wiki/vps/xen-console-no-login) Thanks – kimi May 02 '14 at 16:05

1 Answers1

0

Debian might be a nice place to begin. Since you get the option of only installing what you need, you might find it more forgiving than trying to get an Ubuntu root filesystem working

Try running a base bootstrap install of the minimum packages required for a root filesystem and then install the other library packages as needed.

tangrs
  • 9,709
  • 1
  • 38
  • 53