Compare commits

...

189 Commits

Author SHA1 Message Date
AuxXxilium
0acb2020c8 Merge pull request #5028 from AuxXxilium/dev
tree: rewrite more
2024-12-01 19:19:29 +01:00
AuxXxilium
5338b8ecc7 tree: rewrite more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-01 19:09:57 +01:00
AuxXxilium
fb44e027b3 Merge pull request #5027 from AuxXxilium/dev
Dev
2024-12-01 18:12:30 +01:00
AuxXxilium
ad987595bb tree: rework more logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-01 18:09:26 +01:00
AuxXxilium
3049a8cf5d tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-01 17:53:50 +01:00
AuxXxilium
f6f9ed1810 arc: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-01 17:42:45 +01:00
AuxXxilium
b33d1e0013 grub: test
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-01 17:09:48 +01:00
AuxXxilium
a3f6d44b52 Merge pull request #5024 from AuxXxilium/dev
Dev
2024-12-01 16:44:44 +01:00
AuxXxilium
931e5c7942 grub: set fixed resolution
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-01 16:37:23 +01:00
AuxXxilium
2c90cfd41b init: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-01 11:23:32 +01:00
AuxXxilium
bf33567af2 arc-functions: fix clone loader
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-12-01 11:12:19 +01:00
AuxXxilium
4418bfa3f9 Merge pull request #5005 from AuxXxilium/dev
tree: fix automated
2024-11-30 23:27:14 +01:00
AuxXxilium
a239db84ff tree: fix automated
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-30 23:26:20 +01:00
AuxXxilium
9a50bf50ea Merge pull request #5003 from AuxXxilium/dev
Dev
2024-11-30 22:16:48 +01:00
AuxXxilium
ea0c82fd95 tree: fix more logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-30 22:12:52 +01:00
AuxXxilium
c8663b8994 boot: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-30 21:29:31 +01:00
AuxXxilium
0cf78e4fbf Merge pull request #5000 from AuxXxilium/dev
Dev
2024-11-30 20:18:33 +01:00
AuxXxilium
65210543b7 tree: fix more logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-30 20:17:44 +01:00
AuxXxilium
13fa3fc771 tree: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-30 02:49:53 +01:00
AuxXxilium
f6f86334ed grub: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-29 22:45:11 +01:00
AuxXxilium
74093f29b1 init/boot: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-29 21:31:13 +01:00
AuxXxilium
466424229d tree: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-28 23:22:57 +01:00
AuxXxilium
6c31c321e6 arc: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-28 20:53:38 +01:00
AuxXxilium
1f46c8860f tree: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-28 18:03:45 +01:00
AuxXxilium
21ffcf4cd5 busybox: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-26 22:07:20 +01:00
AuxXxilium
4a94b7237f boot: fix mac
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-25 00:16:43 +01:00
AuxXxilium
8c0e316993 tree: update more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-25 00:12:14 +01:00
AuxXxilium
582292c5d1 init: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-25 00:00:09 +01:00
AuxXxilium
d87c63b870 arc: fix menu bug
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-24 23:52:35 +01:00
AuxXxilium
4be4774994 boot: add sections
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-24 23:16:09 +01:00
AuxXxilium
5f89c1d61a tree: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-24 22:56:22 +01:00
AuxXxilium
73ad75ed34 update: rewrite messages
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-24 14:00:32 +01:00
AuxXxilium
bc0c10f829 boot/grub: change intel pstate
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-24 12:55:17 +01:00
AuxXxilium
dfe6a3c534 arc: add new addon to preselection
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-24 11:39:59 +01:00
AuxXxilium
75fa94aba8 Merge branch 'test' into dev
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-24 11:36:33 +01:00
AuxXxilium
8b4bdf2fc8 tree: fix syntax and logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-24 11:32:03 +01:00
AuxXxilium
16f3590843 update: fix window
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-23 23:32:04 +01:00
AuxXxilium
892c374946 tree: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-23 14:36:09 +01:00
AuxXxilium
c77d646d26 tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-20 20:20:45 +01:00
AuxXxilium
9323868f05 grub: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-20 20:15:15 +01:00
AuxXxilium
3555ec84ad build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-20 20:08:59 +01:00
AuxXxilium
32ffa70cb1 tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-20 19:54:38 +01:00
AuxXxilium
2d0dd7d7e9 tree: rework 2
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-20 13:39:15 +01:00
AuxXxilium
27493c7f4f tree: rework menu order and fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-20 12:30:57 +01:00
AuxXxilium
1021427900 grub: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-20 12:01:21 +01:00
AuxXxilium
8cb6619ae8 tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-20 01:29:20 +01:00
AuxXxilium
d9ebdd95d8 functions: fast fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 17:30:55 +01:00
AuxXxilium
902db23960 arc: add warning if arc patch failed
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:48:17 +01:00
AuxXxilium
2c2286e651 arc: don't show online functions if loader is offline
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:42:46 +01:00
AuxXxilium
d274d528bb arc: reinit loader after restore config
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:40:17 +01:00
AuxXxilium
dabbd3ff81 arc: fix restore from online
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:38:27 +01:00
AuxXxilium
b2538b24ef tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:22:53 +01:00
AuxXxilium
c4ff1ecf1e arc: remove some warnings
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-17 16:17:59 +01:00
AuxXxilium
e218db8511 arc: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 23:17:59 +01:00
AuxXxilium
8c22d11c49 tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 22:58:57 +01:00
AuxXxilium
71e7eba6f3 arc: change false message
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 22:42:00 +01:00
AuxXxilium
5f030c2349 tree: add some sanity check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 21:53:43 +01:00
AuxXxilium
5fa2c3a1c6 arc: cleanup more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 20:43:46 +01:00
AuxXxilium
cf2daa9807 networkdiag: add useridapi check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 19:01:58 +01:00
AuxXxilium
167d909e13 arc-functions: add message for user without a brain
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 18:27:12 +01:00
AuxXxilium
b4ebd305bd functions: fix typo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 15:45:11 +01:00
AuxXxilium
f4bbb7c5bb tree: rework more logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 11:31:31 +01:00
AuxXxilium
390f5b11db tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 10:42:03 +01:00
AuxXxilium
8bc3393d55 functions: move to correct file
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-16 00:35:56 +01:00
AuxXxilium
cee2d7d263 tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 15:46:33 +01:00
AuxXxilium
ab508a9eb5 arc-functions: rename update function
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 15:35:27 +01:00
AuxXxilium
16a73afe9d arc-functions: more logic fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 15:25:43 +01:00
AuxXxilium
c4cc0b779a arc-functions: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 14:57:03 +01:00
AuxXxilium
601547d9db arc-functions: more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 14:16:47 +01:00
AuxXxilium
a68b5d446e functions: fix hwid for multiple nic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-15 14:08:09 +01:00
AuxXxilium
3ccb91be9f arc-functions: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-14 20:42:40 +01:00
AuxXxilium
3e010b781a arc: fix copy
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 23:53:11 +01:00
AuxXxilium
dcd86a4272 build: fix local
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 23:43:24 +01:00
AuxXxilium
c287e33aab arc: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 18:55:07 +01:00
AuxXxilium
95c1eb6897 tree: rework more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 18:05:58 +01:00
AuxXxilium
fb183e437e build: fix local
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 17:23:09 +01:00
AuxXxilium
efca3aaf6d arc-functions: rework id check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 01:20:37 +01:00
AuxXxilium
46ec4215d7 arc-functions: fix loop
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-13 00:32:59 +01:00
AuxXxilium
f44a142d01 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-12 17:02:13 +01:00
AuxXxilium
b036a2aef2 build: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-12 16:51:19 +01:00
AuxXxilium
afb22a6321 functions: more...
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-12 16:11:05 +01:00
AuxXxilium
fb938806a2 functions: finalize hwid
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-12 16:02:28 +01:00
AuxXxilium
1bde43ca66 functions: make hwid unique
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-11 21:42:40 +01:00
AuxXxilium
d890c54a1b arc: add more features for online
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-11 21:05:07 +01:00
AuxXxilium
d876d274d4 functions: add new
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-11 18:54:25 +01:00
AuxXxilium
24d9ed7bb3 arc-functions: make hwid unique
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-10 18:44:21 +01:00
AuxXxilium
1d04d3f59f arc: more logic rewrite
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-10 18:24:04 +01:00
AuxXxilium
78f5455b69 arc: more ...
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-10 17:39:26 +01:00
AuxXxilium
81d72a0800 arc: next step
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-10 17:16:46 +01:00
AuxXxilium
73ec652bd0 boot: fix boot message
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-10 12:56:32 +01:00
AuxXxilium
bbc9904b3e build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-10 11:09:53 +01:00
AuxXxilium
2bc754c9a1 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-10 00:56:17 +01:00
AuxXxilium
f50bb9cc46 arc-functions: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-10 00:16:03 +01:00
AuxXxilium
8de9970341 ramdisk: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 23:58:14 +01:00
AuxXxilium
1245ca4f4a arc-functions: add missing spaces
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 23:46:01 +01:00
AuxXxilium
10a5a18abb arc-function: set defaults for latest changes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 21:59:11 +01:00
AuxXxilium
51eea40ea7 boot: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 21:33:18 +01:00
AuxXxilium
2b13648cc4 arc-functions: more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 21:17:57 +01:00
AuxXxilium
6b315e08ad arc-functions: rework sysinfo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 21:16:12 +01:00
AuxXxilium
fe642ebec2 build: update 2
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 17:59:57 +01:00
AuxXxilium
bc43cdaeb7 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 17:43:20 +01:00
AuxXxilium
0966a2b783 boot: logic fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 17:30:02 +01:00
AuxXxilium
4c5bfbe695 custom: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 13:45:54 +01:00
AuxXxilium
623271fc6c build: include dependencies in release
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-09 12:26:52 +01:00
AuxXxilium
3df2339e63 arc: fix latest
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-08 20:31:40 +01:00
AuxXxilium
323c266812 init/boot: add arc_build
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-08 19:57:07 +01:00
AuxXxilium
a5055dbaf4 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-08 19:44:29 +01:00
AuxXxilium
d9c71d453a tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-08 19:10:03 +01:00
AuxXxilium
474b8bbe03 arc-functions: fix typo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-03 17:19:16 +01:00
AuxXxilium
c45d52459d arc-functions: fix typos
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-03 13:25:13 +01:00
AuxXxilium
1ec1f7ffb9 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-02 18:56:39 +01:00
AuxXxilium
3777d2c952 arc-functions: add back branch switch to update menu
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-02 14:53:49 +01:00
AuxXxilium
bd868c6142 arc: rewrite more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-02 14:35:39 +01:00
AuxXxilium
62bf4259b9 arc: rework some menu things
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-02 14:20:09 +01:00
AuxXxilium
bcc7a7f6c1 addons: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-02 01:10:01 +01:00
AuxXxilium
8f6a18f6dd functions: remove unused
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-01 15:55:34 +01:00
AuxXxilium
d48a970cd8 arc: rework ui
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-01 14:23:45 +01:00
AuxXxilium
39f119c123 arc: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-11-01 11:44:57 +01:00
AuxXxilium
cc429e4ea5 tree: remove usage of syno api
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 22:03:59 +01:00
AuxXxilium
7da081d887 update: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 12:57:57 +01:00
AuxXxilium
73e9eae212 addons: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 12:43:04 +01:00
AuxXxilium
e72a8586cf arc: optimize changes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 12:36:10 +01:00
AuxXxilium
d9650981f7 arc-functions: typo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 12:29:03 +01:00
AuxXxilium
4cced72bbb arc: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 12:27:42 +01:00
AuxXxilium
bbc7e9046d arc: try something new
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 11:47:16 +01:00
AuxXxilium
e512310055 functions: add logic check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 11:26:00 +01:00
AuxXxilium
d44f741887 consts: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 11:19:21 +01:00
AuxXxilium
f6e88b135b update: rewrite logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 11:19:10 +01:00
AuxXxilium
8e2794c1bf update: add backup logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 10:56:49 +01:00
AuxXxilium
843fa0aa30 functions: optimize logic for online check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 10:52:53 +01:00
AuxXxilium
99bb6937eb arc: rewrite more api related
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 02:04:12 +01:00
AuxXxilium
7a5932fea5 arc: reduce api calls and rewrite offline mode
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-31 01:48:27 +01:00
AuxXxilium
ccfbd4c15c tree: rework update functions
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-30 20:53:35 +01:00
AuxXxilium
e7994e5cd2 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-30 20:02:17 +01:00
AuxXxilium
3295073c99 tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-30 19:56:11 +01:00
AuxXxilium
b6c0b24b70 tree: fix VMM issue on epyc7002
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-29 16:57:50 +01:00
AuxXxilium
998bdceba7 arc: more rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-27 23:04:48 +01:00
AuxXxilium
ae0f6a30fe arc: rewrite more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-27 21:26:45 +01:00
AuxXxilium
465b147960 tree: more rewrite
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-27 21:16:55 +01:00
AuxXxilium
a4da6be93b arc: fix reset loader
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-27 18:58:56 +01:00
AuxXxilium
d6a5443593 addons: remove online addons if arc is offline
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-27 18:39:05 +01:00
AuxXxilium
4ba2e6baa6 tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-27 18:33:41 +01:00
AuxXxilium
962645bb9e arc: add check for cpufreqscaling
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-27 18:33:20 +01:00
AuxXxilium
6dfce5cc1b arc: add offline check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-27 18:30:22 +01:00
AuxXxilium
39b95a840a arc: rework update way
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-26 20:15:57 +02:00
AuxXxilium
e3b850ecb0 arc-functions: changes for upcoming
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-26 13:02:18 +02:00
AuxXxilium
fb9d67881d arc: expand sysinfo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-26 12:59:40 +02:00
AuxXxilium
bf8d488eb9 arc: fix config restore
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-26 12:41:02 +02:00
AuxXxilium
877feba5cb arc: remove dependencies for cpufreqscaling
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-26 11:36:56 +02:00
AuxXxilium
bb8c74e9ac arc: fix patch reset while read models
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-26 11:29:06 +02:00
AuxXxilium
25dc3115b6 grub: update 2024-10-25 20:29:10 2024-10-25 22:15:07 +02:00
AuxXxilium
3cdc3c874c tree: fix more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 22:14:52 +02:00
AuxXxilium
bce7d47e4a grub: shrink partition 2
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 20:20:11 +02:00
AuxXxilium
1d13466f83 grub: update 2024-10-25 20:09:50 2024-10-25 20:16:13 +02:00
AuxXxilium
ddd7e2ccef functions: fix sortnetif for arc
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 20:15:58 +02:00
AuxXxilium
5b40850fe0 functions: fix .dev version check
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 20:07:08 +02:00
AuxXxilium
8810cd128d grub: shrink loader to 1G
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 20:00:46 +02:00
AuxXxilium
1c0f3a4c06 compat: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 19:56:02 +02:00
AuxXxilium
2594a8a599 tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 19:55:21 +02:00
AuxXxilium
138d683318 boot: add option to customize
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 19:43:54 +02:00
AuxXxilium
3f916ce79e tree: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 18:32:23 +02:00
AuxXxilium
96e0679adb tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 18:20:04 +02:00
AuxXxilium
293f266842 tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 16:05:39 +02:00
AuxXxilium
7ea1888c93 arc-functions: rework addons
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 15:16:52 +02:00
AuxXxilium
905131ae8e Revert "init: remove sortnetif for now"
This reverts commit 9e482783f0.
2024-10-25 14:49:37 +02:00
AuxXxilium
4d47d4dfb3 functions: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:48:01 +02:00
AuxXxilium
0f64c0ed80 arc: fix sn/mac stuff
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:45:13 +02:00
AuxXxilium
56d9c038a4 tree: syntax fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:32:32 +02:00
AuxXxilium
91babd9162 functions: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:12:48 +02:00
AuxXxilium
a03f4fcada build: update local stable
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:12:14 +02:00
AuxXxilium
326c92acc5 build: update local next
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:12:14 +02:00
AuxXxilium
4ddaaf7584 build: update build
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:12:14 +02:00
AuxXxilium
5c45588bf8 build: update autobuild
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:12:14 +02:00
AuxXxilium
9e482783f0 init: remove sortnetif for now
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-25 14:11:55 +02:00
AuxXxilium
290ef7e65a build: remove ova from autobuild
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 23:42:39 +02:00
AuxXxilium
1830fa3220 build: fix autobuild
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 23:36:06 +02:00
AuxXxilium
fd7c7508b0 custom: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 20:17:24 +02:00
AuxXxilium
57a8b7ccb5 arc: rewrite message
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 20:12:13 +02:00
AuxXxilium
1fadffe0c7 build: update dev build
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:33:20 +02:00
AuxXxilium
678cc34e09 update: rewrite version after update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:28:44 +02:00
AuxXxilium
db5776871e build: update dev build
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:23:24 +02:00
AuxXxilium
f0d61394a0 grub: update 2024-10-24 19:21:21 2024-10-24 19:21:42 +02:00
AuxXxilium
2ab92748a1 arc-functions: update credits
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:21:22 +02:00
AuxXxilium
65d18c8792 tree: modify more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:18:05 +02:00
AuxXxilium
4250b5341b arc-functions: change grub img path
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:10:52 +02:00
AuxXxilium
e03df2dbab build: update local build files
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:08:56 +02:00
AuxXxilium
064c9fe84b grub: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:06:29 +02:00
AuxXxilium
8dcf836a69 tree: merge latest changes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 19:05:24 +02:00
AuxXxilium
dc80125b75 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-24 18:59:15 +02:00
39 changed files with 2885 additions and 3517 deletions

View File

