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

Last change on this file since 926 was 926, checked in by amain, 5 years ago

lede: fix patch 025

File size: 2.1 KB
Line 
1diff --git a/include/image.mk b/include/image.mk
2index 81519cd..a5f89ca 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
40@@ -552,6 +571,17 @@ define BuildImage
41   endif
42 
43   kernel_prepare: image_prepare
44+ifneq ($(CONFIG_IMAGE_CMDLINE_HACK),y)
45+       if [ ! -e $(STAGING_DIR_HOST)/bin/patch-cmdline.bin ]; then \
46+           mv $(STAGING_DIR_HOST)/bin/patch-cmdline $(STAGING_DIR_HOST)/bin/patch-cmdline.bin; \
47+           echo "#!/bin/sh" > $(STAGING_DIR_HOST)/bin/patch-cmdline; \
48+           chmod +x $(STAGING_DIR_HOST)/bin/patch-cmdline; \
49+       fi
50+else
51+       if [ -e $(STAGING_DIR_HOST)/bin/patch-cmdline.bin ]; then \
52+           mv $(STAGING_DIR_HOST)/bin/patch-cmdline.bin $(STAGING_DIR_HOST)/bin/patch-cmdline; \
53+       fi
54+endif
55        $(call Image/Build/targz)
56        $(call Image/Build/cpiogz)
57        $(call Image/BuildKernel)
Note: See TracBrowser for help on using the repository browser.