I want my own rootfs.

424 views
Skip to first unread message

revizes

unread,
Nov 8, 2009, 9:29:40 AM11/8/09
to Beagle Board
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..

raghav n

unread,
Nov 8, 2009, 10:26:38 AM11/8/09
to beagl...@googlegroups.com
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

Daniel Díaz

unread,
Nov 8, 2009, 11:21:55 AM11/8/09
to beagl...@googlegroups.com
Hello, Yool!


On Sun, Nov 8, 2009 at 8:29 AM, revizes <rev...@gmail.com> wrote:
> 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
yo...@danieldiaz.org

revizes

unread,
Nov 9, 2009, 9:25:34 AM11/9/09
to Beagle Board
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

raghav n

unread,
Nov 9, 2009, 9:06:04 PM11/9/09
to beagl...@googlegroups.com
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

jpiat

unread,
Nov 10, 2009, 11:15:22 AM11/10/09
to Beagle Board
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

On 10 nov, 03:06, raghav n <raghav.m...@gmail.com> wrote:
> 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
>

Tuomas Kulve

unread,
Nov 10, 2009, 12:11:09 PM11/10/09
to beagl...@googlegroups.com
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.

--
Tuomas

raghav n

unread,
Nov 10, 2009, 4:55:46 PM11/10/09
to beagl...@googlegroups.com
On Tue, Nov 10, 2009 at 9:45 PM, jpiat <piat.j...@gmail.com> 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
>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
 
--

You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagl...@googlegroups.com.
To unsubscribe from this group, send email to beagleboard...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=.



.config

revizes

unread,
Nov 11, 2009, 2:06:29 AM11/11/09
to Beagle Board
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.

On 11월10일, 오전11시06분, raghav n <raghav.m...@gmail.com> wrote:
> 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..

>
> 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
>

jpiat

unread,
Nov 12, 2009, 5:26:30 AM11/12/09
to Beagle Board
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.

jpiat

unread,
Nov 13, 2009, 11:00:29 AM11/13/09
to Beagle Board
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

Andrew Jackman

unread,
Nov 13, 2009, 6:32:32 PM11/13/09
to beagl...@googlegroups.com
> 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/

--
Andrew Jackman
kd7...@gmail.com

CONFIDENTIALITY NOTICE: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure, or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message. All your base are belong
to us.

Andrew Jackman

unread,
Nov 13, 2009, 6:34:59 PM11/13/09
to beagl...@googlegroups.com
On Fri, Nov 13, 2009 at 4:32 PM, Andrew Jackman <kd7...@gmail.com> wrote:
>> 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

jpiat

unread,
Nov 14, 2009, 8:26:23 AM11/14/09
to Beagle Board
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

Andrew Jackman

unread,
Nov 18, 2009, 6:23:23 PM11/18/09
to beagl...@googlegroups.com
On Sat, Nov 14, 2009 at 6:26 AM, jpiat <piat.j...@gmail.com> wrote:
> 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.
>

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?

jpiat

unread,
Nov 19, 2009, 10:53:01 AM11/19/09
to Beagle Board
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.

On 19 nov, 00:23, Andrew Jackman <kd7...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages