Custom MK/SS808 Image

Table of Contents

The following document describes our own method of creating a custom Kali Linux MK/SS808 ARM image and is targeted at developers. If you would like to install a pre-made Kali image, check out our Install Kali on MK/SS808 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

Build yourself 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 MK/SS808 rootfs and boot images:

[email protected]:~$ sudo apt install -y kpartx xz-utils sharutils
[email protected]:~$ mkdir -p ~/arm-stuff/images/
[email protected]:~$ cd ~/arm-stuff/images/
[email protected]:~/arm-stuff/images$ dd if=/dev/zero of=kali-custom-ss808.img conv=fsync bs=4M count=7000

03. Partition and Mount the Image File

[email protected]:~$ parted kali-custom-ss808.img --script -- mklabel msdos
[email protected]:~$ parted kali-custom-ss808.img --script -- mkpart primary ext4 1 -1
[email protected]:~$ loopdevice=`losetup -f --show kali-custom-ss808.img`
[email protected]:~$ device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
[email protected]:~$ device="/dev/mapper/${device}"
[email protected]:~$ rootp=${device}p1
[email protected]:~$
[email protected]:~$ mkfs.ext4 $rootp
[email protected]:~$ mkdir -p root/
[email protected]:~$ mount $rootp root

04. Copy and Modify the Kali rootfs

[email protected]:~$ rsync -HPavz /root/arm-stuff/rootfs/kali-armhf-xfce4/ root
[email protected]:~$ echo nameserver 8.8.8.8 > root/etc/resolv.conf

05. Compile the rk3066 Kernel and Modules

If you’re not using ARM hardware as the development environment, you will need to set up an ARM cross-compilation environment to build an ARM kernel and modules. Once that’s done, proceed with the following steps:

[email protected]:~$ sudo apt install -y xz-utils
[email protected]:~$ mkdir -p ~/arm-stuff/kernel/
[email protected]:~$ cd ~/arm-stuff/kernel/
[email protected]:~$
[email protected]:~$ git clone git://github.com/aloksinha2001/picuntu-3.0.8-alok.git rk3066-kernel
[email protected]:~$ cd rk3066-kernel/
[email protected]:~$ sed -i "/vpu_service/d" arch/arm/plat-rk/Makefile
[email protected]:~$ export ARCH=arm
[email protected]:~$ export CROSS_COMPILE=~/arm-stuff/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
[email protected]:~$
[email protected]:~$ # A basic configuration for the UG802 and MK802 III
[email protected]:~$ # make rk30_hotdog_ti_defconfig

[email protected]:~$ # A basic configuration for the MK808
[email protected]:~$ make rk30_hotdog_defconfig

[email protected]:~$ # configure your kernel !
[email protected]:~$ make menuconfig

[email protected]:~$ # Configure the kernel as per http://www.armtvtech.com/armtvtechforum/viewtopic.php?f=66&t;=835
[email protected]:~$ mkdir -p ../initramfs/
[email protected]:~$ wget http://208.88.127.99/initramfs.cpio -O ../initramfs/initramfs.cpio
[email protected]:~$
[email protected]:~$ mkdir -p ../patches/
[email protected]:~$ wget http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch -O ../patches/mac80211.patch
[email protected]:~$ wget http://patches.aircrack-ng.org/channel-negative-one-maxim.patch- O ../patches/negative.patch
[email protected]:~$ patch -p1 < ../patches/mac80211.patch
[email protected]:~$ patch -p1 < ../patches/negative.patch
[email protected]:~$
[email protected]:~$ ./make_kernel_ruikemei.sh
[email protected]:~$ make modules -j$(cat /proc/cpuinfo|grep processor | wc -l)
[email protected]:~$ make modules_install INSTALL_MOD_PATH=~/arm-stuff/images/root
[email protected]:~$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git firmware-git
[email protected]:~$ mkdir -p ~/arm-stuff/images/root/lib/firmware
[email protected]:~$ cp -rf firmware-git/* ~/arm-stuff/images/root/lib/firmware/
[email protected]:~$ rm -rf firmware-git
[email protected]:~$ umount $rootp
[email protected]:~$ kpartx -dv $loopdevice
[email protected]:~$ losetup -d $loopdevice

07. dd the Image to a USB device

Use the dd command to image this file to your SD card. In our example, we assume the storage device is located at /dev/sdb. Change this as needed:

[email protected]:~$ dd if=kali-linux-ss808.img of=/dev/sdb conv=fsync bs=4M

Once the dd operation is complete, unmount and eject the SD card and boot your MK/SS808 into Kali Linux


Updated on: 2023-May-28
Author: steev