WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Trouble booting Tiny Core in usermodelinux  (Read 5226 times)

Offline btheado

  • Newbie
  • *
  • Posts: 9
Trouble booting Tiny Core in usermodelinux
« on: January 01, 2011, 05:52:35 PM »
I'm interested in booting into Tiny Core using usermodelinux (UML)  and haven't been able to get it to work yet.

I downloaded and bunzipped the latest 32-bit UML kernel/executable from [removed, see 4 - sources?].

Code: [Select]
wget [...]
bunzip2 kernel32-2.6.36.2.bz2
chmod +x kernel32-2.6.36.2

Then I tried to boot the Tiny Core initial ramdisk (which I have named tinycore-341.gz) using that kernel:

Code: [Select]
./kernel32-2.6.36.2 initrd=tinycore-341.gz text
That segfaulted and it turned out to be because UML defaults to allocating just 32M of ram to the guest instance.

If I allocate more memory, then it seems to boot correctly until it gets to the last step of actually logging in as the tc user.  At that point it doesn't give a login prompt or a shell prompt and I haven't figured out what to do to troubleshoot it.  Here is the command I'm running:

Code: [Select]
./kernel32-2.6.36.2 initrd=tinycore-341.gz mem=128M nozswap text pause
Here is some of the output from the boot:

Booting tinycore_3.4.1
Running Linux Kernel 2.6.36.2.
Checking boot options...Done.
Starting udev daemon for hotplug support...[    2.210000] udevd (968): /proc/968
/oom_adj is deprecated, please use /proc/968/oom_score_adj instead.            
Done.                                                                          
Skipping compressed swap in ram as requested from the boot command line.        
Scanning hard disk partitions to create /etc/fstab                              
Setting Language to C Done.                                                    
Setting Timezone to UTC Done.                                                  
hwclock: can't open '/dev/misc/rtc': No such file or directory                  
Possible swap partition(s) enabled.                                            
Loading Tiny Core Extensions...Done.                                            
Setting keymap to usloadkmap: can't open console                                
 Done.                                                                          
Boot time configuration completed. Press <Enter> to continue.


After I press <Enter>, I see this and then nothing else:

[   16.910000] Virtual console 1 assigned device '/dev/ptyp0'
login[1750]: root login on 'tty1'                                                                                                                    


Anyone have any ideas on what I can do to further troubleshoot?

As a check to make sure I can get UML working at all, I downloaded a DSL image from [...] and successfully get a shell prompt with it:

Code: [Select]
wget [...]
bunzip2 DSL-4.4-root_fs.bz2
./kernel32-2.6.36.2 ubda=DSL-4.4-root_fs
« Last Edit: January 05, 2011, 06:53:57 PM by ^thehatsrule^ »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Trouble booting Tiny Core in usermodelinux
« Reply #1 on: January 01, 2011, 08:22:03 PM »
I doubt the modules in tinycore.gz will be compatible with your kernel.

Offline btheado

  • Newbie
  • *
  • Posts: 9
Re: Trouble booting Tiny Core in usermodelinux
« Reply #2 on: January 01, 2011, 11:49:49 PM »
By 'modules' are you referring to kernel modules?  Based on my experience with booting Tiny Core using the colinux kernel (http://forum.tinycorelinux.net/index.php?topic=7348), I thought none of the kernel modules in tinycore.gz were crucial for getting to the shell prompt.  I can boot using the colinux kernel and unmodified tinycore.gz and get to a shell prompt.  The output of 'lsmod' shows no loaded modules.

So I thought the same might work for the UML kernel.  But maybe both the tinycore kernel and the colinux kernel have something crucial compiled in which the UML kernel lacks?  Any idea how I can find out?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Trouble booting Tiny Core in usermodelinux
« Reply #3 on: January 01, 2011, 11:59:52 PM »
If all you ever want to do is get a shell prompt, go ahead.

Offline btheado

  • Newbie
  • *
  • Posts: 9
Re: Trouble booting Tiny Core in usermodelinux
« Reply #4 on: January 02, 2011, 07:44:25 AM »
If all you ever want to do is get a shell prompt, go ahead.

That's what I'm trying to do, but it isn't working.  I don't get a shell prompt and I'm trying to figure out why.

Offline btheado

  • Newbie
  • *
  • Posts: 9
[SOLVED] Trouble booting Tiny Core in usermodelinux
« Reply #5 on: January 02, 2011, 05:22:28 PM »
I figured out why I wasn't seeing the login/bash prompt.

It seems by default only tty0 is redirected to stdin/stdout of the running UML process.  So tty0 is the only one the user can interact with directly.  However, the /etc/inittab in the tinycore.gz initrd only spawns rungetty for tty1. 

I found http://user-mode-linux.sourceforge.net/old/input.html which describes how to modify the tty handling.  When I use this command-line, I get to the login/bash prompt successfully:

Code: [Select]
./kernel32-2.6.36.2 initrd=tinycore-341.gz mem=128M text con0=pty con1=fd:0,fd:1
This causes tty1 to be redirected to the stdin/stdout of the kernel32-2.6.36.2 process and a login prompt appears.  The only drawback is the normal tinycore boot messages are now going to tty1 and are therefore invisible.  Perhaps an alternative would have been to remaster tinycore.gz with a /etc/inittab that uses tty0 instead of tty1.

UML allows access to the host file system and support for squashfs and I was able to use 'tce-load -i' to load and use .tcz extensions just fine. 

I didn't try to setup networking yet, but it appears to be quite possible to get a fully functioning Tiny Core running within UML.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Trouble booting Tiny Core in usermodelinux
« Reply #6 on: January 02, 2011, 06:03:57 PM »
There is a multivt boot option.