Kashyap Chamarthy
2011-Aug-17 06:04 UTC
[Libguestfs] building a supermin appliance with febootstrap...
Rich, So, I tried to build the simple supermin app. from your blog. I can confirm that I did get to the shell when I invoked qemu-kvm. I used the standard qemu-kvm cmdline (but appended a serial console). This boots fine. ######################################################## [root at moon appliance-test]# qemu-kvm -kernel kernel -append "console=tty0 console=ttyS0,115200" -initrd initrd -hda root -nographic . . . insmod: error inserting 'ideapad-laptop.ko': -1 Unknown symbol in module insmod: wait: File exists febootstrap: insmod sym53c8xx.ko febootstrap: picked /sys/block/sda/dev as root device febootstrap: creating /dev/root as block special 8:0 febootstrap: mounting new root on /root febootstrap: chroot /proc/uptime: No such file or directory Welcome to my world bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell bash-4.2# [ 1.103034] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2 [ 1.334183] Refined TSC clocksource calibration: 1995.006 MHz. bash-4.2# ######################################################## But when I try to 'exit', I notice a kernel panic. And it just seems to hung there, no more budging. I had to do 'ctl a + x' to get out of the serial console. Is this expected? ######################################################## bash-4.2# exit exit [ 153.520309] Kernel panic - not syncing: Attempted to kill init! [ 153.523584] Pid: 1, comm: init Not tainted 2.6.40-4.fc15.x86_64 #1 [ 153.526990] Call Trace: [ 153.529039] [<ffffffff814ae2cd>] panic+0x91/0x19c [ 153.531914] [<ffffffff810580a2>] do_exit+0xb9/0x77b [ 153.534798] [<ffffffff810589e9>] do_group_exit+0x7a/0xa2 [ 153.537835] [<ffffffff81058a28>] sys_exit_group+0x17/0x17 [ 153.540924] [<ffffffff814bd7c2>] system_call_fastpath+0x16/0x1b ######################################################## -- /kashyap
Hilko Bengen
2011-Aug-17 09:01 UTC
[Libguestfs] building a supermin appliance with febootstrap...
* Kashyap Chamarthy:> So, I tried to build the simple supermin app. from your blog. I can > confirm that I did get to the shell when I invoked qemu-kvm. > > I used the standard qemu-kvm cmdline (but appended a serial console). This boots fine. > [...] > > But when I try to 'exit', I notice a kernel panic. And it just seems > to hung there, no more budging. I had to do 'ctl a + x' to get out of > the serial console. > Is this expected?This is normal behavior. The demo system as described by Rich has no regular init process. The shell has been started via exec, so it is PID 1. PID 1 has a special role on Unix and Linux, the first processs that is started by the kernel is normally /sbin/init which is responsible for bringing up the rest of the system. Something must have gone horribly wrong with the system if this process exits. And this is what the kernel panic message you posted is all about:> bash-4.2# exit > exit > [ 153.520309] Kernel panic - not syncing: Attempted to kill init! > [ 153.523584] Pid: 1, comm: init Not tainted 2.6.40-4.fc15.x86_64 #1-Hilko
Richard W.M. Jones
2011-Aug-17 09:24 UTC
[Libguestfs] building a supermin appliance with febootstrap...
On Wed, Aug 17, 2011 at 11:34:54AM +0530, Kashyap Chamarthy wrote:> But when I try to 'exit', I notice a kernel panic. And it just seems > to hung there, no more budging. I had to do 'ctl a + x' to get out > of the serial console. > Is this expected?As Hilko says, this is normal behaviour when the init process dies: http://lxr.linux.no/#linux+v3.0.2/kernel/exit.c#L728 In libguestfs, our "init process" is the guestfsd daemon. We configure the kernel to reboot instead of panicking by adding the kernel command line option "panic=1". If you use a real init or systemd then this won't be an issue because init will issue a reboot system call instead of exiting. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
Reasonably Related Threads
- Re: Notes on building libguestfs in a systemd-nspawn container
- Re: Notes on building libguestfs in a systemd-nspawn container
- Notes on building libguestfs in a systemd-nspawn container
- [PATCH febootstrap 0/2] febootstrap-supermin-helper should visit directory entries in order and ignore backup files
- centos 7, docker, NFS and uid = -2