Emulate piCore with QEMU
Compile the RPI Linux Kernel
Start by creating a working directory and getting the necessary sources and tools:
|
|
Continue by patching and configuring the kernel as outlined in my previous post. When you get to the menuconfig, in addition to the other options (i.e. the ones described in the last post), also select these:
|
|
Then continue compiling the kernel:
|
|
Install the modules in a temporary directory:
|
|
Prepare the initramfs
Download and extract the latest piCore image, then mount the first partition and copy out the piCore initramfs 6.0.gz
:
|
|
Extract the piCore initramfs and copy in the new kernel modules we just compiled. These steps have to be done as root to preserve file permissions:
|
|
Make some changes to make booting smoother, free some space and be able to run tce
commands as root:
|
|
Finish up by recompressing the initramfs:
|
|
Boot to TinyCore
First, create a disk image that we will use for storing extensions and persistent configuration:
|
|
Boot with the kernel we just compiled, the initramfs and the disk image:
|
|
Login with username tc
(just type tc
and hit enter). Then, become root, format the disk image, and setup the tce directory on the disk image. By having the tce directory on the disk image, we can persist installed extensions across boots.
|
|
Now, any extensions you install will be stored on the disk image, so they will be automatically loaded when you boot. To check that this works, lets try installing an openssh server and then rebooting:
|
|
Just check that ssh is working (change the tc
user’s password first):
|
|
To persist the openssh configuration (and passwd
file) across boots, we can back them up by adding their paths to /opt/.filetool.lst
and calling filetool.sh -b
:
|
|
The files should now be backed up and stored in /mnt/sda/tce/mydata.tgz
. Lets reboot and check that the ssh server is in fact started after booting:
|
|
You can also ssh in from your guest machine by forwarding a port with QEMU:
|
|
References
http://forum.tinycorelinux.net/index.php?topic=14080.0
http://myblog-kenton.blogspot.com/2012/03/install-openssh-server-on-tiny-core.html