Skip to content

Commit a4e469f

Browse files
committed
Move pack image to separate file
Signed-off-by: Alexey Gladkov <[email protected]>
1 parent 3b8828e commit a4e469f

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

mk/genimage.mk.in

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@ PHONY += pack install genimage
1313
PHONY += install$(INSTALL_TARGET_SUFFIX)
1414

1515
pack: create
16-
@if [ -d "$(ROOTDIR)/etc/rc.d/init.d" ]; then \
17-
$(VMSG) "Sorting sysvinit services ..."; \
18-
$(TOOLSDIR)/sort-services --rcdir="$(ROOTDIR)/etc/rc.d" "$(ROOTDIR)/etc/rc.d/init.d"; \
19-
fi
20-
@$(VMSG) "Packing image to archive ..."
21-
@$(TOOLSDIR)/pack-image
16+
@$(MAKE) $(MFLAGS) -f @projectdir@/mk/main.mk packimage
2217

2318
install$(INSTALL_TARGET_SUFFIX): pack
2419
@$(VMSG) "Installing image ..."

mk/main.mk.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ ifneq ($(call in-goals,genimage),)
4747
include @projectdir@/mk/genimage.mk
4848
endif
4949

50+
ifneq ($(call in-goals,packimage),)
51+
include @projectdir@/mk/packimage.mk
52+
endif
53+
5054
ifneq ($(call in-goals,process-config),)
5155
STARTUP_TIME = $(shell date +'%s')
5256
WORKDIR_SUFFIX = $(basename $(notdir $(INITRD_CONFIG)))

mk/packimage.mk.in

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
.PHONY: packimage pack-image post-pack-image pre-pack post-pack
4+
5+
packimage: pre-pack pack-image post-pack-image
6+
7+
pack-image: pre-pack
8+
@$(VMSG) "Packing image to archive ..."
9+
@$(TOOLSDIR)/pack-image
10+
11+
post-pack-image: pack-image post-pack
12+
@:
13+
14+
pre-pack::
15+
@if [ -d "$(ROOTDIR)/etc/rc.d/init.d" ]; then \
16+
$(VMSG) "Sorting sysvinit services ..."; \
17+
$(TOOLSDIR)/sort-services --rcdir="$(ROOTDIR)/etc/rc.d" "$(ROOTDIR)/etc/rc.d/init.d"; \
18+
fi
19+
20+
# Load requested features
21+
$(call include-features-once,$(RUNTIME_FEATURE) $(sort $(ALL_ACTIVE_FEATURES)))
22+
23+
pre-pack::
24+
@$(VMSG) "Actions before packing are done"
25+
26+
post-pack::
27+
@$(VMSG) "Actions after packing are done"

0 commit comments

Comments
 (0)