File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,10 @@ INITRAMFS_DIR ?= $(ROOTFS_DIR)
246
246
CPIO_FILE ?= $(ROOTFS_PARENT_DIR ) /$$(basename $(INITRAMFS_DIR ) ) .cpio.gz
247
247
EXT4_SIZE ?= 1G
248
248
249
+ # The user might set a relative path for `CPIO_FILE`, so we need to get the
250
+ # absolute path, as we need to reference it after we've changed directories
251
+ CPIO_FILE := $(shell realpath $(CPIO_FILE ) )
252
+
249
253
$(ROOTFS_DIR ) :
250
254
mkdir -p $(ROOTFS_DIR )
251
255
@@ -269,14 +273,14 @@ ext4: | $(ROOTFS_DIR)
269
273
270
274
.PHONY : cpio initramfs
271
275
initramfs cpio : | $(INITRAMFS_DIR )
272
- cd $(INITRAMFS_DIR ) && find . -print0 \
273
- | cpio --null --create --verbose --format=newc \
276
+ ( cd $( INITRAMFS_DIR) && find . -print0 \
277
+ | cpio --null --create --verbose --format=newc) \
274
278
| gzip --best > $(CPIO_FILE )
275
279
276
280
.PHONY : uncpio
277
281
uncpio :
278
282
mkdir -p $(INITRAMFS_DIR )
279
- cd $(INITRAMFS_DIR ) && zcat ../ $(CPIO_FILE ) | cpio --extract --make-directories --format=newc --no-absolute-filenames
283
+ cd $(INITRAMFS_DIR ) && zcat $(CPIO_FILE ) | cpio --extract --make-directories --format=newc --no-absolute-filenames
280
284
281
285
.PHONY : rootfs
282
286
rootfs : ext4 cpio
You can’t perform that action at this time.
0 commit comments