summaryrefslogtreecommitdiffstats
path: root/rules/initramfs-user-spec.make
blob: c4355141d59e9c85755d569629d25cc26ab0ac53 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# -*-makefile-*-
#
# Copyright (C) 2009 by Jon Ringle <jon@ringle.org>
#
# 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

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

$(STATEDIR)/initramfs-user-spec.get:
	@$(call targetinfo)
	@$(call touch)

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

$(STATEDIR)/initramfs-user-spec.extract:
	@$(call targetinfo)
	@$(call touch)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

$(STATEDIR)/initramfs-user-spec.prepare:
	@$(call targetinfo)
	@$(call touch)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

$(STATEDIR)/initramfs-user-spec.compile:
	@$(call targetinfo)
	@$(call touch)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------
#

$(STATEDIR)/initramfs-user-spec.install:
	@$(call targetinfo)
	@$(call touch)

# ----------------------------------------------------------------------------
# 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