Skip to content

Commit f94d60c

Browse files
committed
Merge branch 'patchset/convert-runtime-to-feature/v1.0'
* patchset/convert-runtime-to-feature/v1.0: Simplify features installation Remove symlink on runtime data Rename create-initrd to better reflect the stage feature/runtime: Move hardcoded utilities to feature Move runtime to features feature/add-udev-rules: Move feature-specific utilities to feature subdirectory Signed-off-by: Alexey Gladkov <[email protected]>
2 parents a28b4d7 + a177071 commit f94d60c

File tree

117 files changed

+76
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+76
-71
lines changed

Makefile.in

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ all: build
109109
$(filter-out \
110110
$(foreach skip,$(SKIP_FEATURES),$(FEATURESDIR)/$(skip)/src/Makefile.mk), \
111111
$(wildcard $(utils_srcdir)/*/Makefile.mk) \
112-
$(wildcard $(runtime_srcdir)/*/Makefile.mk) \
113112
$(wildcard $(FEATURESDIR)/*/src/Makefile.mk))
114113

115114
define VAR_c_CFLAGS =
@@ -166,11 +165,10 @@ build-libs: $(LIBS)
166165
build-progs: build-libs $(PROGS) $(SCRIPTS)
167166

168167
PROJECT_SUBDIRS = guess tools
169-
FEATURES_SUBDIRS = $(filter-out $(SKIP_FEATURES),$(notdir $(wildcard $(FEATURESDIR)/*)))
168+
FEATURES_SUBDIRS = $(filter-out README.md $(SKIP_FEATURES),$(notdir $(wildcard $(FEATURESDIR)/*)))
170169

171170
build: $(addprefix $(dest_projectdir)/,$(PROJECT_SUBDIRS))
172-
build: $(addprefix $(dest_projectdir)/features/,$(FEATURES_SUBDIRS))
173-
build: $(dest_projectdir)/data
171+
build: $(addprefix $(dest_projectdir)/features/,README.md $(FEATURES_SUBDIRS))
174172
build: build-progs build-libs
175173

176174
verify:
@@ -187,7 +185,7 @@ verify:
187185
}; \
188186
done; exit $$rc; \
189187

190-
verify: SHELLCHECK_DIRS = runtime/data features guess tools $(utils_srcdir)
188+
verify: SHELLCHECK_DIRS = features guess tools $(utils_srcdir)
191189
verify: SHELLCHECK_EXCLUDE = SC1003,SC1090,SC1091,SC2004,SC2006,SC2015,SC2034,SC2086,SC2154,SC2295,SC2317
192190

193191
UNITTEST_DIRS = $(sort \
@@ -200,8 +198,7 @@ check-unit: $(UNITTEST_DIRS)
200198
check-services:
201199
@rc=0; \
202200
for svc in \
203-
`find runtime/data/ -executable -path '*/etc/rc.d/init.d/*' |sort` \
204-
`find features/ -path '*/etc/rc.d/init.d/*' |sort`; \
201+
`find features/ -executable -path '*/etc/rc.d/init.d/*' |sort`; \
205202
do \
206203
ret=0; \
207204
errors=`tools/sort-services --json "$$svc" 2>&1 >/dev/null` || ret=1; \
@@ -258,11 +255,6 @@ build-manpages: build-progs $(addprefix $(dest_man1dir)/,$(MANPAGE_NAMES))
258255
build: build-manpages
259256
endif
260257

261-
$(dest_projectdir)/data: runtime/data
262-
$(Q)mkdir -p -- $(dir $@)
263-
$(Q)rm -f -- "$@"
264-
$(call quiet_cmd,SLINK,$@,ln) -sf -- "$(CURDIR)/$<" "$@"
265-
266258
$(dest_projectdir)/%: %
267259
$(Q)mkdir -p -- $(dir $@)
268260
$(Q)rm -f -- "$@"
@@ -388,6 +380,7 @@ $(dest_data_bindir)/busybox: $(BBCFG)
388380
-f "$(external_srcdir)/busybox/upstream/Makefile" \
389381
KBUILD_SRC="$(external_srcdir)/busybox/upstream"
390382
$(MAKE) -C "$(OBJDIR)/external/busybox" busybox.links
383+
$(Q)mkdir -p -- "$(dest_data_bindir)" "$(dest_data_sbindir)" "$(dest_data_libdir)"
391384
$(Q)cp -a -- "$(OBJDIR)/external/busybox/busybox" "$@"
392385
$(Q)while read -r busybox_link; do \
393386
ln -srf -- "$@" "$(dest_runtimedir)$$busybox_link"; \
@@ -431,25 +424,17 @@ install: build-progs build-manpages installdirs
431424
$(Q)cp -at "$(DESTDIR)$(sbindir)" -- $(addprefix $(dest_sbindir)/,$(SBIN_NAMES))
432425
$(Q)cp -at "$(DESTDIR)$(sysconfdir)" -- $(addprefix $(dest_sysconfdir)/,$(SYSCONF_NAMES))
433426
$(Q)cp -at "$(DESTDIR)$(rulesdir)" -- $(addprefix $(dest_rulesdir)/,$(RULE_NAMES))
434-
$(Q)cp -at "$(DESTDIR)$(projectdir)" -- \
435-
$$(readlink -e $(dest_projectdir)/data) \
436-
$$(readlink -e $(addprefix $(dest_projectdir)/,$(PROJECT_SUBDIRS)))
437-
$(Q)mkdir -p -- "$(DESTDIR)$(projectdir)/$(FEATURESDIR)"
427+
$(Q)cp -at "$(DESTDIR)$(projectdir)" -- $(realpath $(addprefix $(dest_projectdir)/,$(PROJECT_SUBDIRS)))
428+
$(Q)mkdir -p -- $(addprefix $(DESTDIR)$(projectdir)/$(FEATURESDIR)/,$(FEATURES_SUBDIRS))
438429
$(Q)for n in $(FEATURES_SUBDIRS); do \
439-
target="$(dest_projectdir)/$(FEATURESDIR)/$$n"; \
440-
dest="$(DESTDIR)$(projectdir)/$(FEATURESDIR)/$$n"; \
441-
if [ -d "$$target" ]; then \
442-
mkdir -p -- "$$dest"; \
443-
find "$$target/" -mindepth 1 -maxdepth 1 \
444-
'(' \
445-
'!' -name 'src' -a \
446-
'!' -name 'tests' \
447-
')' \
448-
-exec cp -at "$$dest" -- '{}' '+'; \
449-
else \
450-
cp -aL -- "$$target" "$$dest"; \
451-
fi; \
452-
done;
430+
find "$(dest_projectdir)/$(FEATURESDIR)/$$n/" -mindepth 1 -maxdepth 1 \
431+
'(' \
432+
'!' -name 'src' -a \
433+
'!' -name 'tests' \
434+
')' \
435+
-exec cp -at "$(DESTDIR)$(projectdir)/$(FEATURESDIR)/$$n" -- '{}' '+'; \
436+
done
437+
$(Q)cp -at "$(DESTDIR)$(projectdir)/$(FEATURESDIR)" -- $(realpath $(dest_projectdir)/$(FEATURESDIR)/README.md)
453438
$(Q)cp -at "$(DESTDIR)$(execdir)/$(FEATURESDIR)" -- $(wildcard $(dest_execdir)/$(FEATURESDIR)/*)
454439
$(Q)cp -at "$(DESTDIR)$(runtimedir)/bin" -- $(addprefix $(dest_data_bindir)/,$(RUNTIME_BIN_NAMES))
455440
$(Q)cp -at "$(DESTDIR)$(runtimedir)/sbin" -- $(addprefix $(dest_data_sbindir)/,$(RUNTIME_SBIN_NAMES))

tools/find-udev-rule-externals renamed to features/add-udev-rules/bin/find-udev-rule-externals

File renamed without changes.

features/add-udev-rules/bin/put-rules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
. shell-signal
66
. sh-functions
77

8+
cwd="$(readlink -ev "$0")"
9+
cwd="${cwd%/*}"
10+
11+
export PATH="$cwd:$PATH"
12+
813
tempdir=
914
exit_handler()
1015
{

features/add-udev-rules/tests/ts0001-nothing/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ export UDEVADM="true"
44

55
cwd="${0%/*}"
66

7-
tools/find-udev-rule-externals "$cwd/data.rules"
7+
features/add-udev-rules/bin/find-udev-rule-externals "$cwd/data.rules"

features/add-udev-rules/tests/ts0002-RUN-without-builtins/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cwd="${0%/*}"
55
export UDEVADM="true"
66
export PATH="$cwd/bin:$PATH"
77

8-
tools/find-udev-rule-externals "$cwd/data.rules"
8+
features/add-udev-rules/bin/find-udev-rule-externals "$cwd/data.rules"

features/add-udev-rules/tests/ts0003-RUN-with-builtins/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export UDEV_RULES_PRINT_MODULES=1
66
export UDEVADM="xudevadm"
77
export PATH="$cwd/bin:$PATH"
88

9-
tools/find-udev-rule-externals "$cwd/data.rules"
9+
features/add-udev-rules/bin/find-udev-rule-externals "$cwd/data.rules"

features/add-udev-rules/tests/ts0004-PROGRAM-with-builtins/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cwd="${0%/*}"
55
export UDEVADM="xudevadm"
66
export PATH="$cwd/bin:$PATH"
77

8-
tools/find-udev-rule-externals "$cwd/data.rules"
8+
features/add-udev-rules/bin/find-udev-rule-externals "$cwd/data.rules"

features/runtime/README.md

Lines changed: 14 additions & 0 deletions
File renamed without changes.

0 commit comments

Comments
 (0)