Building android for hikey 960 fails

I have followed the following commands I have found on the forums to build an image of android for hikey 960 since the prebuilt images use 1080p and my monitor cannot zoom out so i can only see the top left corned of the screen zoomed in.

repo init -u … (link removed since forums doesn’t allow user to post more than 2 urls, i used master branch)
repo sync -j24
tar xzf arm-hikey960-OPR-cf4e0c80.tgz
. ./build/
lunch hikey960-userdebug
make clean # If you run make -j$(nproc) here and not do make clean before make bootimage, It doesn’t rewrite the boot.img
git clone kernel/hikey-linaro - Git at Google
cd hikey-linaro
git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9
make ARCH=arm64 hikey960_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc)
cp ~/aosp/hikey-linaro/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb ~/aosp/device/linaro/hikey-kernel/hi3660-hikey960.dtb-4.9
cp ~/aosp/hikey-linaro/arch/arm64/boot/Image.gz ~/aosp/device/linaro/hikey-kernel/Image.gz-hikey960-4.9
cd ~/aosp
make bootimage -j$(nproc)

the build fails mentioning the following:

you cannot install files to out/target/product while building a separate vendor

The instructions you are following look out of date to me. Can’t be
sure but it is possible that unpacking the legacy tarball is messing
things up.

The official instructions are here:

Current proper instructions are here: Using Reference Boards  |  Android Open Source Project

Looking around, I found out that someone had a repository which contains the last good known manifests for the android source tree. I downloaded that and was able to build successfully using the 3 commands :

. ./build/
lunch hikey960-userdebug
make -j32

However, the resolution android image generated is 1080p which is too big for my monitor. it shows the top left corner and i can’t resize the image. Before running the make -j32 I had edited the BoardConfig file for hikey960 to make it 720p. So am not sure why the resolution is 1080p. any ideas ?. do i have to build the kernel manually or something of that sort

this fails during make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc)

You need to edit the kernel commandline.

If you’re trying to build the kernel (which is not necessary to change the commandline), then you must not forget that your compiler needs to be in your PATH variable. You can find the compiler under prebuilds/gcc/