* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
@ 2010-03-16 11:32 ` Magnus Damm
2010-03-16 12:04 ` Magnus Damm
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Magnus Damm @ 2010-03-16 11:32 UTC (permalink / raw)
To: linux-sh
On Tue, Mar 16, 2010 at 8:22 PM, Fabio Giovagnini
<fabio.giovagnini@aurion-tech.com> wrote:
> Hi All,
> I'd like to know a link where to find info about step by spet procedure to
> embedding the initial root fs into the kernel
Which processor? I can email you a binary initramfs for sh4a if you
are interested.
/ magnus
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
2010-03-16 11:32 ` Magnus Damm
@ 2010-03-16 12:04 ` Magnus Damm
2010-03-16 12:11 ` Fabio Giovagnini
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Magnus Damm @ 2010-03-16 12:04 UTC (permalink / raw)
To: linux-sh
[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]
On Tue, Mar 16, 2010 at 8:32 PM, Magnus Damm <magnus.damm@gmail.com> wrote:
> On Tue, Mar 16, 2010 at 8:22 PM, Fabio Giovagnini
> <fabio.giovagnini@aurion-tech.com> wrote:
>> Hi All,
>> I'd like to know a link where to find info about step by spet procedure to
>> embedding the initial root fs into the kernel
>
> Which processor? I can email you a binary initramfs for sh4a if you
> are interested.
Ok, as for a step-by-step of what I do, see below:
1. Start off with a small initramfs that contains /dev/console
already. I got the attached file from the kernel quite some time ago.
2. Put your files for the initramfs in the directory "tmp", then run
the following:
$ cp initramfs_data-base.cpio initramfs_data.cpio
$ cd tmp && ( find . | cpio -o -H newc --force-local -A -F
"../initramfs_data.cpio" )
3. Modify your kernel configuration to point our your initramfs_data.cpio file:
CONFIG_INITRAMFS_SOURCE="/path/to/your/stuff/initramfs_data.cpio"
4. Make sure you include a script that creates device nodes for you,
or use udev or mdev.
5. I think /init is the first file that gets executed. I usually point
it to /sbin/init from busybox.
6. Start by using statically linked binaries to make it easy.
7. You can always try getting initramfs working with the sh4a binary
on the r2d board in QEMU.
Hope this helps. It's also possible to point out the directory instead
of using an cpio file.
/ magnus
[-- Attachment #2: initramfs_data-base.cpio --]
[-- Type: application/x-cpio, Size: 512 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
2010-03-16 11:32 ` Magnus Damm
2010-03-16 12:04 ` Magnus Damm
@ 2010-03-16 12:11 ` Fabio Giovagnini
2010-03-16 12:28 ` Fabio Giovagnini
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Fabio Giovagnini @ 2010-03-16 12:11 UTC (permalink / raw)
To: linux-sh
Thanks a lot Magnus, I'll keep you informed abotu my progress
Cheers
In data martedì 16 marzo 2010 13:04:54, Magnus Damm ha scritto:
: > On Tue, Mar 16, 2010 at 8:32 PM, Magnus Damm <magnus.damm@gmail.com>
wrote:
> > On Tue, Mar 16, 2010 at 8:22 PM, Fabio Giovagnini
> >
> > <fabio.giovagnini@aurion-tech.com> wrote:
> >> Hi All,
> >> I'd like to know a link where to find info about step by spet procedure
> >> to embedding the initial root fs into the kernel
> >
> > Which processor? I can email you a binary initramfs for sh4a if you
> > are interested.
>
> Ok, as for a step-by-step of what I do, see below:
>
> 1. Start off with a small initramfs that contains /dev/console
> already. I got the attached file from the kernel quite some time ago.
>
> 2. Put your files for the initramfs in the directory "tmp", then run
> the following:
> $ cp initramfs_data-base.cpio initramfs_data.cpio
> $ cd tmp && ( find . | cpio -o -H newc --force-local -A -F
> "../initramfs_data.cpio" )
>
> 3. Modify your kernel configuration to point our your initramfs_data.cpio
> file: CONFIG_INITRAMFS_SOURCE="/path/to/your/stuff/initramfs_data.cpio"
>
> 4. Make sure you include a script that creates device nodes for you,
> or use udev or mdev.
>
> 5. I think /init is the first file that gets executed. I usually point
> it to /sbin/init from busybox.
>
> 6. Start by using statically linked binaries to make it easy.
>
> 7. You can always try getting initramfs working with the sh4a binary
> on the r2d board in QEMU.
>
> Hope this helps. It's also possible to point out the directory instead
> of using an cpio file.
>
> / magnus
>
--
Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (2 preceding siblings ...)
2010-03-16 12:11 ` Fabio Giovagnini
@ 2010-03-16 12:28 ` Fabio Giovagnini
2010-03-16 12:29 ` Magnus Damm
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Fabio Giovagnini @ 2010-03-16 12:28 UTC (permalink / raw)
To: linux-sh
What default command kernel line I have to set?
the standard I find from MCP data is
console=ttySC0,19200 rootfstype=jffs2
but I have probelm with nor flash and so I'm tring to boot in a different way to
have with busybox more test tools in my hands
Thanks a lot
In data martedì 16 marzo 2010 13:11:24, Fabio Giovagnini ha scritto:
: > Thanks a lot Magnus, I'll keep you informed abotu my progress
>
> Cheers
>
> In data martedì 16 marzo 2010 13:04:54, Magnus Damm ha scritto:
> : > On Tue, Mar 16, 2010 at 8:32 PM, Magnus Damm <magnus.damm@gmail.com>
>
> wrote:
> > > On Tue, Mar 16, 2010 at 8:22 PM, Fabio Giovagnini
> > >
> > > <fabio.giovagnini@aurion-tech.com> wrote:
> > >> Hi All,
> > >> I'd like to know a link where to find info about step by spet
> > >> procedure to embedding the initial root fs into the kernel
> > >
> > > Which processor? I can email you a binary initramfs for sh4a if you
> > > are interested.
> >
> > Ok, as for a step-by-step of what I do, see below:
> >
> > 1. Start off with a small initramfs that contains /dev/console
> > already. I got the attached file from the kernel quite some time ago.
> >
> > 2. Put your files for the initramfs in the directory "tmp", then run
> > the following:
> > $ cp initramfs_data-base.cpio initramfs_data.cpio
> > $ cd tmp && ( find . | cpio -o -H newc --force-local -A -F
> > "../initramfs_data.cpio" )
> >
> > 3. Modify your kernel configuration to point our your initramfs_data.cpio
> > file: CONFIG_INITRAMFS_SOURCE="/path/to/your/stuff/initramfs_data.cpio"
> >
> > 4. Make sure you include a script that creates device nodes for you,
> > or use udev or mdev.
> >
> > 5. I think /init is the first file that gets executed. I usually point
> > it to /sbin/init from busybox.
> >
> > 6. Start by using statically linked binaries to make it easy.
> >
> > 7. You can always try getting initramfs working with the sh4a binary
> > on the r2d board in QEMU.
> >
> > Hope this helps. It's also possible to point out the directory instead
> > of using an cpio file.
> >
> > / magnus
>
--
Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (3 preceding siblings ...)
2010-03-16 12:28 ` Fabio Giovagnini
@ 2010-03-16 12:29 ` Magnus Damm
2010-03-16 12:35 ` Fabio Giovagnini
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Magnus Damm @ 2010-03-16 12:29 UTC (permalink / raw)
To: linux-sh
On Tue, Mar 16, 2010 at 9:28 PM, Fabio Giovagnini
<fabio.giovagnini@aurion-tech.com> wrote:
> What default command kernel line I have to set?
I have no idea. =) Nothing for initramfs I think.
> the standard I find from MCP data is
> console=ttySC0,19200 rootfstype=jffs2
>
> but I have probelm with nor flash and so I'm tring to boot in a different way to
> have with busybox more test tools in my hands
What hardware platform is this? rsk7203?
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (4 preceding siblings ...)
2010-03-16 12:29 ` Magnus Damm
@ 2010-03-16 12:35 ` Fabio Giovagnini
2010-03-16 12:41 ` Magnus Damm
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Fabio Giovagnini @ 2010-03-16 12:35 UTC (permalink / raw)
To: linux-sh
It si my own, derived form rsk+7203
its name in MLCD, and at the and I'll can send the BSP to linux-sh list, if
you like
In data martedì 16 marzo 2010 13:29:25, Magnus Damm ha scritto:
: > On Tue, Mar 16, 2010 at 9:28 PM, Fabio Giovagnini
>
> <fabio.giovagnini@aurion-tech.com> wrote:
> > What default command kernel line I have to set?
>
> I have no idea. =) Nothing for initramfs I think.
>
> > the standard I find from MCP data is
> > console=ttySC0,19200 rootfstype=jffs2
> >
> > but I have probelm with nor flash and so I'm tring to boot in a different
> > way to have with busybox more test tools in my hands
>
> What hardware platform is this? rsk7203?
>
> Cheers,
>
> / magnus
>
--
Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (5 preceding siblings ...)
2010-03-16 12:35 ` Fabio Giovagnini
@ 2010-03-16 12:41 ` Magnus Damm
2010-03-18 21:05 ` Fabio Giovagnini
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Magnus Damm @ 2010-03-16 12:41 UTC (permalink / raw)
To: linux-sh
> In data martedì 16 marzo 2010 13:29:25, Magnus Damm ha scritto:
>> What hardware platform is this? rsk7203?
On Tue, Mar 16, 2010 at 9:35 PM, Fabio Giovagnini
<fabio.giovagnini@aurion-tech.com> wrote:
> It si my own, derived form rsk+7203
> its name in MLCD, and at the and I'll can send the BSP to linux-sh list, if
> you like
Ok, I think we may be interested in processor specific fixes to begin
with. But you need to update your BSP kernel to latest upstream before
we can use any of your work.
So please work with the latest kernel if possible. It is almost
impossible to fix bugs in an old kernel, and very few people will give
you support unless you pay them.
Thanks!
/ magnus
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (6 preceding siblings ...)
2010-03-16 12:41 ` Magnus Damm
@ 2010-03-18 21:05 ` Fabio Giovagnini
2010-03-18 21:07 ` Fabio Giovagnini
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Fabio Giovagnini @ 2010-03-18 21:05 UTC (permalink / raw)
To: linux-sh
Hi magnus, still in troubles.
I have very low performances rooting nfs. I'm coming back to the idea of
initfsram.
What is exactly r2d board in QEMU?
Where can I study QEMU for sh family?
I read wiki.qemu.org and no word about sh; at leas it seems.
Let me know, thanks
In data martedì 16 marzo 2010 13:04:54, Magnus Damm ha scritto:
: > 7. You can always try getting initramfs working with the sh4a binary
> on the r2d board in QEMU.
>
--
Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (7 preceding siblings ...)
2010-03-18 21:05 ` Fabio Giovagnini
@ 2010-03-18 21:07 ` Fabio Giovagnini
2010-03-19 4:58 ` Magnus Damm
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Fabio Giovagnini @ 2010-03-18 21:07 UTC (permalink / raw)
To: linux-sh
Wher do I have to include the script creating the nodes?
Thanks
In data martedì 16 marzo 2010 13:04:54, Magnus Damm ha scritto:
: > 3. Modify your kernel configuration to point our your initramfs_data.cpio
> file: CONFIG_INITRAMFS_SOURCE="/path/to/your/stuff/initramfs_data.cpio"
>
> 4. Make sure you include a script that creates device nodes for you,
> or use udev or mdev.
>
> 5. I think /init is the first file that gets executed. I usually point
> it to /sbin/init from busybox.
>
--
Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (8 preceding siblings ...)
2010-03-18 21:07 ` Fabio Giovagnini
@ 2010-03-19 4:58 ` Magnus Damm
2010-03-19 5:23 ` Fabio Giovagnini
2010-03-19 5:44 ` Magnus Damm
11 siblings, 0 replies; 13+ messages in thread
From: Magnus Damm @ 2010-03-19 4:58 UTC (permalink / raw)
To: linux-sh
On Fri, Mar 19, 2010 at 6:07 AM, Fabio Giovagnini
<fabio.giovagnini@aurion-tech.com> wrote:
> Wher do I have to include the script creating the nodes?
It depends on your user space setup.
I'm using busybox with init enabled together with the following line
in my /etc/inittab:
::sysinit:/etc/init.d/rcS
The file /etc/init.d/rcS looks like this:
#!/bin/sh
# sysfs is mandatory
mount -t sysfs none /sys
# optional filesystem support
mount -t proc none /proc
mount -t tmpfs none /tmp
# use tmpfs for /dev
mount -t tmpfs -o sizedk,mode\a55 tmpfs /dev
# optional /dev/pts filesystem support
mkdir -p /dev/pts
mount -t devpts none /dev/pts
# setup mdev as hotplug handler
if [ -f /proc/sys/kernel/hotplug ]; then
echo /sbin/mdev > /proc/sys/kernel/hotplug
else
/sbin/sysctl -w kernel.hotplug=/sbin/mdev
fi
# udev replacement
mdev -s
# setup local network interface
ifconfig lo 127.0.0.1 up
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (9 preceding siblings ...)
2010-03-19 4:58 ` Magnus Damm
@ 2010-03-19 5:23 ` Fabio Giovagnini
2010-03-19 5:44 ` Magnus Damm
11 siblings, 0 replies; 13+ messages in thread
From: Fabio Giovagnini @ 2010-03-19 5:23 UTC (permalink / raw)
To: linux-sh
Ok I understand.
But now I'd like to test first as init the hello world program.
Do you use uclibc for userspace building applications?
In data venerdì 19 marzo 2010 05:58:25, Magnus Damm ha scritto:
: > On Fri, Mar 19, 2010 at 6:07 AM, Fabio Giovagnini
>
> <fabio.giovagnini@aurion-tech.com> wrote:
> > Wher do I have to include the script creating the nodes?
>
> It depends on your user space setup.
>
> I'm using busybox with init enabled together with the following line
>
> in my /etc/inittab:
> ::sysinit:/etc/init.d/rcS
>
> The file /etc/init.d/rcS looks like this:
> #!/bin/sh
>
> # sysfs is mandatory
> mount -t sysfs none /sys
>
> # optional filesystem support
> mount -t proc none /proc
> mount -t tmpfs none /tmp
>
> # use tmpfs for /dev
> mount -t tmpfs -o sizedk,mode\a55 tmpfs /dev
>
> # optional /dev/pts filesystem support
> mkdir -p /dev/pts
> mount -t devpts none /dev/pts
>
> # setup mdev as hotplug handler
> if [ -f /proc/sys/kernel/hotplug ]; then
> echo /sbin/mdev > /proc/sys/kernel/hotplug
> else
> /sbin/sysctl -w kernel.hotplug=/sbin/mdev
> fi
>
> # udev replacement
> mdev -s
>
> # setup local network interface
> ifconfig lo 127.0.0.1 up
>
--
Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: Trouble with embedding initial root fs into the kernel
2010-03-16 11:22 Trouble with embedding initial root fs into the kernel Fabio Giovagnini
` (10 preceding siblings ...)
2010-03-19 5:23 ` Fabio Giovagnini
@ 2010-03-19 5:44 ` Magnus Damm
11 siblings, 0 replies; 13+ messages in thread
From: Magnus Damm @ 2010-03-19 5:44 UTC (permalink / raw)
To: linux-sh
On Fri, Mar 19, 2010 at 2:23 PM, Fabio Giovagnini
<fabio.giovagnini@aurion-tech.com> wrote:
> Ok I understand.
> But now I'd like to test first as init the hello world program.
> Do you use uclibc for userspace building applications?
Nope, I've only used glibc on SH. Actually, I have very little
experience with sh2a user space, so you should ask someone else for
recommendation in that area.
You can always write a freestanding hello world example without libc:
http://blog.ksplice.com/2010/03/libc-free-world/
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 13+ messages in thread