DART-SD410 Debian 5.7.0 Download Packages

From Variscite Wiki
Revision as of 09:17, 19 November 2020 by Leonid (talk | contribs) (Created page with "{{PageHeader|Download packages and build.}} __toc__ = Create directory tree = Create the following directory tree: <pre> $ mkdir ~/sd410 $ cd ~/sd410 $ mkdir Debian $ cd Debi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Download packages and build.

1 Create directory tree

Create the following directory tree:

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

2 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-20.07 remotes/origin/release/kernel-20.07

3 Download Linaro folder from FTP site

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

└── Debian
    └── Linaro-20.07
        ├── 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
        │   ├── linaro-sid-developer-dart-sd410-893.zip
        │   ├── linaro-sid-alip-dart-sd410-893.zip
        │   ├── rpm.mbn
        │   ├── sbl1.mbn
        │   └── tz.mbn
        ├── mkbootimg
        └── makebootimg.sh

Extract the rootfs files by:

$ unzip -o linaro-sid-developer-dart-sd410-893.zip
$ unzip -o linaro-sid-developer-dart-sd410-893.zip

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

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

4 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

5 Boot Image Build

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

5.1 Automatic creation of the boot image first time

Build kernel source using the supplied script file:

$ ./makebootimg.sh full

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

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

$ ./makebootimg.sh

5.2 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=5.7.0-linaro-lt-qcom Image dtbs  -j8
$ make KERNELRELEASE=5.7.0-linaro-lt-qcom modules  -j8
$ make KERNELRELEASE=5.7.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

5.3 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

6 Flash new image to the board

Cycle power of the VAR-SD410CustomBoard with Back button pressed. It will enter fastboot mode. run the following command 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