summaryrefslogtreecommitdiffstats
path: root/rules/blspec-entry.make
blob: d5407c9999f7245b3f596fb6d1beeca86b0566e8 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*-makefile-*-
#
# Copyright (C) 2014 by Michael Olbrich <m.olbrich@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_BLSPEC_ENTRY) += blspec-entry

BLSPEC_ENTRY_VERSION	:= $(KERNEL_VERSION)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

BLSPEC_ENTRY_TITLE	:= PTXdist - $(call remove_quotes,$(PTXCONF_PROJECT_VENDOR)-$(PTXCONF_PROJECT))
ifdef PTXCONF_BLSPEC_ENTRY_DEVICETREE
BLSPEC_ENTRY_NAMES	= $(basename $(notdir $(DTC_DTB)))
blspec/title		= $(BLSPEC_ENTRY_TITLE) $(strip $(1))
blspec/devicetree	= devicetree\t/boot/$(strip $(1)).dtb
else
BLSPEC_ENTRY_NAMES	= default
blspec/title		= $(BLSPEC_ENTRY_TITLE)
blspec/devicetree	=
endif
BLSPEC_ENTRY_LICENSE	= ignore

$(STATEDIR)/blspec-entry.targetinstall:
	@$(call targetinfo)

	@$(call install_init, blspec-entry)
	@$(call install_fixup,blspec-entry,PRIORITY,optional)
	@$(call install_fixup,blspec-entry,SECTION,base)
	@$(call install_fixup,blspec-entry,AUTHOR,"Michael Olbrich <m.olbrich@pengutronix.de>")
	@$(call install_fixup,blspec-entry,DESCRIPTION,missing)

	@$(foreach name, $(BLSPEC_ENTRY_NAMES), \
		$(call install_alternative, blspec-entry, 0, 0, 0644, \
			/loader/entries/default.conf,n,/loader/entries/$(name).conf)$(ptx/nl) \
		$(call install_replace, blspec-entry, /loader/entries/$(name).conf, \
			@TITLE@,'$(call blspec/title,$(name))')$(ptx/nl) \
		$(call install_replace, blspec-entry, /loader/entries/$(name).conf, \
			@VERSION@,'$(BLSPEC_ENTRY_VERSION)')$(ptx/nl) \
		$(call install_replace, blspec-entry, /loader/entries/$(name).conf, \
			@CMDLINE@,$(PTXCONF_BLSPEC_ENTRY_CMDLINE))$(ptx/nl) \
		$(call install_replace, blspec-entry, /loader/entries/$(name).conf, \
			@KERNEL@,'/boot/$(KERNEL_IMAGE)')$(ptx/nl) \
		$(call install_replace, blspec-entry, /loader/entries/$(name).conf, \
			@DEVICETREE@,'$(call blspec/devicetree,$(name))')$(ptx/nl))

	@$(call install_finish,blspec-entry)

	@$(call touch)

# vim: syntax=make