DART-SD410 Debian 4.14.0 Download Packages

From Variscite Wiki
Revision as of 15:41, 12 May 2019 by Leonid (talk | contribs) (Created page with "{{PageHeader|Download packages and build.}} __toc__ {{note| NOTE:<br> The dtb file selection was changed in this new version, it now requires a new version of skales tool (do...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Download packages and build.


NOTE:
The dtb file selection was changed in this new version, it now requires a new version of skales tool (downloaded from ftp site) and a new version of boot loader files.
In order to get it running please update the whole system by running flashall script.

Create directory tree

Create the following directory tree:

$ mkdir ~/sd410
$ cd ~/sd410
$ mkdir Debian
$ cd Debian
$ mkdir Linaro-4.14.0
$ cd Linaro-4.14.0

Download kernel source

Download kernel source from git repository

$ git clone https://github.com/varigit/DART-SD410-kernel.git kernel
$ cd kernel
$ git checkout -b kernel-19.01 remotes/origin/release/kernel-19.01

Download Linaro folder from FTP site

Download the whole Linaro-19.01 folder located in /dart-sd410/Software/Debian on Variscite FTP into ~/sd410/Debian/Linaro-4.14.0 directory The following files will be downloaded.

sd410
└── Debian
    └── Linaro-19.01
        ├── kernel
        │   └── build.sh
        ├── ramdisk
        │   └── initrd.img
        ├── RescueImages
        │   ├── boot-sd410-lvds.img
        │   ├── boot-sd410-hdmi.img
        │   ├── dart-sd410_8016.bin
        │   ├── emmc_appsboot.mbn
        │   ├── flashall.bat
        │   ├── gpt_both0.bin
        │   ├── hyp.mbn
        │   ├── LICENSE
        │   ├── variscite-buster-developer-dart-sd410-491.tar.gz
        │   ├── variscite-buster-alip-dart-sd410-491.tar.gz
        │   ├── NON-HLOS.bin
        │   ├── rpm.mbn
        │   ├── sbl1.mbn
        │   └── tz.mbn
        ├── skales
        └── makebootimg.sh

Extract the rootfs files by:

$ tar -xvf variscite-buster-developer-dart-sd410-491.tar.gz
$ tar -xvf variscite-buster-alip-dart-sd410-491.tar.gz

The file build.sh will be placed in the git kernel directory


NOTE:
Please refer to support@variscite.com for obtaining FTP credentials.

Download GCC from FTP site

Download GCC compiler archive from /Software/Debian directory into ~/sd410/Debian directory of your PC.
Extract the GCC compiler by:

$ tar -xvf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz

Boot Image Build

Variscite suggests using the downloaded script for building the boot images. If something goes wrong then try the manual build.

Automatic creation of the boot image first time

Build kernel source using supplied script file:

$ ./makebootimg.sh full

The kernel sources will be built and the output boot image file will be created in the ~/sd410/Debial/Linaro-4.14.0/ directory

If the kernel configuration was not changed the next builds can be speed up by using the command:

$ ./makebootimg.sh

Manual kernel build

Export Envornment variables for compiler and architecture

$ export CROSS_COMPILE=~/sd410/debian/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
$ export ARCH=arm64

Select the needed defconfig file for kernel:

$ make defconfig distro.config var-sd410.config

Build the kernel and modules

$ make KERNELRELEASE=4.14.0-linaro-lt-qcom Image dtbs  -j8
$ make KERNELRELEASE=4.14.0-linaro-lt-qcom modules  -j8
$ make KERNELRELEASE=4.14.0-linaro-lt-qcom INSTALL_MOD_PATH=build-${ARCH}-modules modules_install -j8

Combine dtb files with kernel image

$ cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/apq8016-var-dart-hdmi.dtb > arch/arm64/boot/Image.gz_hdmi_dtb
$ cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/apq8016-var-dart-lvds.dtb > arch/arm64/boot/Image.gz_lvds_dtb

Manual boot image creation

You will need a default ramdisk for boot image creation.
It is located in the ramdisk directory of the downloaded folder.

Compress all the dtb files and the kernel image file into one dt.img file by:

$ ./mkbootimg --kernel kernel/arch/arm64/boot/Image.gz_hdmi_dtb\
              --ramdisk ramdisk/initrd.img \
              --output boot-sd410-hdmi.img \
              --pagesize 2048 \
              --base 0x80000000 \
              --cmdline "root=/dev/disk/by-partlabel/rootfs rw rootwait console=ttyMSM0,115200n8"

$ ./mkbootimg --kernel kernel/arch/arm64/boot/Image.gz_lvds_dtb\
              --ramdisk ramdisk/initrd.img \
              --output boot-sd410-lvds.img \
              --pagesize 2048 \
              --base 0x80000000 \
              --cmdline "root=/dev/disk/by-partlabel/rootfs rw rootwait console=ttyMSM0,115200n8"

The files named boot-sd410-hdmi.img and boot-sd410-lvds.img are created. One of them should be burned into the board using fastboot. Remove unneeded dt.img file:

$ rm kernel/arch/arm64/boot/Image.gz_hdmi_dtb
$ rm kernel/arch/arm64/boot/Image.gz_lvds_dtb

Flash new image to the board

Cycle power of the VAR-SD410CustomBoard with Back button pressed. it will enter fastboot. run the following commend to update the boot image:

$ sudo fastboot flash boot boot-sd410-lvds.img
$ sudo fastboot reboot

The board will update the system and reboot with the updated kernel