Re: init: illegal runlevel (null)
> here is a description of what I'm trying to do. > > I created a small rootfs with buildroot and I gPXE booted it. Once that is > running I do > > mount -t tmpfs -o size=4G mount -t tmpfs -o size=4G none /tmp > > (I have a system with 8GB of RAM) > > and then i copy with scp a new rootfs (rootfs.img whose size is around > 2.5GB) under /tmp > > At this point, this I run this simple script > > #!/bin/bash > cd /tmp > mkdir newrootfs > mount rootfs.img newrootfs > cd newrootfs > mkdir oldrootfs > pivot_root . oldrootfs > exec chroot . sh -c 'exec /sbin/init' dev/console 2>&1 > > I can see the new root is rootfs, but still there is something not working. > When I run the script I get the message > > init: illegal runlevel (null) > > Any idea of what can be wrong? The script calling "exec chroot . sh -c 'exec /sbin/init'..." has to have pid 1 otherwise init will expect a run level. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: init: illegal runlevel (null)
Ok. Reading the pivot_root man page (http://linux.die.net/man/8/pivot_root) to change the root fs mount /dev/hda1 /new-root cd /new-root pivot_root . old-root exec chroot . sh dev/console 2>&1 So I changed exec chroot . sh -c 'exec /sbin/init' dev/console 2>&1 to exec chroot . sh dev/console 2>&1 I do not see any complains, but the /proc dir is empty now. If I try to change run level though I get telinit 5 telinit: Unable to send message: Connection refused Thank you, Luca On Thu, Dec 17, 2009 at 9:06 AM, Konstantin Svist wrote: > On 12/17/2009 08:41 AM, Luca wrote: > >> #!/bin/bash >> cd /tmp >> mkdir newrootfs >> mount rootfs.img newrootfs >> cd newrootfs >> mkdir oldrootfs >> pivot_root . oldrootfs >> exec chroot . sh -c 'exec /sbin/init' dev/console 2>&1 >> >> I can see the new root is rootfs, but still there is something not >> working. When I run the script I get the message >> >> init: illegal runlevel (null) >> >> > It looks like you think /sbin/init does something other than what it really > does. > http://www.fedorafaq.org/basics/#runlevel > > -- > fedora-list mailing list > fedora-list@redhat.com > To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list > Guidelines: > http://fedoraproject.org/wiki/Communicate/MailingListGuidelines > -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: init: illegal runlevel (null)
On 12/17/2009 08:41 AM, Luca wrote: #!/bin/bash cd /tmp mkdir newrootfs mount rootfs.img newrootfs cd newrootfs mkdir oldrootfs pivot_root . oldrootfs exec chroot . sh -c 'exec /sbin/init' dev/console 2>&1 I can see the new root is rootfs, but still there is something not working. When I run the script I get the message init: illegal runlevel (null) It looks like you think /sbin/init does something other than what it really does. http://www.fedorafaq.org/basics/#runlevel -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
init: illegal runlevel (null)
Hi all, here is a description of what I'm trying to do. I created a small rootfs with buildroot and I gPXE booted it. Once that is running I do mount -t tmpfs -o size=4G mount -t tmpfs -o size=4G none /tmp (I have a system with 8GB of RAM) and then i copy with scp a new rootfs (rootfs.img whose size is around 2.5GB) under /tmp At this point, this I run this simple script #!/bin/bash cd /tmp mkdir newrootfs mount rootfs.img newrootfs cd newrootfs mkdir oldrootfs pivot_root . oldrootfs exec chroot . sh -c 'exec /sbin/init' dev/console 2>&1 I can see the new root is rootfs, but still there is something not working. When I run the script I get the message init: illegal runlevel (null) Any idea of what can be wrong? Thank you all, Luca -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines