The following document describes our own method of creating a custom Kali Linux ODROID image and is targeted at developers. If you would like to install a pre-made Kali ODROID image, check our Install Kali on ODROID article.
You’ll need to have root privileges to do this procedure, or the ability to escalate your privileges with the command “sudo su”.
01. Create a Kali rootfs
Start by building a Kali rootfs as described in our Kali documentation using an armhf architecture. By the end of this process, you should have a populated rootfs directory in ~/arm-stuff/rootfs/kali-armhf.
02. Create the Image File
Next, we create the physical image file which will hold our ODROID rootfs and boot images:
:~$ export ARCH=arm
:~$ export CROSS_COMPILE=~/arm-stuff/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
:~$
:~$ # for ODROID-X2
:~$ make odroidx2_defconfig
:~$ # for ODROID-U2
:~$ make odroidu2_defconfig
:~$ # configure your kernel !
:~$ make menuconfig
:~$ # and enable
:~$ CONFIG_HAVE_KERNEL_LZMA=y
:~$ CONFIG_RD_LZMA=y
:~$
:~$ # If cross compiling, run this once
:~$ sed -i 's/if defined(__linux__)/if defined(__linux__) ||defined(__KERNEL__) /g' include/uapi/drm/drm.h
:~$
:~$ make -j $(cat /proc/cpuinfo|grep processor | wc -l)
:~$ make modules_install INSTALL_MOD_PATH=~/arm-stuff/images/root/
Chroot into the rootfs and create an initrd. Make sure to use the correct kernel version/extraversion for the mkinitramfs command. In our case, it was “3.8.13”:
:~$ LANG=C chroot ~/arm-stuff/images/root/
:~$ sudo apt install -y initramfs-tools uboot-mkimage
:~$ cd /
:~$ # Change the example "3.8.13" to your current odroid kernel revision
:~$ mkinitramfs -c lzma -o ./initramfs 3.8.13
:~$ mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ./initramfs ./uInitrd
:~$ rm initramfs
:~$ exit
06. Prepare the Boot Partition
Copy the kernel and generated initrd file to the mounted boot partition as shown below:
Once this operation is complete, connect your UART serial cable to the ODROID and boot it up with the microSD/SD card plugged in. Through the serial console, you will be able to log in to Kali (root / toor) and startx.
If everything works and you want the ODROID to start on boot, make sure to use the “autologin” line in the inittab given above and add the following to your bash_profile:
# If you don't have a .bash_profile, copy it from /etc/skel/.profile first
:~$ cat <<EOF >> ~/.bash_profile
if [ -z "$DISPLAY" ] && [ $(tty) = /dev/ttySAC1 ]; then
startx
fi
EOF
08. Install Mali Graphic Drivers (Optional)
These steps are experimental and not fully tested yet. They should be performed inside the Kali rootfs:
If you’re not using ARM hardware as the development environment, you will need to set up an to build an ARM kernel and modules. Once that’s done, proceed with the following instructions.