Building ArchLinux kernel with cross toolchain

Started by r3flow, October 01, 2012, 09:05:36 pm

Previous topic - Next topic


October 01, 2012, 09:05:36 pm Last Edit: October 01, 2012, 09:09:47 pm by r3flow
Anybody who missing drivers from the Arch Linux kernel and don't want to use the alarm native build system, I wrote a small script that rebuilds the Arch kernel with your favorite cross tolchain. It's doesn't generate a pacman package, but I think it's also would be possible.

The only requirement is that your toolchain should be in the PATH and the CROSS_TOOL_PREFIX variable should be set according to your toolchain. Everything else will be downloaded from the internet.

Step 1: download

./ prepare

Step 2: configure the kernel (optional, but this is the goal)

./ config

Step 3: build the kernel and modules

./ build

Step 4: generate boot image and module archive

./ pack

The binaries will be placed in the "bin" directory and should be installed manually. Tested on CentOS 6 but I think it will works on other systems too.


Missing patch?

root@raspberrypi# pwd

root@raspberrypi# ./ prepare
patching file linux_prep/cmdlines/iMX28_EVK.txt
patching file linux_prep/cmdlines/stmp378x_dev.txt
patching file
patching file linux_prep/include/mx23/platform.h
patch: **** Can't open patch file ../imx-boot-build.patch : No such file or directory

root@raspberrypi# find . | grep imx-boot-build.patch


Thanks, that fixed it!

Odd ball question: Difference between imx-bootlets-src-10.05.02 and 10.12.01?


Thank you so much! I had to make two small changes to make it work:

---       2012-10-17 10:04:35.133216603 +0200
+++ 2012-10-17 10:20:49.493216604 +0200
@@ -147,7 +147,8 @@
     rm -rf lib

-    cp "${BOOT_SRC_DIR}/" "${OUTPUT_ROOT_DIR}/sd_mmc_bootstream.raw"
+    dd if=/dev/zero of="${OUTPUT_ROOT_DIR}/sd_mmc_bootstream.raw" bs=512 count=4
+    cat "${BOOT_SRC_DIR}/" >> "${OUTPUT_ROOT_DIR}/sd_mmc_bootstream.raw"

export PATH=`pwd`/"${IMX23_ELFTOSB_DIR}":$PATH

as well as unchecking "Kernel support for a.out and ECOFF binaries" in "Userspace binary formats" to make my Kernel compile.
But also with this Kernel standby & resume (via PWR BTN) does not work on my board - it suspends but I can not wake it up. Does it work with yours?


Theoretically the resulted kernel is same as the official Arch ARM kernel, just built with a cross toolchain instead of the native toolchain. So should not be any regression there compared to the offical ARM kernel.

The wakeup (from standby) also doesn't work for me. I didn't tried this with the offical 2.6.35 ArchARM kernel but I hope that's doesn't work too. :)

Also I use the freescale trunk (the commented line git clone --depth=1 ${KGIT_ROOT} "${KSRC_DIR}") instead of the offical "imx_2.6.35_10.12.01" branch/commit, beacuse it seems more stable for me. Also might be should try with other versions of imx-bootlets...


Quote from: rabinath on October 17, 2012, 11:53:51 am
Thank you so much! I had to make two small changes to make it work:

-    cp "${BOOT_SRC_DIR}/" "${OUTPUT_ROOT_DIR}/sd_mmc_bootstream.raw"
+    dd if=/dev/zero of="${OUTPUT_ROOT_DIR}/sd_mmc_bootstream.raw" bs=512 count=4
+    cat "${BOOT_SRC_DIR}/" >> "${OUTPUT_ROOT_DIR}/sd_mmc_bootstream.raw"

Yes, it's simpler for advanced users, but the offical installation instructions already does this

Also the imx-bootlets-src-10.12.01/Makefile also contains this step, but commented out...