forked from lindenis-org/lindenis-v853-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaw-upgrade.mk
executable file
·94 lines (76 loc) · 2.27 KB
/
aw-upgrade.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# author:henrisk.ho
define Aw/BuildUpgradeImage/prepare
#$(1): target_dir #$(2): temp_usr
#prepare for base system (no include /usr)
#for procd
-mv $(1)/usr/lib/libjson-c.so.* $(1)/lib/
-mv $(1)/usr/bin/readlink $(1)/bin/
-mv $(1)/usr/bin/basename $(1)/bin/
-mv $(1)/usr/bin/jshn $(1)/bin/
#for wifi
-mv $(1)/usr/sbin/wpa* $(1)/sbin/
-mv $(1)/usr/sbin/hostapd* $(1)/sbin/
-mv $(1)/usr/lib/libnl-tiny.so $(1)/lib/
#for filesystem tools
-mv $(1)/usr/sbin/mke2fs $(1)/sbin/
-mv $(1)/usr/sbin/mkfs.ext4 $(1)/sbin/
-mv $(1)/usr/sbin/mkfs.jffs2 $(1)/sbin/
-mv $(1)/usr/lib/libext2fs.so* $(1)/lib/
-mv $(1)/usr/lib/libcom_err.so* $(1)/lib/
-mv $(1)/usr/lib/libuuid.so* $(1)/lib/
-mv $(1)/usr/lib/libe2p.so* $(1)/lib/
-mv $(1)/usr/lib/libz.so* $(1)/lib/
#for tinymp3player
-mv $(1)/usr/lib/libmad.so* $(1)/lib/
-mv $(1)/usr/lib/libasound.so* $(1)/lib/
#ssl
-mv $(1)/usr/lib/libssl.so* $(1)/lib/
#curl
-mv $(1)/usr/lib/libcurl.so* $(1)/lib/
#crypto
-mv $(1)/usr/lib/libcrypto.so* $(1)/lib/
find $(1)/usr/lib | grep libstdc++.so | xargs -i mv {} $(1)/lib
#for link /usr/bin /usr/sbin
rm -rf $(2)
mv $(1)/usr $(2)
mkdir -p $(1)/lib/functions
mkdir -p $(1)/usr/share
cp -r $(2)/bin $(1)/usr/
find $(1)/usr/bin -type f -exec rm {} \;
-cp $(2)/share/libubox/jshn.sh $(1)/lib/functions/
-cp -r $(2)/share/* $(1)/usr/share/
endef
define Aw/BuildUpgradeImage/resume
#$(1): target_dir #$(2): temp_usr
rm -rf $(1)/usr
mv $(2) $(1)/usr
endef
define Aw/BuildUpgradeImage/normal-prepare
#$(1): target_dir #$(2): temp_usr
$(call Aw/BuildUpgradeImage/prepare,$(1),$(2))
endef
define Aw/BuildUpgradeImage/normal-resume
#$(1): target_dir #$(2): temp_usr
$(call Aw/BuildUpgradeImage/resume,$(1),$(2))
endef
ifeq ($(CONFIG_TARGET_AW_OTA_INITRAMFS),y)
define Aw/BuildUpgradeImage/initramfs-prepare
#$(1): target_dir #$(2): temp_usr
$(call Aw/BuildUpgradeImage/prepare,$(1),$(2))
endef
define Aw/BuildUpgradeImage/initramfs-resume
#$(1): target_dir #$(2): temp_usr
$(call Aw/BuildUpgradeImage/resume,$(1),$(2))
endef
else
define Aw/BuildUpgradeImage/initramfs-prepare
endef
define Aw/BuildUpgradeImage/initramfs-resume
endef
endif