############################################################## # Document: HOWTO-BUILD-LINUX-2.6 # Purpose : Document how to build a Linux Kernel for use on an # Acorn StrongARM RiscPC. # Author..: Stuart Winter # Date....: 22-Jan-2005 # Version : 1.00 ############################################################### # Eventually this will be turned into a proper build script # once I have a nice working ARM Linux Kernel and some more time # on my hands. ############################################################### # Should also build: # d/kernel-headers (see d/kernel-headers) # a/kernel-modules # These packages will be created from a single build script # but the packages will only ever be dumped into /tmp # as I'm not always going to want to update the kernel-headers # package. # This is one of those TODOs which may sit around for a while. ## ---------------------------------------------------------------------------------------- Cross compiling a Kernel using gcc 3.3 ---------------------------------------------------------------------------------------- # Download the handhelds.org gcc-3.3 ARM toolchain: # cd /tmp # wget http://handhelds.org/download/toolchain/arm-linux-gcc-3.3.2.tar.bz2 # tar jxf arm-linux-gcc-3.3.2.tar.bz2 -C/ # chown -R root.root /usr/local/arm # We're using this Kernel version: KVER=2.6.10 # Add our cross compiler stuff to our path: export PATH=/usr/local/arm/3.3.2/bin:$PATH # Setup the working environment: PKG=/tmp/package-kernel cd /tmp rm -rf {kernel,package-kernel} mkdir -p {kernel,package-kernel} && cd kernel # Update this path with the one where your ARM kernel bits are (source, patches & config): KPTH=/scratchbox/users/build/home/build/armedslack-current/source/k tar jxf $KPTH/sources/linux-2.6/linux-$KVER.tar.bz2 ln -fs linux-$KVER linux cd linux chown -R root:root . # Install ARMedslack Kernel config file (this is always the latest .config) install -m644 $KPTH/configs/config-riscpc-linux-2.6 .config # RapIDE driver. patch -p1 < $KPTH/sources/linux-2.6/patches/rapide.patch # Fix up Makefile so we're compiling for ARM & it knows we're cross compiling: perl -pi -e 's?^ARCH.*=.*?ARCH = arm?;' Makefile perl -pi -e 's?^CROSS_COMPILE.*=.*?CROSS_COMPILE = arm-linux-?;' Makefile # Compile Kernel: make oldconfig make clean && make zImage && make modules # Archive the compiled source (esp useful to shove into /usr/src on # a devbox when building alsa or something else that wants kernel source) ( cd .. tar jcf /scratchbox/users/build/home/build/kernel-riscpc-srcbuilt-$KVER.tar.bz2 . ) # Install Kernel modules into a packageable directory: make modules_install INSTALL_MOD_PATH=$PKG mkdir -p /tmp/package-kernel/{install,boot} install -m644 System.map $PKG/boot/System.map-riscpc-$KVER install -m644 arch/arm/boot/zImage $PKG/boot/zImage-riscpc-$KVER # Now make the package (following the Slackware standard here): install -m644 .config $PKG/install/config-riscpc-$KVER # The description: install -m644 $KPTH/slack-desc $PKG/install # Make symlinks: cd $PKG/boot ln -s System.map-riscpc-$KVER System.map ln -s zImage-riscpc-$KVER zImage # Build the base Kernel package (without libraries): cd $PKG chown -R root:root . chmod -R og-w . # Move the libs out of the way -- they go in a/kernel-modules package mv lib /tmp/$$lib makepkg -l y -c y /tmp/kernel-riscpc-$KVER-arm-1.tgz # Now put the libs back (we need them for the a/kernel-modules package): mv /tmp/$$lib lib # Now go into a/kernel-modules and run the build script. # Then take the zImage; # copy it to prisere; # reboot a devbox (zaden); # copy the zImage from prisere into !SlackBt (renaming the old one just incase!); # boot the devbox with the new zImage; # Test it for a while, build some more packages; if it works, put it into !SlackBt # and re-zip it.