rcu-test-image.txt 3.0 KB

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