* USB Flash rootfs prep! @ 2008-11-15 1:05 Cristian Axenie 2008-11-15 8:18 ` Joachim Foerster 0 siblings, 1 reply; 9+ messages in thread From: Cristian Axenie @ 2008-11-15 1:05 UTC (permalink / raw) To: linuxppc-embedded [-- Attachment #1: Type: text/plain, Size: 2386 bytes --] Hello all ! I'm porting a former Control application from x86 (Linux+RTAI+Comedi) to PowerPC (Xenomai+Comedi for RTDM). I've choosed for my development the ELDK tool and a MPC8315ERDB platform. So I 've properly patched and build my kernel with the Xenomai support and I get some errors when running a latency test app. I've managed to spot the problem , that consists in an incompatibility between the shared libraries used on the target (ver 2.5) and the standard libraries used (and with which were compiled the kernel and the Xenomai addon) version 2.6, and so ld screams and a SegFault appears. Now I,ve creted an ext2.img rootfs with the rootfs.tar.gz from /eldk/ppc_6xx/images and I've added in the rootfs some libs and other useful stuff for Xenomai for elliminating the need for an NFS mount. My primary concern is now to write the new FS to a USB Flash Stick so that I can test if the latency tests works now when the libs are compatible (ver 2.6). So resuming I want to now what are the corect steps to do this, because I've tried to write the generated ext2.img to my USB flash stick (formated as ext2) and added to the uBoot bootargs to the following : setenv usbstick_args setenv bootargs root=/dev/sdb1 ro rootdelay=10 rootfstype=ext2 console=$consoledev,$baudrate; setenv usbstick 'run usbstick_args;bootm fe500000 - fe700000' setenv bootcmd run usbstick As a result I get the following output : Waiting 10sec before mounting root device... scsi 2:0:0:0: Direct-Access SanDisk Cruzer Micro 0.1 PQ: 0 ANSI: 2 sd 2:0:0:0: [sdb] 2001888 512-byte hardware sectors (1025 MB) sd 2:0:0:0: [sdb] Write Protect is off sd 2:0:0:0: [sdb] Assuming drive cache: write through sd 2:0:0:0: [sdb] 2001888 512-byte hardware sectors (1025 MB) sd 2:0:0:0: [sdb] Write Protect is off sd 2:0:0:0: [sdb] Assuming drive cache: write through sdb: sdb1 sd 2:0:0:0: [sdb] Attached SCSI removable disk sd 2:0:0:0: Attached scsi generic sg1 type 0 VFS: Mounted root (ext2 filesystem) readonly. Freeing unused kernel memory: 156k init Warning: unable to open an initial console. Failed to execute /bin/busybox. Attempting defaults... Kernel panic - not syncing: No init found. Try passing init= option to kernel. Rebooting in 180 seconds.. Shall I explicitly give the init ? What should be ... init=/sbin/init, init=/bin/busybox ???? Thanks in advance !!! Best regards , Cristian [-- Attachment #2: Type: text/html, Size: 2597 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB Flash rootfs prep! 2008-11-15 1:05 USB Flash rootfs prep! Cristian Axenie @ 2008-11-15 8:18 ` Joachim Foerster [not found] ` <9c789a000811150112q3088a044ub8b38489b2119a60@mail.gmail.com> 0 siblings, 1 reply; 9+ messages in thread From: Joachim Foerster @ 2008-11-15 8:18 UTC (permalink / raw) To: Cristian Axenie; +Cc: linuxppc-embedded Hi Cristian, On Sat, 2008-11-15 at 03:05 +0200, Cristian Axenie wrote: > VFS: Mounted root (ext2 filesystem) readonly. > Freeing unused kernel memory: 156k init > Warning: unable to open an initial console. Device file /dev/console doesn't seem to exist in your rootfs. > Failed to execute /bin/busybox. Attempting defaults... > Kernel panic - not syncing: No init found. Try passing init= option > to kernel. It seems that you don't have an executable called /bin/busybox in your rootfs. Your kernel command line seems to have "init=/bin/busybox" included? But, hmmm, it is very strange, at least in your uboot bootargs there is no such string. Is it because of some default kernel command line (set before compiling the kernel)? > Rebooting in 180 seconds.. > > Shall I explicitly give the init ? What should be ... init=/sbin/init, > init=/bin/busybox ???? The rootfs which comes with ELDK "starts" with /sbin/init - it does not use busybox, right (as far as I can remember)? So you need to specify "init=/sbin/init" on your kernel command line. Joachim ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <9c789a000811150112q3088a044ub8b38489b2119a60@mail.gmail.com>]
* Re: USB Flash rootfs prep! [not found] ` <9c789a000811150112q3088a044ub8b38489b2119a60@mail.gmail.com> @ 2008-11-15 9:12 ` Cristian Axenie 2008-11-15 10:01 ` Nicholas Mc Guire 0 siblings, 1 reply; 9+ messages in thread From: Cristian Axenie @ 2008-11-15 9:12 UTC (permalink / raw) To: linuxppc-embedded [-- Attachment #1: Type: text/plain, Size: 1614 bytes --] On Sat, Nov 15, 2008 at 11:12 AM, Cristian Axenie <cristian.axenie@gmail.com > wrote: > > > On Sat, Nov 15, 2008 at 10:18 AM, Joachim Foerster <mls.JOFT@gmx.de>wrote: > >> Hi Cristian, >> >> On Sat, 2008-11-15 at 03:05 +0200, Cristian Axenie wrote: >> > VFS: Mounted root (ext2 filesystem) readonly. >> > Freeing unused kernel memory: 156k init >> > Warning: unable to open an initial console. >> >> Device file /dev/console doesn't seem to exist in your rootfs. > > Strange because /dev/console exists in my ext2.img. > >> >> >> > Failed to execute /bin/busybox. Attempting defaults... >> > Kernel panic - not syncing: No init found. Try passing init= option >> > to kernel. >> >> It seems that you don't have an executable called /bin/busybox in your >> rootfs. Your kernel command line seems to have "init=/bin/busybox" >> included? >> >> But, hmmm, it is very strange, at least in your uboot bootargs there is >> no such string. Is it because of some default kernel command line (set >> before compiling the kernel)? > > > I simply forgot to write them here (because I didn't knew if they were > valid) but I 've tried with init=/sbin/init and get the same result ! > >> >> >> > Rebooting in 180 seconds.. >> > >> > Shall I explicitly give the init ? What should be ... init=/sbin/init, >> > init=/bin/busybox ???? >> >> The rootfs which comes with ELDK "starts" with /sbin/init - it does not >> use busybox, right (as far as I can remember)? So you need to specify >> "init=/sbin/init" on your kernel command line. > > > I've tried with /sbin/init and the same !! > >> >> >> Joachim >> >> >> > Cristian > [-- Attachment #2: Type: text/html, Size: 2870 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB Flash rootfs prep! 2008-11-15 9:12 ` Cristian Axenie @ 2008-11-15 10:01 ` Nicholas Mc Guire 2008-11-15 10:17 ` Cristian Axenie 0 siblings, 1 reply; 9+ messages in thread From: Nicholas Mc Guire @ 2008-11-15 10:01 UTC (permalink / raw) To: Cristian Axenie; +Cc: linuxppc-embedded > > > > > > > On Sat, Nov 15, 2008 at 10:18 AM, Joachim Foerster <mls.JOFT@gmx.de>wrote: > > > >> Hi Cristian, > >> > >> On Sat, 2008-11-15 at 03:05 +0200, Cristian Axenie wrote: > >> > VFS: Mounted root (ext2 filesystem) readonly. > >> > Freeing unused kernel memory: 156k init > >> > Warning: unable to open an initial console. > >> > >> Device file /dev/console doesn't seem to exist in your rootfs. > > > > Strange because /dev/console exists in my ext2.img. did you check that it is actually a valid character device (c 5 1) ? it can easaly happend during copying of a tree into your image that they become regular files. hofrat ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB Flash rootfs prep! 2008-11-15 10:01 ` Nicholas Mc Guire @ 2008-11-15 10:17 ` Cristian Axenie 2008-11-15 10:40 ` Nicholas Mc Guire 0 siblings, 1 reply; 9+ messages in thread From: Cristian Axenie @ 2008-11-15 10:17 UTC (permalink / raw) To: Nicholas Mc Guire, Joachim Foerster, linuxppc-embedded [-- Attachment #1: Type: text/plain, Size: 832 bytes --] On Sat, Nov 15, 2008 at 12:01 PM, Nicholas Mc Guire <hofrat@hofr.at> wrote: > > > > > > > > > > > On Sat, Nov 15, 2008 at 10:18 AM, Joachim Foerster <mls.JOFT@gmx.de > >wrote: > > > > > >> Hi Cristian, > > >> > > >> On Sat, 2008-11-15 at 03:05 +0200, Cristian Axenie wrote: > > >> > VFS: Mounted root (ext2 filesystem) readonly. > > >> > Freeing unused kernel memory: 156k init > > >> > Warning: unable to open an initial console. > > >> > > >> Device file /dev/console doesn't seem to exist in your rootfs. > > > > > > Strange because /dev/console exists in my ext2.img. > > did you check that it is actually a valid character device (c 5 1) ? > it can easaly happend during copying of a tree into your image that > they become regular files. > > hofrat > I think that you are right, butr how can I test this validity?? Cristian [-- Attachment #2: Type: text/html, Size: 1323 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB Flash rootfs prep! 2008-11-15 10:17 ` Cristian Axenie @ 2008-11-15 10:40 ` Nicholas Mc Guire 2008-11-15 11:15 ` Cristian Axenie 0 siblings, 1 reply; 9+ messages in thread From: Nicholas Mc Guire @ 2008-11-15 10:40 UTC (permalink / raw) To: Cristian Axenie; +Cc: linuxppc-embedded > > > > did you check that it is actually a valid character device (c 5 1) ? > > it can easaly happend during copying of a tree into your image that > > they become regular files. > > > > hofrat > > > I think that you are right, butr how can I test this validity?? > just check with ls -l that the device file is actually still a character device with the right major/minor number. crw--w--w- 1 root tty 5, 1 Nov 13 22:18 /mnt/dev/console modes and date of course may be diferent. hofrat ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB Flash rootfs prep! 2008-11-15 10:40 ` Nicholas Mc Guire @ 2008-11-15 11:15 ` Cristian Axenie 2008-11-15 12:12 ` Cristian Axenie [not found] ` <Pine.LNX.4.58.0811150700530.5061@vlab.hofr.at> 0 siblings, 2 replies; 9+ messages in thread From: Cristian Axenie @ 2008-11-15 11:15 UTC (permalink / raw) To: Nicholas Mc Guire, linuxppc-embedded, Joachim Foerster [-- Attachment #1: Type: text/plain, Size: 3218 bytes --] On Sat, Nov 15, 2008 at 12:40 PM, Nicholas Mc Guire <hofrat@hofr.at> wrote: > > > > > > did you check that it is actually a valid character device (c 5 1) ? > > > it can easaly happend during copying of a tree into your image that > > > they become regular files. > > > > > > hofrat > > > > > I think that you are right, butr how can I test this validity?? > > > just check with ls -l that the device file is actually still a character > device with the right major/minor number. > > crw--w--w- 1 root tty 5, 1 Nov 13 22:18 /mnt/dev/console > > modes and date of course may be diferent. > > hofrat > I mount my ext2.img and run ls -l and I get crw-r----- 1 root root 5, 1 2008-11-15 02:24 console I think is not ok ?! Now regarding some steps in the creation of the rootfs: use "tmpfs" for cases where a writable file system is needed and add the following lines to the /etc/rc.sh script: # mount TMPFS because root-fs is readonly /bin/mount -t tmpfs -o size=2M tmpfs /tmpfs create the same symbolic links for device files that must be placed in a writable filesystem: dev/ptyp0 → /tmpfs/dev/ptyp0 dev/ttyp0 → /tmpfs/dev/ttyp0 dev/ptyp1 → /tmpfs/dev/ptyp1 dev/ttyp1 → /tmpfs/dev/ttyp1 dev/ptyp2 → /tmpfs/dev/ptyp2 dev/ttyp2 → /tmpfs/dev/ttyp2 dev/ptyp3 → /tmpfs/dev/ptyp3 dev/ttyp3 → /tmpfs/dev/ttyp3 dev/ptyp4 → /tmpfs/dev/ptyp4 dev/ttyp4 → /tmpfs/dev/ttyp4 dev/ptyp5 → /tmpfs/dev/ptyp5 dev/ttyp5 → /tmpfs/dev/ttyp5 dev/ptyp6 → /tmpfs/dev/ptyp6 dev/ttyp6 → /tmpfs/dev/ttyp6 dev/ptyp7 → /tmpfs/dev/ptyp7 dev/ttyp7 → /tmpfs/dev/ttyp7 dev/ptyp8 → /tmpfs/dev/ptyp8 dev/ttyp8 → /tmpfs/dev/ttyp8 dev/ptyp9 → /tmpfs/dev/ptyp9 dev/ttyp9 → /tmpfs/dev/ttyp9 dev/ptypa → /tmpfs/dev/ptypa dev/ttypa → /tmpfs/dev/ttypa dev/ptypb → /tmpfs/dev/ptypb dev/ttypb → /tmpfs/dev/ttypb dev/ptypc → /tmpfs/dev/ptypc dev/ttypc → /tmpfs/dev/ttypc dev/ptypd → /tmpfs/dev/ptypd dev/ttypd → /tmpfs/dev/ttypd dev/ptype → /tmpfs/dev/ptype dev/ttype → /tmpfs/dev/ttype dev/ptypf → /tmpfs/dev/ptypf dev/ttypf → /tmpfs/dev/ttypf tmp → /tmpfs/tmp var → /tmpfs/var dev/log → /var/log/log In case you use dhclient also: etc/dhclient.conf → /tmpfs/var/lib/dhclient.conf etc/resolv.conf → /tmpfs/var/lib/resolv.conf Shall I create the symlinks manually? Is rc.sh executed ?? I,ve created a tmpfs directory in my rootfs directory and even if I mount it on my host it's not populateed. place the corresponding directories and device files in the tmpfs file system, the following code is added to the /etc/rc.sh script: mkdir -p /tmpfs/tmp /tmpfs/dev \ /tmpfs/var/lib/dhcp /tmpfs/var/lock /tmpfs/var/run while read name minor do mknod /tmpfs/dev/ptyp$name c 2 $minor mknod /tmpfs/dev/ttyp$name c 3 $minor done <<__EOD__ 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 a 10 b 11 c 12 d 13 e 14 f 15 __EOD__ chmod 0666 /tmpfs/dev/* Cristian [-- Attachment #2: Type: text/html, Size: 6484 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: USB Flash rootfs prep! 2008-11-15 11:15 ` Cristian Axenie @ 2008-11-15 12:12 ` Cristian Axenie [not found] ` <Pine.LNX.4.58.0811150700530.5061@vlab.hofr.at> 1 sibling, 0 replies; 9+ messages in thread From: Cristian Axenie @ 2008-11-15 12:12 UTC (permalink / raw) To: Nicholas Mc Guire, linuxppc-embedded, Joachim Foerster [-- Attachment #1: Type: text/plain, Size: 3162 bytes --] So I mounted the ext2.img on my host and the /dev/console is not a regular file. If it helps or clears some aspects this is the contetnt of rootfs_devices.tab used at the ext2.img generation : #<name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count> /dev d 755 0 0 - - - - - /dev/console c 640 0 0 5 1 - - - /dev/fb0 c 640 0 0 29 0 - - - /dev/full c 640 0 0 1 7 - - - /dev/hda b 640 0 0 3 0 - - - /dev/hda b 640 0 0 3 1 1 1 16 /dev/kmem c 640 0 0 1 2 - - - /dev/mem c 640 0 0 1 1 - - - /dev/mtd c 640 0 0 90 0 0 2 16 /dev/mtdblock b 640 0 0 31 0 0 1 16 /dev/mtdr c 640 0 0 90 1 0 2 16 /dev/nftla b 640 0 0 93 0 - - - /dev/nftla b 640 0 0 93 1 1 1 8 /dev/nftlb b 640 0 0 93 16 - - - /dev/nftlb b 640 0 0 93 17 1 1 8 /dev/null c 640 0 0 1 3 - - - /dev/ptyp c 640 0 0 2 0 0 1 10 /dev/ptypa c 640 0 0 2 10 - - - /dev/ptypb c 640 0 0 2 11 - - - /dev/ptypc c 640 0 0 2 12 - - - /dev/ptypd c 640 0 0 2 13 - - - /dev/ptype c 640 0 0 2 14 - - - /dev/ptypf c 640 0 0 2 15 - - - /dev/ram b 640 0 0 1 0 0 1 2 /dev/ram b 640 0 0 1 1 - - - /dev/rtc c 640 0 0 10 135 - - - /dev/tty c 640 0 0 4 0 0 1 4 /dev/tty c 640 0 0 5 0 - - - /dev/ttyS c 640 0 0 4 64 0 1 8 /dev/ttyp c 640 0 0 3 0 0 1 10 /dev/ttypa c 640 0 0 3 10 - - - /dev/ttypb c 640 0 0 3 11 - - - /dev/ttypc c 640 0 0 3 12 - - - /dev/ttypd c 640 0 0 3 13 - - - /dev/ttype c 640 0 0 3 14 - - - /dev/ttypf c 640 0 0 3 15 - - - /dev/zero c 640 0 0 1 5 - - - Am I missing something ??? The ext2 formatting of the USB Flash Stick is influencing this ? Can you spot a probable cause ? Thank you ! Cristian [-- Attachment #2: Type: text/html, Size: 11376 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <Pine.LNX.4.58.0811150700530.5061@vlab.hofr.at>]
* Re: USB Flash rootfs prep! [not found] ` <Pine.LNX.4.58.0811150700530.5061@vlab.hofr.at> @ 2008-11-16 14:21 ` Cristian Axenie 0 siblings, 0 replies; 9+ messages in thread From: Cristian Axenie @ 2008-11-16 14:21 UTC (permalink / raw) To: Nicholas Mc Guire, linuxppc-embedded, Joachim Foerster [-- Attachment #1: Type: text/plain, Size: 1420 bytes --] On Sat, Nov 15, 2008 at 6:02 PM, Nicholas Mc Guire <hofrat@hofr.at> wrote: > > > > > > > I mount my ext2.img and run ls -l and I get > > > > crw-r----- 1 root root 5, 1 2008-11-15 02:24 console > > > > I think is not ok ?! > > > > > > thats fine - so that should not be your problem. > > what is the console device set to ? can you pass it an explicid > > console=/dev/ttyS0 or the like to map it to a device that exists for sure > and is in /dev/ ? off course you also have to check that the driver > support is in the kernel. > > hofrat I've managed to solve my problem. I took a clean ramdisk (that came with the ELDK) mount it , added my needed libs, devs and test apps , then generated an ramdisk.img (using genext2fs) , compressed it and then created an uBoot image file. The modified rootfs is now on my USB Flash stick and it works. My USB Flash rootfs is loaded properly by the kernel and related to my initial problem, to be more specific, I've created a root filesystem on my USB Flash stick where I added the xenomai dir (including /bin /lib /include...) generated during the Xenomai (from the trunk) install and also the devices rtheap rtp0... in the /dev directory of my FS. I also used the proper libc-2.6 standard shared libraries so the dynamic linker does't send a SIGSEGV anymore and I am able now to run ./latency or ./cyclictest). I don't receive SegFault anymore. Thanks to all, Cristian [-- Attachment #2: Type: text/html, Size: 1844 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-11-16 14:21 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-11-15 1:05 USB Flash rootfs prep! Cristian Axenie 2008-11-15 8:18 ` Joachim Foerster [not found] ` <9c789a000811150112q3088a044ub8b38489b2119a60@mail.gmail.com> 2008-11-15 9:12 ` Cristian Axenie 2008-11-15 10:01 ` Nicholas Mc Guire 2008-11-15 10:17 ` Cristian Axenie 2008-11-15 10:40 ` Nicholas Mc Guire 2008-11-15 11:15 ` Cristian Axenie 2008-11-15 12:12 ` Cristian Axenie [not found] ` <Pine.LNX.4.58.0811150700530.5061@vlab.hofr.at> 2008-11-16 14:21 ` Cristian Axenie
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).