mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.8 KiB

  1. Cross-Building ROCK Linux
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~
  3. 1. Cross building ROCK Linux itself
  4. ===================================
  5. Cross-Building ROCK Linux from one architecture to another is pretty easy.
  6. Just follow the steps described in the Documentation/BUILD file and make
  7. sure that you selected the 'This is a cross-build between architectures'
  8. configuration option.
  9. Now, when you start './scripts/Build-Target' it will first build a cross
  10. compiler and then cross compile a minimal ROCK Linux for you. This minimal
  11. system contains everything needed for a full-functional command-line system
  12. including init-process, shell, etc. but excluding the linux kernel itself.
  13. You can install this cross-compiled ROCK Linux system on your target
  14. architecture and make a full rebuild of ROCK Linux there if you need the
  15. more advanced packages (like X11).
  16. Note that not all targets can be cross-compiled without errors - but the
  17. target 'generic' should do fine.
  18. 2. Cross building the kernel
  19. ============================
  20. First extract the kernel sources somewhere. Do not cross-build the linux kernel
  21. in /usr/src/linux - this might screw up your system headers! Change to the
  22. linux kernel source directory.
  23. Before we can build the kernel we need to tell the system where the cross
  24. compiler we build with './scripts/Build-Target' is installed. It's in the
  25. ROCK Linux base directory under build/<config-id>/tools/crosscc. So we extend
  26. the PATH variable using a command like e.g. for PowerPC:
  27. export PATH="/rock-linux/build/powerpc-1.7.0-DEV-powerpc-cross-generic/tools/crosscc:$PATH"
  28. We also need to tell the kernel about the architecture and cross-compiler. Set
  29. in the Makefile the variables ARCH and CROSS_COMPILE to e.g. for PowerPC:
  30. ARCH = ppc
  31. CROSS_COMPILE = powerpc-unknown-linux-gnu-
  32. Now you can configure and build a kernel as usual using "make menuconfig"
  33. and "make vmlinux" (or something like "make bzImage").
  34. 3. Installing the results
  35. =========================
  36. This is the most complicated step and may be difficult for some architectures.
  37. You need to export the system in build/<config-id>/root using NFS and boot the
  38. cross-built kernel on the target architecture with nfs-root.
  39. Let's say we want to install our PowerPC cross-built on an RS/6000 with
  40. OpenFirmware. In that case we need to copy the kernel chrp image to a floppy
  41. disk and boot the kernel with the Openfirmware command:
  42. boot floppy:,zImage.prep root=/dev/nfs nfsroot=/ppc-nfs-root \
  43. ip=192.168.0.2:192.168.0.1
  44. Assuming that the nfs server has the ip 192.168.0.1, the client should
  45. use 192.168.0.2 and the exported directory is "/ppc-nfs-root". Read
  46. Documentation/nfsroot.txt from the linux kernel sources for details.
  47. Now you can use the standard Linux commands for creating a filesystem on a
  48. local partition and copy all system data.