blob: afc2ffe1e955f6091bb95e52850d21f98ea632ba [file] [log] [blame]
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE = 1
VERSION := 4.4.22-aiy
ARCH := arm64
CROSS_COMPILE := aarch64-linux-gnu-
KERNEL_OPTIONS := \
ARCH=${ARCH} \
CROSS_COMPILE=${CROSS_COMPILE} \
LOCALVERSION=-aiy
LDFLAGS :=
BUILD_DIR := $(CURDIR)/debian/build
DESTDIR := $(CURDIR)/debian/linux-image-$(VERSION)
DESTDIR_HEADERS := $(CURDIR)/debian/linux-headers-$(VERSION)
DESTDIR_KBUILD := $(CURDIR)/debian/linux-kbuild-$(VERSION)
%:
dh $@
override_dh_auto_clean:
true
override_dh_auto_build:
+make $(KERNEL_OPTIONS) mt8167s_excelsior_defconfig
+make $(KERNEL_OPTIONS) olddefconfig
+make $(KERNEL_OPTIONS) -j$(shell nproc) Image modules dtbs
$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S vmlinux linux.bin
/boot/compress_lz4.sh linux.bin
cp /boot/kernel-fit-image.its .
mtk-mkimage -D "-I dts -O dtb -p 1024" -k /boot/keys -f kernel-fit-image.its boot.img
override_dh_auto_install:
+make $(KERNEL_OPTIONS) INSTALL_MOD_PATH=$(DESTDIR) modules_install
rm $(DESTDIR)/lib/modules/$(VERSION)/build
rm $(DESTDIR)/lib/modules/$(VERSION)/source
install -d $(DESTDIR)/boot
install -p -m 655 boot.img $(DESTDIR)/boot