-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkernel.mk
36 lines (28 loc) · 1.23 KB
/
kernel.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ifeq ($(ARCH),x86_64)
KERNEL_IMAGE := linux-$(LINUX_VERSION)/arch/x86_64/boot/bzImage
endif
KEYMAP ?= /usr/share/keymaps/i386/qwerty/se-latin1.kmap.gz
linux-$(LINUX_VERSION).tar.xz:
./get-verified-tarball.sh "$(LINUX_VERSION)" || (rm -f "$@"; exit 1)
linux-$(LINUX_VERSION)/.dir: linux-$(LINUX_VERSION).tar.xz
tar -xf linux-$(LINUX_VERSION).tar.xz
touch linux-$(LINUX_VERSION)/.dir
linux-$(LINUX_VERSION)/.config: linux-$(LINUX_VERSION)/.dir arch/$(ARCH)/linux.config
cp -v "$(PWD)/arch/$(ARCH)/linux.config" "$@"
(cd linux-$(LINUX_VERSION); make \
ARCH="$(ARCH)" \
olddefconfig)
.PHONY: keymap
keymap: linux-$(LINUX_VERSION)/.dir
loadkeys -m $(KEYMAP) > linux-$(LINUX_VERSION)/drivers/tty/vt/defkeymap.c
.PHONY: linux
linux:
make -C linux-$(LINUX_VERSION) ARCH="$(ARCH)" all -j $(shell nproc)
$(KERNEL_IMAGE)-noninteractive: linux-$(LINUX_VERSION)/.config rootfs-$(ARCH).cpio keymap
make ARCH="$(ARCH)" LINUX_VERSION="$(LINUX_VERSION)" linux
cp $(KERNEL_IMAGE) $(@)
touch "$(@)"
$(KERNEL_IMAGE)-interactive: linux-$(LINUX_VERSION)/.config rootfs-interactive-$(ARCH).cpio keymap
make ARCH="$(ARCH)" LINUX_VERSION="$(LINUX_VERSION)" CONFIG_INITRAMFS_SOURCE="../rootfs-interactive-$(ARCH).cpio" linux
cp $(KERNEL_IMAGE) $(@)
touch "$(@)"