Zynq precompiled Kernel releases (uImage) download:
http://www.wiki.xilinx.com/Zynq+Releases
Install tools required for the build:
apt-get install make
apt-get install gcc
apt-get install libelf-dev
apt-get install bc
apt-get install libssl-dev
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.12.8.tar.xz # Download latest source from https://www.kernel.org/
Option 1:
make oldconfig # Wil use the /boot/.config. Use previos config from /boot. Also issues warnings if anything new or depriciated.
Option 2:
cp /arch/arm/configs/xilinx_zynq_defconfig /arch/arm/configs/ # for xilinx configurations
cp /arch/arm/configs/zynq_zturn_defconfig /arch/arm/configs/ # for MYIR ZTurn configurations
make ARCH=arm xilinx_zynq_defconfig
make ARCH=arm zynq_zturn_defconfig
Option 3: (Run this option anyways after op1 or 2)
make ARCH=arm menuconfig # If anything manually needs be added OR
make ARCH=arm nconfig # Newer tool
make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage # Compile the main kernel
Convert from zImage to uImage (optional as build generates uImage):
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d arch/arm/boot/zImage uImage
mkimage -A arm -O linux -T ramdisk -a 0x2000000 -n "Linux Ramdisk -d arch/arm/boot/zImage uRamdisk.Image.gz # Test if this command is working
make modules # Compile the kernel modules
make modules_install # Install the kernel modules
make install # Install the new kernel on the system. Install files in the /boot, update the grub.cfg
Initramfs bug fix: add 'exit 0' to the second line of /etc/initramfs/post-update.d/flash-kernel
dpkg: User error => rm /var/lib/dpkg/statoverride
update_grub2
make headers_install
cp arch/arm/boot/uImage /media/BOOT
dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)
There will be three status in the listed kernel images:
dpkg --purge <>_header
apt -f install # Fix dependency after removal
apt autoremove --purge
purge-old-kernels