summaryrefslogtreecommitdiffstats
path: root/rules/image-kernel.make
blob: f14fc9e82ac40fbdb17e3ff51e89b2e911e7c5da (plain)
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
36
37
38
39
# -*-makefile-*-
#
# Copyright (C) 2018 by Michael Olbrich <m.olbrich@pengutronix.de>
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
IMAGE_PACKAGES-$(PTXCONF_IMAGE_KERNEL) += image-kernel

#
# Paths and names
#
IMAGE_KERNEL		:= image-kernel
IMAGE_KERNEL_IMAGE	:= $(IMAGEDIR)/linuximage

# ----------------------------------------------------------------------------
# Image
# ----------------------------------------------------------------------------

$(IMAGE_KERNEL_IMAGE): $(STATEDIR)/kernel.install.post
	@$(call targetinfo)

ifdef PTXCONF_IMAGE_KERNEL_INITRAMFS
	@echo "Creating '$(KERNEL_IMAGE)' including '$(notdir $(IMAGE_ROOT_CPIO_IMAGE))'..."
	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"$(IMAGE_ROOT_CPIO_IMAGE)\",g' \
		$(KERNEL_BUILD_DIR)/.config
	@$(call compile, KERNEL, $(KERNEL_MAKE_OPT) $(KERNEL_IMAGE))
endif

	@echo "Creating '$(notdir $(@))' from '$(notdir $(KERNEL_IMAGE_PATH_y))'..."
	@install -m 644 "$(KERNEL_IMAGE_PATH_y)" "$(@)"

	@$(call finish)

# vim: syntax=make