Skip to content

Commit 5b6d69b

Browse files
committed
Merge INITRAMFS_DIR and ROOTFS_DIR variables
1 parent 816458b commit 5b6d69b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ help:
8686
@echo ''
8787
@echo ' Environment Variables:'
8888
@echo ' EXT4_SIZE - The disk size of the rootfs image to build'
89-
@echo ' INITRAMFS_DIR - The directory to create the initramfs from (default: rootfs/alpine-$$ARCH)'
90-
@echo ' ROOTFS_DIR - The directory to create the ext4/rootfs image from (default: rootfs/alpine-$$ARCH)'
89+
@echo ' ROOTFS_DIR - The directory to create the ext4 rootfs image and initramfs CPIO from (default: rootfs/alpine-$$ARCH)'
9190
@echo ' ROOTFS - The path to the rootfs image file (default: rootfs/rootfs-$$ARCH.img)'
9291
@echo ' ROOTFS_FORMAT - The format of the rootfs image file (default: qcow2)'
9392
@echo ''
@@ -242,8 +241,7 @@ ROOTFS_PARENT_DIR := $(ROOT_DIR)/rootfs
242241
ROOTFS ?= $(ROOTFS_PARENT_DIR)/rootfs-$(ARCH).img
243242
ROOTFS_FORMAT ?= qcow2
244243
ROOTFS_DIR ?= $(ROOTFS_PARENT_DIR)/alpine-$(ARCH)
245-
INITRAMFS_DIR ?= $(ROOTFS_DIR)
246-
CPIO_FILE ?= $(ROOTFS_PARENT_DIR)/$$(basename $(INITRAMFS_DIR)).cpio.gz
244+
CPIO_FILE ?= $(ROOTFS_PARENT_DIR)/$$(basename $(ROOTFS_DIR)).cpio.gz
247245
EXT4_SIZE ?= 1G
248246

249247
# The user might set a relative path for `CPIO_FILE`, so we need to get the
@@ -272,15 +270,14 @@ ext4: | $(ROOTFS_DIR)
272270
mv $(ROOTFS).tmp $(ROOTFS)
273271

274272
.PHONY: cpio initramfs
275-
initramfs cpio: | $(INITRAMFS_DIR)
276-
(cd $(INITRAMFS_DIR) && find . -print0 \
273+
initramfs cpio: | $(ROOTFS_DIR)
274+
(cd $(ROOTFS_DIR) && find . -print0 \
277275
| cpio --null --create --verbose --format=newc) \
278276
| gzip --best > $(CPIO_FILE)
279277

280278
.PHONY: uncpio
281-
uncpio:
282-
mkdir -p $(INITRAMFS_DIR)
283-
cd $(INITRAMFS_DIR) && zcat $(CPIO_FILE) | cpio --extract --make-directories --format=newc --no-absolute-filenames
279+
uncpio: | $(ROOTFS_DIR)
280+
cd $(ROOTFS_DIR) && zcat $(CPIO_FILE) | cpio --extract --make-directories --format=newc --no-absolute-filenames
284281

285282
.PHONY: rootfs
286283
rootfs: ext4 cpio

0 commit comments

Comments
 (0)