Cross-compiling a custom-kernel for Raspbian PI2; HowTo?
Hello,
according this https://www.raspberrypi.com/document...ux_kernel.html I am trying to cross-compile a new custom-kernel for my pi2 (3G/1G instead of the standard 2G/2G). sudo apt install git bc bison flex libssl-dev make libc6-dev libncurses5-dev sudo apt install crossbuild-essential-armhf git clone --depth=1 https://github.com/raspberrypi/linux make bcm2709_defconfig give the error.. Quote:
Or there is any other method to create that .config file for my pi2 locally on my cross-compiler (debian11 64bits desktop) ? How? Any hint and support is welcome. UPDATE: the command above was wrong. A new command seems ok. I will close in few hours if all fine. Code:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig Code:
# |
did you use sudo? Error 1 is permissions, IIRC.
|
So far, it cross-compiled.
I identified a pi2 based on cat /sys/firmware/devicetree/base/model Quote:
Quote:
sudo nano /boot/config.txt ... [pi2] kernel=kernel7.img .. If anybody have an explanation why it is not Oct 12 which would be todays time (because the customized kernel7.img was created today oct 12). Perhaps is the pi2 booting with another kernel? |
Quote:
In fact, I used wrongly Code:
make bcm2709_defconfig Code:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig |
Or perhaps this is a PI1 ? I am confused..
cat /proc/cpuinfo Quote:
https://linuxhint.com/identify-raspberry-pi/ the BCM2835 is a PI1 with 2x USB. Which is the case. I will have to review all my doing. Looks like my thinking of a PI2 was wrong. Thats a PI1 and it was looking at boot at the kernel.img which was the old one. Modifying config.txt ... with ... [pi2] kernel=kernel7.img .. was then for sure useless. Lets redo the whole thing. |
The change was that the folks at RazPi stopped using the BCM2836 in the Pi 2 in favour of the BCM2837 which had the A53 core. You can just google for specs.
You want at least the Pi 4 w/8G. If there's a little more cash about, there's an Arm A-72 16 core chip from NXP (runs @2 Ghz). It's built into a tiny server being sold fairly cheap by http://www.solid-run.com in Israel and you can get decent memory for that. Video is not really supplied, however, as it's a server. |
Yes. Its working. Its a PI1 (I have another PI4 where my project is working but would like to make it working on that PI1) and the correct kernel is recognized at boot.
Linux version 5.15.73+ (xxxx) (arm-linux-gnueabihf-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #2 Thu Oct 13 10:55:19 CEST 2022 Now its booting a bit weird and new errors are coming up. systemd[1]: Failed to start Load Kernel Modules. systemd[1]: Failed to mount Arbitrary Executable File Formats File System. I missed something at the install recommend https://www.raspberrypi.com/document...ux_kernel.html Quote:
|
mkdir mnt
mkdir mnt/fat32 mkdir mnt/ext4 sudo mount /dev/sdd1 mnt/fat32 sudo mount /dev/sdd2 mnt/ext4 sudo env PATH=$PATH make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=mnt/ext4 modules_install No errors anymore. The correct cross-compiled kernel is in use. End-summary: - my original assumption was wrong: that was a pi1 instead of a pi2 - cross-compile a kernel for a pi1; after 2 days of compiling, I CTRL-C the local pi1 compilation (on a 6core 64bits linux PC that MUCH better; then I transfered all data onto the SD card) - the link for cross-compiling had to be followed step by step; missing one step was creating errors |
All times are GMT -5. The time now is 12:43 PM. |