1 Normally, a minimal initrd is created automatically by the rcutorture 2 scripting. But minimal really does mean "minimal", namely just a single 3 root directory with a single statically linked executable named "init": 4 5 $ size tools/testing/selftests/rcutorture/initrd/init 6 text data bss dec hex filename 7 328 0 8 336 150 tools/testing/selftests/rcutorture/initrd/init 8 9 Suppose you need to run some scripts, perhaps to monitor or control 10 some aspect of the rcutorture testing. This will require a more fully 11 filled-out userspace, perhaps containing libraries, executables for 12 the shell and other utilities, and soforth. In that case, place your 13 desired filesystem here: 14 15 tools/testing/selftests/rcutorture/initrd 16 17 For example, your tools/testing/selftests/rcutorture/initrd/init might 18 be a script that does any needed mount operations and starts whatever 19 scripts need starting to properly monitor or control your testing. 20 The next rcutorture build will then incorporate this filesystem into 21 the kernel image that is passed to qemu. 22 23 Or maybe you need a real root filesystem for some reason, in which case 24 please read on! 25 26 The remainder of this document describes one way to create the 27 rcu-test-image file that contains the filesystem used by the guest-OS 28 kernel. There are probably much better ways of doing this, and this 29 filesystem could no doubt be smaller. It is probably also possible to 30 simply download an appropriate image from any number of places. 31 32 That said, here are the commands: 33 34 ------------------------------------------------------------------------ 35 dd if=/dev/zero of=rcu-test-image bs=400M count=1 36 mkfs.ext3 ./rcu-test-image 37 sudo mount -o loop ./rcu-test-image /mnt 38 39 # Replace "precise" below with your favorite Ubuntu release. 40 # Empirical evidence says this image will work for 64-bit, but... 41 # Note that debootstrap does take a few minutes to run. Or longer. 42 sudo debootstrap --verbose --arch i386 precise /mnt http://archive.ubuntu.com/ubuntu 43 cat << '___EOF___' | sudo dd of=/mnt/etc/fstab 44 # UNCONFIGURED FSTAB FOR BASE SYSTEM 45 # 46 /dev/vda / ext3 defaults 1 1 47 dev /dev tmpfs rw 0 0 48 tmpfs /dev/shm tmpfs defaults 0 0 49 devpts /dev/pts devpts gid=5,mode=620 0 0 50 sysfs /sys sysfs defaults 0 0 51 proc /proc proc defaults 0 0 52 ___EOF___ 53 sudo umount /mnt 54 ------------------------------------------------------------------------ 55 56 57 References: 58 59 http://sripathikodi.blogspot.com/2010/02/creating-kvm-bootable-fedora-system.html 60 https://help.ubuntu.com/community/KVM/CreateGuests 61 https://help.ubuntu.com/community/JeOSVMBuilder 62 http://wiki.libvirt.org/page/UbuntuKVMWalkthrough 63 http://www.moe.co.uk/2011/01/07/pci_add_option_rom-failed-to-find-romfile-pxe-rtl8139-bin/ -- "apt-get install kvm-pxe" 64 https://www.landley.net/writing/rootfs-howto.html 65 https://en.wikipedia.org/wiki/Initrd 66 https://en.wikipedia.org/wiki/Cpio 67 http://wiki.libvirt.org/page/UbuntuKVMWalkthrough
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.