source: trunk/openwrt/patches/lede/all/025_make_empty_rootfs @ 924

Last change on this file since 924 was 924, checked in by amain, 2 years ago

lede: update patches, split patch 021_install_kernel_modules_and_merge_debwrt_config

File size: 1.5 KB
Line 
1diff --git a/include/image.mk b/include/image.mk
2index 81519cd..c4021ed 100644
3--- a/include/image.mk
4+++ b/include/image.mk
5@@ -200,13 +200,32 @@ endef
6 $(eval $(foreach S,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/template,$(S))))
7 $(eval $(foreach S,$(NAND_BLOCKSIZE),$(call Image/mkfs/jffs2-nand/template,$(S))))
8 
9-define Image/mkfs/squashfs
10+ifneq ($(CONFIG_BOOT_METHOD_SCRIPT),)
11+       define Image/mkfs/squashfs
12+       # kexec and LABEL= boot
13+       @mkdir -p $(call mkfs_target_dir,$(1))/overlay
14+       ls -l $(1)
15+       # remove /lib/modules to prevent the image from getting to big
16+       rm -rf $(call mkfs_target_dir,$(1))/lib/modules
17        $(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
18                -nopad -noappend -root-owned \
19                -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
20                -processors 1 \
21                $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
22-endef
23+       endef
24+else
25+       define Image/mkfs/squashfs
26+       # boot direclty from device
27+       mkdir -p $(TMP_DIR)/debwrt-empty-rootfs/overlay
28+       touch $(TMP_DIR)/debwrt-empty-rootfs/debwrt-empty-rootfs
29+       # create image file $@[used to be $(KDIR)/root.squashfs] from $(TMP_DIR)/debwrt-empty-rootfs/
30+       $(STAGING_DIR_HOST)/bin/mksquashfs4 $(TMP_DIR)/debwrt-empty-rootfs/ $@ \
31+               -nopad -noappend -root-owned \
32+               -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
33+               -processors $(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1) \
34+               $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
35+       endef
36+endif
37 
38 # $(1): board name
39 # $(2): rootfs type
Note: See TracBrowser for help on using the repository browser.