aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2017-11-01 13:08:03 +0000
committerRiku Voipio <riku.voipio@linaro.org>2017-11-13 14:54:28 +0200
commitced74a803cce4d36b771da6de0d04575bafce5e9 (patch)
tree6ca7d160c5fe83a90b9a73df223086c86984f682
parent63a3d5afb75857d499135a7aaa56f5194bac3b2f (diff)
downloadfai-ced74a803cce4d36b771da6de0d04575bafce5e9.tar.gz
Add hikey support
Uses the ERP kernel for now, since 4.14 works. To generate an SD card image: fai-diskimage -v --cspace $(pwd)/fai/ --hostname linaro-developer -S 4G \ --class SAVECACHE,STRETCH,DEBIAN,LINARO,DEVELOPER,HIKEY,GRUB_PC hikey.raw Change-Id: I68d5feb24051a7849b1e97bc4df7bd1d504ce82d Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rw-r--r--disk_config/HIKEY3
-rw-r--r--files/etc/apt/sources.list.d/linaro.list/HIKEY3
-rw-r--r--files/etc/apt/sources.list/STRETCH6
-rw-r--r--package_config/HIKEY7
-rwxr-xr-xscripts/GRUB_PC/10-setup33
-rwxr-xr-xscripts/HIKEY/10-setup5
6 files changed, 40 insertions, 17 deletions
diff --git a/disk_config/HIKEY b/disk_config/HIKEY
new file mode 100644
index 0000000..bd5c96d
--- /dev/null
+++ b/disk_config/HIKEY
@@ -0,0 +1,3 @@
+disk_config disk1 disklabel:msdos fstabkey:uuid bootable:1
+primary /boot/efi 64 vfat rw
+primary / 3G ext4 rw
diff --git a/files/etc/apt/sources.list.d/linaro.list/HIKEY b/files/etc/apt/sources.list.d/linaro.list/HIKEY
new file mode 100644
index 0000000..929ef2a
--- /dev/null
+++ b/files/etc/apt/sources.list.d/linaro.list/HIKEY
@@ -0,0 +1,3 @@
+deb http://obs.linaro.org/linaro-overlay-${release}/${obs_release}/ ./
+deb http://obs.linaro.org/ERP:/staging/Debian_9/ ./
+
diff --git a/files/etc/apt/sources.list/STRETCH b/files/etc/apt/sources.list/STRETCH
index 8ebdbfb..51b0f81 100644
--- a/files/etc/apt/sources.list/STRETCH
+++ b/files/etc/apt/sources.list/STRETCH
@@ -1,3 +1,3 @@
-deb ${apt_cdn}/debian ${release} main
-deb http://security.debian.org/ ${release}/updates main
-deb ${apt_cdn}/debian ${release}-updates main
+deb ${apt_cdn}/debian ${release} main contrib non-free
+deb http://security.debian.org/ ${release}/updates main contrib non-free
+deb ${apt_cdn}/debian ${release}-updates main contrib non-free
diff --git a/package_config/HIKEY b/package_config/HIKEY
new file mode 100644
index 0000000..d3b811c
--- /dev/null
+++ b/package_config/HIKEY
@@ -0,0 +1,7 @@
+PACKAGES install-norec
+grub-efi-arm64
+linux-image-reference-arm64
+firmware-linux-free
+firmware-misc-nonfree
+firmware-ti-connectivity
+firmware-hikey-nonfree
diff --git a/scripts/GRUB_PC/10-setup b/scripts/GRUB_PC/10-setup
index 7a04760..b891276 100755
--- a/scripts/GRUB_PC/10-setup
+++ b/scripts/GRUB_PC/10-setup
@@ -28,23 +28,28 @@ fi
$ROOTCMD grub-mkdevicemap --no-floppy
GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
-
-# Check if RAID is used for the boot device
-if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
- raiddev=${BOOT_DEVICE#/dev/}
- # install grub on all members of RAID
- for device in `LC_ALL=C perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; print }' /proc/mdstat`; do
- echo Install grub on /dev/$device
- $ROOTCMD grub-install --no-floppy "/dev/$device"
- done
-
-elif [[ $GROOT =~ 'hostdisk' ]]; then
+if [[ $GROOT =~ 'hostdisk' ]]; then
cat > $target/boot/grub/device.map <<EOF
(hd0) $BOOT_DEVICE
EOF
- $ROOTCMD grub-install --no-floppy --modules=part_msdos $BOOT_DEVICE
- if [ $? -eq 0 ]; then
- echo "Grub installed on hostdisk $BOOT_DEVICE"
+ if ifclass HIKEY; then
+ # Standard grub-install for SD card
+ $ROOTCMD grub-install --removable --no-nvram $BOOT_DEVICE
+ if [ $? -eq 0 ]; then
+ echo "Hikey grub for SD card installed"
+ fi
+ # Custom grub for emmc and lava
+cat << EOF > $target/boot/grub/emmc.config
+set root=(hd0,gpt9)
+set prefix=(\$root)'/boot/grub'
+configfile \$prefix/grub.cfg
+EOF
+ GRUB_MODULES="boot chain configfile echo efinet eval ext2 fat font gettext gfxterm gzio help linux loadenv lsefi normal part_gpt part_msdos read regexp search search_fs_file search_fs_uuid search_label terminal terminfo test tftp time"
+
+ $ROOTCMD grub-mkimage --prefix='(hd0,gpt9)/boot/grub' \
+ --config=/boot/grub/emmc.config --output=/boot/efi/EFI/BOOT/GRUBAA64.EFI \
+ --format=arm64-efi --compression=auto $GRUB_MODULES
+ echo "Standalone Hikey grub for eMMC and LAVA installed"
fi
rm $target/boot/grub/device.map
diff --git a/scripts/HIKEY/10-setup b/scripts/HIKEY/10-setup
new file mode 100755
index 0000000..0640f6c
--- /dev/null
+++ b/scripts/HIKEY/10-setup
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo hi655x_pmic >> $target/etc/initramfs-tools/modules
+$ROOTCMD update-initramfs -u -k all
+