* (unknown),
@ 2011-10-25 5:55 Renjun Qu
[not found] ` <CAPu47WTjxrrF+tHGRJOgKohD-sijBvX8iC-gBUnbsRw_KS4K5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Renjun Qu @ 2011-10-25 5:55 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA
Hello everyone:
I am building a small embedded linux system right now. I
confused that why the default rootfs must has a "dev/console" node. I
have made a experiment as follow:
1st, configure the kernel(2.6.32) to support the initramfs
and initrd, and set the source of the initramfs to a directory which
only has a "root" node.
2nd, configure the kernel to support the root file system on
nfs, and rebuild the kernel. I have created all necessary files and
directories in the directory exported by the nfs server.
3rd, set the appropriate boot parameter, and boot my kernel.
The result is, the kernel can successfully mount the root
file system, but the "/sbin/init" program can not print any
information to me. My "sbin/init" program is just a hello world
program which only print some greeting information.There is a
"dev/console" device node in the nfs exported directory.
But if i set the source of the initramfs to empty, and redo
my experiment from the 2nd step,everything will be ok. So, i think
there must be a “dev/console” node in the rootfs. The real root file
system already has a "dev/console" node, why default rootfs must have
a dev/console node. Please help me.
Best regards,
Ren jun Qu
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re:
[not found] ` <CAPu47WTjxrrF+tHGRJOgKohD-sijBvX8iC-gBUnbsRw_KS4K5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-11-01 11:52 ` Harald Hoyer
0 siblings, 0 replies; 2+ messages in thread
From: Harald Hoyer @ 2011-11-01 11:52 UTC (permalink / raw)
To: Renjun Qu; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On 25.10.2011 07:55, Renjun Qu wrote:
> Hello everyone:
> I am building a small embedded linux system right now. I
> confused that why the default rootfs must has a "dev/console" node. I
> have made a experiment as follow:
> 1st, configure the kernel(2.6.32) to support the initramfs
> and initrd, and set the source of the initramfs to a directory which
> only has a "root" node.
> 2nd, configure the kernel to support the root file system on
> nfs, and rebuild the kernel. I have created all necessary files and
> directories in the directory exported by the nfs server.
> 3rd, set the appropriate boot parameter, and boot my kernel.
> The result is, the kernel can successfully mount the root
> file system, but the "/sbin/init" program can not print any
> information to me. My "sbin/init" program is just a hello world
> program which only print some greeting information.There is a
> "dev/console" device node in the nfs exported directory.
> But if i set the source of the initramfs to empty, and redo
> my experiment from the 2nd step,everything will be ok. So, i think
> there must be a “dev/console” node in the rootfs. The real root file
> system already has a "dev/console" node, why default rootfs must have
> a dev/console node. Please help me.
>
> Best regards,
>
> Ren jun Qu
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Your small initramfs should have something like this in sbin/init:
mknod -m 0666 /dev/null c 1 3
mount -t proc -o nosuid,noexec,nodev proc /proc
mount -t sysfs -o nosuid,noexec,nodev sysfs /sys
ismounted() {
while read a m a; do
[ "$m" = "$1" ] && return 0
done < /proc/mounts
return 1
}
_opt="-o mode=0755,nosuid,exec"; _fs="-t devtmpfs"
ismounted /dev && { _opt="$_opt,remount"; unset _fs; }
if ! mount $_fs $_opt devtmpfs /dev >/dev/null 2>&1; then
# if it failed (remount can't fail - no need to redo $_opt), fall back to
# normal tmpfs
mount -t tmpfs $_opt tmpfs /dev >/dev/null 2>&1
# Make some basic devices first, let udev handle the rest
mknod -m 0666 /dev/null c 1 3
mknod -m 0666 /dev/ptmx c 5 2
mknod -m 0600 /dev/console c 5 1
mknod -m 0660 /dev/kmsg c 1 11
fi
# prepare the /dev directory (note: newer udevd takes care of it automatically)
[ ! -h /dev/fd ] && ln -s /proc/self/fd /dev/fd >/dev/null 2>&1
[ ! -h /dev/stdin ] && ln -s /proc/self/fd/0 /dev/stdin >/dev/null 2>&1
[ ! -h /dev/stdout ] && ln -s /proc/self/fd/1 /dev/stdout >/dev/null 2>&1
[ ! -h /dev/stderr ] && ln -s /proc/self/fd/2 /dev/stderr >/dev/null 2>&1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-01 11:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 5:55 (unknown), Renjun Qu
[not found] ` <CAPu47WTjxrrF+tHGRJOgKohD-sijBvX8iC-gBUnbsRw_KS4K5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-01 11:52 ` Harald Hoyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox