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

Last change on this file since 884 was 884, checked in by amain, 3 years ago

Add LEDE support. LEDE is (for now) the new default.

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