I want my own rootfs.

hello.

I want to construct the my own rootfs with only busybox (no ramdisk).

actually, i constructed rootfs. but i always met the below messages.

mmcblk0: mmc0:cffc SU512 483 MiB
mmcblk0: p1 p2
kjournald starting. Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is
recommended
EXT3 FS on mmcblk0p2, internal journal
EXT3-fs: mounted filesystem with writeback data mode.
VFS: Mounted root (ext3 filesystem) on device 179:2.
Freeing init memory: 136K
Kernel panic - not syncing: No init found. Try passing init= option
to kernel.

plz recommend some documentations or some advices.

thanks..

I had the same problem with busybox on Leopardboard. I passed init=/linuxrc as part of the kernel command line.
After that I saw another problem ‘unable to execute /linuxrc’. I built busybox as a static image and that problem went away.
Hope this helps.
-raghav

Hello, Yool!

hello.
I want to construct the my own rootfs with only busybox (no ramdisk).

There are several options for you:
1) You can follow the Linux From Scratch route and build all the
necessary packages yourself to get a booting image.
2) You can base your work on the mini file system available here:
https://gforge.ti.com/gf/project/minifs/.
3) You can build one of the OpenEmbedded images that have the
essential packages just to boot.

I recommend the 3rd option. Poky (http://pokylinux.org/) has a
poky-image-minimal that you could bitbake; I'm sure Angstrom must have
an equivalent for that.

Greetings!

Daniel Díaz
yosoy@danieldiaz.org

Hi.

Thank you, raghav & daniel.

your advices helps me about many things.

problem is inittab & rc script...

now i can see a login prompt...

below is my inittab & rcsciprt..

inittab
::sysinit:/etc/init.d/rcS
::respawn:/sbin/getty -L ttyS2 115200 vt100
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot

init.d/rcS
#!/bin/sh

# Set the path
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

# Remount the root filesystem in read-write (requires /etc/fstab)
#mount -n -o remount,rw /
#mount -o remount,rw /dev/root /
mount -a

# Set the hostname
hostname -F /etc/hostname

# Start the network interface
#/sbin/ifconfig lo 127.0.0.1 up
#/sbin/ifconfig usb0 192.168.1.2 up

# call local boot scripts
/etc/init.d/rc.local

Hi revizes,

now i can see a login prompt…
Good to see you got a login prompt already.

problem is inittab & rc script…
I did not quite get what is the problem with the inittab and rc script.

One other article I used was this - http://free-electrons.com/docs/elfs/. This article has listed inittab file contents which you could try. I used the same. It also has contents for an rcS script, I have used:
#!/bin/sh
mount ­t proc none /proc
mount ­t sysfs none /sys
/bin/sh

I see one problem with busybox on leopardboard. Just before the prompt appears, I see a line that says (I need to figure out the problem yet) -
/bin/sh: can’t access tty; job control turned off

Let me know how it goes.
-raghav

Hi,

i'am working on doing a kind of CLFS (Cross Linux From scratch) for
the beagleboard. I have been able to compile a cross toolchain for the
omap processor and i'am now trying to set-up a simple rootfs based on
busybox. Could you give the busybox version, and configuration you are
using and how you created the /dev entries.

Thanks

jpiat wrote:

Hi,

i'am working on doing a kind of CLFS (Cross Linux From scratch) for
the beagleboard. I have been able to compile a cross toolchain for the

If you like build your own rootfs (but not to build the toolchain too),
you can check out Linux On ARM:

http://linux.onarm.com/

That uses a tool called "matrix" that fetches the sources from GIT
repositories and build them according to a simple plug -file (usually
running just the normal ./autogen.sh && ./configure && make && make
install).

That's kind of linux from scratch but just a bit automated (handles
dependencies etc. but doesn't handle the toolchain).

The cross compilation is handled by Scratchbox:

http://www.scratchbox.org/

It do introduce its own problems but being able to run just "make" with
basically any source code release is just great.

Quickest way to try it out is the "From Scratch" instructions:

http://linux.onarm.com/index.php/From_scratch

Running the "matrix install" command will download all source code
components to src/ directory and then build and install them.

Hi,

i’am working on doing a kind of CLFS (Cross Linux From scratch) for
the beagleboard. I have been able to compile a cross toolchain for the
omap processor and i’am now trying to set-up a simple rootfs based on
busybox. Could you give the busybox version, and configuration you are
using and how you created the /dev entries.

busybox version: 1.15.1
.config file is attached.
Creating dev entries: I flashed the uImage and have busybox on the SD card. After mounting the SD card on my Linux laptop, I created the dev directory and used the mknod command to create null, console nodes (again using -http://free-electrons.com/docs/elfs/)
-raghav

.config (20.7 KB)

so sorry.. I didn't see the your writing..

actually, i'm not in my house.

when i go home, i will upload the my full rootfs.

Thanks.

Hi revizes,

>now i can see a login prompt...

Good to see you got a login prompt already.

> problem is inittab & rc script...

I did not quite get what is the problem with the inittab and rc script.

---> I mean, previous intittab & rc script had problems..

Does anyone knows how to use qemu to test filesystem and kernel
image ? I found the quemu-omap3, but i just wan now if it is possible
to test the kernel image without having to generate a nand image.

I now have a working rcS scripte which mount proc sysfs and then
populate the /dev entries using mdev and starts a console.

#!/bin/sh

# Set the path
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

#mount proc on /proc
mount -t proc none /proc
#mount sysfs on /sys
mount -t sysfs none /sys
#call mdev to poupulate /dev entries (micro-udev)
mdev -s
#launch a shell
/bin/sh

my systems uses busybox (with dynamic libraries) with the minimum
library requirement but the filesystem size is still 48M ... Does
anyone knows how to strip down the libraries (libc 8M, libm 12M) ?

Thanks

my systems uses busybox (with dynamic libraries) with the minimum
library requirement but the filesystem size is still 48M ... Does
anyone knows how to strip down the libraries (libc 8M, libm 12M) ?

Would it be worth the effort to statically link your binaries with
dietlibc or similar?

http://www.fefe.de/dietlibc/

Also: Check out embutils. There may be something newer, but it's from
the same guy that did dietlibc. Check out slide 23:

http://www.fefe.de/dietlibc/talk.pdf

I have tried to statically link busybox (defconfig), but my rootfs is
still 38M with busybox beeing 1M. As busybox is the only executable
installed, i really don't understand how my filesystem can be that
big ... I prefer to not use libc alternatives such as dietlib or
uclibc as i want my toolchain to be fully compatible with the
codeSourcery one. I'll keep investigating on how to build a full (but
limitated) system with less than 8M space. I'll post soon my scripts,
source version and instruction to build this minimum system from
scratch.

One thing my system lacks is a login prompt at startup. I get a prompt
logged with root user at startup, but i would like to log as another
user. Any idea ?

Thanks

If you're building all of your binaries as static binaries, you should
not need anything but those binaries to run. Shouldn't you be able to
safely delete the libraries?

In fact i have removed ALL the libraries with busybox statically
built. I think that i may have some hidden directory on my sd card,
that i have not delete.