-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
83 lines (63 loc) · 2.07 KB
/
Makefile
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
#
# Copyright (C) 2023 remittor
#
include $(TOPDIR)/rules.mk
PKG_NAME:=facinstall
PKG_VERSION:=2.0
PKG_RELEASE:=20240910
PKG_MAINTAINER:=remittor <remittor@gmail.com>
PKG_LICENSE:=MIT
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Installer for factory and OEM images
PKGARCH:=all
endef
define Package/$(PKG_NAME)/description
Installer for factory and OEM images
endef
define Package/$(PKG_NAME)/conffiles
/etc/config/$(PKG_NAME)
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
$(INSTALL_DIR) $(1)/lib/upgrade/$(PKG_NAME)
$(INSTALL_BIN) ./files/$(PKG_NAME).sh $(1)/lib/upgrade/$(PKG_NAME)/$(PKG_NAME).sh
$(INSTALL_DIR) $(1)/lib/upgrade/$(PKG_NAME)
$(INSTALL_BIN) ./files/functions.sh $(1)/lib/upgrade/$(PKG_NAME)/functions.sh
$(INSTALL_DIR) $(1)/lib/upgrade/$(PKG_NAME)
$(INSTALL_BIN) ./files/fi_boards.sh $(1)/lib/upgrade/$(PKG_NAME)/fi_boards.sh
$(INSTALL_DIR) $(1)/lib/upgrade/$(PKG_NAME)
$(INSTALL_BIN) ./files/validate_fw_image.sh $(1)/lib/upgrade/$(PKG_NAME)/validate_fw_image.sh
$(INSTALL_DIR) $(1)/lib/upgrade/$(PKG_NAME)
$(INSTALL_BIN) ./files/fi_do_stage2.sh $(1)/lib/upgrade/$(PKG_NAME)/fi_do_stage2.sh
$(INSTALL_DIR) $(1)/lib/upgrade/$(PKG_NAME)
$(INSTALL_BIN) ./files/xiaomi.sh $(1)/lib/upgrade/$(PKG_NAME)/xiaomi.sh
$(INSTALL_DIR) $(1)/lib/upgrade/$(PKG_NAME)
$(INSTALL_BIN) ./files/asus.sh $(1)/lib/upgrade/$(PKG_NAME)/asus.sh
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
/etc/init.d/$(PKG_NAME) enabled
/etc/init.d/$(PKG_NAME) start
fi
exit 0
endef
define Package/$(PKG_NAME)/prerm
#!/bin/sh
# check if we are on real system
if [ -n "$${IPKG_INSTROOT}" ]; then
/etc/init.d/$(PKG_NAME) stop
/etc/init.d/$(PKG_NAME) disable
fi
exit 0
endef
$(eval $(call BuildPackage,$(PKG_NAME)))