@@ -1,87 +1,106 @@
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build Arc Dev
name: Build Arc Image Development
on:
workflow_dispatch:
push:
branches:
- dev
inputs:
runs:
description: "runs-on"
type: choice
options:
- ubuntu-latest
- self-hosted
version:
description: "version (1.0.0)"
required: true
type: string
next:
description: "next"
default: true
type: boolean
stable:
description: "stable"
default: true
type: boolean
jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ inputs.runs }}
steps:
- name: Checkout
uses: actions/checkout@main
# Install Dependencies
- name: Install Dependencies
if: ${{ inputs.runs == 'ubuntu-latest' }}
run: |
git config --global user.email "info@auxxxilium.tech"
git config --global user.name "AuxXxilium"
sudo timedatectl set-timezone "Europe/Berlin"
sudo apt update
sudo apt install -y jq gawk cpio gettext libelf-dev qemu-utils busybox dialog curl sed
sudo snap install yq
sudo apt install -y locales busybox dialog gettext sed gawk jq curl
sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils cpio xz-utils lz4 lzma bzip2 gzip zstd
# sudo snap install yq
if ! command -v yq &>/dev/null || ! yq --version 2>/dev/null | grep -q "v4."; then
sudo curl -kL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && sudo chmod a+x /usr/bin/yq
fi
df -h
# calculates the version number and push
- name: Calculate Version
run: |
# Calculate Version
VERSION="`date +'%y.%m'`.dev"
echo "Version: ${VERSION}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
# Get extractor, LKM, Addons, Modules, Theme and Configs
- name: Get extractor, LKM, Addons, Modules, Theme and Configs
- name: Get Buildroot
run: |
. scripts/func.sh
. scripts/func.sh "${{ secrets.BUILD_TOKEN }}"
getLKMs "files/p3/lkms"
echo "LKMTAG=${TAG}" >> $GITHUB_ENV
echo "Get Dependencies"
getAddons "files/p3/addons"
echo "ADDONSTAG=${TAG}" >> $GITHUB_ENV
getModules "files/p3/modules"
echo "MODULESTAG=${TAG}" >> $GITHUB_ENV
getConfigs "files/p3/configs"
echo "CONFIGSTAG=${TAG}" >> $GITHUB_ENV
getPatches "files/p3/patches"
echo "PATCHESTAG=${TAG}" >> $GITHUB_ENV
getCustom "files/p3/custom"
echo "CUSTOMTAG=${TAG}" >> $GITHUB_ENV
getOffline "files/p3/configs"
getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
getBuildrootx "latest" "brx"
echo "BRX_VERSION=${TAG}" >> $GITHUB_ENV
getBuildroots "latest" "brs"
echo "BRS_VERSION=${TAG}" >> $GITHUB_ENV
getOffline "files/p3/offline"
getBuildrootx "brx"
getBuildroots "brs"
# Export Dependencies Version to env
echo "ADDONTAG=${ADDONTAG}" >> $GITHUB_ENV
echo "MODULETAG=${MODULETAG}" >> $GITHUB_ENV
echo "CONFIGTAG=${CONFIGTAG}" >> $GITHUB_ENV
echo "PATCHTAG=${PATCHTAG}" >> $GITHUB_ENV
echo "CUSTOMTAG=${CUSTOMTAG}" >> $GITHUB_ENV
echo "LKMTAG=${LKMTAG}" >> $GITHUB_ENV
echo "THEMETAG=${THEMETAG}" >> $GITHUB_ENV
echo "BRXTAG=${BRXTAG}" >> $GITHUB_ENV
echo "BRSTAG=${BRSTAG}" >> $GITHUB_ENV
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
echo "OK"
# Build incremental
- name: Build Image S
- name: Build Next Image
if: ${{ inputs.next == true }}
run: |
. scripts/func.sh
if [ -n "${VERSION}" ]; then
# Modify Source File
echo "${VERSION}" >VERSION
echo "${VERSION}" >files/p1/ARC-VERSION
echo "stable" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
fi
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="${{ inputs.version }}-dev"
ARC_BRANCH="next"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
echo "Create Arc Image"
IMAGE_FILE="arc.img"
@@ -97,70 +116,6 @@ jobs:
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
echo "Image Converter"
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc.ova"
# Zip update and generate checksum
cp -f files/p1/ARC-VERSION files/p3/ARC-VERSION
cp -f files/p1/ARC-BRANCH files/p3/ARC-BRANCH
cp -f files/p1/boot/grub/grub.cfg files/p3/grub.cfg
cd files/p3
zip -9 update.zip -r .
sha256sum update.zip >checksum.sha256
mv update.zip ../../
mv checksum.sha256 ../../
cd -
# Build incremental
- name: Build Image X
run: |
. scripts/func.sh
if [ -n "${VERSION}" ]; then
# Modify Source File
echo "${VERSION}" >VERSION
echo "${VERSION}" >files/p1/ARC-VERSION
echo "next" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
fi
echo "Create Arc Image"
IMAGE_FILE="arc-next.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
echo "Repack initrd"
@@ -168,9 +123,9 @@ jobs:
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sudo sync
echo "Unmount image file"
sudo umount "/tmp/p1"
@@ -181,73 +136,124 @@ jobs:
sudo losetup --detach ${LOOPX}
echo "Image Converter"
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-next-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-next.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-next.vhdx
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc-next.ova"
# Zip update and generate checksum
cp -f files/p1/ARC-VERSION files/p3/ARC-VERSION
cp -f files/p1/ARC-BRANCH files/p3/ARC-BRANCH
cp -f files/p1/boot/grub/grub.cfg files/p3/grub.cfg
cd files/p3
zip -9 update-next.zip -r .
sha256sum update-next.zip >checksum-next.sha256
mv update-next.zip ../../
mv checksum-next.sha256 ../../
cd -
qemu-img convert -p -f raw -O vmdk ${IMAGE_FILE} arc-dyn.vmdk
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk
qemu-img convert -p -f raw -O vhdx ${IMAGE_FILE} arc.vhdx
# Zip image and generate checksum
- name: Pack
- name: Pack Next Image
if: ${{ inputs.next == true }}
run: |
if [ -n "${{ env.VERSION }}" ]; then
# XBase
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc-next.img
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-next-dyn.vmdk
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc-next.vmdk arc-next-flat.vmdk
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc-next.vhdx
zip -9 "arc-${{ env.VERSION }}-next.ova.zip" arc-next.ova
# SBase
zip -9 "arc-${{ env.VERSION }}.img.zip" arc.img
zip -9 "arc-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
zip -9 "arc-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
zip -9 "arc-${{ env.VERSION }}.ova.zip" arc.ova
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
fi
# Cleanup
- name: Cleanup
run: |
rm -rf "arc.img" "arc.vmdk" "arc-dyn.vmdk" "arc.vhdx" "arc-flat.vmdk"
# Build incremental
- name: Build Stable Image
if: ${{ inputs.stable }}
run: |
. scripts/func.sh
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="${{ inputs.version }}-dev"
ARC_BRANCH="stable"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
echo "Create Arc Image"
IMAGE_FILE="arc.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
#cp -f "brs/initrd-arc" "files/p3/initrd-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sudo sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
echo "Image Converter"
qemu-img convert -p -f raw -O vmdk ${IMAGE_FILE} arc-dyn.vmdk
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk
qemu-img convert -p -f raw -O vhdx ${IMAGE_FILE} arc.vhdx
# Zip image and generate checksum
- name: Pack Stable Image
if: ${{ inputs.stable }}
run: |
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
fi
echo "24.01.01" >check.update
# Publish a release if is a tag
- name: Release
if: success() && env.VERSION != ''
if: success() && env.ARC_VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
tag: ${{ env.ARC_VERSION }}
prerelease: true
makeLatest: false
allowUpdates: true
body: |
### Information:
Notice: Development Build
- Version:
- arc: Stable Buildroot System (Less Hardware supported / faster Boot)
- arc-next: Latest Buildroot System (More Hardware supported (still in testing))
- Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
### Note:
- Development Build
### Versions:
Addons: ${{ env.ADDONSTAG }}
Configs: ${{ env.CONFIGSTAG }}
Modules: ${{ env.MODULESTAG }}
Patches: ${{ env.PATCHESTAG }}
Custom: ${{ env.CUSTOMTAG }}
Theme: ${{ env.THEMETAG }}
LKM: ${{ env.LKMTAG }}
Buildroot: ${{ env.BRS_VERSION }} | Buildroot Next: ${{ env.BRX_VERSION }}
Release: ${{ env.BUILD_TIME }}
### Information:
- Full Changelog is available in my Discord
- Discord Account for Arc Patch needed
### Dependencies:
- Addons: ${{ env.ADDONTAG }}
- Modules: ${{ env.MODULETAG }}
- Configs: ${{ env.CONFIGTAG }}
- Patches: ${{ env.PATCHTAG }}
- Custom: ${{ env.CUSTOMTAG }}
- LKMs: ${{ env.LKMTAG }}
- Buildroot Stable: ${{ env.BRSTAG }}
- Buildroot Next: ${{ env.BRXTAG }}
### Release
- ${{ env.BUILD_TIME }}
artifacts: |
arc-*.zip
update.zip
update-next.zip
checksum.sha256
checksum-next.sha256
check.update
update-*.zip

View File

@@ -1,18 +1,24 @@
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build Arc
name: Build Arc Image
on:
workflow_dispatch:
inputs:
runs:
description: "runs-on"
type: choice
options:
- ubuntu-latest
- self-hosted
version:
description: "version"
required: false
description: "version (1.0.0)"
required: true
type: string
notice:
description: "Notice here"
@@ -26,100 +32,101 @@ on:
description: "pre release"
default: false
type: boolean
next:
description: "next"
default: true
type: boolean
stable:
description: "stable"
default: true
type: boolean
clean:
description: "clean"
default: false
type: boolean
update_version:
description: "update min version"
default: "24.09.22"
type: string
jobs:
build:
runs-on: self-hosted
runs-on: ${{ inputs.runs }}
steps:
- name: Checkout
uses: actions/checkout@main
- name: Delete releases and workflows runs
if: inputs.clean == true
if: ${{ inputs.clean == true }}
uses: ophub/delete-releases-workflows@main
with:
delete_releases: true
releases_keep_latest: 1
delete_workflows: true
workflows_keep_day: 1
delete_workflows: false
delete_tags: true
gh_token: ${{ secrets.GITHUB_TOKEN }}
# Install Dependencies
- name: Install Dependencies
if: ${{ inputs.runs == 'ubuntu-latest' }}
run: |
git config --global user.email "info@auxxxilium.tech"
git config --global user.name "AuxXxilium"
sudo timedatectl set-timezone "Europe/Berlin"
sudo apt update
sudo apt install -y jq gawk cpio gettext libelf-dev qemu-utils busybox dialog curl sed
sudo snap install yq
sudo apt install -y locales busybox dialog gettext sed gawk jq curl
sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils cpio xz-utils lz4 lzma bzip2 gzip zstd
# sudo snap install yq
if ! command -v yq &>/dev/null || ! yq --version 2>/dev/null | grep -q "v4."; then
sudo curl -kL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && sudo chmod a+x /usr/bin/yq
fi
df -h
# calculates the version number and push
- name: Calculate Version
run: |
# Calculate Version
VERSION=""
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="`date +'%y.%m.%d'`"
fi
echo "Version: ${VERSION}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
# Get extractor, LKM, Addons, Modules, Theme and Configs
- name: Get extractor, LKM, Addons, Modules, Theme and Configs
- name: Get Dependencies for all Image
run: |
. scripts/func.sh
. scripts/func.sh "${{ secrets.BUILD_TOKEN }}"
getLKMs "files/p3/lkms"
echo "LKMTAG=${TAG}" >> $GITHUB_ENV
echo "Get Dependencies"
getAddons "files/p3/addons"
echo "ADDONSTAG=${TAG}" >> $GITHUB_ENV
getModules "files/p3/modules"
echo "MODULESTAG=${TAG}" >> $GITHUB_ENV
getConfigs "files/p3/configs"
echo "CONFIGSTAG=${TAG}" >> $GITHUB_ENV
getPatches "files/p3/patches"
echo "PATCHESTAG=${TAG}" >> $GITHUB_ENV
getCustom "files/p3/custom"
echo "CUSTOMTAG=${TAG}" >> $GITHUB_ENV
getOffline "files/p3/configs"
getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
getBuildrootx "latest" "brx"
echo "BRX_VERSION=${TAG}" >> $GITHUB_ENV
getBuildroots "latest" "brs"
echo "BRS_VERSION=${TAG}" >> $GITHUB_ENV
getOffline "files/p3/offline"
getBuildrootx "brx"
getBuildroots "brs"
# Export Dependencies Version to env
echo "ADDONTAG=${ADDONTAG}" >> $GITHUB_ENV
echo "MODULETAG=${MODULETAG}" >> $GITHUB_ENV
echo "CONFIGTAG=${CONFIGTAG}" >> $GITHUB_ENV
echo "PATCHTAG=${PATCHTAG}" >> $GITHUB_ENV
echo "CUSTOMTAG=${CUSTOMTAG}" >> $GITHUB_ENV
echo "LKMTAG=${LKMTAG}" >> $GITHUB_ENV
echo "THEMETAG=${THEMETAG}" >> $GITHUB_ENV
echo "BRXTAG=${BRXTAG}" >> $GITHUB_ENV
echo "BRSTAG=${BRSTAG}" >> $GITHUB_ENV
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
echo "OK"
# Build incremental
- name: Build Image S
- name: Build Next Image
if: ${{ inputs.next == true }}
run: |
. scripts/func.sh
if [ -n "${VERSION}" ]; then
# Modify Source File
echo "${VERSION}" >VERSION
echo "${VERSION}" >files/p1/ARC-VERSION
echo "stable" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
fi
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="${{ inputs.version }}"
ARC_BRANCH="next"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
echo "Create Arc Image"
IMAGE_FILE="arc.img"
@@ -135,70 +142,6 @@ jobs:
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
echo "Image Converter"
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc.ova"
# Zip update and generate checksum
cp -f files/p1/ARC-VERSION files/p3/ARC-VERSION
cp -f files/p1/ARC-BRANCH files/p3/ARC-BRANCH
cp -f files/p1/boot/grub/grub.cfg files/p3/grub.cfg
cd files/p3
zip -9 update.zip -r .
sha256sum update.zip >checksum.sha256
mv update.zip ../../
mv checksum.sha256 ../../
cd -
# Build incremental
- name: Build Image X
run: |
. scripts/func.sh
if [ -n "${VERSION}" ]; then
# Modify Source File
echo "${VERSION}" >VERSION
echo "${VERSION}" >files/p1/ARC-VERSION
echo "next" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
fi
echo "Create Arc Image"
IMAGE_FILE="arc-next.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
echo "Repack initrd"
@@ -206,9 +149,9 @@ jobs:
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sudo sync
echo "Unmount image file"
sudo umount "/tmp/p1"
@@ -219,74 +162,136 @@ jobs:
sudo losetup --detach ${LOOPX}
echo "Image Converter"
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-next-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-next.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-next.vhdx
qemu-img convert -p -f raw -O vmdk ${IMAGE_FILE} arc-dyn.vmdk
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk
qemu-img convert -p -f raw -O vhdx ${IMAGE_FILE} arc.vhdx
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc-next.ova"
# Zip update and generate checksum
cp -f files/p1/ARC-VERSION files/p3/ARC-VERSION
cp -f files/p1/ARC-BRANCH files/p3/ARC-BRANCH
cp -f files/p1/boot/grub/grub.cfg files/p3/grub.cfg
cd files/p3
zip -9 update-next.zip -r .
sha256sum update-next.zip >checksum-next.sha256
mv update-next.zip ../../
mv checksum-next.sha256 ../../
cd -
convertova "${IMAGE_FILE}" "arc.ova"
# Zip image and generate checksum
- name: Pack
- name: Pack Next Image
if: ${{ inputs.next == true }}
run: |
if [ -n "${{ env.VERSION }}" ]; then
# XBase
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc-next.img
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-next-dyn.vmdk
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc-next.vmdk arc-next-flat.vmdk
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc-next.vhdx
zip -9 "arc-${{ env.VERSION }}-next.ova.zip" arc-next.ova
# SBase
zip -9 "arc-${{ env.VERSION }}.img.zip" arc.img
zip -9 "arc-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
zip -9 "arc-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
zip -9 "arc-${{ env.VERSION }}.ova.zip" arc.ova
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.ova.zip" arc.ova
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
fi
# Cleanup
- name: Cleanup
run: |
rm -rf "arc.img" "arc.ova" "arc.vmdk" "arc-dyn.vmdk" "arc.vhdx" "arc-flat.vmdk"
# Build incremental
- name: Build Stable Image
if: ${{ inputs.stable == true }}
run: |
. scripts/func.sh
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="${{ inputs.version }}"
ARC_BRANCH="stable"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
echo "Create Arc Image"
IMAGE_FILE="arc.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
#cp -f "brs/initrd-arc" "files/p3/initrd-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sudo sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
echo "Image Converter"
qemu-img convert -p -f raw -O vmdk ${IMAGE_FILE} arc-dyn.vmdk
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk
qemu-img convert -p -f raw -O vhdx ${IMAGE_FILE} arc.vhdx
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc.ova"
# Zip image and generate checksum
- name: Pack Stable Image
if: ${{ inputs.stable == true }}
run: |
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.ova.zip" arc.ova
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
fi
echo "${{ inputs.update_version }}" >check.update
# Publish a release if is a tag
- name: Release
if: success() && env.VERSION != ''
if: success() && env.ARC_VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
tag: ${{ env.ARC_VERSION }}
prerelease: ${{ inputs.prerelease }}
makeLatest: ${{ inputs.latest }}
allowUpdates: true
body: |
### Note:
- ${{ inputs.notice }}
### Information:
Notice: ${{ inputs.notice }}
- Version:
- arc: Stable Buildroot System (Less Hardware supported / faster Boot)
- arc-next: Latest Buildroot System (More Hardware supported (still in testing))
- Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
- Full Changelog is available in my Discord
- Discord Account for Arc Patch needed
### Versions:
Addons: ${{ env.ADDONSTAG }}
Configs: ${{ env.CONFIGSTAG }}
Modules: ${{ env.MODULESTAG }}
Patches: ${{ env.PATCHESTAG }}
Custom: ${{ env.CUSTOMTAG }}
Theme: ${{ env.THEMETAG }}
LKM: ${{ env.LKMTAG }}
Buildroot: ${{ env.BRS_VERSION }} | Buildroot Next: ${{ env.BRX_VERSION }}
Release: ${{ env.BUILD_TIME }}
- stable: Stable Image (Full Image, all dependencies are included, less hardware support)
- next: Next Image (Full Image, all dependencies are included, more hardware support, new features to test)
### Dependencies:
- Addons: ${{ env.ADDONTAG }}
- Modules: ${{ env.MODULETAG }}
- Configs: ${{ env.CONFIGTAG }}
- Patches: ${{ env.PATCHTAG }}
- Custom: ${{ env.CUSTOMTAG }}
- LKMs: ${{ env.LKMTAG }}
- Buildroot Stable: ${{ env.BRSTAG }}
- Buildroot Next: ${{ env.BRXTAG }}
### Release
- ${{ env.BUILD_TIME }}
artifacts: |
arc-*.zip
update.zip
update-next.zip
checksum.sha256
checksum-next.sha256
check.update
update-*.zip

View File

