|
Edited by rollmeister at 2018-7-7 02:44
I figured it out myself and my guide is below. We are installing the full Linux sources, not just the headers. Possibility of configuring and building your own kernel later on is added.
Instructions and descriptions explaining what is going on with each line of command below it in blue is in between the # hashes #.
#Login as root. Alternatively as regular user can type su and enter root password (default password is orangepi if using Official Beta Ubuntu/Debian images)##Ensure dependencies are installed#
apt-get install git fakeroot build-essential xz-utils libssl-dev bc
#Download Xunlong's Allwinner H6 3.10.65 kernel sources#
git clone https://github.com/orangepi-xunlong/OrangePiH6_kernel.git /usr/src/linux-3.10.65-sun50iw6p1
#Rename broken build folder#
mv /lib/modules/3.10.65/build /lib/modules/build-OLD
#Create and fix symbolic links to kernel sources you just downloaded#
ln -s /usr/src/linux-3.10.65-sun50iw6p1 /lib/modules/3.10.65/build
ln -sf /usr/src/linux-3.10.65-sun50iw6p1/kernel /lib/modules/3.10.65/source
#Ensure the script that extracts kernel .config file from kernel is executable#
chmod +x /usr/src/linux-3.10.65-sun50iw6p1/scripts/extract-ikconfig
#Extract config and store in kernel sources folder#
/usr/src/linux-3.10.65-sun50iw6p1/scripts/./extract-ikconfig /boot/orangepi/uImage >> /usr/src/linux-3.10.65-sun50iw6p1/.config
#change directory and compile kernel sources ready for building kernel modules after.#
cd /usr/src/linux-3.10.65-sun50iw6p1
make clean && make prepare && make scripts && make modules_prepare && make modules && make && make modules_install
Might also need to add the kernel module to load at startup. Some kernel module/driver source packages do this for you when you do make install.
If you are compiling a new kernel, its Image file is found in /usr/src/linux-3.10.65-sun50iw6p1 /lib/modules/3.10.65/arch/arm64/boot and you can do...
cd /usr/src/linux-3.10.65-sun50iw6p1 /lib/modules/3.10.65/arch/arm64/boot
mkimage -A arm -O linux -T kernel -C none -a 0x40080000 -e 0x40080000 -n "OrangePiH6" -d Image uImage
The uboot compatible kernel image is located now in the same folder. If you configured a kernel that does not boot, there is not much you can do but start over and burn the unaltered Sunxi provided Ubuntu image onto the SD card again.
If you can use the SD card on a Linux system and mount it in the a filemanager like Nautilus, I recommend you copy the new kernel image like this after the above step to test the kernel first.
cp /usr/src/linux-3.10.65-sun50iw6p1 /lib/modules/3.10.65/arch/arm64/boot/uImage /boot/orangepi/newuImage
then edit the /boot/uEnv.txt (as root/sudo user) file and change the line where it reads...
kernel_filename=orangepi/uImage
to
kernel_filename=orangepi/newuImage
If the board does not boot, the red light stays on or does not connect to network you can edit the same file and reverse the changes you did in /boot/uEnv.txt
|
|