summaryrefslogtreecommitdiffstats
path: root/rules/initramfs-user-spec.make
blob: 3b4379a152991d3e94219c112789e82428295851 (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
# -*-makefile-*-
#
# Copyright (C) 2009 by Jon Ringle <jon@ringle.org>
#           (C) 2010 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_INITRAMFS_USER_SPEC) += initramfs-user-spec

#
# Dummy to keep ipkg happy
#
INITRAMFS_USER_SPEC_VERSION	:= $(INITRAMFS_TOOLS_VERSION)

ifdef PTXCONF_INITRAMFS_USER_SPEC
$(STATEDIR)/klibc.targetinstall.post: $(STATEDIR)/initramfs-user-spec.targetinstall
endif

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

$(STATEDIR)/initramfs-user-spec.targetinstall: $(STATEDIR)/klibc.targetinstall
	@$(call targetinfo)
#
# adding user specific files to the list last
# Note: files without a leading '/' get a prefix path of $(PTXDIST_WORKSPACE)/initramfs
#
	cat $(PTXDIST_WORKSPACE)/initramfs_spec | while read type target source rest; do	\
		if [ "$$type" == "file" ]; then							\
			if [ "$$(echo "$$source" | grep "^/")" == "" ]; then			\
				source=$(PTXDIST_WORKSPACE)/initramfs/$$source;			\
			fi;									\
		fi;										\
		echo "$$type $$target $$source $$rest" >> $(INITRAMFS_CONTROL);			\
	done

	@$(call touch)

# vim: syntax=make