@@ -41,6 +41,7 @@ jobs:
ADDONS = ''
KERNEL = ''
FORMAT = ''
BRANCH = ''
try:
jsonbody = json.loads(issuebody)
MODEL = jsonbody.get('model', '')
@@ -48,6 +49,7 @@ jobs:
ADDONS = jsonbody.get('addons', '')
KERNEL = jsonbody.get('kernel', '')
FORMAT = jsonbody.get('format', '')
BRANCH = jsonbody.get('branch', '')
except ValueError as e:
pass
@@ -56,6 +58,7 @@ jobs:
set_output("ADDONS", ADDONS)
set_output("KERNEL", KERNEL)
set_output("FORMAT", FORMAT)
set_output("BRANCH", BRANCH)
# calculates the version number and push
- name: Calculate Version
@@ -75,7 +78,7 @@ jobs:
issue-number: ${{ github.event.issue.number }}
body: |
Hi @${{ github.event.issue.user.login }}.
arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }} is being build, it will be uploaded here and sent to your email later..
building arc-${{ env.MODEL }}-${{ env.VERSION }}, it will be uploaded here and sent to your email later..
> ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
----
@@ -97,7 +100,7 @@ jobs:
}
TAG="$(curl -m 5 -kL https://api.github.com/repos/AuxXxilium/arc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
curl -kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip" -o "/tmp/arc.img.zip"
curl -kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}-${{ env.BRANCH }}.img.zip" -o "/tmp/arc.img.zip"
unzip -o "/tmp/arc.img.zip" -d "/tmp"
echo "Modify Arc Image"
@@ -176,36 +179,36 @@ jobs:
- name: Pack
run: |
if [ "${{ env.FORMAT }}" = "img" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.img.zip" arc.img
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.img.zip" "https://file.io")"
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.img.zip" arc.img
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.img.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
elif [ "${{ env.FORMAT }}" = "dyn" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.vmdk-dyn.zip" "https://file.io")"
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-dyn.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
elif [ "${{ env.FORMAT }}" = "flat" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.vmdk-flat.zip" "https://file.io")"
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-flat.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
elif [ "${{ env.FORMAT }}" = "vhdx" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.vhdx.zip" arc.vhdx
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.vhdx.zip" "https://file.io")"
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vhdx.zip" arc.vhdx
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.vhdx.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
elif [ "${{ env.FORMAT }}" = "ova" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.ova.zip" arc.ova
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}.ova.zip" "https://file.io")"
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.ova.zip" arc.ova
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.ova.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
@@ -225,7 +228,7 @@ jobs:
server_port: 587
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: arc-${{ env.model }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}
subject: arc-${{ env.model }}-${{ env.VERSION }}
to: ${{ env.EMAIL }}
from: ${{ secrets.MAIL_USERNAME }}
body: |
@@ -241,7 +244,7 @@ jobs:
update-mode: replace
body: |
Hi @${{ github.event.issue.user.login }}.
arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }} is ready to download: ${{ env.FIOURL }}
arc-${{ env.MODEL }}-${{ env.VERSION }} is ready to download: ${{ env.FIOURL }}
> ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
If this will not work, do not use customized Versions!

View File

@@ -35,13 +35,6 @@ jobs:
run: |
. scripts/grub.sh "grub-2.12" "i386-pc i386-efi x86_64-efi"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: grub
path: |
grub.img.gz
- name: Check and Push
if: success() && inputs.push == true
run: |

View File

@@ -17,7 +17,6 @@ The Arc Loader is a customized Redpill Loader for DSM 7.x (Xpenology) with enhan
- <a href="https://github.com/AuxXxilium">Overview</a>
- <a href="https://auxxxilium.tech/wiki">FAQ & Wiki</a>
- <a href="https://github.com/AuxXxilium/arc/releases?q=prerelease%3Afalse&expanded=true">Download latest Build</a>
- <a href="https://auxxxilium.github.io/arc">Customized Build with automated Config</a>
### Developer

View File

@@ -3,23 +3,18 @@
version: "3"
tasks:
build-img:
build-img-n:
cmds:
- git pull
- ./img-gen.sh
- ./img-gen-n.sh
build-img-next:
build-img-s:
cmds:
- git pull
- ./img-gen-next.sh
build-img-all:
cmds:
- git pull
- ./img-gen-all.sh
- ./img-gen-s.sh
compile-kpatch:
dir: kpatch
cmds:
- make clean all
- mv kpatch ../files/board/arc/overlayfs/opt/arc/
- mv kpatch ../files/p3/system/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,29 +3,28 @@
set -e
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
. ${ARC_PATH}/include/functions.sh
. ${ARC_PATH}/include/addons.sh
. "${ARC_PATH}/include/functions.sh"
# Clear logs for dbgutils addons
rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true
rm -rf /sys/fs/pstore/* >/dev/null 2>&1 || true
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
[ "${BUILDDONE}" == "false" ] && die "Loader build not completed!"
ARCBRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
[ "${BUILDDONE}" = "false" ] && die "Loader build not completed!"
ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
# Get Loader Disk Bus
[ -z "${LOADER_DISK}" ] && die "Loader Disk not found!"
BUS=$(getBus "${LOADER_DISK}")
# Check if machine has EFI
[ -d /sys/firmware/efi ] && EFI=1 || EFI=0
FBI=$(cat /sys/class/graphics/fb*/name 2>/dev/null | head -1)
EFI=$([ -d /sys/firmware/efi ] && echo 1 || echo 0)
# Print Title centralized
clear
COLUMNS=${COLUMNS:-50}
BANNER="$(figlet -c -w "$(((${COLUMNS})))" "Arc Loader")"
TITLE="Version:"
TITLE+=" ${ARC_TITLE} | ${ARCBRANCH}"
TITLE+=" ${ARC_VERSION} (${ARC_BUILD})"
[ -n "${ARC_BRANCH}" ] && TITLE+=" | Branch: ${ARC_BRANCH}"
printf "\033[1;30m%*s\n" ${COLUMNS} ""
printf "\033[1;30m%*s\033[A\n" ${COLUMNS} ""
printf "\033[1;34m%*s\033[0m\n" ${COLUMNS} "${BANNER}"
@@ -39,7 +38,6 @@ ZIMAGE_HASH="$(readConfigKey "zimage-hash" "${USER_CONFIG_FILE}")"
ZIMAGE_HASH_CUR="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
RAMDISK_HASH="$(readConfigKey "ramdisk-hash" "${USER_CONFIG_FILE}")"
RAMDISK_HASH_CUR="$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')"
OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
if [ "${ZIMAGE_HASH_CUR}" != "${ZIMAGE_HASH}" ] || [ "${RAMDISK_HASH_CUR}" != "${RAMDISK_HASH}" ]; then
echo -e "\033[1;31mDSM zImage/Ramdisk changed!\033[0m"
livepatch
@@ -56,31 +54,35 @@ SMALLNUM="$(readConfigKey "smallnum" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
CPU="$(echo $(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}'))"
RAMTOTAL="$(awk '/MemTotal:/ {printf "%.0f\n", $2 / 1024 / 1024 + 0.5}' /proc/meminfo 2>/dev/null)"
VENDOR="$(dmesg 2>/dev/null | grep -i "DMI:" | sed 's/\[.*\] DMI: //i')"
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
REGION="$(readConfigKey "time.region" "${USER_CONFIG_FILE}")"
TIMEZONE="$(readConfigKey "time.timezone" "${USER_CONFIG_FILE}")"
VENDOR="$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')"
DSMINFO="$(readConfigKey "boot.dsminfo" "${USER_CONFIG_FILE}")"
SYSTEMINFO="$(readConfigKey "boot.systeminfo" "${USER_CONFIG_FILE}")"
DISKINFO="$(readConfigKey "boot.diskinfo" "${USER_CONFIG_FILE}")"
echo -e "\033[1;37mDSM:\033[0m"
echo -e "Model: \033[1;37m${MODELID:-${MODEL}}\033[0m"
echo -e "Platform: \033[1;37m${PLATFORM}\033[0m"
echo -e "Version: \033[1;37m${PRODUCTVER} (${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))\033[0m"
echo -e "LKM: \033[1;37m${LKM}\033[0m"
echo
echo -e "\033[1;37mSystem:\033[0m"
echo -e "Vendor: \033[1;37m${VENDOR}\033[0m"
echo -e "CPU: \033[1;37m${CPU}\033[0m"
echo -e "Memory: \033[1;37m${RAMTOTAL}GB\033[0m"
echo
echo -e "\033[1;37mLocation:\033[0m"
echo -e "Keymap: \033[1;37m${KEYMAP}\033[0m"
echo -e "Timezone: \033[1;37m${REGION}/${TIMEZONE}\033[0m"
echo
if [ "${DSMINFO}" = "true" ]; then
echo -e "\033[1;37mDSM:\033[0m"
echo -e "Model: \033[1;37m${MODELID:-${MODEL}}\033[0m"
echo -e "Platform: \033[1;37m${PLATFORM}\033[0m"
echo -e "Version: \033[1;37m${PRODUCTVER} (${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))\033[0m"
echo -e "LKM: \033[1;37m${LKM}\033[0m"
echo
fi
if [ "${SYSTEMINFO}" = "true" ]; then
echo -e "\033[1;37mSystem:\033[0m"
echo -e "Vendor: \033[1;37m${VENDOR}\033[0m"
echo -e "CPU: \033[1;37m${CPU}\033[0m"
echo -e "Memory: \033[1;37m${RAMTOTAL}GB\033[0m"
echo
fi
if [ "${DISKINFO}" = "true" ]; then
echo -e "\033[1;37mDisks:\033[0m"
echo -e "Disks: \033[1;37m$(lsblk -dpno NAME | grep -v "${LOADER_DISK}" | wc -l)\033[0m"
fi
if ! readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q nvmesystem; then
HASATA=0
for D in $(lsblk -dpno NAME); do
[ "${D}" == "${LOADER_DISK}" ] && continue
[ "${D}" = "${LOADER_DISK}" ] && continue
if echo "sata sas scsi" | grep -qw "$(getBus "${D}")"; then
HASATA=1
break
@@ -134,8 +136,10 @@ if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 5 ]; then
CMDLINE['dom_szmax']="${SIZE}"
fi
CMDLINE["elevator"]="elevator"
else
CMDLINE["split_lock_detect"]="off"
fi
if [ "${DT}" == "true" ]; then
if [ "${DT}" = "true" ]; then
CMDLINE["syno_ttyS0"]="serial,0x3f8"
CMDLINE["syno_ttyS1"]="serial,0x2f8"
else
@@ -146,30 +150,36 @@ fi
CMDLINE["HddHotplug"]="1"
CMDLINE["vender_format_version"]="2"
CMDLINE['skip_vender_mac_interfaces']="0,1,2,3,4,5,6,7"
CMDLINE['earlyprintk']=""
CMDLINE['earlycon']="uart8250,io,0x3f8,115200n8"
CMDLINE['console']="ttyS0,115200n8"
CMDLINE['consoleblank']="600"
# CMDLINE['no_console_suspend']="1"
CMDLINE['root']="/dev/md0"
CMDLINE['rootwait']=""
CMDLINE['loglevel']="15"
CMDLINE['log_buf_len']="32M"
CMDLINE['rootwait']=""
CMDLINE['panic']="${KERNELPANIC:-0}"
# DSM Specific Cmdline
CMDLINE['pcie_aspm']="off"
CMDLINE['modprobe.blacklist']="${MODBLACKLIST}"
[ $(cat /proc/cpuinfo | grep Intel | wc -l) -gt 0 ] && CMDLINE["intel_pstate"]="disable"
[ $(cat /proc/cpuinfo | grep Intel | wc -l) -gt 0 ] && CMDLINE["intel_pstate"]="passive"
# CMDLINE['nointremap']="" # no need
# CMDLINE['split_lock_detect']="off" # no need
# CMDLINE['nomodeset']=""
if echo "apollolake geminilake purley" | grep -wq "${PLATFORM}"; then
CMDLINE["nox2apic"]=""
fi
#if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ "${BUS}" != "mmc" ] && [ "${EMMCBOOT}" != "true" ]; then
# if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "sdhci"; then
# [ ! "${CMDLINE['modprobe.blacklist']}" == "" ] && CMDLINE['modprobe.blacklist']+=","
# [ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
# CMDLINE['modprobe.blacklist']+="sdhci,sdhci_pci,sdhci_acpi"
# fi
# fi
if [ "${DT}" == "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
if [ "${DT}" = "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
if ! echo "${CMDLINE['modprobe.blacklist']}" | grep -q "mpt3sas"; then
[ ! "${CMDLINE['modprobe.blacklist']}" == "" ] && CMDLINE['modprobe.blacklist']+=","
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt3sas"
fi
fi
@@ -182,16 +192,15 @@ if echo "purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
CMDLINE["SASmodel"]="1"
fi
# Cmdline NIC Settings
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
ETHM="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)"
ETHN="$(echo ${ETHX} | wc -w)"
# NIC Cmdline
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
ETHM=$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)
ETHN=$(echo ${ETHX} | wc -w)
[ -z "${ETHM}" ] && ETHM="${ETHN}"
NIC=0
for ETH in ${ETHX}; do
MAC="$(readConfigKey "${ETH}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
NIC=$((${NIC} + 1))
for N in ${ETHX}; do
MAC="$(readConfigKey "${N}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${N}/address 2>/dev/null | tr '[:upper:]' '[:lower:]')" || NIC=$((NIC + 1))
[ ${NIC} -le ${ETHM} ] && CMDLINE["mac${NIC}"]="${MAC}"
[ ${NIC} -ge ${ETHM} ] && break
done
@@ -219,89 +228,86 @@ echo "${CMDLINE_LINE}" >"${PART1_PATH}/cmdline.yml"
# Boot
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
if [ "${DIRECTBOOT}" == "true" ]; then
if [ "${DIRECTBOOT}" = "true" ]; then
CMDLINE_DIRECT=$(echo ${CMDLINE_LINE} | sed 's/>/\\\\>/g') # Escape special chars
grub-editenv ${USER_GRUBENVFILE} set dsm_cmdline="${CMDLINE_DIRECT}"
grub-editenv ${USER_GRUBENVFILE} set next_entry="direct"
_bootwait || true
echo -e "\033[1;34mReboot with Directboot\033[0m"
exec reboot
elif [ "${DIRECTBOOT}" == "false" ]; then
reboot
exit 0
elif [ "${DIRECTBOOT}" = "false" ]; then
grub-editenv ${USER_GRUBENVFILE} unset dsm_cmdline
grub-editenv ${USER_GRUBENVFILE} unset next_entry
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=30
IPCON=""
if [ "${ARCPATCH}" == "true" ]; then
echo -e "\033[1;34mUsing ${NIC} NIC for Arc Patch.\033[0m"
echo
if [ "${ARCPATCH}" = "true" ]; then
echo -e "\033[1;37mDetected ${ETHN} NIC\033[0m | \033[1;34mUsing ${NIC} NIC for Arc Patch:\033[0m"
else
echo -e "\033[1;37mDetected ${ETHN} NIC:\033[0m"
fi
echo -e "\033[1;34mDetected ${ETHN} NIC.\033[0m \033[1;37mWaiting for Connection:\033[0m"
echo
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
sleep 3
for ETH in ${ETHX}; do
for N in ${ETHX}; do
COUNT=0
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
DRIVER=$(ls -ld /sys/class/net/${N}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
while true; do
if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then
echo -e "\r\033[1;37m${DRIVER}:\033[0m NOT CONNECTED"
if [ "0" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mNOT CONNECTED\033[0m"
break
fi
COUNT=$((${COUNT} + 1))
IP="$(getIP ${ETH})"
COUNT=$((COUNT + 1))
IP="$(getIP "${N}")"
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}')
SPEED=$(ethtool ${N} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then
echo -e "\r\033[1;37m${DRIVER} (${SPEED}):\033[0m LINK LOCAL (No DHCP server found.)"
echo -e "\r${DRIVER} (${SPEED}): \033[1;37mLINK LOCAL (No DHCP server found.)\033[0m"
else
echo -e "\r\033[1;37m${DRIVER} (${SPEED}):\033[0m Access \033[1;34mhttp://${IP}:5000\033[0m to connect to DSM via web."
echo -e "\r${DRIVER} (${SPEED}): \033[1;37m${IP}\033[0m"
[ -z "${IPCON}" ] && IPCON="${IP}"
fi
break
fi
if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then
echo -e "\r\033[1;37m${DRIVER}:\033[0m DOWN"
if [ -z "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mDOWN\033[0m"
break
fi
if [ ${COUNT} -ge ${BOOTIPWAIT} ]; then
echo -e "\r\033[1;37m${DRIVER}:\033[0m TIMEOUT"
echo -e "\r${DRIVER}: \033[1;37mTIMEOUT\033[0m"
break
fi
sleep 1
done
done
# Exec Bootwait to check SSH/Web connection
BOOTWAIT=5
busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WB
MSG=""
while test ${BOOTWAIT} -ge 0; do
MSG="\033[1;33mAccess SSH/Web will interrupt boot...\033[0m"
echo -en "\r${MSG}"
busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WC
if ! diff WB WC >/dev/null 2>&1; then
echo -en "\r\033[1;33mAccess SSH/Web detected and boot is interrupted.\033[0m\n"
rm -f WB WC
exit 0
fi
sleep 1
BOOTWAIT=$((BOOTWAIT - 1))
done
rm -f WB WC
echo -en "\r$(printf "%$((${#MSG} * 2))s" " ")\n"
_bootwait || true
echo -e "\033[1;37mLoading DSM kernel...\033[0m"
DSMLOGO="$(readConfigKey "dsmlogo" "${USER_CONFIG_FILE}")"
if [ "${DSMLOGO}" == "true" ] && [ -c "/dev/fb0" ]; then
DSMLOGO="$(readConfigKey "boot.dsmlogo" "${USER_CONFIG_FILE}")"
if [ "${DSMLOGO}" = "true" ] && [ -c "/dev/fb0" ]; then
[[ "${IPCON}" =~ ^169\.254\..* ]] && IPCON=""
if [ -n "${IPCON}" ]; then
URL="http://${IPCON}:5000"
else
URL="http://find.synology.com/"
fi
python ${ARC_PATH}/include/functions.py makeqr -d "${URL}" -l "6" -o "${TMP_PATH}/qrcode_boot.png"
[ -n "${IPCON}" ] && URL="http://${IPCON}:5000" || URL="http://find.synology.com/"
python3 ${ARC_PATH}/include/functions.py makeqr -d "${URL}" -l "6" -o "${TMP_PATH}/qrcode_boot.png"
[ -f "${TMP_PATH}/qrcode_boot.png" ] && echo | fbv -acufi "${TMP_PATH}/qrcode_boot.png" >/dev/null 2>/dev/null || true
fi
for T in $(w 2>/dev/null | grep -v 'TTY' | awk '{print $2}'); do
if [ -w "/dev/${T}" ]; then
[ -n "${IPCON}" ] && echo -e "Use \033[1;34mhttp://${IPCON}:5000\033[0m or try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n\n\033[1;37mThis interface will not be operational. Wait a few minutes.\033[0m\n" >"/dev/${T}" 2>/dev/null || echo -e "Try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n\n\033[1;37mThis interface will not be operational. Wait a few minutes.\nNo IP found.\033[0m\n" >"/dev/${T}" 2>/dev/null
fi
done
# # Unload all network interfaces
# for D in $(readlink /sys/class/net/*/device/driver); do rmmod -f "$(basename ${D})" 2>/dev/null || true; done
# Unload all graphics drivers
# for D in $(lsmod | grep -E '^(nouveau|amdgpu|radeon|i915)' | awk '{print $1}'); do rmmod -f "${D}" 2>/dev/null || true; done
# for I in $(find /sys/devices -name uevent -exec bash -c 'cat {} 2>/dev/null | grep -Eq "PCI_CLASS=0?30[0|1|2]00" && dirname {}' \;); do
# [ -e ${I}/reset ] && cat ${I}/vendor >/dev/null | grep -iq 0x10de && echo 1 >${I}/reset || true # Proc open nvidia driver when booting
# done
echo -e "\033[1;37mLoading DSM Kernel...\033[0m"
# Executes DSM kernel via KEXEC
KEXECARGS="-a"
if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 4 ] && [ ${EFI} -eq 1 ]; then
@@ -310,16 +316,9 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
fi
kexec ${KEXECARGS} -l "${MOD_ZIMAGE_FILE}" --initrd "${MOD_RDGZ_FILE}" --command-line="${CMDLINE_LINE}" >"${LOG_FILE}" 2>&1 || dieLog
for T in $(busybox w 2>/dev/null | grep -v 'TTY' | awk '{print $2}'); do
if [ -n "${IPCON}" ]; then
[ -w "/dev/${T}" ] && echo -e "\n\033[1;37mThis interface will not be operational. Wait a few minutes.\033[0m\nUse \033[1;34mhttp://${IPCON}:5000\033[0m or try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n" >"/dev/${T}" 2>/dev/null || true
else
[ -w "/dev/${T}" ] && echo -e "\n\033[1;37mThis interface will not be operational. Wait a few minutes.\nNo IP found. \033[0m\nTry \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n" >"/dev/${T}" 2>/dev/null || true
fi
done
echo -e "\033[1;37mBooting DSM...\033[0m"
# Boot to DSM
[ "${KERNELLOAD}" == "kexec" ] && kexec -e || poweroff
[ "${KERNELLOAD}" = "kexec" ] && kexec -e || poweroff
fi
exit 0
exit 0

View File

@@ -1,16 +1,16 @@
#!/usr/bin/env bash
read_u8() {
dd if=$1 bs=1 skip=$(($2)) count=1 2>/dev/null | od -An -tu1 | grep -Eo '[0-9]+'
dd if="${1}" bs=1 skip="$((${2}))" count=1 2>/dev/null | od -An -tu1 | grep -Eo '[0-9]+'
}
read_u32() {
dd if=$1 bs=1 skip=$(($2)) count=4 2>/dev/null | od -An -tu4 | grep -Eo '[0-9]+'
dd if="${1}" bs=1 skip="$((${2}))" count=4 2>/dev/null | od -An -tu4 | grep -Eo '[0-9]+'
}
set -x
setup_size=$(read_u8 $1 0x1f1)
payload_offset=$(read_u32 $1 0x248)
payload_length=$(read_u32 $1 0x24c)
inner_pos=$((($setup_size + 1) * 512))
setup_size=$(read_u8 "${1}" 0x1f1)
payload_offset=$(read_u32 "${1}" 0x248)
payload_length=$(read_u32 "${1}" 0x24c)
inner_pos=$(((setup_size + 1) * 512))
tail -c+$(($inner_pos + 1)) $1 | tail -c+$(($payload_offset + 1)) | head -c $(($payload_length)) | head -c $(($payload_length - 4)) | unlzma >$2
tail -c+$(($inner_pos + 1)) "${1}" | tail -c+$(($payload_offset + 1)) | head -c "${payload_length}" | head -c $(($payload_length - 4)) | unlzma >"${2}"

View File

@@ -7,28 +7,22 @@
# objdump -h a.out | sh calc_run_size.sh
NUM='\([0-9a-fA-F]*[ \t]*\)'
OUT=$(sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"${NUM}${NUM}${NUM}${NUM}"'.*/\1\4/p')
if [ -z "$OUT" ]; then
OUT=$(sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"${NUM}${NUM}${NUM}${NUM}"'.*/0x\1 0x\4/p')
if [ -z "${OUT}" ]; then
echo "Never found .bss or .brk file offset" >&2
exit 1
fi
OUT=$(echo ${OUT# })
sizeA=$(printf "%d" 0x${OUT%% *})
OUT=${OUT#* }
offsetA=$(printf "%d" 0x${OUT%% *})
OUT=${OUT#* }
sizeB=$(printf "%d" 0x${OUT%% *})
OUT=${OUT#* }
offsetB=$(printf "%d" 0x${OUT%% *})
read -r sizeA offsetA sizeB offsetB <<<$(echo ${OUT} | awk '{printf "%d %d %d %d", strtonum($1), strtonum($2), strtonum($3), strtonum($4)}')
run_size=$((${offsetA} + ${sizeA} + ${sizeB}))
runSize=$((offsetA + sizeA + sizeB))
# BFD linker shows the same file offset in ELF.
if [ "${offsetA}" -ne "${offsetB}" ]; then
# Gold linker shows them as consecutive.
endB=$((${offsetB} + ${sizeB}))
if [ "$endB" != "$run_size" ]; then
endSize=$((offsetB + sizeB))
if [ "${endSize}" -ne "${runSize}" ]; then
printf "sizeA: 0x%x\n" ${sizeA} >&2
printf "offsetA: 0x%x\n" ${offsetA} >&2
printf "sizeB: 0x%x\n" ${sizeB} >&2
@@ -38,5 +32,5 @@ if [ "${offsetA}" -ne "${offsetB}" ]; then
fi
fi
printf "%d\n" ${run_size}
printf "%d\n" ${runSize}
exit 0

View File

@@ -1 +0,0 @@
kmod

View File

@@ -10,38 +10,34 @@
#
# ----------------------------------------------------------------------
check_vmlinux()
{
# Use readelf to check if it's a valid ELF
# TODO: find a better to way to check that it's really vmlinux
# and not just an elf
readelf -h $1 > /dev/null 2>&1 || return 1
check_vmlinux() {
# Use readelf to check if it's a valid ELF
# TODO: find a better to way to check that it's really vmlinux
# and not just an elf
readelf -h $1 >/dev/null 2>&1 || return 1
cat $1
exit 0
cat $1
exit 0
}
try_decompress()
{
# The obscure use of the "tr" filter is to work around older versions of
# "grep" that report the byte offset of the line instead of the pattern.
try_decompress() {
# The obscure use of the "tr" filter is to work around older versions of
# "grep" that report the byte offset of the line instead of the pattern.
# Try to find the header ($1) and decompress from here
for pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
do
pos=${pos%%:*}
tail -c+$pos "$img" | $3 > $tmp 2> /dev/null
check_vmlinux $tmp
done
# Try to find the header ($1) and decompress from here
for pos in $(tr "$1\n$2" "\n$2=" <"$img" | grep -abo "^$2"); do
pos=${pos%%:*}
tail -c+$pos "$img" | $3 >$tmp 2>/dev/null
check_vmlinux $tmp
done
}
# Check invocation:
me=${0##*/}
img=$1
if [ $# -ne 1 -o ! -s "$img" ]
then
echo "Usage: $me <kernel-image>" >&2
exit 2
if [ $# -ne 1 ] || [ ! -s "$img" ]; then
echo "Usage: $me <kernel-image>" >&2
exit 2
fi
# Prepare temp files:
@@ -61,4 +57,4 @@ try_decompress '(\265/\375' xxx unzstd
check_vmlinux $img
# Bail out:
echo "$me: Cannot find vmlinux." >&2
echo "$me: Cannot find vmlinux." >&2

Binary file not shown.

View File

@@ -6,20 +6,33 @@ function availableAddons() {
echo ""
return 1
fi
local ARCOFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
local ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
for D in $(find "${ADDONS_PATH}" -maxdepth 1 -type d 2>/dev/null | sort); do
[ ! -f "${D}/manifest.yml" ] && continue
ADDON=$(basename ${D})
AVAILABLE="$(readConfigKey "${1}" "${D}/manifest.yml")"
local ADDON=$(basename ${D})
local AVAILABLE="$(readConfigKey "${1}" "${D}/manifest.yml")"
[ "${AVAILABLE}" = false ] && continue
SYSTEM=$(readConfigKey "system" "${D}/manifest.yml")
local SYSTEM=$(readConfigKey "system" "${D}/manifest.yml")
[ "${SYSTEM}" = true ] && continue
DESC="$(readConfigKey "description" "${D}/manifest.yml")"
BETA="$(readConfigKey "beta" "${D}/manifest.yml")"
TARGET="$(readConfigKey "target" "${D}/manifest.yml")"
if [[ "${ARCOFFLINE}" = "true" || -z "${ARCCONF}" ]] && [[ "${ADDON}" = "amepatch" || "${ADDON}" = "arcdns" ]]; then
continue
fi
if [ "${MACHINE}" != "Native" ] && [ "${ADDON}" = "cpufreqscaling" ]; then
continue
fi
if echo "${PAT_URL}" 2>/dev/null | grep -vq "7.2.2"; then
if [ "${ADDON}" = "allowdowngrade" ]; then
continue
fi
fi
local DESC="$(readConfigKey "description" "${D}/manifest.yml")"
local BETA="$(readConfigKey "beta" "${D}/manifest.yml")"
local TARGET="$(readConfigKey "target" "${D}/manifest.yml")"
[ "${BETA}" = true ] && BETA="(Beta) " || BETA=""
if [ "${TARGET}" == "app" ]; then
if [ "${TARGET}" = "app" ]; then
[ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t\Z4${BETA}${DESC}\Zn"
elif [ "${TARGET}" == "system" ]; then
elif [ "${TARGET}" = "system" ]; then
[ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t\Z1${BETA}${DESC}\Zn"
else
[ "${AVAILABLE}" = true ] && echo -e "${ADDON}\t${BETA}${DESC}"

View File

@@ -1,13 +1 @@
###############################################################################
# Compatibility boot
function compatboot () {
# Timezone
TIMEZONE="$(readConfigKey "time.timezone" "${USER_CONFIG_FILE}")"
REGION="$(readConfigKey "time.region" "${USER_CONFIG_FILE}")"
if [ -n "${TIMEZONE}" ] && [ -n "${REGION}" ]; then
ln -sf "/usr/share/zoneinfo/right/${TIMEZONE}/${REGION}" /etc/localtime
fi
# Check for compatibility
deleteConfigKey "nanover" "${USER_CONFIG_FILE}"
}

View File

@@ -23,7 +23,7 @@ function writeConfigKey() {
# Return Value
function readConfigKey() {
RESULT=$(yq eval '.'${1}' | explode(.)' "${2}" 2>/dev/null)
[ "${RESULT}" == "null" ] && echo "" || echo "${RESULT}"
[ "${RESULT}" = "null" ] && echo "" || echo "${RESULT}"
}
###############################################################################

View File

@@ -1,12 +1,14 @@
ARC_VERSION="24.1.1"
ARC_TITLE="Arc ${ARC_VERSION}"
# Define paths
PART1_PATH="/mnt/p1"
PART2_PATH="/mnt/p2"
PART3_PATH="/mnt/p3"
TMP_PATH="/tmp"
[ -f "${PART1_PATH}/ARC-BRANCH" ] && ARC_BRANCH=$(cat "${PART1_PATH}/ARC-BRANCH") || ARC_BRANCH="null"
[ -f "${PART1_PATH}/ARC-VERSION" ] && ARC_VERSION=$(cat "${PART1_PATH}/ARC-VERSION") || ARC_VERSION="null"
[ -f "${PART1_PATH}/ARC-BUILD" ] && ARC_BUILD=$(cat "${PART1_PATH}/ARC-BUILD") || ARC_BUILD="null"
ARC_TITLE="Arc ${ARC_VERSION}"
RAMDISK_PATH="${TMP_PATH}/ramdisk"
LOG_FILE="${TMP_PATH}/log.txt"
TMP_UP_PATH="${TMP_PATH}/upload"
@@ -20,6 +22,7 @@ ORI_ZIMAGE_FILE="${PART2_PATH}/zImage"
ORI_RDGZ_FILE="${PART2_PATH}/rd.gz"
ARC_BZIMAGE_FILE="${PART3_PATH}/bzImage-arc"
ARC_RAMDISK_FILE="${PART3_PATH}/initrd-arc"
ARC_RAMDISK_USER_FILE="${PART3_PATH}/initrd-user"
MOD_ZIMAGE_FILE="${PART3_PATH}/zImage-dsm"
MOD_RDGZ_FILE="${PART3_PATH}/initrd-dsm"
@@ -33,9 +36,15 @@ USER_UP_PATH="${PART3_PATH}/users"
UNTAR_PAT_PATH="${PART3_PATH}/DSM"
S_FILE="${MODEL_CONFIG_PATH}/serials.yml"
S_FILE_ARC="${MODEL_CONFIG_PATH}/arc_serials.yml"
S_FILE_ENC="${MODEL_CONFIG_PATH}/arc_serials.enc"
P_FILE="${MODEL_CONFIG_PATH}/platforms.yml"
D_FILE="${MODEL_CONFIG_PATH}/data.yml"
EXTRACTOR_PATH="${PART3_PATH}/extractor"
EXTRACTOR_BIN="syno_extract_system_patch"
EXTRACTOR_BIN="syno_extract_system_patch"
HTTPPORT=$(grep -i '^HTTP_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
[ -z "${HTTPPORT}" ] && HTTPPORT=7080 || true
DUFSPORT=$(grep -i '^DUFS_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
[ -z "${DUFSPORT}" ] && DUFSPORT=7304 || true
TTYDPORT=$(grep -i '^TTYD_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
[ -z "${TTYDPORT}" ] && TTYDPORT=7681 || true

View File

@@ -108,266 +108,5 @@ def makeqr(data, file, location, output):
except:
pass
@cli.command()
@click.option("-p", "--platforms", type=str, help="The platforms of Syno.")
def getmodels(platforms=None):
"""
Get Syno Models.
"""
import json, requests, urllib3
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry # type: ignore
adapter = HTTPAdapter(max_retries=Retry(total=3, backoff_factor=0.5, status_forcelist=[500, 502, 503, 504]))
session = requests.Session()
session.mount("http://", adapter)
session.mount("https://", adapter)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
if platforms is not None and platforms != "":
PS = platforms.lower().replace(",", " ").split()
else:
PS = []
models = []
try:
req = session.get("https://autoupdate.synology.com/os/v2", timeout=10, verify=False)
req.encoding = "utf-8"
data = json.loads(req.text)
for I in data["channel"]["item"]:
if not I["title"].startswith("DSM"):
continue
for J in I["model"]:
arch = J["mUnique"].split("_")[1]
name = J["mLink"].split("/")[-1].split("_")[1].replace("%2B", "+")
if len(PS) > 0 and arch.lower() not in PS:
continue
if any(name == B["name"] for B in models):
continue
models.append({"name": name, "arch": arch})
models = sorted(models, key=lambda k: (k["arch"], k["name"]))
except:
pass
models.sort(key=lambda x: (x["arch"], x["name"]))
print(json.dumps(models, indent=4))
@cli.command()
@click.option("-p", "--platforms", type=str, help="The platforms of Syno.")
def getmodelsbykb(platforms=None):
"""
Get Syno Models.
"""
import json, requests, urllib3
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry # type: ignore
adapter = HTTPAdapter(max_retries=Retry(total=3, backoff_factor=0.5, status_forcelist=[500, 502, 503, 504]))
session = requests.Session()
session.mount("http://", adapter)
session.mount("https://", adapter)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
if platforms is not None and platforms != "":
PS = platforms.lower().replace(",", " ").split()
else:
PS = []
models = []
try:
import re
from bs4 import BeautifulSoup
url="https://kb.synology.com/en-us/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have"
#url = "https://kb.synology.cn/zh-cn/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have"
req = session.get(url, timeout=10, verify=False)
req.encoding = "utf-8"
bs = BeautifulSoup(req.text, "html.parser")
p = re.compile(r"data: (.*?),$", re.MULTILINE | re.DOTALL)
data = json.loads(p.search(bs.find("script", string=p).prettify()).group(1))
model = "(.*?)" # (.*?): all, FS6400: one
p = re.compile(r"<td>{}<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>".format(model), re.MULTILINE | re.DOTALL,)
it = p.finditer(data["preload"]["content"].replace("\n", "").replace("\t", ""))
for i in it:
d = i.groups()
if len(d) == 6:
d = model + d
if len(PS) > 0 and d[5].lower() not in PS:
continue
models.append({"name": d[0].split("<br")[0], "arch": d[5].lower()})
except:
pass
models.sort(key=lambda x: (x["arch"], x["name"]))
print(json.dumps(models, indent=4))
@cli.command()
@click.option("-m", "--model", type=str, required=True, help="The model of Syno.")
@click.option("-v", "--version", type=str, required=True, help="The version of Syno.")
def getpats4mv(model, version):
import json, requests, urllib3
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry # type: ignore
adapter = HTTPAdapter(max_retries=Retry(total=3, backoff_factor=0.5, status_forcelist=[500, 502, 503, 504]))
session = requests.Session()
session.mount("http://", adapter)
session.mount("https://", adapter)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
pats = {}
try:
urlInfo = "https://www.synology.com/api/support/findDownloadInfo?lang=en-us"
urlSteps = "https://www.synology.com/api/support/findUpgradeSteps?"
#urlInfo = "https://www.synology.cn/api/support/findDownloadInfo?lang=zh-cn"
#urlSteps = "https://www.synology.cn/api/support/findUpgradeSteps?"
major = "&major={}".format(version.split('.')[0]) if len(version.split('.')) > 0 else ""
minor = "&minor={}".format(version.split('.')[1]) if len(version.split('.')) > 1 else ""
req = session.get("{}&product={}{}{}".format(urlInfo, model.replace("+", "%2B"), major, minor), timeout=10, verify=False)
req.encoding = "utf-8"
data = json.loads(req.text)
build_ver = data['info']['system']['detail'][0]['items'][0]['build_ver']
build_num = data['info']['system']['detail'][0]['items'][0]['build_num']
buildnano = data['info']['system']['detail'][0]['items'][0]['nano']
V=__fullversion("{}-{}-{}".format(build_ver, build_num, buildnano))
if not V in pats:
pats[V]={}
pats[V]['url'] = data['info']['system']['detail'][0]['items'][0]['files'][0]['url'].split('?')[0]
pats[V]['sum'] = data['info']['system']['detail'][0]['items'][0]['files'][0]['checksum']
from_ver=0
for I in data['info']['pubVers']:
if from_ver == 0 or I['build'] < from_ver: from_ver = I['build']
for I in data['info']['productVers']:
if not I['version'].startswith(version): continue
if major == "" or minor == "":
majorTmp = "&major={}".format(I['version'].split('.')[0]) if len(I['version'].split('.')) > 0 else ""
minorTmp = "&minor={}".format(I['version'].split('.')[1]) if len(I['version'].split('.')) > 1 else ""
reqTmp = session.get("{}&product={}{}{}".format(urlInfo, model.replace("+", "%2B"), majorTmp, minorTmp), timeout=10, verify=False)
reqTmp.encoding = "utf-8"
dataTmp = json.loads(reqTmp.text)
build_ver = dataTmp['info']['system']['detail'][0]['items'][0]['build_ver']
build_num = dataTmp['info']['system']['detail'][0]['items'][0]['build_num']
buildnano = dataTmp['info']['system']['detail'][0]['items'][0]['nano']
V=__fullversion("{}-{}-{}".format(build_ver, build_num, buildnano))
if not V in pats:
pats[V]={}
pats[V]['url'] = dataTmp['info']['system']['detail'][0]['items'][0]['files'][0]['url'].split('?')[0]
pats[V]['sum'] = dataTmp['info']['system']['detail'][0]['items'][0]['files'][0]['checksum']
for J in I['versions']:
to_ver=J['build']
reqSteps = session.get("{}&product={}&from_ver={}&to_ver={}".format(urlSteps, model.replace("+", "%2B"), from_ver, to_ver), timeout=10, verify=False)
if reqSteps.status_code != 200: continue
reqSteps.encoding = "utf-8"
dataSteps = json.loads(reqSteps.text)
for S in dataSteps['upgrade_steps']:
if not 'full_patch' in S or S['full_patch'] is False: continue
if not 'build_ver' in S or not S['build_ver'].startswith(version): continue
V=__fullversion("{}-{}-{}".format(S['build_ver'], S['build_num'], S['nano']))
if not V in pats:
pats[V] = {}
pats[V]['url'] = S['files'][0]['url'].split('?')[0]
pats[V]['sum'] = S['files'][0]['checksum']
except:
pass
pats = {k: pats[k] for k in sorted(pats.keys(), reverse=True)}
print(json.dumps(pats, indent=4))
@cli.command()
@click.option("-p", "--models", type=str, help="The models of Syno.")
def getpats(models=None):
import json, requests, urllib3, re
from bs4 import BeautifulSoup
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry # type: ignore
adapter = HTTPAdapter(max_retries=Retry(total=3, backoff_factor=0.5, status_forcelist=[500, 502, 503, 504]))
session = requests.Session()
session.mount("http://", adapter)
session.mount("https://", adapter)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
if models is not None and models != "":
MS = models.lower().replace(",", " ").split()
else:
MS = []
pats = {}
try:
req = session.get('https://archive.synology.com/download/Os/DSM', timeout=10, verify=False)
req.encoding = 'utf-8'
bs=BeautifulSoup(req.text, 'html.parser')
p = re.compile(r"(.*?)-(.*?)", re.MULTILINE | re.DOTALL)
l = bs.find_all('a', string=p)
for i in l:
ver = i.attrs['href'].split('/')[-1]
if not ver.startswith('7'): continue
req = session.get('https://archive.synology.com{}'.format(i.attrs['href']), timeout=10, verify=False)
req.encoding = 'utf-8'
bs=BeautifulSoup(req.text, 'html.parser')
p = re.compile(r"^(.*?)_(.*?)_(.*?).pat$", re.MULTILINE | re.DOTALL)
data = bs.find_all('a', string=p)
for item in data:
p = re.compile(r"DSM_(.*?)_(.*?).pat", re.MULTILINE | re.DOTALL)
rels = p.search(item.attrs['href'])
if rels != None:
info = p.search(item.attrs['href']).groups()
model = info[0].replace('%2B', '+')
if len(MS) > 0 and model.lower() not in MS:
continue
if model not in pats.keys():
pats[model]={}
pats[model][__fullversion(ver)] = item.attrs['href']
except:
pass
print(json.dumps(pats, indent=4))
@cli.command()
@click.option("-p", "--platforms", type=str, help="The platforms of Syno.")
def getmodelsoffline(platforms=None):
"""
Get Syno Models.
"""
import re, json
import requests
import fcntl, struct
if platforms is not None and platforms != "":
PS = platforms.lower().replace(",", " ").split()
else:
PS = []
models = []
with open(os.path.join('/mnt/p3/offline', "offline.json")) as user_file:
data = json.load(user_file)
for I in data["channel"]["item"]:
if not I["title"].startswith("DSM"):
continue
for J in I["model"]:
arch = J["mUnique"].split("_")[1]
name = J["mLink"].split("/")[-1].split("_")[1].replace("%2B", "+")
if len(PS) > 0 and arch.lower() not in PS:
continue
if any(name == B["name"] for B in models):
continue
models.append({"name": name, "arch": arch})
models = sorted(models, key=lambda k: (k["arch"], k["name"]))
print(json.dumps(models, indent=4))
if __name__ == "__main__":
cli()

View File

@@ -1,15 +1,15 @@
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../" 2>/dev/null && pwd)"
. ${ARC_PATH}/include/consts.sh
. ${ARC_PATH}/include/configFile.sh
. ${ARC_PATH}/include/addons.sh
. "${ARC_PATH}/include/consts.sh"
. "${ARC_PATH}/include/configFile.sh"
. "${ARC_PATH}/include/addons.sh"
###############################################################################
# Check loader disk
function checkBootLoader() {
while read KNAME RO; do
[ -z "${KNAME}" ] && continue
[ "${RO}" == "0" ] && continue
[ "${RO}" = "0" ] && continue
hdparm -r0 "${KNAME}" >/dev/null 2>&1 || true
done <<<$(lsblk -pno KNAME,RO 2>/dev/null)
[ ! -w "${PART1_PATH}" ] && return 1
@@ -49,7 +49,7 @@ function arrayExistItem() {
ITEM="${1}"
shift
for i in "$@"; do
[ "${i}" == "${ITEM}" ] || continue
[ "${i}" = "${ITEM}" ] || continue
EXISTS=0
break
done
@@ -92,7 +92,7 @@ function genRandomValue() {
function generateSerial() {
PREFIX="$(readConfigArray "${1}.prefix" "${S_FILE}" 2>/dev/null | sort -R | tail -1)"
MIDDLE="$(readConfigArray "${1}.middle" "${S_FILE}" 2>/dev/null | sort -R | tail -1)"
if [ "${2}" == "true" ]; then
if [ "${2}" = "true" ]; then
SUFFIX="arc"
else
SUFFIX="$(readConfigKey "${1}.suffix" "${S_FILE}" 2>/dev/null)"
@@ -111,6 +111,7 @@ function generateSerial() {
;;
esac
SERIAL="$(echo "${SERIAL}" | tr '[:lower:]' '[:upper:]')"
echo "${SERIAL}"
return 0
}
@@ -123,7 +124,7 @@ function generateSerial() {
# Returns serial number
function generateMacAddress() {
MACPRE="$(readConfigKey "${1}.macpre" "${S_FILE}")"
if [ "${3}" == "true" ]; then
if [ "${3}" = "true" ]; then
MACSUF="$(readConfigKey "${1}.mac" "${S_FILE}" 2>/dev/null)"
else
MACSUF="$(printf '%02x%02x%02x' $((${RANDOM} % 256)) $((${RANDOM} % 256)) $((${RANDOM} % 256)))"
@@ -134,6 +135,8 @@ function generateMacAddress() {
MACS+="$(printf '%06x%06x' $((0x${MACPRE:-"001132"})) $(($((0x${MACSUF})) + ${I})))"
[ ${I} -lt ${NUM} ] && MACS+=" "
done
MACS="$(echo "${MACS}" | tr '[:upper:]' '[:lower:]')"
echo "${MACS}"
return 0
}
@@ -185,7 +188,7 @@ function arrayExistItem() {
ITEM="${1}"
shift
for i in "$@"; do
[ "${i}" == "${ITEM}" ] || continue
[ "${i}" = "${ITEM}" ] || continue
EXISTS=0
break
done
@@ -223,36 +226,28 @@ function _set_conf_kv() {
}
###############################################################################
# sort netif name
# @1 -mac1,mac2,mac3...
# sort netif busid
function _sort_netif() {
local ETHLIST=""
local ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)" # real network cards list
for ETH in ${ETHX}; do
local MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g; s/.*/\L&/')"
local ETHBUS="$(ethtool -i ${ETH} 2>/dev/null | grep bus-info | cut -d' ' -f2)"
ETHLIST="${ETHLIST}${ETHBUS} ${MAC} ${ETH}\n"
local ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
for N in ${ETHX}; do
local MAC="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g; s/.*/\L&/')"
local BUS="$(ethtool -i ${N} 2>/dev/null | grep bus-info | cut -d' ' -f2)"
ETHLIST="${ETHLIST}${BUS} ${MAC} ${N}\n"
done
local ETHLISTTMPM=""
local ETHLISTTMPB="$(echo -e "${ETHLIST}" | sort)"
if [ -n "${1}" ]; then
local MACS="$(echo "${1}" | sed 's/://g; s/,/ /g; s/.*/\L&/')"
for MACX in ${MACS}; do
ETHLISTTMPM="${ETHLISTTMPM}$(echo -e "${ETHLISTTMPB}" | grep "${MACX}")\n"
ETHLISTTMPB="$(echo -e "${ETHLISTTMPB}" | grep -v "${MACX}")\n"
done
fi
local ETHLIST="$(echo -e "${ETHLISTTMPM}${ETHLISTTMPB}" | grep -v '^$')"
local ETHLIST="$(echo -e "${ETHLISTTMPB}" | grep -v '^$')"
local ETHSEQ="$(echo -e "${ETHLIST}" | awk '{print $3}' | sed 's/eth//g')"
local ETHNUM="$(echo -e "${ETHLIST}" | wc -l)"
# sort
if [ ! "${ETHSEQ}" == "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then
if [ ! "${ETHSEQ}" = "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then
/etc/init.d/S41dhcpcd stop >/dev/null 2>&1
/etc/init.d/S40network stop >/dev/null 2>&1
for i in $(seq 0 $((${ETHNUM:0} - 1))); do
ip link set dev eth${i} name tmp${i}
done
local I=0
I=0
for i in ${ETHSEQ}; do
ip link set dev tmp${i} name eth${I}
I=$((${I} + 1))
@@ -282,7 +277,7 @@ function getBus() {
# 1 - ethN
function getIP() {
local IP=""
MACR="$(cat /sys/class/net/${1}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')"
MACR="$(cat /sys/class/net/${1}/address 2>/dev/null | sed 's/://g')"
IPR="$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")"
if [ -n "${IPR}" ]; then
IFS='/' read -r -a IPRA <<<"${IPR}"
@@ -387,6 +382,7 @@ function rebootTo() {
local MODES="config recovery junior automated update bios memtest"
[ -z "${1}" ] && exit 1
if ! echo "${MODES}" | grep -qw "${1}"; then exit 1; fi
[ "${1}" = "automated" ] && echo "arc-${MODEL}-${PRODUCTVER}-${ARC_VERSION}" >"${PART3_PATH}/automated"
[ ! -f "${USER_GRUBENVFILE}" ] && grub-editenv ${USER_GRUBENVFILE} create
# echo -e "Rebooting to ${1} mode..."
grub-editenv ${USER_GRUBENVFILE} set next_entry="${1}"
@@ -398,10 +394,8 @@ function rebootTo() {
# 1 - DSM root path
function copyDSMFiles() {
if [ -f "${1}/grub_cksum.syno" ] && [ -f "${1}/GRUB_VER" ] && [ -f "${1}/zImage" ] && [ -f "${1}/rd.gz" ]; then
# Remove old model files
rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/grub_cksum.syno" "${PART2_PATH}/GRUB_VER"
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}"
# Remove old build files
rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/grub_cksum.syno" "${PART2_PATH}/GRUB_VER" >/dev/null
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" >/dev/null
rm -f "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" >/dev/null
# Copy new model files
cp -f "${1}/grub_cksum.syno" "${PART1_PATH}"
@@ -443,7 +437,7 @@ function extractDSMFiles() {
echo -e "Could not determine if pat file is encrypted or not, maybe corrupted, try again!"
;;
esac
if [ "${isencrypted}" == "yes" ]; then
if [ "${isencrypted}" = "yes" ]; then
# Uses the extractor to untar PAT file
LD_LIBRARY_PATH="${EXTRACTOR_PATH}" "${EXTRACTOR_PATH}/${EXTRACTOR_BIN}" "${PAT_PATH}" "${EXT_PATH}" >"${LOG_FILE}" 2>&1
else
@@ -471,7 +465,7 @@ function livepatch() {
echo -e " - failed!"
PVALID="false"
fi
if [ "${PVALID}" == "true" ]; then
if [ "${PVALID}" = "true" ]; then
# Patch Ramdisk
echo -n "Patching Ramdisk"
if ${ARC_PATH}/ramdisk-patch.sh; then
@@ -482,42 +476,12 @@ function livepatch() {
PVALID="false"
fi
fi
if [ "${PVALID}" == "false" ]; then
OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
if [ "${OFFLINE}" == "false" ]; then
# Load update functions
. ${ARC_PATH}/include/update.sh
# Update Patches
echo -e "Updating Patches..."
updatePatches
# Patch zImage
echo -n "Patching zImage"
if ${ARC_PATH}/zimage-patch.sh; then
echo -e " - successful!"
PVALID="true"
else
echo -e " - failed!"
PVALID="false"
fi
if [ "${PVALID}" == "true" ]; then
# Patch Ramdisk
echo -n "Patching Ramdisk"
if ${ARC_PATH}/ramdisk-patch.sh; then
echo -e " - successful!"
PVALID="true"
else
echo -e " - failed!"
PVALID="false"
fi
fi
fi
fi
if [ "${PVALID}" == "false" ]; then
if [ "${PVALID}" = "false" ]; then
echo
echo -e "Patching DSM Files failed! Please stay patient for Update."
sleep 5
exit 1
elif [ "${PVALID}" == "true" ]; then
elif [ "${PVALID}" = "true" ]; then
ZIMAGE_HASH="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
writeConfigKey "zimage-hash" "${ZIMAGE_HASH}" "${USER_CONFIG_FILE}"
RAMDISK_HASH="$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')"
@@ -528,81 +492,36 @@ function livepatch() {
###############################################################################
# Check NTP and Keyboard Layout
function ntpCheck() {
LAYOUT="$(readConfigKey "layout" "${USER_CONFIG_FILE}")"
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
if [ "${OFFLINE}" == "false" ]; then
# Timezone
function onlineCheck() {
REGION="$(curl -m 10 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f1)"
TIMEZONE="$(curl -m 10 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f2)"
KEYMAP="$(curl -m 10 -v "http://ip-api.com/line?fields=countryCode" 2>/dev/null | tr '[:upper:]' '[:lower:]')"
if [ "${KEYMAP}" = "ua" ]; then
rm -rf "${PART3_PATH}" && exec poweroff
fi
[ -z "${KEYMAP}" ] && KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
if [ -n "${REGION}" ] && [ -n "${TIMEZONE}" ]; then
writeConfigKey "time.region" "${REGION}" "${USER_CONFIG_FILE}"
writeConfigKey "time.timezone" "${TIMEZONE}" "${USER_CONFIG_FILE}"
else
REGION="$(readConfigKey "time.region" "${USER_CONFIG_FILE}")"
TIMEZONE="$(readConfigKey "time.timezone" "${USER_CONFIG_FILE}")"
if [ -z "${REGION}" ] || [ -z "${TIMEZONE}" ]; then
if [ "${ARCNIC}" == "auto" ]; then
REGION="$(curl -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f1)"
TIMEZONE="$(curl -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f2)"
[ -z "${KEYMAP}" ] && KEYMAP="$(curl -m 5 -v "http://ip-api.com/line?fields=countryCode" 2>/dev/null | tr '[:upper:]' '[:lower:]')"
else
REGION="$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f1)"
TIMEZONE="$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f2)"
[ -z "${KEYMAP}" ] && KEYMAP="$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=countryCode" 2>/dev/null | tr '[:upper:]' '[:lower:]')"
fi
writeConfigKey "time.region" "${REGION}" "${USER_CONFIG_FILE}"
writeConfigKey "time.timezone" "${TIMEZONE}" "${USER_CONFIG_FILE}"
fi
if [ -n "${REGION}" ] && [ -n "${TIMEZONE}" ]; then
ln -sf "/usr/share/zoneinfo/right/${REGION}/${TIMEZONE}" /etc/localtime
#hwclock --systohc
fi
fi
[ -n "${TIMEZONE}" ] && [ -n "${REGION}" ] && ln -sf "/usr/share/zoneinfo/${REGION}/${TIMEZONE}" /etc/localtime
LAYOUT="$(readConfigKey "layout" "${USER_CONFIG_FILE}")"
if [ -z "${LAYOUT}" ]; then
[ -n "${KEYMAP}" ] && KEYMAP="$(echo ${KEYMAP} | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]' | tr -d '[:punct:]' | tr -d '[:digit:]')"
[ -n "${KEYMAP}" ] && writeConfigKey "keymap" "${KEYMAP}" "${USER_CONFIG_FILE}"
[ -z "${KEYMAP}" ] && KEYMAP="us"
loadkeys ${KEYMAP}
fi
}
###############################################################################
# Offline Check
function offlineCheck() {
CNT=0
local ARCNIC=""
local OFFLINE="${1}"
if [ "${OFFLINE}" == "true" ]; then
ARCNIC="offline"
OFFLINE="true"
elif [ "${OFFLINE}" == "false" ]; then
while true; do
NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
CNT=$((${CNT} + 1))
if [ -n "${NEWTAG}" ]; then
ARCNIC="auto"
break
elif [ ${CNT} -ge 3 ]; then
ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)"
for ETH in ${ETHX}; do
# Update Check
NEWTAG="$(curl --interface ${ETH} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
if [ -n "${NEWTAG}" ]; then
ARCNIC="${ETH}"
break 2
fi
done
break
fi
done
if [ -n "${ARCNIC}" ]; then
OFFLINE="false"
elif [ -z "${ARCNIC}" ]; then
dialog --backtitle "$(backtitle)" --title "Online Check" \
--infobox "Could not connect to Github.\nSwitch to Offline Mode!" 0 0
sleep 5
ARCNIC="offline"
OFFLINE="true"
fi
[ $(echo "${ARC_VERSION}" | grep "dev" | wc -l) -eq 0 ] && NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)" || NEWTAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep "dev" | sort -rV | head -1)"
if [ -n "${NEWTAG}" ]; then
writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
updateOffline
else
writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}"
fi
[ "${OFFLINE}" == "true" ] && cp -f "${PART3_PATH}/offline/offline.json" "${ARC_PATH}/include/offline.json"
writeConfigKey "arc.nic" "${ARCNIC}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.offline" "${OFFLINE}" "${USER_CONFIG_FILE}"
}
###############################################################################
@@ -634,46 +553,81 @@ function systemCheck () {
fi
# Check for CPU Frequency Scaling
CPUFREQUENCIES=$(ls -ltr /sys/devices/system/cpu/cpufreq/* 2>/dev/null | wc -l)
if [ ${CPUFREQUENCIES} -gt 0 ] && [ "${ACPISYS}" == "true" ]; then
if [ ${CPUFREQUENCIES} -gt 1 ] && [ "${ACPISYS}" = "true" ]; then
CPUFREQ="true"
else
CPUFREQ="false"
fi
# Check for ARCKEY
ARCKEY="$(readConfigKey "arc.key" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
if [ -n "${MODEL}" ]; then
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}" 2>/dev/null)"
fi
if [ -z "${ARCCONF}" ] && [ -n "${ARCKEY}" ]; then
if openssl enc -in "${S_FILE_ENC}" -out "${S_FILE_ARC}" -d -aes-256-cbc -k "${ARCKEY}" 2>/dev/null; then
cp -f "${S_FILE_ARC}" "${S_FILE}"
writeConfigKey "arc.key" "${ARCKEY}" "${USER_CONFIG_FILE}"
# Check for Arc Patch
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
[ -z "${ARCCONF}" ] && writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
}
###############################################################################
# Generate HardwareID
function genHWID () {
HWID="$(echo $(dmidecode -t 4 | grep ID | sed 's/.*ID://;s/ //g' | head -1) $(ifconfig | grep eth | awk '{print $NF}' | sed 's/://g' | sort | head -1) | sha256sum | awk '{print $1}' | cut -c1-16)" 2>/dev/null
echo "${HWID}"
}
###############################################################################
# Check if port is valid
function check_port() {
if [ -z "${1}" ]; then
return 0
else
if [[ "${1}" =~ ^[0-9]+$ ]] && [ "${1}" -ge 0 ] && [ "${1}" -le 65535 ]; then
return 0
else
[ -f "${S_FILE}.bak" ] && cp -f "${S_FILE}" "${S_FILE}.bak"
writeConfigKey "arc.key" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
return 1
fi
fi
}
###############################################################################
# Check Dynamic Mode
function dynCheck () {
ARCDYN="$(readConfigKey "arc.dynamic" "${USER_CONFIG_FILE}")"
OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
if [ "${ARCDYN}" == "true" ] && [ "${OFFLINE}" == "false" ] && [ ! -f "${TMP_PATH}/dynamic" ]; then
curl -skL "https://github.com/AuxXxilium/arc/archive/refs/heads/dev.zip" -o "${TMP_PATH}/dev.zip"
unzip -qq -o "${TMP_PATH}/dev.zip" -d "${TMP_PATH}" 2>/dev/null
cp -rf "${TMP_PATH}/arc-dev/files/initrd/opt/arc/"* "${ARC_PATH}"
rm -rf "${TMP_PATH}/arc-dev"
rm -f "${TMP_PATH}/dev.zip"
VERSION="Dynamic-Dev"
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i ${ARC_PATH}/include/consts.sh
echo "true" >"${TMP_PATH}/dynamic"
clear
exec init.sh
elif [ "${ARCDYN}" == "false" ] || [ "${OFFLINE}" == "true" ]; then
[ -f "${TMP_PATH}/dynamic" ] && rm -f "${TMP_PATH}/dynamic" >/dev/null 2>&1 || true
# Unmount disks
function __umountNewBlDisk() {
umount "${TMP_PATH}/sdX1" 2>/dev/null
umount "${TMP_PATH}/sdX2" 2>/dev/null
umount "${TMP_PATH}/sdX3" 2>/dev/null
}
function __umountDSMRootDisk() {
umount "${TMP_PATH}/mdX"
rm -rf "${TMP_PATH}/mdX"
}
###############################################################################
# bootwait SSH/Web
function _bootwait() {
# Exec Bootwait to check SSH/Web connection
BOOTWAIT=5
w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WB
MSG=""
while test ${BOOTWAIT} -ge 0; do
MSG="\033[1;33mAccess SSH/Web will interrupt boot...\033[0m"
echo -en "\r${MSG}"
w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WC
if ! diff WB WC >/dev/null 2>&1; then
echo -en "\r\033[1;33mAccess SSH/Web detected and boot is interrupted.\033[0m\n"
rm -f WB WC
exit 0
fi
sleep 1
BOOTWAIT=$((BOOTWAIT - 1))
done
rm -f WB WC
echo -en "\r$(printf "%$((${#MSG} * 2))s" " ")\n"
return 0
}
###############################################################################
# check and fix the DSM root partition
# 1 - DSM root path
function fixDSMRootPart() {
if mdadm --detail "${1}" 2>/dev/null | grep -i "State" | grep -iEq "active|FAILED|Not Started"; then
mdadm --stop "${1}" >/dev/null 2>&1
mdadm --assemble --scan >/dev/null 2>&1
fsck "${1}" >/dev/null 2>&1
fi
}

View File

@@ -7,10 +7,10 @@
# eg: N i915.ko
# kvm
F irqbypass.ko
F kvm-intel.ko
F kvm-amd.ko
F kvm.ko
N irqbypass.ko
N kvm-intel.ko
N kvm-amd.ko
N kvm.ko
# acpi
N acpi_call.ko
@@ -29,10 +29,18 @@ N nct6683.ko
N nct6775.ko
# rndis
F mii.ko
F cdc_ether.ko
F rndis_host.ko
F r8152.ko
N mii.ko
N cdc_ether.ko
N rndis_host.ko
N r8152.ko
# iwlwifi
N libarc4.ko
N cfg80211.ko
N mac80211.ko
N iwlwifi.ko
N iwlmvm.ko
N iwldvm.ko
## i915
#N dmabuf.ko

View File

@@ -14,7 +14,7 @@ function getAllModules() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
@@ -49,7 +49,7 @@ function installModules() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" 2>"${LOG_FILE}"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" 2>"${LOG_FILE}"
@@ -61,7 +61,7 @@ function installModules() {
local ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")"
for F in $(ls "${TMP_PATH}/modules/"*.ko 2>/dev/null); do
local M=$(basename ${F})
[ "${ODP}" == "true" -a -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue
[ "${ODP}" = "true" ] && [ -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue
if echo "${MLIST}" | grep -wq "${M:0:-3}"; then
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}" 2>"${LOG_FILE}"
else
@@ -69,7 +69,7 @@ function installModules() {
fi
done
mkdir -p "${RAMDISK_PATH}/usr/lib/firmware"
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware" 2>"${LOG_FILE}"
else
tar -zxf "${MODULES_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware" 2>"${LOG_FILE}"
@@ -101,13 +101,13 @@ function addToModules() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
fi
cp -f ${KOFILE} ${TMP_PATH}/modules
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
tar -zcf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
else
tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
@@ -132,13 +132,13 @@ function delToModules() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
fi
rm -f ${TMP_PATH}/modules/${KONAME}
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
tar -zcf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
else
tar -zcf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules" .
@@ -174,7 +174,7 @@ function getdepends() {
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
local KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/modules-${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"
else
tar -zxf "${MODULES_PATH}/${PLATFORM}-${KVER}.tgz" -C "${TMP_PATH}/modules"

View File

@@ -1,36 +1,37 @@
# Get Network Config for Loader
function getnet() {
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
NICPORTS="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)"
if [ "${ARCPATCH}" == "true" ]; then
ETHN="$(echo ${ETHX} | wc -w)"
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "true" | tr '[:lower:]' '[:upper:]'))
ETHN=$(echo ${ETHX} | wc -w)
if [ "${ARCPATCH}" = "true" ]; then
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "true"))
for I in $(seq 1 ${ETHN}); do
eval MAC${I}="${MACS[$((${I} - 1))]}"
writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}"
done
elif [ "${ARCPATCH}" == "false" ]; then
ETHN="$(echo ${ETHX} | wc -w)"
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "false" | tr '[:lower:]' '[:upper:]'))
elif [ "${ARCPATCH}" = "false" ]; then
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "false"))
for I in $(seq 1 ${ETHN}); do
eval MAC${I}="${MACS[$((${I} - 1))]}"
writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}"
done
elif [ "${ARCPATCH}" == "user" ]; then
elif [ "${ARCPATCH}" = "user" ]; then
# User Mac
for ETH in ${ETHX}; do
for N in ${ETHX}; do
while true; do
MAC="$(cat /sys/class/net/${ETH}/address | sed 's/://g')"
dialog --backtitle "$(backtitle)" --title "Mac Setting" \
--inputbox "Type a custom MAC for ${ETH} (Eq. 001132abc123)." 7 50 "${MAC}"\
--inputbox "Type a custom Mac for ${N} (Eq. 001132a1b2c3).\nA custom Mac will not be applied to NIC!" 7 50\
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && break
MAC=$(cat "${TMP_PATH}/resp")
[ -z "${MAC}" ] && MAC="$(readConfigKey "${ETH}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')"
MAC="$(echo "${MAC}" | sed "s/:\|-\| //g" | tr '[:lower:]' '[:upper:]')"
[ -z "${MAC}" ] && MAC="$(readConfigKey "${N}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g')"
MAC="$(echo "${MAC}" | tr '[:upper:]' '[:lower:]')"
if [ ${#MAC} -eq 12 ]; then
writeConfigKey "${ETH}" "${MAC}" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "Mac Setting" --msgbox "Set Mac for ${N} to ${MAC}!" 5 50
writeConfigKey "${N}" "${MAC}" "${USER_CONFIG_FILE}"
break
else
dialog --backtitle "$(backtitle)" --title "Mac Setting" --msgbox "Invalid MAC - Try again!" 5 50
@@ -41,9 +42,9 @@ function getnet() {
}
# Get Amount of NIC
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
# Get actual IP
for ETH in ${ETHX}; do
IPCON=$(getIP ${ETH})
for N in ${ETHX}; do
IPCON="$(getIP "${N}")"
[ -n "${IPCON}" ] && break
done

View File

@@ -2,52 +2,50 @@
function getmap() {
# Sata Disks
SATADRIVES=0
# Clean old files
[ -f "${TMP_PATH}/drivesmax" ] && rm -f "${TMP_PATH}/drivesmax"
touch "${TMP_PATH}/drivesmax"
[ -f "${TMP_PATH}/drivescon" ] && rm -f "${TMP_PATH}/drivescon"
touch "${TMP_PATH}/drivescon"
[ -f "${TMP_PATH}/ports" ] && rm -f "${TMP_PATH}/ports"
touch "${TMP_PATH}/ports"
[ -f "${TMP_PATH}/remap" ] && rm -f "${TMP_PATH}/remap"
touch "${TMP_PATH}/remap"
if [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
let DISKIDXMAPIDX=0
DISKIDXMAP=""
let DISKIDXMAPIDXMAX=0
DISKIDXMAPMAX=""
for PCI in $(lspci -d ::106 | awk '{print $1}'); do
NUMPORTS=0
CONPORTS=0
unset HOSTPORTS
declare -A HOSTPORTS
while read -r LINE; do
ATAPORT="$(echo ${LINE} | grep -o 'ata[0-9]*')"
PORT=$(echo ${ATAPORT} | sed 's/ata//')
HOSTPORTS[${PORT}]=$(echo ${LINE} | grep -o 'host[0-9]*$')
done < <(ls -l /sys/class/scsi_host | grep -F "${PCI}")
while read -r PORT; do
ls -l /sys/block | grep -F -q "${PCI}/ata${PORT}" && ATTACH=1 || ATTACH=0
PCMD=$(cat /sys/class/scsi_host/${HOSTPORTS[${PORT}]}/ahci_port_cmd)
[ ${PCMD} = 0 ] && DUMMY=1 || DUMMY=0
[ ${ATTACH} = 1 ] && CONPORTS="$((${CONPORTS} + 1))" && echo "$((${PORT} - 1))" >>"${TMP_PATH}/ports"
[ ${DUMMY} = 1 ] # Do nothing for now
NUMPORTS=$((${NUMPORTS} + 1))
done < <(echo ${!HOSTPORTS[@]} | tr ' ' '\n' | sort -n)
[ ${NUMPORTS} -gt 8 ] && NUMPORTS=8
[ ${CONPORTS} -gt 8 ] && CONPORTS=8
echo -n "${NUMPORTS}" >>"${TMP_PATH}/drivesmax"
echo -n "${CONPORTS}" >>"${TMP_PATH}/drivescon"
DISKIDXMAP=$DISKIDXMAP$(printf "%02x" $DISKIDXMAPIDX)
let DISKIDXMAPIDX=$DISKIDXMAPIDX+$CONPORTS
DISKIDXMAPMAX=$DISKIDXMAPMAX$(printf "%02x" $DISKIDXMAPIDXMAX)
let DISKIDXMAPIDXMAX=$DISKIDXMAPIDXMAX+$NUMPORTS
SATADRIVES=$((${SATADRIVES} + ${CONPORTS}))
done
if [ $(lspci -d ::106 2>/dev/null | wc -l) -gt 0 ]; then
# Clean old files
[ -f "${TMP_PATH}/drivesmax" ] && rm -f "${TMP_PATH}/drivesmax" && touch "${TMP_PATH}/drivesmax" || true
[ -f "${TMP_PATH}/drivescon" ] && rm -f "${TMP_PATH}/drivescon" && touch "${TMP_PATH}/drivescon" || true
[ -f "${TMP_PATH}/ports" ] && rm -f "${TMP_PATH}/ports" && touch "${TMP_PATH}/ports" || true
[ -f "${TMP_PATH}/remap" ] && rm -f "${TMP_PATH}/remap" && touch "${TMP_PATH}/remap" || true
if [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
let DISKIDXMAPIDX=0
DISKIDXMAP=""
let DISKIDXMAPIDXMAX=0
DISKIDXMAPMAX=""
for PCI in $(lspci -d ::106 | awk '{print $1}'); do
NUMPORTS=0
CONPORTS=0
unset HOSTPORTS
declare -A HOSTPORTS
while read -r LINE; do
ATAPORT="$(echo ${LINE} | grep -o 'ata[0-9]*')"
PORT=$(echo ${ATAPORT} | sed 's/ata//')
HOSTPORTS[${PORT}]=$(echo ${LINE} | grep -o 'host[0-9]*$')
done < <(ls -l /sys/class/scsi_host | grep -F "${PCI}")
while read -r PORT; do
ls -l /sys/block | grep -F -q "${PCI}/ata${PORT}" && ATTACH=1 || ATTACH=0
PCMD=$(cat /sys/class/scsi_host/${HOSTPORTS[${PORT}]}/ahci_port_cmd)
[ ${PCMD} = 0 ] && DUMMY=1 || DUMMY=0
[ ${ATTACH} = 1 ] && CONPORTS="$((${CONPORTS} + 1))" && echo "$((${PORT} - 1))" >>"${TMP_PATH}/ports"
[ ${DUMMY} = 1 ] # Do nothing for now
NUMPORTS=$((${NUMPORTS} + 1))
done < <(echo ${!HOSTPORTS[@]} | tr ' ' '\n' | sort -n)
[ ${NUMPORTS} -gt 8 ] && NUMPORTS=8
[ ${CONPORTS} -gt 8 ] && CONPORTS=8
echo -n "${NUMPORTS}" >>"${TMP_PATH}/drivesmax"
echo -n "${CONPORTS}" >>"${TMP_PATH}/drivescon"
DISKIDXMAP=$DISKIDXMAP$(printf "%02x" $DISKIDXMAPIDX)
let DISKIDXMAPIDX=$DISKIDXMAPIDX+$CONPORTS
DISKIDXMAPMAX=$DISKIDXMAPMAX$(printf "%02x" $DISKIDXMAPIDXMAX)
let DISKIDXMAPIDXMAX=$DISKIDXMAPIDXMAX+$NUMPORTS
SATADRIVES=$((${SATADRIVES} + ${CONPORTS}))
done
fi
fi
# SAS Disks
SASDRIVES=0
if [ $(lspci -d ::107 | wc -l) -gt 0 ]; then
if [ $(lspci -d ::107 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::107 | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
@@ -57,7 +55,7 @@ function getmap() {
fi
# SCSI Disks
SCSIDRIVES=0
if [ $(lspci -d ::100 | wc -l) -gt 0 ]; then
if [ $(lspci -d ::100 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::100 | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort - 2>/dev/null)
@@ -67,7 +65,7 @@ function getmap() {
fi
# Raid Disks
RAIDDRIVES=0
if [ $(lspci -d ::104 | wc -l) -gt 0 ]; then
if [ $(lspci -d ::104 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::104 | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
@@ -77,7 +75,7 @@ function getmap() {
fi
# USB Disks
USBDRIVES=0
if [[ -d "/sys/class/scsi_host" && $(ls -l /sys/class/scsi_host | grep usb | wc -l) -gt 0 ]]; then
if [ $(ls -l /sys/class/scsi_host 2>/dev/null | grep usb | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::c03 | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
@@ -88,7 +86,7 @@ function getmap() {
fi
# MMC Disks
MMCDRIVES=0
if [[ -d "/sys/class/mmc_host" && $(ls -l /sys/class/mmc_host | grep mmc_host | wc -l) -gt 0 ]]; then
if [ $(ls -l /sys/block/mmc* 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::805 | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
PORTNUM=$(ls -l /sys/block/mmc* | grep "${PCI}" | wc -l 2>/dev/null)
@@ -98,7 +96,7 @@ function getmap() {
fi
# NVMe Disks
NVMEDRIVES=0
if [ $(lspci -d ::108 | wc -l) -gt 0 ]; then
if [ $(lspci -d ::108 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::108 | awk '{print $1}'); do
NAME=$(lspci -s "${PCI}" | sed "s/\ .*://")
PORT=$(ls -l /sys/class/nvme | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/nvme//' | sort -n 2>/dev/null)
@@ -122,13 +120,13 @@ function getmap() {
if [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
LASTDRIVE=0
while read -r D; do
if [ "${BUS}" == "sata" ] && [ "${MACHINE}" != "Native" ] && [ ${D} -eq 0 ]; then
if [ "${BUS}" = "sata" ] && [ "${MACHINE}" != "Native" ] && [ ${D} -eq 0 ]; then
MAXDISKS=${DRIVES}
echo -n "${D}>${MAXDISKS}:">>"${TMP_PATH}/remap"
elif [ ${D} != ${LASTDRIVE} ]; then
echo -n "${D}>${LASTDRIVE}:">>"${TMP_PATH}/remap"
LASTDRIVE=$((${LASTDRIVE} + 1))
elif [ ${D} == ${LASTDRIVE} ]; then
elif [ ${D} = ${LASTDRIVE} ]; then
LASTDRIVE=$((${D} + 1))
fi
done < <(cat "${TMP_PATH}/ports")
@@ -142,27 +140,41 @@ function getmapSelection() {
SATAREMAP="$(awk '{print $1}' "${TMP_PATH}/remap" | sed 's/.$//')"
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" == "config" ]; then
if [ "${ARCMODE}" = "config" ]; then
# Show recommended Option to user
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "true" ] && [ "${MACHINE}" == "Native" ]; then
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && [ "${MACHINE}" = "Native" ]; then
REMAP2="*"
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
REMAP3="*"
else
REMAP1="*"
fi
# Ask for Portmap
dialog --backtitle "$(backtitle)" --title "Sata Portmap" \
--menu "Choose a Portmap for Sata!?\n* Recommended Option" 8 60 0 \
1 "DiskIdxMap: Active Ports ${REMAP1}" \
2 "DiskIdxMap: Max Ports ${REMAP2}" \
3 "SataRemap: Remove empty Ports ${REMAP3}" \
4 "AhciRemap: Remove empty Ports (new) ${REMAP4}" \
5 "Set my own Portmap in Config" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat "${TMP_PATH}/resp")
[ -z "${resp}" ] && return 1
if [ "${STEP}" = "storagemap" ]; then
dialog --backtitle "$(backtitlep)" --title "Sata Portmap" \
--menu "Choose a Portmap for Sata!?\n* Recommended Option" 8 60 0 \
1 "DiskIdxMap: Active Ports ${REMAP1}" \
2 "DiskIdxMap: Max Ports ${REMAP2}" \
3 "SataRemap: Remove empty Ports ${REMAP3}" \
4 "AhciRemap: Remove empty Ports (new) ${REMAP4}" \
5 "Set my own Portmap in Config" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat "${TMP_PATH}/resp")
[ -z "${resp}" ] && return 1
else
dialog --backtitle "$(backtitle)" --title "Sata Portmap" \
--menu "Choose a Portmap for Sata!?\n* Recommended Option" 8 60 0 \
1 "DiskIdxMap: Active Ports ${REMAP1}" \
2 "DiskIdxMap: Max Ports ${REMAP2}" \
3 "SataRemap: Remove empty Ports ${REMAP3}" \
4 "AhciRemap: Remove empty Ports (new) ${REMAP4}" \
5 "Set my own Portmap in Config" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat "${TMP_PATH}/resp")
[ -z "${resp}" ] && return 1
fi
if [ ${resp} -eq 1 ]; then
writeConfigKey "arc.remap" "acports" "${USER_CONFIG_FILE}"
elif [ ${resp} -eq 2 ]; then
@@ -176,9 +188,9 @@ function getmapSelection() {
fi
else
# Show recommended Option to user
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "true" ] && [ "${MACHINE}" == "Native" ]; then
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && [ "${MACHINE}" = "Native" ]; then
writeConfigKey "arc.remap" "maxports" "${USER_CONFIG_FILE}"
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" == "false" ]; then
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
writeConfigKey "arc.remap" "remap" "${USER_CONFIG_FILE}"
else
writeConfigKey "arc.remap" "acports" "${USER_CONFIG_FILE}"
@@ -187,27 +199,27 @@ function getmapSelection() {
# Check Remap for correct config
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
# Write Map to config and show Map to User
if [ "${REMAP}" == "acports" ]; then
if [ "${REMAP}" = "acports" ]; then
writeConfigKey "cmdline.SataPortMap" "${SATAPORTMAP}" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline.DiskIdxMap" "${DISKIDXMAP}" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}"
elif [ "${REMAP}" == "maxports" ]; then
elif [ "${REMAP}" = "maxports" ]; then
writeConfigKey "cmdline.SataPortMap" "${SATAPORTMAPMAX}" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline.DiskIdxMap" "${DISKIDXMAPMAX}" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}"
elif [ "${REMAP}" == "remap" ]; then
elif [ "${REMAP}" = "remap" ]; then
writeConfigKey "cmdline.sata_remap" "${SATAREMAP}" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}"
elif [ "${REMAP}" == "ahci" ]; then
elif [ "${REMAP}" = "ahci" ]; then
writeConfigKey "cmdline.ahci_remap" "${SATAREMAP}" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"
elif [ "${REMAP}" == "user" ]; then
elif [ "${REMAP}" = "user" ]; then
deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"

File diff suppressed because it is too large Load Diff

View File

@@ -3,36 +3,21 @@
set -e
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
. ${ARC_PATH}/include/functions.sh
. ${ARC_PATH}/include/addons.sh
. ${ARC_PATH}/include/compat.sh
. "${ARC_PATH}/include/functions.sh"
# Get Loader Disk Bus
[ -z "${LOADER_DISK}" ] && die "Loader Disk not found!"
checkBootLoader || die "The loader is corrupted, please rewrite it!"
BUS=$(getBus "${LOADER_DISK}")
# Sanity Check
CONFIGSVERSION="$(cat "${MODEL_CONFIG_PATH}/VERSION" | sed -e 's/\.//g' | sed 's/[^0-9]*//g')"
LOADERVERSION="$(echo "${ARC_VERSION}" | sed -e 's/\.//g' | sed 's/[^0-9]*//g')"
CONFHASHFILE="$(sha256sum "${S_FILE}" | awk '{print $1}')"
CONFHASH="$(readConfigKey "arc.confhash" "${USER_CONFIG_FILE}")"
[ -z "${CONFHASH}" ] && CONFHASH="${CONFHASHFILE}"
if [ ${CONFIGSVERSION} -lt ${LOADERVERSION} ] || [ "${CONFHASH}" != "${CONFHASHFILE}" ]; then
echo -e "Pirated Version of Arc Loader detected!!! Files can't be verified."
sleep 3
exec poweroff
fi
# Check if machine has EFI
[ -d /sys/firmware/efi ] && EFI=1 || EFI=0
EFI=$([ -d /sys/firmware/efi ] && echo 1 || echo 0)
# Print Title centralized
clear
COLUMNS=${COLUMNS:-50}
BANNER="$(figlet -c -w "$(((${COLUMNS})))" "Arc Loader")"
TITLE="Version:"
TITLE+=" ${ARC_TITLE}"
TITLE+=" ${ARC_VERSION} (${ARC_BUILD})"
[ -n "${ARC_BRANCH}" ] && TITLE+=" | Branch: ${ARC_BRANCH}"
printf "\033[1;30m%*s\n" ${COLUMNS} ""
printf "\033[1;30m%*s\033[A\n" ${COLUMNS} ""
printf "\033[1;34m%*s\033[0m\n" ${COLUMNS} "${BANNER}"
@@ -46,23 +31,22 @@ printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
if [ ! -f "${USER_CONFIG_FILE}" ]; then
touch "${USER_CONFIG_FILE}"
fi
# Config Init
initConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
initConfigKey "arc" "{}" "${USER_CONFIG_FILE}"
initConfigKey "arc.branch" "" "${USER_CONFIG_FILE}"
initConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.confdone" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.confhash" "${CONFHASHFILE}" "${USER_CONFIG_FILE}"
initConfigKey "arc.dynamic" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.ipv6" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.key" "" "${USER_CONFIG_FILE}"
initConfigKey "arc.nic" "" "${USER_CONFIG_FILE}"
initConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
initConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
initConfigKey "arc.version" "${ARC_VERSION}" "${USER_CONFIG_FILE}"
initConfigKey "boot" "{}" "${USER_CONFIG_FILE}"
initConfigKey "boot.dsminfo" "true" "${USER_CONFIG_FILE}"
initConfigKey "boot.systeminfo" "true" "${USER_CONFIG_FILE}"
initConfigKey "boot.dsmlogo" "true" "${USER_CONFIG_FILE}"
initConfigKey "bootipwait" "30" "${USER_CONFIG_FILE}"
initConfigKey "device" "{}" "${USER_CONFIG_FILE}"
initConfigKey "directboot" "false" "${USER_CONFIG_FILE}"
initConfigKey "dsmlogo" "true" "${USER_CONFIG_FILE}"
initConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}"
initConfigKey "hddsort" "false" "${USER_CONFIG_FILE}"
initConfigKey "kernel" "official" "${USER_CONFIG_FILE}"
@@ -73,8 +57,6 @@ initConfigKey "pathash" "" "${USER_CONFIG_FILE}"
initConfigKey "paturl" "" "${USER_CONFIG_FILE}"
initConfigKey "sn" "" "${USER_CONFIG_FILE}"
initConfigKey "cmdline" "{}" "${USER_CONFIG_FILE}"
initConfigKey "device" "{}" "${USER_CONFIG_FILE}"
initConfigKey "device.externalcontroller" "false" "${USER_CONFIG_FILE}"
initConfigKey "keymap" "" "${USER_CONFIG_FILE}"
initConfigKey "layout" "" "${USER_CONFIG_FILE}"
initConfigKey "lkm" "prod" "${USER_CONFIG_FILE}"
@@ -104,41 +86,36 @@ else
writeConfigKey "arc.mode" "dsm" "${USER_CONFIG_FILE}"
fi
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
if [ -f "${PART1_PATH}/ARC-BRANCH" ]; then
ARCBRANCH=$(cat "${PART1_PATH}/ARC-BRANCH") && writeConfigKey "arc.branch" "${ARCBRANCH}" "${USER_CONFIG_FILE}"
rm -f "${PART1_PATH}/ARC-BRANCH" >/dev/null 2>&1 || true
if [ -n "${ARC_BRANCH}" ]; then
writeConfigKey "arc.branch" "${ARC_BRANCH}" "${USER_CONFIG_FILE}"
fi
# Check for compatibility
compatboot
# Init Network
ETHX="$(ls /sys/class/net 2>/dev/null | grep eth)"
# Sort network interfaces
if arrayExistItem "sortnetif:" $(readConfigMap "addons" "${USER_CONFIG_FILE}"); then
_sort_netif "$(readConfigKey "addons.sortnetif" "${USER_CONFIG_FILE}")"
fi
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
# Read/Write IP/Mac config
for ETH in ${ETHX}; do
MACR="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:lower:]' '[:upper:]')"
IPR="$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")"
if [ -n "${IPR}" ]; then
IFS='/' read -r -a IPRA <<<"${IPR}"
ip addr flush dev ${ETH}
ip addr add ${IPRA[0]}/${IPRA[1]:-"255.255.255.0"} dev ${ETH}
if [ -n "${IPRA[2]}" ]; then
ip route add default via ${IPRA[2]} dev ${ETH}
# Read/Write IP/Mac to config
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
for N in ${ETHX}; do
MACR="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')"
IPR="$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")"
if [ -n "${IPR}" ] && [ "1" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
IFS='/' read -r -a IPRA <<<"${IPR}"
ip addr flush dev "${N}"
ip addr add "${IPRA[0]}/${IPRA[1]:-"255.255.255.0"}" dev "${N}"
if [ -n "${IPRA[2]}" ]; then
ip route add default via "${IPRA[2]}" dev "${N}"
fi
if [ -n "${IPRA[3]:-${IPRA[2]}}" ]; then
sed -i "/nameserver ${IPRA[3]:-${IPRA[2]}}/d" /etc/resolv.conf
echo "nameserver ${IPRA[3]:-${IPRA[2]}}" >>/etc/resolv.conf
fi
sleep 1
fi
if [ -n "${IPRA[3]:-${IPRA[2]}}" ]; then
sed -i "/nameserver ${IPRA[3]:-${IPRA[2]}}/d" /etc/resolv.conf
echo "nameserver ${IPRA[3]:-${IPRA[2]}}" >>/etc/resolv.conf
fi
sleep 1
fi
[ "${ETH::3}" == "eth" ] && ethtool -s ${ETH} wol g 2>/dev/null || true
# [ "${ETH::3}" == "eth" ] && ethtool -K ${ETH} rxhash off 2>/dev/null || true
initConfigKey "${ETH}" "${MACR}" "${USER_CONFIG_FILE}"
done
ETHN="$(echo ${ETHX} | wc -w)"
[ "${N::3}" = "eth" ] && ethtool -s "${N}" wol g 2>/dev/null || true
# [ "${N::3}" = "eth" ] && ethtool -K ${N} rxhash off 2>/dev/null || true
initConfigKey "${N}" "${MACR}" "${USER_CONFIG_FILE}"
done
ETHN=$(echo ${ETHX} | wc -w)
writeConfigKey "device.nic" "${ETHN}" "${USER_CONFIG_FILE}"
# No network devices
echo
@@ -149,7 +126,7 @@ VID="0x46f4"
PID="0x0001"
BUSLIST="usb sata sas scsi nvme mmc ide virtio vmbus xen"
if [ "${BUS}" == "usb" ]; then
if [ "${BUS}" = "usb" ]; then
VID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_VENDOR_ID | cut -d= -f2)"
PID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_MODEL_ID | cut -d= -f2)"
elif ! echo "${BUSLIST}" | grep -wq "${BUS}"; then
@@ -159,23 +136,11 @@ fi
# Inform user and check bus
echo -e "Loader Disk: \033[1;34m${LOADER_DISK}\033[0m"
echo -e "Loader Disk Type: \033[1;34m${BUS}\033[0m"
echo
# Save variables to user config file
writeConfigKey "vid" ${VID} "${USER_CONFIG_FILE}"
writeConfigKey "pid" ${PID} "${USER_CONFIG_FILE}"
# Load keymap name
LAYOUT="$(readConfigKey "layout" "${USER_CONFIG_FILE}")"
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
# Loads a keymap if is valid
if [ -n "${LAYOUT}" ] && [ -n "${KEYMAP}" ]; then
if [ -f "/usr/share/keymaps/i386/${LAYOUT}/${KEYMAP}.map.gz" ]; then
echo -e "Loading User Keymap: \033[1;34m${LAYOUT}/${KEYMAP}\033[0m"
zcat "/usr/share/keymaps/i386/${LAYOUT}/${KEYMAP}.map.gz" | loadkeys
fi
fi
echo
writeConfigKey "vid" "${VID}" "${USER_CONFIG_FILE}"
writeConfigKey "pid" "${PID}" "${USER_CONFIG_FILE}"
# Decide if boot automatically
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
@@ -186,10 +151,9 @@ elif [ "${ARCMODE}" = "automated" ]; then
echo -e "\033[1;34mStarting automated Build Mode...\033[0m"
elif [ "${ARCMODE}" = "update" ]; then
echo -e "\033[1;34mStarting Update Mode...\033[0m"
elif [ "${BUILDDONE}" == "true" ] && [ "${ARCMODE}" = "dsm" ]; then
elif [ "${BUILDDONE}" = "true" ] && [ "${ARCMODE}" = "dsm" ]; then
echo -e "\033[1;34mStarting DSM Mode...\033[0m"
boot.sh
exit 0
exec boot.sh && exit 0
else
echo -e "\033[1;34mStarting Config Mode...\033[0m"
fi
@@ -197,48 +161,42 @@ echo
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=30
echo -e "\033[1;34mDetected ${ETHN} NIC.\033[0m \033[1;37mWaiting for Connection:\033[0m"
echo -e "\033[1;37mDetected ${ETHN} NIC:\033[0m"
IPCON=""
echo
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
sleep 3
for ETH in ${ETHX}; do
for N in ${ETHX}; do
COUNT=0
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
DRIVER=$(ls -ld /sys/class/net/${N}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
while true; do
if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then
echo -e "\r\033[1;37m${DRIVER}:\033[0m NOT CONNECTED"
if [ "0" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mNOT CONNECTED\033[0m"
break
fi
COUNT=$((${COUNT} + 1))
IP="$(getIP ${ETH})"
COUNT=$((COUNT + 1))
IP="$(getIP "${N}")"
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}')
SPEED=$(ethtool ${N} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then
echo -e "\r\033[1;37m${DRIVER} (${SPEED}):\033[0m LINK LOCAL (No DHCP server found.)"
echo -e "\r${DRIVER} (${SPEED}): \033[1;37mLINK LOCAL (No DHCP server found.)\033[0m"
else
echo -e "\r\033[1;37m${DRIVER} (${SPEED}):\033[0m Access \033[1;34mhttp://${IP}:7681\033[0m to connect to Arc via web interface."
echo -e "\r${DRIVER} (${SPEED}): \033[1;37m${IP}\033[0m"
[ -z "${IPCON}" ] && IPCON="${IP}"
fi
break
fi
if ! ip link show ${ETH} 2>/dev/null | grep -q 'UP'; then
echo -e "\r\033[1;37m${DRIVER}:\033[0m DOWN"
if [ -z "$(cat /sys/class/net/${N}}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mDOWN\033[0m"
break
fi
if [ ${COUNT} -ge ${BOOTIPWAIT} ]; then
echo -e "\r\033[1;37m${DRIVER}:\033[0m TIMEOUT"
echo -e "\r${DRIVER}: \033[1;37mTIMEOUT\033[0m"
break
fi
sleep 1
done
done
# NTP
/etc/init.d/S49ntpd restart > /dev/null 2>&1
# Inform user
echo
echo -e "Call \033[1;34marc.sh\033[0m to configure Arc"
echo
echo -e "User config is on \033[1;34m${USER_CONFIG_FILE}\033[0m"
echo -e "Default SSH Root password is \033[1;34marc\033[0m"
echo
mkdir -p "${ADDONS_PATH}"
@@ -249,16 +207,20 @@ mkdir -p "${MODULES_PATH}"
mkdir -p "${PATCH_PATH}"
mkdir -p "${USER_UP_PATH}"
# Tell webterminal that the loader is ready
touch "${HOME}/.initialized"
# Load Arc Overlay
echo -e "\033[1;34mLoading Arc Overlay...\033[0m"
echo
echo -e "Use \033[1;34mDisplay Output\033[0m or \033[1;34mhttp://${IPCON}:${TTYDPORT}\033[0m to configure Loader."
# Check memory and load Arc
RAM=$(free -m | grep -i mem | awk '{print$2}')
RAM=$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null)
if [ ${RAM} -le 3500 ]; then
echo -e "\033[1;31mYou have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of RAM.\033[0m\n"
echo -e "\033[1;31mUse arc.sh to proceed. Not recommended!\033[0m"
echo -e "\033[1;31mYou have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of RAM.\033[0m\n\033[1;31mUse arc.sh to proceed. Not recommended!\033[0m"
else
arc.sh
exec arc.sh
fi
exit 0

Binary file not shown.

View File

@@ -1 +0,0 @@
kmod

View File

@@ -2,9 +2,9 @@
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
. ${ARC_PATH}/include/functions.sh
. ${ARC_PATH}/include/addons.sh
. ${ARC_PATH}/include/modules.sh
. "${ARC_PATH}/include/functions.sh"
. "${ARC_PATH}/include/addons.sh"
. "${ARC_PATH}/include/modules.sh"
set -o pipefail # Get exit code from process piped
@@ -43,8 +43,8 @@ ARCBRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
[ "${PATURL:0:1}" == "#" ] && PATURL=""
[ "${PATSUM:0:1}" == "#" ] && PATSUM=""
[ "${PATURL:0:1}" = "#" ] && PATURL=""
[ "${PATSUM:0:1}" = "#" ] && PATSUM=""
# Check if DSM Version changed
. "${RAMDISK_PATH}/etc/VERSION"
@@ -67,7 +67,7 @@ writeConfigKey "smallnum" "${SMALLNUM}" "${USER_CONFIG_FILE}"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
# Sanity check
if [ -z "${PLATFORM}" ] || [ -z "${KVER}" ]; then
@@ -106,7 +106,7 @@ for PE in ${PATCHES[@]}; do
echo "Patching with ${PF}" >>"${LOG_FILE}"
(
cd "${RAMDISK_PATH}"
busybox patch -p1 -i "${PF}" >>"${LOG_FILE}" 2>&1 # busybox patch and gun patch have different processing methods and parameters.
patch -p1 -i "${PF}" >>"${LOG_FILE}" 2>&1
)
RET=$?
[ ${RET} -eq 0 ] && break
@@ -153,6 +153,7 @@ echo "#!/bin/sh" >"${RAMDISK_PATH}/addons/addons.sh"
echo 'echo "addons.sh called with params ${@}"' >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export LOADERLABEL=\"ARC\"" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export LOADERVERSION=\"${ARC_VERSION}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export LOADERBUILD=\"${ARC_BUILD}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export LOADERBRANCH=\"${ARCBRANCH}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export PLATFORM=\"${PLATFORM}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "export PRODUCTVER=\"${PRODUCTVER}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
@@ -167,7 +168,7 @@ chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# System Addons
for ADDON in "redpill" "revert" "misc" "eudev" "disks" "localrss" "notify" "wol" "mountloader"; do
PARAMS=""
if [ "${ADDON}" == "disks" ]; then
if [ "${ADDON}" = "disks" ]; then
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
PARAMS="${HDDSORT} ${USBMOUNT}"
@@ -180,7 +181,7 @@ done
# User Addons
for ADDON in ${!ADDONS[@]}; do
PARAMS=${ADDONS[${ADDON}]}
installAddon "${ADDON}" "${PLATFORM}" || exit 1
installAddon "${ADDON}" "${PLATFORM}" || echo "Addon ${ADDON} not found"
echo "/addons/${ADDON}.sh \${1} ${PARAMS}" >>"${RAMDISK_PATH}/addons/addons.sh" 2>>"${LOG_FILE}" || exit 1
done
@@ -189,7 +190,7 @@ echo "inetd" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "Modify files" >"${LOG_FILE}"
# Remove function from scripts
[ "2" == "${PRODUCTVER:0:1}" ] && sed -i 's/function //g' $(find "${RAMDISK_PATH}/addons/" -type f -name "*.sh")
[ "2" = "${PRODUCTVER:0:1}" ] && sed -i 's/function //g' $(find "${RAMDISK_PATH}/addons/" -type f -name "*.sh")
# Build modules dependencies
# ${ARC_PATH}/depmod -a -b ${RAMDISK_PATH} 2>/dev/null
@@ -227,14 +228,14 @@ for N in $(seq 0 7); do
done
# SA6400 patches
if [ "${PLATFORM}" == "epyc7002" ]; then
if [ "${PLATFORM}" = "epyc7002" ]; then
echo -n " - Apply Epyc7002 Fixes"
sed -i 's#/dev/console#/var/log/lrc#g' ${RAMDISK_PATH}/usr/bin/busybox
sed -i '/^echo "START/a \\nmknod -m 0666 /dev/console c 1 3' ${RAMDISK_PATH}/linuxrc.syno
fi
# Broadwellntbap patches
if [ "${PLATFORM}" == "broadwellntbap" ]; then
if [ "${PLATFORM}" = "broadwellntbap" ]; then
echo -n " - Apply Broadwellntbap Fixes"
sed -i 's/IsUCOrXA="yes"/XIsUCOrXA="yes"/g; s/IsUCOrXA=yes/XIsUCOrXA=yes/g' ${RAMDISK_PATH}/usr/syno/share/environments.sh
fi
@@ -246,7 +247,7 @@ for F in $(ls -1 ${USER_UP_PATH}/*.sh 2>/dev/null); do
done
# Reassembly ramdisk
if [ "${RD_COMPRESSED}" == "true" ]; then
if [ "${RD_COMPRESSED}" = "true" ]; then
(cd "${RAMDISK_PATH}" && find . 2>/dev/null | cpio -o -H newc -R root:root | xz -9 --format=lzma >"${MOD_RDGZ_FILE}") >"${LOG_FILE}" 2>&1 || exit 1
else
(cd "${RAMDISK_PATH}" && find . 2>/dev/null | cpio -o -H newc -R root:root >"${MOD_RDGZ_FILE}") >"${LOG_FILE}" 2>&1 || exit 1

View File

@@ -3,7 +3,7 @@
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
. ${ARC_PATH}/include/functions.sh
. "${ARC_PATH}/include/functions.sh"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
@@ -14,61 +14,51 @@ KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver"
# Output: LE HEX with size of file in bytes (to STDOUT)
file_size_le() {
printf $(
dec_size=0
for F in "${@}"; do
fsize=$(stat -c "%s" ${F})
dec_size=$((${dec_size} + ${fsize}))
done
printf "%08x\n" ${dec_size} |
sed 's/\(..\)/\1 /g' | {
read ch0 ch1 ch2 ch3
for ch in ${ch3} ${ch2} ${ch1} ${ch0}; do
printf '%s%03o' '\' $((0x${ch}))
done
local dec_size=0
for F in "$@"; do dec_size=$((dec_size + $(stat -c "%s" "${F}"))); done
printf "%08x\n" "${dec_size}" | sed 's/\(..\)/\1 /g' | {
read -r ch0 ch1 ch2 ch3
for ch in "${ch3}" "${ch2}" "${ch1}" "${ch0}"; do printf '%s%03o' '\' "$((0x${ch}))"; done
}
)
}
size_le() {
printf $(
printf "%08x\n" "${@}" |
sed 's/\(..\)/\1 /g' | {
read ch0 ch1 ch2 ch3
for ch in ${ch3} ${ch2} ${ch1} ${ch0}; do
printf '%s%03o' '\' $((0x${ch}))
done
printf "%08x\n" "${@}" | sed 's/\(..\)/\1 /g' | {
read -r ch0 ch1 ch2 ch3
for ch in "${ch3}" "${ch2}" "${ch1}" "${ch0}"; do printf '%s%03o' '\' "$((0x${ch}))"; done
}
)
}
VMLINUX_MOD=${1}
ZIMAGE_MOD=${2}
KVER_MAJOR=${KVER:0:1}
if [ ${KVER_MAJOR} -eq 4 ]; then
if [ "$(echo "${KVER:-4}" | cut -d'.' -f1)" -lt 5 ]; then
# Kernel version 4.x or 3.x (bromolow)
#zImage_head 16494
#payload(
# vmlinux.bin x
# padding 0xf00000-x
# vmlinux.bin size 4
#) 0xf00004
#zImage_tail(
# unknown 72
# run_size 4
# unknown 30
# vmlinux.bin size 4
# unknown 114460
#) 114570
#crc32 4
# zImage_head 16494
# payload(
# vmlinux.bin x
# padding 0xf00000-x
# vmlinux.bin size 4
# ) 0xf00004
# zImage_tail(
# unknown 72
# run_size 4
# unknown 30
# vmlinux.bin size 4
# unknown 114460
# ) 114570
# crc32 4
gzip -dc "${ARC_PATH}/bzImage-template-v4.gz" >"${ZIMAGE_MOD}" || exit 1
dd if="${VMLINUX_MOD}" of="${ZIMAGE_MOD}" bs=16494 seek=1 conv=notrunc || exit 1
file_size_le "${VMLINUX_MOD}" | dd of="${ZIMAGE_MOD}" bs=15745134 seek=1 conv=notrunc || exit 1
file_size_le "${VMLINUX_MOD}" | dd of="${ZIMAGE_MOD}" bs=15745244 seek=1 conv=notrunc || exit 1
RUN_SIZE=$(objdump -h ${VMLINUX_MOD} | sh "${ARC_PATH}/calc_run_size.sh")
size_le ${RUN_SIZE} | dd of=${ZIMAGE_MOD} bs=15745210 seek=1 conv=notrunc|| exit 1
size_le $(($((16#$(crc32 "${ZIMAGE_MOD}" | awk '{print $1}'))) ^ 0xFFFFFFFF)) | dd of="${ZIMAGE_MOD}" conv=notrunc oflag=append || exit 1
RUN_SIZE=$(objdump -h "${VMLINUX_MOD}" | sh "${ARC_PATH}/calc_run_size.sh")
size_le "${RUN_SIZE}" | dd of="${ZIMAGE_MOD}" bs=15745210 seek=1 conv=notrunc || exit 1
size_le "$((16#$(crc32 "${ZIMAGE_MOD}" | awk '{print $1}') ^ 0xFFFFFFFF))" | dd of="${ZIMAGE_MOD}" conv=notrunc oflag=append || exit 1
else
# Kernel version 5.x
gzip -dc "${ARC_PATH}/bzImage-template-v5.gz" >"${ZIMAGE_MOD}" || exit 1
@@ -76,7 +66,7 @@ else
dd if="${VMLINUX_MOD}" of="${ZIMAGE_MOD}" bs=14561 seek=1 conv=notrunc || exit 1
file_size_le "${VMLINUX_MOD}" | dd of="${ZIMAGE_MOD}" bs=34463421 seek=1 conv=notrunc || exit 1
file_size_le "${VMLINUX_MOD}" | dd of="${ZIMAGE_MOD}" bs=34479132 seek=1 conv=notrunc || exit 1
# RUN_SIZE=$(objdump -h ${VMLINUX_MOD} | sh "${ARC_PATH}/calc_run_size.sh")
# size_le ${RUN_SIZE} | dd of=${ZIMAGE_MOD} bs=34626904 seek=1 conv=notrunc || exit 1
size_le $(($((16#$(crc32 "${ZIMAGE_MOD}" | awk '{print $1}'))) ^ 0xFFFFFFFF)) | dd of="${ZIMAGE_MOD}" conv=notrunc oflag=append || exit 1
# RUN_SIZE=$(objdump -h "${VMLINUX_MOD}" | sh "${ARC_PATH}/calc_run_size.sh")
# size_le "${RUN_SIZE}" | dd of="${ZIMAGE_MOD}" bs=34626904 seek=1 conv=notrunc || exit 1
size_le "$((16#$(crc32 "${ZIMAGE_MOD}" | awk '{print $1}') ^ 0xFFFFFFFF))" | dd of="${ZIMAGE_MOD}" conv=notrunc oflag=append || exit 1
fi

View File

@@ -2,7 +2,7 @@
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
. ${ARC_PATH}/include/functions.sh
. "${ARC_PATH}/include/functions.sh"
set -o pipefail # Get exit code from process piped
@@ -12,22 +12,22 @@ set -o pipefail # Get exit code from process piped
rm -f "${MOD_ZIMAGE_FILE}"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
if [ "${KERNEL}" == "custom" ]; then
if [ "${KERNEL}" = "custom" ]; then
echo -n " - Using customized Kernel"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
# Modify KVER for Epyc7002
[ "${PLATFORM}" == "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
# Extract bzImage
gzip -dc "${CUSTOM_PATH}/bzImage-${PLATFORM}-${KVERP}.gz" >"${MOD_ZIMAGE_FILE}"
else
# Extract vmlinux
${ARC_PATH}/bzImage-to-vmlinux.sh "${ORI_ZIMAGE_FILE}" "${TMP_PATH}/vmlinux" >"${LOG_FILE}" 2>&1 || dieLog
"${ARC_PATH}/bzImage-to-vmlinux.sh" "${ORI_ZIMAGE_FILE}" "${TMP_PATH}/vmlinux" >"${LOG_FILE}" 2>&1 || dieLog
# Patch boot params and ramdisk check
${ARC_PATH}/kpatch "${TMP_PATH}/vmlinux" "${TMP_PATH}/vmlinux-mod" >"${LOG_FILE}" 2>&1 || dieLog
"${ARC_PATH}/kpatch" "${TMP_PATH}/vmlinux" "${TMP_PATH}/vmlinux-mod" >"${LOG_FILE}" 2>&1 || dieLog
# rebuild zImage
${ARC_PATH}/vmlinux-to-bzImage.sh "${TMP_PATH}/vmlinux-mod" "${MOD_ZIMAGE_FILE}" >"${LOG_FILE}" 2>&1 || dieLog
"${ARC_PATH}/vmlinux-to-bzImage.sh" "${TMP_PATH}/vmlinux-mod" "${MOD_ZIMAGE_FILE}" >"${LOG_FILE}" 2>&1 || dieLog
fi
sync

View File

@@ -12,7 +12,6 @@ insmod fat
insmod ext2
insmod ata
insmod btrfs
insmod ntfs
insmod part_msdos
insmod part_gpt
@@ -49,21 +48,16 @@ function load_video {
load_video
if loadfont unicode; then
if keystatus --shift; then true ; else
insmod gfxterm
set gfxmode=1024x768
set gfxpayload=auto
terminal_output gfxterm
if terminal_output gfxterm; then true ; else
terminal gfxterm
fi
insmod gfxmenu
loadfont ${prefix}/theme/dejavu_bold_14.pf2
loadfont ${prefix}/theme/dejavu_mono_12.pf2
insmod png
set theme=${prefix}/theme/theme.txt
export theme
fi
insmod gfxterm
set gfxmode=1280x720x32,1024x768x32,auto
set gfxpayload=auto
terminal_output gfxterm
insmod gfxmenu
loadfont ${prefix}/theme/dejavu_bold_14.pf2
loadfont ${prefix}/theme/dejavu_mono_12.pf2
insmod png
set theme=${prefix}/theme/theme.txt
export theme
fi
if serial --unit=0 --speed=115200; then
@@ -83,7 +77,7 @@ set menu_color_normal=white/black
set menu_color_highlight=white/red
set color_normal=white/black
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait net.ifnames=0 ipv6.disable=1"
set ARC_CMDLINE="earlyprintk earlycon=uart8250,io,0x3f8,115200n8 console=ttyS0,115200n8 root=/dev/ram rootwait nointremap net.ifnames=0 panic=5 split_lock_detect=off pcie_aspm=off intel_pstate=passive nox2apic nomodeset"
search --set=root --label "ARC3"
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
@@ -104,7 +98,11 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline}
echo "Loading Arc Initramfs..."
initrd /initrd-arc
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
fi
@@ -115,7 +113,11 @@ if [ -e /automated ]; then
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} automated_arc
echo "Loading Arc Initramfs..."
initrd /initrd-arc
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
fi
@@ -125,7 +127,11 @@ menuentry 'Arc Config Mode' --id config {
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} force_arc
echo "Loading Arc Initramfs..."
initrd /initrd-arc
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
@@ -135,7 +141,11 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} update_arc
echo "Loading Arc Initramfs..."
initrd /initrd-arc
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
menuentry 'DSM Recovery Mode' --id recovery {
@@ -143,7 +153,11 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} recovery
echo "Loading Arc Initramfs..."
initrd /initrd-arc
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
menuentry 'DSM Reinstall Mode' --id junior {
@@ -151,7 +165,11 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
echo "Loading Arc Kernel..."
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} force_junior
echo "Loading Arc Initramfs..."
initrd /initrd-arc
if [ -e /initrd-user ]; then
initrd /initrd-arc /initrd-user
else
initrd /initrd-arc
fi
echo "Booting..."
}
fi

View File

@@ -1,5 +0,0 @@
Check:
- numa=off
- pcie_aspm=off
- intremap=off (old -> working?)

View File

@@ -1,110 +0,0 @@
#!/usr/bin/env bash
set -e
# Clean cached Files
sudo git clean -fdx
. scripts/func.sh
# Get extractor, LKM, addons and Modules
getLKMs "files/p3/lkms"
getAddons "files/p3/addons"
getModules "files/p3/modules"
getConfigs "files/p3/configs"
getPatches "files/p3/patches"
getCustom "files/p3/custom"
getTheme "files/p1/boot/grub"
getOffline "files/p3/offline"
getBuildroots "latest" "brs"
getBuildrootx "latest" "brx"
# Sbase
IMAGE_FILE="arc.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[[ ! -f "brs/bzImage-arc" || ! -f "brs/initrd-arc" ]] && return 1
VERSION=$(date +'%y.%m.dev')
echo "${VERSION}" >files/p1/ARC-VERSION
echo "${VERSION}" >VERSION
echo "stable" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
echo "Repack initrd"
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
# Xbase
IMAGE_FILE="arc-next.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[[ ! -f "brx/bzImage-arc" || ! -f "brx/initrd-arc" ]] && return 1
VERSION=$(date +'%y.%m.dev')
echo "${VERSION}" >files/p1/ARC-VERSION
echo "${VERSION}" >VERSION
echo "next" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
echo "Repack initrd"
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-next-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-next.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-next.vhdx

View File

@@ -5,18 +5,20 @@ set -e
# Clean cached Files
sudo git clean -fdx
. scripts/func.sh
. scripts/func.sh "${AUX_TOKEN}"
# Get extractor, LKM, addons and Modules
getLKMs "files/p3/lkms"
echo "Get Dependencies"
getAddons "files/p3/addons"
getModules "files/p3/modules"
getConfigs "files/p3/configs"
getPatches "files/p3/patches"
getCustom "files/p3/custom"
getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
getOffline "files/p3/offline"
getBuildroots "latest" "brs"
getOffline "files/p3/configs"
mkdir -p "brx"
[ ! -f "../brx/bzImage" ] && getBuildrootx "brx" || copyBuildroot "brx"
# Sbase
IMAGE_FILE="arc.img"
@@ -34,21 +36,26 @@ mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[[ ! -f "brs/bzImage-arc" || ! -f "brs/initrd-arc" ]] && return 1
VERSION=$(date +'%y.%m.dev')
echo "${VERSION}" >files/p1/ARC-VERSION
echo "${VERSION}" >VERSION
echo "stable" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="13.37.dev"
ARC_BRANCH="next"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
echo "Repack initrd"
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
if [ -f "brx/bzImage-arc" ] && [ -f "brx/initrd-arc" ]; then
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
else
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
exit 1
fi
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
@@ -59,6 +66,4 @@ rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk

View File

@@ -1,64 +0,0 @@
#!/usr/bin/env bash
set -e
# Clean cached Files
sudo git clean -fdx
. scripts/func.sh
# Get extractor, LKM, addons and Modules
getLKMs "files/p3/lkms"
getAddons "files/p3/addons"
getModules "files/p3/modules"
getConfigs "files/p3/configs"
getPatches "files/p3/patches"
getCustom "files/p3/custom"
getTheme "files/p1/boot/grub"
getOffline "files/p3/offline"
getBuildrootx "latest" "brx"
# Xbase
IMAGE_FILE="arc-next.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[[ ! -f "brx/bzImage-arc" || ! -f "brx/initrd-arc" ]] && return 1
VERSION=$(date +'%y.%m.dev')
echo "${VERSION}" >files/p1/ARC-VERSION
echo "${VERSION}" >VERSION
echo "next" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
echo "Repack initrd"
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-next-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-next.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-next.vhdx

68
img-gen-s.sh Executable file
View File

@@ -0,0 +1,68 @@
#!/usr/bin/env bash
set -e
# Clean cached Files
sudo git clean -fdx
. scripts/func.sh "${AUX_TOKEN}"
# Get extractor, LKM, addons and Modules
echo "Get Dependencies"
getAddons "files/p3/addons"
getModules "files/p3/modules"
getConfigs "files/p3/configs"
getPatches "files/p3/patches"
getCustom "files/p3/custom"
getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
getOffline "files/p3/configs"
[ -f "../brs/bzImage" ] && copyBuildroot "brs" || getBuildroots "brs"
# Sbase
IMAGE_FILE="arc.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="13.37.dev"
ARC_BRANCH="stable"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
echo "Repack initrd"
if [ -f "brs/bzImage-arc" ] && [ -f "brs/initrd-arc" ]; then
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
else
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
exit 1
fi
echo "Copying files"
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk

View File

@@ -1,319 +1,280 @@
#!/usr/bin/env bash
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# Get Extractor
# $1 path
function getExtractor() {
echo "Getting syno extractor begin"
local DEST_PATH="${1:-extractor}"
local CACHE_DIR="/tmp/pat"
rm -rf "${CACHE_DIR}"
mkdir -p "${CACHE_DIR}"
# Download pat file
# global.synologydownload.com, global.download.synology.com, cndl.synology.cn
local PAT_URL="https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_DS3622xs%2B_42218.pat"
local PAT_FILE="DSM_DS3622xs+_42218.pat"
local STATUS=$(curl -# -w "%{http_code}" -L "${PAT_URL}" -o "${CACHE_DIR}/${PAT_FILE}")
if [ $? -ne 0 ] || [ ${STATUS} -ne 200 ]; then
echo "[E] DSM_DS3622xs%2B_42218.pat download error!"
rm -rf ${CACHE_DIR}
exit 1
fi
mkdir -p "${CACHE_DIR}/ramdisk"
tar -C "${CACHE_DIR}/ramdisk/" -xf "${CACHE_DIR}/${PAT_FILE}" rd.gz 2>&1
if [ $? -ne 0 ]; then
echo "[E] extractor rd.gz error!"
rm -rf ${CACHE_DIR}
exit 1
fi
(
cd "${CACHE_DIR}/ramdisk"
xz -dc <rd.gz | cpio -idm
) >/dev/null 2>&1 || true
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
# Copy only necessary files
for f in libcurl.so.4 libmbedcrypto.so.5 libmbedtls.so.13 libmbedx509.so.1 libmsgpackc.so.2 libsodium.so libsynocodesign-ng-virtual-junior-wins.so.7; do
cp -f "${CACHE_DIR}/ramdisk/usr/lib/${f}" "${DEST_PATH}"
done
cp -f "${CACHE_DIR}/ramdisk/usr/syno/bin/scemd" "${DEST_PATH}/syno_extract_system_patch"
# Clean up
rm -rf ${CACHE_DIR}
echo "Getting syno extractor end"
}
[ -n "${1}" ] && export TOKEN="${1}"
# Get latest LKMs
# $1 path
function getLKMs() {
echo "Getting LKMs begin"
local DEST_PATH="${1:-lkms}"
local DEST_PATH="${1}"
local CACHE_FILE="/tmp/rp-lkms.zip"
rm -f "${CACHE_FILE}"
if [ -n "${LKMTAG}" ]; then
TAG="${LKMTAG}"
TAG="$(curl -s "https://api.github.com/repos/AuxXxilium/arc-lkm/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")')"
export LKMTAG="${TAG}"
if curl -skL "https://github.com/AuxXxilium/arc-lkm/releases/download/${TAG}/rp-lkms.zip" -o "${CACHE_FILE}"; then
# Unzip LKMs
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting LKMs end - ${TAG}"
else
TAG="$(curl -s "https://api.github.com/repos/AuxXxilium/arc-lkm/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")')"
echo "Failed to get LKMs"
exit 1
fi
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-lkm/releases/download/${TAG}/rp-lkms.zip" -o "${CACHE_FILE}")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
# Unzip LKMs
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting LKMs end - ${TAG}"
}
# Get latest Addons
# $1 path
function getAddons() {
echo "Getting Addons begin"
local DEST_PATH="${1:-addons}"
local DEST_PATH="${1}"
local CACHE_DIR="/tmp/addons"
local CACHE_FILE="/tmp/addons.zip"
if [ -n "${ADDONSTAG}" ]; then
TAG="${ADDONSTAG}"
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-addons/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
export ADDONTAG="${TAG}"
if curl -skL "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/addons-${TAG}.zip" -o "${CACHE_FILE}"; then
# Unzip Addons
rm -rf "${CACHE_DIR}"
mkdir -p "${CACHE_DIR}"
mkdir -p "${DEST_PATH}"
unzip -o "${CACHE_FILE}" -d "${CACHE_DIR}"
echo "Installing Addons to ${DEST_PATH}"
[ -f /tmp/addons/VERSION ] && cp -f /tmp/addons/VERSION ${DEST_PATH}/
for PKG in $(ls ${CACHE_DIR}/*.addon); do
ADDON=$(basename "${PKG}" .addon)
mkdir -p "${DEST_PATH}/${ADDON}"
echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"
tar -xaf "${PKG}" -C "${DEST_PATH}/${ADDON}"
done
rm -f "${CACHE_FILE}"
echo "Getting Addons end - ${TAG}"
else
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-addons/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
echo "Failed to get Addons"
exit 1
fi
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/addons.zip" -o "${CACHE_FILE}")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
# Install Addons
rm -rf "${CACHE_DIR}"
mkdir -p "${CACHE_DIR}"
unzip "${CACHE_FILE}" -d "${CACHE_DIR}"
echo "Installing Addons to ${DEST_PATH}"
[ -f /tmp/addons/VERSION ] && cp -f /tmp/addons/VERSION ${DEST_PATH}/
for PKG in $(ls ${CACHE_DIR}/*.addon); do
ADDON=$(basename "${PKG}" .addon)
mkdir -p "${DEST_PATH}/${ADDON}"
echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"
tar -xaf "${PKG}" -C "${DEST_PATH}/${ADDON}"
done
rm -f "${CACHE_FILE}"
echo "Getting Addons end - ${TAG}"
}
# Get latest Modules
# $1 path
function getModules() {
echo "Getting Modules begin"
local DEST_PATH="${1:-modules}"
local DEST_PATH="${1}"
local CACHE_FILE="/tmp/modules.zip"
rm -f "${CACHE_FILE}"
if [ -n "${MODULESTAG}" ]; then
TAG="${MODULESTAG}"
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-modules/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
export MODULETAG="${TAG}"
if curl -skL "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules-${TAG}.zip" -o "${CACHE_FILE}"; then
# Unzip Modules
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
echo "Getting Modules end - ${TAG}"
else
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-modules/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
echo "Failed to get Modules"
exit 1
fi
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules.zip" -o "${CACHE_FILE}")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
# Unzip Modules
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Modules end - ${TAG}"
}
# Get latest Configs
# $1 path
function getConfigs() {
echo "Getting Configs begin"
local DEST_PATH="${1:-configs}"
local DEST_PATH="${1}"
local CACHE_FILE="/tmp/configs.zip"
rm -f "${CACHE_FILE}"
if [ -n "${CONFIGSTAG}" ]; then
TAG="${CONFIGSTAG}"
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-configs/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
export CONFIGTAG="${TAG}"
if curl -skL "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs-${TAG}.zip" -o "${CACHE_FILE}"; then
# Unzip Configs
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Configs end - ${TAG}"
else
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-configs/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
echo "Failed to get Configs"
exit 1
fi
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip" -o "${CACHE_FILE}")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
# Unzip Configs
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Configs end - ${TAG}"
}
# Get latest Patches
# $1 path
function getPatches() {
echo "Getting Patches begin"
local DEST_PATH="${1:-patches}"
local DEST_PATH="${1}"
local CACHE_FILE="/tmp/patches.zip"
rm -f "${CACHE_FILE}"
if [ -n "${PATCHESTAG}" ]; then
TAG="${PATCHESTAG}"
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-patches/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
export PATCHTAG="${TAG}"
if curl -skL "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/patches-${TAG}.zip" -o "${CACHE_FILE}"; then
# Unzip Patches
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Patches end - ${TAG}"
else
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-patches/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
echo "Failed to get Patches"
exit 1
fi
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/patches.zip" -o "${CACHE_FILE}")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
# Unzip Patches
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Patches end - ${TAG}"
}
# Get latest Custom
# $1 path
function getCustom() {
echo "Getting Custom begin"
local DEST_PATH="${1:-custom}"
local DEST_PATH="${1}"
local CACHE_FILE="/tmp/custom.zip"
rm -f "${CACHE_FILE}"
if [ -n "${CUSTOMTAG}" ]; then
TAG="${CUSTOMTAG}"
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-custom/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
export CUSTOMTAG="${TAG}"
if curl -skL "https://github.com/AuxXxilium/arc-custom/releases/download/${TAG}/custom-${TAG}.zip" -o "${CACHE_FILE}"; then
# Unzip Custom
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Custom end - ${TAG}"
else
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-custom/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
echo "Failed to get Custom"
exit 1
fi
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-custom/releases/download/${TAG}/custom.zip" -o "${CACHE_FILE}")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
# Unzip Custom
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Custom end - ${TAG}"
}
# Get latest Theme
# $1 path
function getTheme() {
echo "Getting Theme begin"
local DEST_PATH="${1:-theme}"
local DEST_PATH="${1}"
local CACHE_FILE="/tmp/theme.zip"
rm -f "${CACHE_FILE}"
if [ -n "${THEMETAG}" ]; then
TAG="${THEMETAG}"
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-theme/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
export THEMETAG="${TAG}"
if curl -skL "https://github.com/AuxXxilium/arc-theme/releases/download/${TAG}/arc-theme-${TAG}.zip" -o "${CACHE_FILE}"; then
# Unzip Theme
mkdir -p "${DEST_PATH}"
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Theme end - ${TAG}"
else
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-theme/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
echo "Failed to get Theme"
exit 1
fi
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-theme/releases/download/${TAG}/arc-theme.zip" -o "${CACHE_FILE}")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
# Unzip Theme
mkdir -p "${DEST_PATH}"
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
rm -f "${CACHE_FILE}"
echo "Getting Theme end - ${TAG}"
}
# Get latest Buildroot-X
# $1 TAG
# $2 path
# $1 path
function getBuildrootx() {
echo "Getting Buildroot-X begin"
TAG="${1:-latest}"
local DEST_PATH="${2:-brx}"
local DEST_PATH="${1}"
if [ "${TAG}" = "latest" ]; then
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
fi
TAG=$(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
export BRXTAG="${TAG}"
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
rm -f "${DEST_PATH}/bzImage-arc"
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot-x/releases/download/${TAG}/bzImage" -o "${DEST_PATH}/bzImage-arc")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
rm -f "${DEST_PATH}/initrd-arc"
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot-x/releases/download/${TAG}/rootfs.cpio.xz" -o "${DEST_PATH}/initrd-arc")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
echo "Getting Buildroot-X end - ${TAG}"
while read -r ID NAME; do
if [ "${NAME}" = "buildroot-${TAG}.zip" ]; then
curl -kL -H "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases/assets/${ID}" -o "${DEST_PATH}/brx.zip"
echo "Buildroot-X: ${TAG}"
unzip -o "${DEST_PATH}/brx.zip" -d "${DEST_PATH}"
mv -f "${DEST_PATH}/bzImage" "${DEST_PATH}/bzImage-arc"
mv -f "${DEST_PATH}/rootfs.cpio.zst" "${DEST_PATH}/initrd-arc"
[ -f "${DEST_PATH}/bzImage-arc" ] && [ -f "${DEST_PATH}/initrd-arc" ] && break
fi
done <<<$(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
}
# Get latest Buildroot-S
# $1 TAG
# $2 path
# $1 path
function getBuildroots() {
echo "Getting Buildroot-S begin"
TAG="${1:-latest}"
local DEST_PATH="${2:-brs}"
local DEST_PATH="${1}"
if [ "${TAG}" = "latest" ]; then
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
fi
TAG=$(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
export BRSTAG="${TAG}"
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
rm -f "${DEST_PATH}/bzImage-arc"
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot-s/releases/download/${TAG}/bzImage" -o "${DEST_PATH}/bzImage-arc")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
rm -f "${DEST_PATH}/initrd-arc"
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot-s/releases/download/${TAG}/rootfs.cpio.xz" -o "${DEST_PATH}/initrd-arc")
echo "TAG=${TAG}; Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
echo "Getting Buildroot-S end - ${TAG}"
while read -r ID NAME; do
if [ "${NAME}" = "buildroot-${TAG}.zip" ]; then
curl -kL -H "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases/assets/${ID}" -o "${DEST_PATH}/brs.zip"
echo "Buildroot-S: ${TAG}"
unzip -o "${DEST_PATH}/brs.zip" -d "${DEST_PATH}"
mv -f "${DEST_PATH}/bzImage" "${DEST_PATH}/bzImage-arc"
mv -f "${DEST_PATH}/rootfs.cpio.zst" "${DEST_PATH}/initrd-arc"
[ -f "${DEST_PATH}/bzImage-arc" ] && [ -f "${DEST_PATH}/initrd-arc" ] && break
fi
done <<<$(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
}
# Get latest Offline
# $1 path
function getOffline() {
echo "Getting Offline begin"
local DEST_PATH="${1:-configs}"
local DEST_PATH="${1}"
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
rm -f "${DEST_PATH}/offline.json"
STATUS=$(curl -w "%{http_code}" -L "https://autoupdate.synology.com/os/v2" -o "${DEST_PATH}/offline.json")
echo "Status=${STATUS}"
[ ${STATUS} -ne 200 ] && exit 1
echo "Getting Offline end"
rm -f "${DEST_PATH}/data.yml"
if curl -skL "https://raw.githubusercontent.com/AuxXxilium/arc-dsm/refs/heads/main/data.yml" -o "${DEST_PATH}/data.yml"; then
echo "Getting Offline end"
else
echo "Failed to get Offline"
exit 1
fi
}
# repack initrd
# $1 initrd file
# $1 initrd file
# $2 plugin path
# $3 output file
function repackInitrd() {
INITRD_FILE="${1}"
PLUGIN_PATH="${2}"
OUTPUT_PATH="${3:-${INITRD_FILE}}"
local INITRD_FILE="${1}"
local PLUGIN_PATH="${2}"
local OUTPUT_PATH="${3:-${INITRD_FILE}}"
[ -z "${INITRD_FILE}" ] || [ ! -f "${INITRD_FILE}" ] && exit 1
[ -z "${PLUGIN_PATH}" ] || [ ! -d "${PLUGIN_PATH}" ] && exit 1
INITRD_FILE="$(readlink -f "${INITRD_FILE}")"
PLUGIN_PATH="$(readlink -f "${PLUGIN_PATH}")"
OUTPUT_PATH="$(readlink -f "${OUTPUT_PATH}")"
RDXZ_PATH="rdxz_tmp"
local RDXZ_PATH="rdxz_tmp"
mkdir -p "${RDXZ_PATH}"
(
cd "${RDXZ_PATH}"
sudo xz -dc <"${INITRD_FILE}" | sudo cpio -idm
) || true
sudo cp -Rf "${PLUGIN_PATH}/"* "${RDXZ_PATH}/"
local INITRD_FORMAT=$(file -b --mime-type "${INITRD_FILE}")
case "${INITRD_FORMAT}" in
*'x-cpio'*) (cd "${RDXZ_PATH}" && sudo cpio -idm <"${INITRD_FILE}") >/dev/null 2>&1 ;;
*'x-xz'*) (cd "${RDXZ_PATH}" && xz -dc "${INITRD_FILE}" | sudo cpio -idm) >/dev/null 2>&1 ;;
*'x-lz4'*) (cd "${RDXZ_PATH}" && lz4 -dc "${INITRD_FILE}" | sudo cpio -idm) >/dev/null 2>&1 ;;
*'x-lzma'*) (cd "${RDXZ_PATH}" && lzma -dc "${INITRD_FILE}" | sudo cpio -idm) >/dev/null 2>&1 ;;
*'x-bzip2'*) (cd "${RDXZ_PATH}" && bzip2 -dc "${INITRD_FILE}" | sudo cpio -idm) >/dev/null 2>&1 ;;
*'gzip'*) (cd "${RDXZ_PATH}" && gzip -dc "${INITRD_FILE}" | sudo cpio -idm) >/dev/null 2>&1 ;;
*'zstd'*) (cd "${RDXZ_PATH}" && zstd -dc "${INITRD_FILE}" | sudo cpio -idm) >/dev/null 2>&1 ;;
*) ;;
esac
sudo cp -rf "${PLUGIN_PATH}/"* "${RDXZ_PATH}/"
[ -f "${OUTPUT_PATH}" ] && rm -rf "${OUTPUT_PATH}"
(
cd "${RDXZ_PATH}"
sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | xz -9 --check=crc32 >"${OUTPUT_PATH}"
) || true
case "${INITRD_FORMAT}" in
*'x-cpio'*) (cd "${RDXZ_PATH}" && sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root >"${OUTPUT_PATH}") >/dev/null 2>&1 ;;
*'x-xz'*) (cd "${RDXZ_PATH}" && sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | xz -9 -C crc32 -c - >"${OUTPUT_PATH}") >/dev/null 2>&1 ;;
*'x-lz4'*) (cd "${RDXZ_PATH}" && sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | lz4 -9 -l -c - >"${OUTPUT_PATH}") >/dev/null 2>&1 ;;
*'x-lzma'*) (cd "${RDXZ_PATH}" && sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | lzma -9 -c - >"${OUTPUT_PATH}") >/dev/null 2>&1 ;;
*'x-bzip2'*) (cd "${RDXZ_PATH}" && sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | bzip2 -9 -c - >"${OUTPUT_PATH}") >/dev/null 2>&1 ;;
*'gzip'*) (cd "${RDXZ_PATH}" && sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | gzip -9 -c - >"${OUTPUT_PATH}") >/dev/null 2>&1 ;;
*'zstd'*) (cd "${RDXZ_PATH}" && sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | zstd -19 -T0 -f -c - >"${OUTPUT_PATH}") >/dev/null 2>&1 ;;
*) ;;
esac
sudo rm -rf "${RDXZ_PATH}"
}
@@ -387,7 +348,7 @@ function convertova() {
# Create VM configuration
cat <<_EOF_ >"OVA_${VMNAME}/${VMNAME}.vmx"
.encoding = "GBK"
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "21"
displayName = "${VMNAME}"
@@ -437,6 +398,9 @@ ethernet0.virtualDev = "vmxnet3"
ethernet0.connectionType = "nat"
ethernet0.allowguestconnectioncontrol = "true"
ethernet0.present = "TRUE"
serial0.fileType = "file"
serial0.fileName = "serial0.log"
serial0.present = "TRUE"
sata0.present = "TRUE"
sata0:0.fileName = "${VMNAME}-disk1.vmdk"
sata0:0.present = "TRUE"
@@ -448,3 +412,12 @@ _EOF_
ovftool/ovftool "OVA_${VMNAME}/${VMNAME}.vmx" "${OVAPATH}"
rm -rf "OVA_${VMNAME}"
}
# copy buildroot
function copyBuildroot() {
DEST_PATH="${1}"
rm -rf "${DEST_PATH}"
mkdir -p "${DEST_PATH}"
cp -f "../${DEST_PATH}/bzImage" "${DEST_PATH}/bzImage-arc"
cp -f "../${DEST_PATH}/rootfs.cpio.zst" "${DEST_PATH}/initrd-arc"
}

View File

@@ -29,8 +29,8 @@ done
popd
rm -f grub.img
dd if=/dev/zero of=grub.img bs=1M seek=1536 count=0
echo -e "n\np\n1\n\n+50M\nn\np\n2\n\n+100M\nn\np\n3\n\n\na\n1\nw\nq\n" | fdisk grub.img
dd if=/dev/zero of=grub.img bs=1M seek=1024 count=0
echo -e "n\np\n1\n\n+50M\nn\np\n2\n\n+50M\nn\np\n3\n\n\na\n1\nw\nq\n" | fdisk grub.img
fdisk -l grub.img
LOOPX=$(sudo losetup -f)