forked from wummle/arkos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdate-RG351P.sh
More file actions
2332 lines (1745 loc) · 134 KB
/
Copy pathUpdate-RG351P.sh
File metadata and controls
2332 lines (1745 loc) · 134 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
clear
UPDATE_DATE="07182026"
LOG_FILE="/home/ark/update$UPDATE_DATE.log"
UPDATE_DONE="/home/ark/.config/.update$UPDATE_DATE"
if [ -f "$UPDATE_DONE" ] && [ -f "/home/ark/.config/.kernelupdate02032021" ]; then
msgbox "No more updates available. Check back later."
rm -- "$0"
exit 187
fi
if [ -f "$LOG_FILE" ]; then
sudo rm "$LOG_FILE"
fi
c_brightness="$(cat /sys/devices/platform/backlight/backlight/backlight/brightness)"
sudo chmod 666 /dev/tty1
echo 255 > /sys/devices/platform/backlight/backlight/backlight/brightness
touch $LOG_FILE
tail -f $LOG_FILE >> /dev/tty1 &
if [ ! -f "/home/ark/.config/.update07152021" ]; then
printf "\nRetroArch 1.9.6 and add GX4000\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/07152021/arkosupdate07152021.zip -O /home/ark/arkosupdate07152021.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate07152021.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate07152021.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate07152021.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate07152021.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update07152021"
fi
if [ ! -f "/home/ark/.config/.update08092021" ]; then
printf "\nStreet of Rage Remake, EasyRPG\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/08092021/arkosupdate08092021.zip -O /home/ark/arkosupdate08092021.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate08092021.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate08092021.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate08092021.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate08092021.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update08092021"
fi
if [ ! -f "/home/ark/.config/.update09052021" ]; then
printf "\nRetroArch 1.9.8, Correct permissions\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/09052021/arkosupdate09052021.zip -O /home/ark/arkosupdate09052021.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate09052021.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate09052021.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate09052021.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate09052021.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update09052021"
fi
if [ ! -f "/home/ark/.config/.update09062021" ]; then
printf "\nAdd missing cue extension for Playstation, add files for EasyRPG, add liblcf, libWildMidi, and libxmp\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/09062021/arkosupdate09062021.zip -O /home/ark/arkosupdate09062021.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate09062021.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate09062021.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate09062021.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate09062021.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update09062021"
fi
if [ ! -f "/home/ark/.config/.update10212021" ]; then
printf "\nRetroArch 1.9.11, EmulationStation, add Channel F, mess libretro, quicknes, update nes-box theme, update ThemeMaster \n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/10212021/arkosupdate10212021.zip -O /home/ark/arkosupdate10212021.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate10212021.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate10212021.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate10212021.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate10212021.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update10212021"
fi
if [ ! -f "/home/ark/.config/.update10262021" ]; then
printf "\nRetroArch 1.9.11 update to hopefully fix missing assets error\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/10262021/arkosupdate10262021.zip -O /home/ark/arkosupdate10262021.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate10262021.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate10262021.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate10262021.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate10262021.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update10262021"
fi
if [ ! -f "/home/ark/.config/.update11172021" ]; then
printf "\nRetroArch 1.9.13, PPSSPP, EmulationStation\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/11172021/arkosupdate11172021.zip -O /home/ark/arkosupdate11172021.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate11172021.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate11172021.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate11172021.zip -d / | tee -a "$LOG_FILE"
sudo cp -f -v /usr/bin/emulationstation/emulationstation.351v /usr/bin/emulationstation/emulationstation | tee -a "$LOG_FILE"
sudo chmod 777 /usr/bin/emulationstation/emulationstation
sudo rm -v /usr/bin/emulationstation/emulationstation.351v | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate11172021.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nRemove old logs, cache and backup folder files from var folder\n" | tee -a "$LOG_FILE"
sudo rm -rfv /var/cache/* | tee -a "$LOG_FILE"
sudo rm -rfv /var/backups/* | tee -a "$LOG_FILE"
sudo journalctl --vacuum-time=1s | tee -a "$LOG_FILE"
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update11172021"
fi
if [ ! -f "/home/ark/.config/.update01132022" ]; then
printf "\nRetroArch 1.9.14, add np2kai libretro, add sameduck libretro, add 32-Bit GPSP GBA core, add megaduck and neshacks\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/01132022/arkosupdate01132022.zip -O /home/ark/arkosupdate01132022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate01132022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate01132022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate01132022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate01132022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update01132022"
fi
if [ ! -f "/home/ark/.config/.update01142022" ]; then
printf "\nGX4000 now using retroarch 1.9.6, add megaduck to nes-box theme\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/01142022/arkosupdate01142022.zip -O /home/ark/arkosupdate01142022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate01142022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate01142022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate01142022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate01142022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update01142022"
fi
if [ ! -f "/home/ark/.config/.update02142022" ]; then
printf "\nUpdate Retroarch, add snes9x2005 libretro, add pcsx_rearmed_peops libretro, add 351Files\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/02142022/arkosupdate02142022.zip -O /home/ark/arkosupdate02142022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate02142022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate02142022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate02142022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate02142022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update02142022"
fi
if [ ! -f "/home/ark/.config/.update05142022" ]; then
printf "\nUpdate extfat drivers, update RetroArch\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/05142022/arkosupdate05142022.zip -O /home/ark/arkosupdate05142022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate05142022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate05142022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate05142022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate05142022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
sudo apt remove -y exfat-fuse
sudo install -m644 -b -D -v /home/ark/exfat.ko.351 /lib/modules/$(uname -r)/kernel/fs/exfat/exfat.ko
sudo depmod -a
sudo modprobe -v exfat
sudo rm -v /home/ark/exfat.ko*
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.14.1 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.10.0 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update05142022"
fi
if [ ! -f "/home/ark/.config/.update06062022" ]; then
printf "\nUpdate SDL2 to 2.0.18.2, add libSDL2_gfx\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/06062022/arkosupdate06062022.zip -O /home/ark/arkosupdate06062022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate06062022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate06062022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate06062022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate06062022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
sudo mv -f -v /home/ark/sdl2-64/libSDL2-2.0.so.0.18.2.rotated /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.18.2 | tee -a "$LOG_FILE"
sudo mv -f -v /home/ark/sdl2-32/libSDL2-2.0.so.0.18.2.rotated /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.18.2 | tee -a "$LOG_FILE"
sudo rm -rfv /home/ark/sdl2-64 | tee -a "$LOG_FILE"
sudo rm -rfv /home/ark/sdl2-32 | tee -a "$LOG_FILE"
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.18.2 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.18.2 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update06062022"
fi
if [ ! -f "/home/ark/.config/.update10022022" ]; then
printf "\nUpdate retroarch info files to make save states work on rumble cores\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/10022022/arkosupdate10022022.zip -O /home/ark/arkosupdate10022022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate10022022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate10022022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate10022022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate10022022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.18.2 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.18.2 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update10022022"
fi
if [ ! -f "/home/ark/.config/.update12022022" ]; then
printf "\nAdd GZDoom, fix ecwolf screen resolution\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/12022022/arkosupdate12022022.zip -O /home/ark/arkosupdate12022022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate12022022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate12022022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate12022022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate12022022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
sudo chown -R ark:ark /opt/
sudo chmod ugo+rwx /opt/gzdoom/*
sudo chown -R ark:ark /home/ark/.config/gzdoom/
sudo chmod ugo+rwx -R /home/ark/.config/gzdoom/*
sudo chmod ugo+rwx /opt/quitter/*
sudo chmod 755 /usr/lib/aarch64-linux-gnu/libSDL2_gfx-1.0.so.0
sudo chmod 755 /usr/lib/aarch64-linux-gnu/libzmusic.so.1
sudo chmod 755 /usr/lib/aarch64-linux-gnu/libzmq.so.5.2.2
sudo chmod ugo+rwx /usr/local/bin/doom.sh
if test -z "$(grep 'standalone-gzdoom' /etc/emulationstation/es_systems.cfg | tr -d '\0')"
then
sed -i '/doom.sh/!{p;d;};n;a \\t\t <emulator name=\"\standalone-gzdoom\">\n\t\t <\/emulator>' /etc/emulationstation/es_systems.cfg
fi
cp -f -v /home/ark/.config/gzdoom/gzdoom.ini.351p /home/ark/.config/gzdoom/gzdoom.ini
rm -f -v /opt/gzdoom/gzdoom.351v
rm -f -v /opt/gzdoom/gzdoom.chi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.18.2 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.18.2 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle gaming" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update12022022"
fi
if [ ! -f "/home/ark/.config/.update12092022" ]; then
printf "\nPPSSPP 1.13.2-1665\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/12092022/arkosupdate12092022.zip -O /home/ark/arkosupdate12092022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate12092022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate12092022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate12092022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate12092022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
sudo chmod ugo+rwx /opt/ppsspp/PPSSPPSDL
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.18.2 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.18.2 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wuMMLe fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update12092022"
fi
if [ ! -f "/home/ark/.config/.update12102022" ]; then
printf "\nRetroArch 1.13.0\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/12102022/arkosupdate12102022.zip -O /home/ark/arkosupdate12102022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate12102022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate12102022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate12102022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate12102022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
sudo chmod ugo+rwx /opt/retroarch/bin/*
printf "\nClean up some old unneeded files in the system\n" | tee -a "$LOG_FILE"
sudo rm -rfv /var/cache/* | tee -a "$LOG_FILE"
sudo rm -rfv /var/backups/* | tee -a "$LOG_FILE"
sudo journalctl --vacuum-time=1s
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.18.2 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.18.2 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wuMMLe fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update12102022"
fi
if [ ! -f "/home/ark/.config/.update12202022" ]; then
printf "\nUpdate PPSSPP to 1.14, update RetroArch to 1.14.0, fix Playstation file extension typo (Credit to K-tec-UK) \n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/12202022/arkosupdate12202022.zip -O /home/ark/arkosupdate12202022.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate12202022.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate12202022.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate12202022.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate12202022.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.18.2 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.18.2 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wuMMLe fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update12202022"
fi
if [ ! -f "/home/ark/.config/.update02022023" ]; then
printf "\nUpdate PPSSPP to 1.14.4\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/02022023/arkosupdate02022023.zip -O /home/ark/arkosupdate02022023.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate02022023.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate02022023.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate02022023.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate02022023.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
sudo chmod ugo+rwx /opt/ppsspp/PPSSPPSDL
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.18.2 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.18.2 /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wuMMLe fork" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update02022023"
fi
if [ ! -f "/home/ark/.config/.update03262023" ]; then
printf "\nUpdate SDL2 to 2.0.26.2, RetroArch 1.15.0, Add swanstation PSX core, update mupen64plus, fix GZDoom for SDL2.0.26.2, update scummvm and drastic launchers, update filebrowser CLI\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/03262023/arkosupdate03262023.zip -O /home/ark/arkosupdate03262023.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate03262023.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate03262023.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate03262023.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate03262023.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
sudo chown -R ark:ark /opt/
sudo chmod ugo+rwx /opt/gzdoom/*
sudo chown -R ark:ark /home/ark/.config/gzdoom/
sudo chmod ugo+rwx -R /home/ark/.config/gzdoom/*
sudo chmod 755 /usr/lib/aarch64-linux-gnu/libzmusic.so.1
sudo chmod ugo+rwx /usr/local/bin/doom.sh
printf "\nInstall and link new SDL 2.0.2600.2 (aka SDL 2.0.26.2)\n" | tee -a "$LOG_FILE"
sudo mv -f -v /home/ark/sdl2-64/libSDL2-2.0.so.0.2600.2.rotated /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.2600.2 | tee -a "$LOG_FILE"
sudo mv -f -v /home/ark/sdl2-32/libSDL2-2.0.so.0.2600.2.rotated /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.2600.2 | tee -a "$LOG_FILE"
sudo rm -rfv /home/ark/sdl2-64 | tee -a "$LOG_FILE"
sudo rm -rfv /home/ark/sdl2-32 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2.so /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.2600.2 /usr/lib/aarch64-linux-gnu/libSDL2.so | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2.so /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.2600.2 /usr/lib/arm-linux-gnueabihf/libSDL2.so | tee -a "$LOG_FILE"
printf "\nUpdate RetroArch to v1.15.0 for 351p and 351m\n" | tee -a "$LOG_FILE"
cp -fv /opt/retroarch/bin/retroarch32.rk3326.rot /opt/retroarch/bin/retroarch32 | tee -a "$LOG_FILE"
cp -fv /opt/retroarch/bin/retroarch.rk3326.rot /opt/retroarch/bin/retroarch | tee -a "$LOG_FILE"
rm -fv /opt/retroarch/bin/retroarch.* | tee -a "$LOG_FILE"
rm -fv /opt/retroarch/bin/retroarch32.* | tee -a "$LOG_FILE"
printf "\nCrate backup of es_systems.cfg in case something goes wrong\n" | tee -a "$LOG_FILE"
cp -v /etc/emulationstation/es_systems.cfg /etc/emulationstation/es_systems.cfg.update03212023.bak | tee -a "$LOG_FILE"
printf "\nAdd swanstation libreto for psx to ES\n" | tee -a "$LOG_FILE"
if test -z "$(grep 'swanstation' /usr/local/bin/perfmax | tr -d '\0')"
then
sudo sed -i '/\[\[ \$2 == "duckstation" \]\]/s//\[\[ \$2 == "duckstation" \]\] || \[\[ \$2 == "swanstation" \]\] || \[\[ \$2 == *"uae"* \]\]/' /usr/local/bin/perfmax
sudo sed -i '/\[\[ \$2 == "duckstation" \]\]/s//\[\[ \$2 == "duckstation" \]\] || \[\[ \$2 == "swanstation" \]\] || \[\[ \$2 == *"uae"* \]\]/' /usr/local/bin/perfmax.pic
sudo sed -i '/\[\[ \$2 == "duckstation" \]\]/s//\[\[ \$2 == "duckstation" \]\] || \[\[ \$2 == "swanstation" \]\] || \[\[ \$2 == *"uae"* \]\]/' /usr/local/bin/perfmax.asc
fi
if test -z "$(grep 'swanstation' /etc/emulationstation/es_systems.cfg | tr -d '\0')"
then
sed -i '/<core>duckstation<\/core>/c\\t\t\t <core>duckstation<\/core>\n\t\t\t <core>swanstation<\/core>' /etc/emulationstation/es_systems.cfg
fi
cp -fv /home/ark/swanstation_libretro.so.rk3326 /home/ark/.config/retroarch/cores/swanstation_libretro.so | tee -a "$LOG_FILE"
mv -fv /home/ark/.config/retroarch/cores/swanstation_libretro.so.rk3326 /home/ark/.config/retroarch/cores/swanstation_libretro.so | tee -a "$LOG_FILE"
sudo rm -rf /home/ark/swanstation_libretro* | tee -a "$LOG_FILE"
printf "\nCleanup some unneeded left over files in the home folder from previous updates if need be\n" | tee -a "$LOG_FILE"
if [ $(ls -1 /home/ark/*.dtb 2>/dev/null | wc -l) != 0 ]; then
sudo rm -fv /home/ark/*.dtb | tee -a "$LOG_FILE"
sudo rm -fv /home/ark/*.v2 | tee -a "$LOG_FILE"
printf " Cleaned up some unneeded files found.\n" | tee -a "$LOG_FILE"
else
printf " No clean up needed.\n" | tee -a "$LOG_FILE"
fi
printf "\nEnable software renderer for swanstation by default\n" | tee -a "$LOG_FILE"
if test ! -z "$(cat /home/ark/.config/retroarch/retroarch-core-options.cfg | grep 'swanstation_GPU_Renderer' | tr -d '\0')"
then
sed -i '/swanstation_GPU_Renderer \= /c\swanstation_GPU_Renderer \= "Software"' /home/ark/.config/retroarch/retroarch-core-options.cfg
sed -i '/mgba_use_bios \= \"ON\"/c\mgba_use_bios \= \"ON\"\nswanstation_GPU_Renderer \= "Software"' /home/ark/.config/retroarch/retroarch-core-options.cfg.bak
else
sed -i '/mgba_use_bios \= \"ON\"/c\mgba_use_bios \= \"ON\"\nswanstation_GPU_Renderer \= "Software"' /home/ark/.config/retroarch/retroarch-core-options.cfg
sed -i '/mgba_use_bios \= \"ON\"/c\mgba_use_bios \= \"ON\"\nswanstation_GPU_Renderer \= "Software"' /home/ark/.config/retroarch/retroarch-core-options.cfg.bak
fi
printf "\nCopy mupen64plus standalone\n" | tee -a "$LOG_FILE"
cp -fv /opt/mupen64plus/mupen64plus-video-GLideN64.so.rk3326 /opt/mupen64plus/mupen64plus-video-GLideN64.so | tee -a "$LOG_FILE"
cp -fv /opt/mupen64plus/mupen64plus-video-glide64mk2.so.rk3326 /opt/mupen64plus/mupen64plus-video-glide64mk2.so | tee -a "$LOG_FILE"
cp -fv /opt/mupen64plus/mupen64plus-video-rice.so.rk3326 /opt/mupen64plus/mupen64plus-video-rice.so | tee -a "$LOG_FILE"
cp -fv /opt/mupen64plus/mupen64plus-audio-sdl.so.rk3326 /opt/mupen64plus/mupen64plus-audio-sdl.so | tee -a "$LOG_FILE"
cp -fv /opt/mupen64plus/mupen64plus.rk3326 /opt/mupen64plus/mupen64plus | tee -a "$LOG_FILE"
cp -fv /opt/mupen64plus/libmupen64plus.so.2.0.0.rk3326 /opt/mupen64plus/libmupen64plus.so.2.0.0 | tee -a "$LOG_FILE"
cp -fv /opt/mupen64plus/mupen64plus-rsp-hle.so.rk3326 /opt/mupen64plus/mupen64plus-rsp-hle.so | tee -a "$LOG_FILE"
cp -fv /opt/mupen64plus/mupen64plus-input-sdl.so.rk3326 /opt/mupen64plus/mupen64plus-input-sdl.so | tee -a "$LOG_FILE"
rm -fv /opt/mupen64plus/*.rk3326 | tee -a "$LOG_FILE"
printf "\nMake sure permissions for the ark home directory are set to 755\n" | tee -a "$LOG_FILE"
sudo chown -R ark:ark /home/ark
sudo chmod -R 755 /home/ark
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2.so /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.2600.2 /usr/lib/aarch64-linux-gnu/libSDL2.so | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2.so /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.2600.2 /usr/lib/arm-linux-gnueabihf/libSDL2.so | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wummle gaming" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update03262023"
fi
if [ ! -f "/home/ark/.config/.update04052023" ]; then
printf "\nRevert filebrowser back to working version\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/04052023/arkosupdate04052023.zip -O /home/ark/arkosupdate04052023.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate04052023.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate04052023.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate04052023.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate04052023.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
#Ensure permissions are set correctly on filebrowser executable
sudo chmod 777 /usr/local/bin/filebrowser
printf "\nEnsure 64bit and 32bit sdl2 is still properly linked\n" | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2.so /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.2600.2 /usr/lib/aarch64-linux-gnu/libSDL2.so | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2.so /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.2600.2 /usr/lib/arm-linux-gnueabihf/libSDL2.so | tee -a "$LOG_FILE"
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wuMMLe gaming" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update04052023"
fi
if [ ! -f "/home/ark/.config/.update08252023" ]; then
printf "\nquicknes, fceumm, supafaust, 32bit gpsp, A5200, puae2021, Gearsystem, picodrive, gearcoleco, coolCV, fbneo-neogeocd, Fake08, Arduboy, vic20, microvision, mame2003_plus to arcade, cap32 update, ECWolf update, retroarch 1.15.0 performance, retroarch filters, (Add extensions for C64, Genesis, AmigaCD32, PC98, AmstradCPC and movie player), OpenBOR update, PPSSPP update, (mgba, 3DO and virtualboy default to performance mode), SDL 2.0.28.2\n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/08252023/arkosupdate08252023.zip -O /home/ark/arkosupdate08252023.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate08252023.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate08252023.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate08252023.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate08252023.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\n Note: All Added systems in this list have been hardcoded into this archived es_systems.cfg that will replace the old es_systems.cfg. This is because the scripted injection method severely broke the contents of the file for reasons unknown (this usually doesn't happen), so this process has instead been performed manually to ensure a working configuration. \n" | tee -a "$LOG_FILE"
printf "\n Most if not all updates here have been brought in from other updates provided by (and thanks to) christianhaitian and all who contributed \n" | tee -a "$LOG_FILE"
printf "\n ---CORES--- \n" | tee -a "$LOG_FILE"
printf "\n Update ECWolf to 1.4.1 and add mods support \n" | tee -a "$LOG_FILE"
printf "\n Add quicknes core for NES and Famicom Disk System \n" | tee -a "$LOG_FILE"
printf "\n Add support for fceumm to Famicom system \n" | tee -a "$LOG_FILE"
printf "\n Add supafaust core for SNES \n" | tee -a "$LOG_FILE"
printf "\n Add 32bit gpsp core for GBA \n" | tee -a "$LOG_FILE"
printf "\n Add A5200 libretro core as additional core for Atari 5200 \n" | tee -a "$LOG_FILE"
printf "\n Add puae2021 libretro core for Amiga \n" | tee -a "$LOG_FILE"
printf "\n Add Gearsystem and picodrive cores for Sega Master System \n" | tee -a "$LOG_FILE"
printf "\n Add Gearsystem core for Game Gear \n" | tee -a "$LOG_FILE"
printf "\n Add gearcoleco libretro core for colecovision \n"
printf "\n Add fbneo as optional core for NeoGeo CD \n" | tee -a "$LOG_FILE"
printf "\n Add coolCV core for colecovision \n" | tee -a "$LOG_FILE"
printf "\n Add Fake08 emulator for PICO-8 \n" | tee -a "$LOG_FILE"
printf "\n Add widescreen mode support for mupen64plus-glide64mk2 \n" | tee -a "$LOG_FILE"
printf "\n Update cap32 core for Amstrad CPC and GX4000 \n" | tee -a "$LOG_FILE"
printf "\n ---RETROARCH--- \n" | tee -a "$LOG_FILE"
printf "\n Rebuild retroarch and retroarch32 v1.15.0 to resolve microstutter issues \n" | tee -a "$LOG_FILE"
printf "\n Add retroarch video filters \n" | tee -a "$LOG_FILE"
printf "\n Add retroarch audio filters \n" | tee -a "$LOG_FILE"
printf "\n ---EXTENSIONS--- \n" | tee -a "$LOG_FILE"
printf "\n Add prg, d71, d81, nib, tap, and vsf support for C64 \n" | tee -a "$LOG_FILE"
printf "\n Add sgd support for Genesis and MD \n" | tee -a "$LOG_FILE"
printf "\n Add chd support for Amiga CD32 \n" | tee -a "$LOG_FILE"
printf "\n Add .cmd extension support for PC98 \n" | tee -a "$LOG_FILE"
printf "\n Add .mov extension for video player \n" | tee -a "$LOG_FILE"
printf "\n Add cpc and 7z support for Amstrad CPC \n" | tee -a "$LOG_FILE"
printf "\n ---STANDALONE EMULATOR UPDATES--- \n" | tee -a "$LOG_FILE"
printf "\n Add GLideN64 plugin for mupen64plus standalone to ES \n" | tee -a "$LOG_FILE"
printf "\n Update OpenBOR \n" | tee -a "$LOG_FILE"
printf "\n Update PPSSPPSDL to v1.15.3-26 \n" | tee -a "$LOG_FILE"
printf "\n ---THEMES--- \n" | tee -a "$LOG_FILE"
printf "\n Update NesBox Theme \n" | tee -a "$LOG_FILE"
printf "\n ---TOOLS--- \n" | tee -a "$LOG_FILE"
printf "\n Add tool to remove ._ Mac files \n" | tee -a "$LOG_FILE"
printf "\n ---ADDITIONAL UPDATES AND CHANGES FOR THIS UPDATE--- \n" | tee -a "$LOG_FILE"
printf "\n Set permissions on es_systems.cfg in case they were altered \n" | tee -a "$LOG_FILE"
sudo chmod ugo+rwx /etc/emulationstation/es_systems.cfg
printf "\n Set permissions on ecwolf.sh in case they were altered \n" | tee -a "$LOG_FILE"
sudo chmod ugo+rwx /usr/local/bin/ecwolf.sh
printf "\n Set permissions on vice_xvic_libretro core in case they were altered \n" | tee -a "$LOG_FILE"
sudo chmod ugo+rwx /home/ark/.config/retroarch/cores/vice_xvic_libretro.so
printf "\n Change mednafen_vb options cpu emulation to fast \n" | tee -a "$LOG_FILE"
if [[ ! -z $(cat /home/ark/.config/retroarch/retroarch-core-options.cfg | grep vb_cpu_emulation) ]]; then
sed -i '/vb_cpu_emulation \= /c\vb_cpu_emulation \= \"fast\"' /home/ark/.config/retroarch/retroarch-core-options.cfg
else
printf '\nvb_cpu_emulation = "fast"' | tee -a /home/ark/.config/retroarch/retroarch-core-options.cfg
fi
printf '\nvb_cpu_emulation = "fast"' | tee -a /home/ark/.config/retroarch/retroarch-core-options.cfg.bak
printf "\n Add video filters and set default filters' paths for retroarch and retroarch32 \n" | tee -a "$LOG_FILE"
sed -i "/video_filter_dir \= \"default\"/c\video_filter_dir \= \"\/home\/ark\/.config\/retroarch\/filters\/video\"" /home/ark/.config/retroarch/retroarch.cfg && sed -i "/video_filter_dir \= \"default\"/c\video_filter_dir \= \"\/home\/ark\/.config\/retroarch\/filters\/video\"" /home/ark/.config/retroarch/retroarch.cfg.bak && sed -i "/video_filter_dir \= \"default\"/c\video_filter_dir \= \"\/home\/ark\/.config\/retroarch32\/filters\/video\"" /home/ark/.config/retroarch32/retroarch.cfg && sed -i "/video_filter_dir \= \"default\"/c\video_filter_dir \= \"\/home\/ark\/.config\/retroarch32\/filters\/video\"" /home/ark/.config/retroarch32/retroarch.cfg.bak
sed -i "/video_filter_dir \= \"default\"/c\video_filter_dir \= \"\/home\/ark\/.config\/retroarch32\/filters\/video\"" /home/ark/.config/retroarch/config/Atari800/retroarch_5200.cfg && sed -i "/video_filter_dir \= \"default\"/c\video_filter_dir \= \"\/home\/ark\/.config\/retroarch32\/filters\/video\"" /home/ark/.config/retroarch/config/Atari800/retroarch_A800.cfg && sed -i "/video_filter_dir \= \"default\"/c\video_filter_dir \= \"\/home\/ark\/.config\/retroarch32\/filters\/video\"" /home/ark/.config/retroarch/config/Atari800/retroarch_XEGS.cfg
printf "\n Update audio filters directory in retroarch and retroarch32 configs \n" | tee -a "$LOG_FILE"
sed -i "/audio_filter_dir = \"/c\\audio_filter_dir = \"~\/.config\/retroarch\/filters\/audio\"" /home/ark/.config/retroarch/retroarch.cfg
sed -i "/audio_filter_dir = \"/c\\audio_filter_dir = \"~\/.config\/retroarch\/filters\/audio\"" /home/ark/.config/retroarch/retroarch.cfg.bak
sed -i "/audio_filter_dir = \"/c\\audio_filter_dir = \"~\/.config\/retroarch32\/filters\/audio\"" /home/ark/.config/retroarch32/retroarch.cfg
sed -i "/audio_filter_dir = \"/c\\audio_filter_dir = \"~\/.config\/retroarch32\/filters\/audio\"" /home/ark/.config/retroarch32/retroarch.cfg.bak
printf "\n Force the use of older SDL2 for hypseus due to audio sync issue \n" | tee -a "$LOG_FILE"
if test -z "$(cat /usr/local/bin/daphne.sh | grep -i 'libSDL2-2.0.so.0.1')"
then
sudo sed -i '/\.\/hypseus/s//LD_PRELOAD=\/usr\/lib\/aarch64-linux-gnu\/libSDL2-2.0.so.0.14.1 .\/hypseus/' /usr/local/bin/daphne.sh
fi
printf "\n Added Arduboy \n" | tee -a "$LOG_FILE"
mkdir -v /roms/arduboy | tee -a "$LOG_FILE"
printf "\n Duckstation optimization \n" | tee -a "$LOG_FILE"
if test -z "$(grep 'record' /usr/local/bin/perfmax | tr -d '\0')"
then
sudo sed -i '/\[\[ \$2 == "duckstation" \]\]/s//\[\[ $2 == \"duckstation\" \]\] || [[ "$2" == *\"record\"* ]]/' /usr/local/bin/perfmax
sudo sed -i '/\[\[ \$2 == "duckstation" \]\]/s//\[\[ $2 == \"duckstation\" \]\] || [[ "$2" == *\"record\"* ]]/' /usr/local/bin/perfmax.pic
sudo sed -i '/\[\[ \$2 == "duckstation" \]\]/s//\[\[ $2 == \"duckstation\" \]\] || [[ "$2" == *\"record\"* ]]/' /usr/local/bin/perfmax.asc
fi
printf "\n Add mame2003_plus to arcade, cps1, cps2, and cps3 \n" | tee -a "$LOG_FILE"
sed -i '/mame2003-plus_skip_disclaimer \=/c\mame2003-plus_skip_disclaimer \= "enabled"' /home/ark/.config/retroarch/retroarch-core-options.cfg
sed -i '/mame2003-plus_skip_disclaimer \=/c\mame2003-plus_skip_disclaimer \= "enabled"' /home/ark/.config/retroarch/retroarch-core-options.cfg.bak
sed -i '/mame2003-plus_skip_warnings \=/c\mame2003-plus_skip_warnings \= "enabled"' /home/ark/.config/retroarch/retroarch-core-options.cfg
sed -i '/mame2003-plus_skip_warnings \=/c\mame2003-plus_skip_warnings \= "enabled"' /home/ark/.config/retroarch/retroarch-core-options.cfg.bak
sudo sed -i 's/exfat defaults,auto,umask=000,noatime 0 0/exfat defaults,auto,umask=000,uid=1002,gid=1002,noatime 0 0/' /etc/fstab
sudo sed -i 's/exfat umask=0000,iocharset=utf8,noatime 0 0/exfat umask=0000,iocharset=utf8,uid=1002,gid=1002,noatime 0 0/' /etc/fstab
printf "\n Duckstation update \n" | tee -a "$LOG_FILE"
if [ -e "/dev/input/by-path/platform-ff300000.usb-usb-0:1.2:1.0-event-joystick" ]; then
printf "\n Copy correct duckstation binary per device \n" | tee -a "$LOG_FILE"
sudo rm -fv /usr/local/bin/duckstation-nogui.chirgb10 | tee -a "$LOG_FILE"
#sed -i '/Rotate = 1/d' /home/ark/.config/duckstation/settings.ini
fi
printf "\n GlideN64 video plugin for mupen64plus \n" | tee -a "$LOG_FILE"
if test -z "$(cat /home/ark/.config/mupen64plus/mupen64plus.cfg | grep Video-GLideN64)"
then
sed -i -e '/Rotate \= 0/{r /home/ark/add_gliden64_to_mupen64plus_cfg.txt' -e 'd}' /home/ark/.config/mupen64plus/mupen64plus.cfg
fi
if test -z "$(grep 'GlideN64' /usr/local/bin/perfmax | tr -d '\0')"
then
sudo sed -i '/\[\[ \$1 == "standalone-Rice" \]\] || \[\[ \$1 == "standalone-Glide64mk2" \]\]/s//\[\[ \$1 == "standalone-Rice" \]\] || \[\[ \$1 == "standalone-Glide64mk2" \]\] || \[\[ \$1 == "standalone-GlideN64" \]\]/' /usr/local/bin/perfmax
sudo sed -i '/\[\[ \$1 == "standalone-Rice" \]\] || \[\[ \$1 == "standalone-Glide64mk2" \]\]/s//\[\[ \$1 == "standalone-Rice" \]\] || \[\[ \$1 == "standalone-Glide64mk2" \]\] || \[\[ \$1 == "standalone-GlideN64" \]\]/' /usr/local/bin/perfmax.pic
sudo sed -i '/\[\[ \$1 == "standalone-Rice" \]\] || \[\[ \$1 == "standalone-Glide64mk2" \]\]/s//\[\[ \$1 == "standalone-Rice" \]\] || \[\[ \$1 == "standalone-Glide64mk2" \]\] || \[\[ \$1 == "standalone-GlideN64" \]\]/' /usr/local/bin/perfmax.asc
fi
printf "\n Add support for 4:3 aspect ratio for mupen64plus standalone rice video plugin \n" | tee -a "$LOG_FILE"
if test -z "$(grep "ResolutionWidth" /home/ark/.config/mupen64plus/mupen64plus.cfg | tr -d '\0')"
then
sed -i "/\[Video-Rice\]/c\\[Video-Rice\]\n\n\# Hack to accomodate widescreen devices (Thanks to AmberElec sources for tip)\nResolutionWidth \= 480" /home/ark/.config/mupen64plus/mupen64plus.cfg
fi
printf "\n Enable Threaded DSP for 3DO by default \n" | tee -a "$LOG_FILE"
if test ! -z "$(cat /home/ark/.config/retroarch/retroarch-core-options.cfg | grep 'opera_dsp_threaded' | tr -d '\0')"
then
sed -i '/opera_dsp_threaded \= "disabled"/c\opera_dsp_threaded \= "enabled"' /home/ark/.config/retroarch/retroarch-core-options.cfg
sed -i '/mgba_use_bios \= \"ON\"/c\mgba_use_bios \= \"ON\"\nopera_dsp_threaded \= "enabled"' /home/ark/.config/retroarch/retroarch-core-options.cfg.bak
else
sed -i '/mgba_use_bios \= \"ON\"/c\mgba_use_bios \= \"ON\"\nopera_dsp_threaded \= "enabled"' /home/ark/.config/retroarch/retroarch-core-options.cfg
sed -i '/mgba_use_bios \= \"ON\"/c\mgba_use_bios \= \"ON\"\nopera_dsp_threaded \= "enabled"' /home/ark/.config/retroarch/retroarch-core-options.cfg.bak
fi
printf "\n Make sure retroarch core repos are still set to Github if it's been changed and make sure they're set to the correct repo \n" | tee -a "$LOG_FILE"
sed -i "/core_updater_buildbot_cores_url \=/c\core_updater_buildbot_cores_url \= \"https:\/\/raw.githubusercontent.com\/christianhaitian\/retroarch-cores\/master\/aarch64\/\"" ~/.config/retroarch/retroarch.cfg
sed -i "/core_updater_buildbot_cores_url \=/c\core_updater_buildbot_cores_url \= \"https:\/\/raw.githubusercontent.com\/christianhaitian\/retroarch-cores\/master\/arm7hf\/\"" ~/.config/retroarch32/retroarch.cfg
sed -i "/core_updater_buildbot_cores_url \=/c\core_updater_buildbot_cores_url \= \"https:\/\/raw.githubusercontent.com\/christianhaitian\/retroarch-cores\/master\/aarch64\/\"" ~/.config/retroarch/retroarch.cfg.bak
sed -i "/core_updater_buildbot_cores_url \=/c\core_updater_buildbot_cores_url \= \"https:\/\/raw.githubusercontent.com\/christianhaitian\/retroarch-cores\/master\/arm7hf\/\"" ~/.config/retroarch32/retroarch.cfg.bak
echo "Retroarch core repos have been changed to github"
printf "\n Clean up some old unneeded files in the system \n" | tee -a "$LOG_FILE"
sudo rm -rfv /var/cache/* | tee -a "$LOG_FILE"
sudo rm -rfv /var/backups/* | tee -a "$LOG_FILE"
sudo journalctl --vacuum-time=1s
printf "\n cap32 standalone-Glide64mk2 optimization \n" | tee -a "$LOG_FILE"
if test -z "$(grep 'cap32' /usr/local/bin/perfmax | tr -d '\0')"
then
sudo sed -i '/\[\[ \$1 == "standalone-Glide64mk2" \]\]/s//\[\[ \$1 == "standalone-Glide64mk2" \]\] || \[\[ \$1 == "standalone-GlideN64" \]\] || \[\[ \$2 == "cap32" \]\]/' /usr/local/bin/perfmax
sudo sed -i '/\[\[ \$1 == "standalone-Glide64mk2" \]\]/s//\[\[ \$1 == "standalone-Glide64mk2" \]\] || \[\[ \$1 == "standalone-GlideN64" \]\] || \[\[ \$2 == "cap32" \]\]/' /usr/local/bin/perfmax.pic
sudo sed -i '/\[\[ \$1 == "standalone-Glide64mk2" \]\]/s//\[\[ \$1 == "standalone-Glide64mk2" \]\] || \[\[ \$1 == "standalone-GlideN64" \]\] || \[\[ \$2 == "cap32" \]\]/' /usr/local/bin/perfmax.asc
fi
printf "\n Apply cap32_libretro updated core \n" | tee -a "$LOG_FILE"
mv -fv /home/ark/cap32_libretro.so.rk3326 /home/ark/.config/retroarch/cores/cap32_libretro.so | tee -a "$LOG_FILE"
printf "\n Add symlink for librga.so.2 arm32bit environment \n" | tee -a "$LOG_FILE"
if [ ! -f "/usr/lib/arm-linux-gnueabihf/librga.so.2" ]; then
cd /usr/lib/arm-linux-gnueabihf/
sudo ln -sf librga.so librga.so.2
cd /home/ark
else
printf " librga.so.2 already exists in /usr/lib/arm-linux-gnueabihf/" | tee -a "$LOG_FILE"
fi
printf "\n Add vic20 as separate system \n" | tee -a "$LOG_FILE"
mkdir -v /roms/vic20 | tee -a "$LOG_FILE"
printf "\n Add microvision \n" | tee -a "$LOG_FILE"
if [ ! -d "/roms/mv" ]; then
mkdir -v /roms/mv | tee -a "$LOG_FILE"
fi
printf "\n Set permissions on microvision assets in case they were altered \n" | tee -a "$LOG_FILE"
sudo chmod ugo+rwx -R /opt/mvem
sudo chmod ugo+rwx /usr/local/bin/mvem.sh
sudo chmod ugo+rwx /opt/mvem/gptokeyb
printf "\n Install puae2021 libretro core \n" | tee -a "$LOG_FILE"
mv -fv /home/ark/puae2021_libretro.so.rk3326 /home/ark/.config/retroarch/cores/puae2021_libretro.so | tee -a "$LOG_FILE"
printf "\n Cleanup some unneeded left over files in the home folder from previous updates if need be \n" | tee -a "$LOG_FILE"
if [ $(ls -1 /home/ark/*.dtb 2>/dev/null | wc -l) != 0 ]; then
sudo rm -fv /home/ark/*.dtb | tee -a "$LOG_FILE"
sudo rm -fv /home/ark/*.v2 | tee -a "$LOG_FILE"
printf " Cleaned up some unneeded files found.\n" | tee -a "$LOG_FILE"
else
printf " No clean up needed.\n" | tee -a "$LOG_FILE"
fi
printf "\n Ensure swanstation and puae2021 work for rk3326 devices \n" | tee -a "$LOG_FILE"
if [ ! -f "/boot/rk3566.dtb" ] && [ ! -f "/boot/rk3566-OC.dtb" ]; then
printf "\nFixing swanstation and puae2021 (if) not booting...\n" | tee -a "$LOG_FILE"
if [ -f "/home/ark/.config/retroarch/cores/swanstation_libretro.so.rk3326" ]; then
mv -fv /home/ark/.config/retroarch/cores/swanstation_libretro.so.rk3326 /home/ark/.config/retroarch/cores/swanstation_libretro.so | tee -a "$LOG_FILE"
fi
if [ -f "/home/ark/.config/retroarch/cores/puae2021_libretro.so.rk3326" ]; then
mv -fv /home/ark/.config/retroarch/cores/puae2021_libretro.so.rk3326 /home/ark/.config/retroarch/cores/puae2021_libretro.so | tee -a "$LOG_FILE"
fi
fi
printf "\n Default mgba libretro emulator governor to performance \n" | tee -a "$LOG_FILE"
if test -z "$(grep 'mgba' /usr/local/bin/perfmax.pic | tr -d '\0')"
then
sudo sed -i '/\[\[ \$1 == "On" \]\]/s//\[\[ \$1 == "On" \]\] || \[\[ \$2 == *"mgba"* \]\]/' /usr/local/bin/perfmax
sudo sed -i '/\[\[ \$1 == "On" \]\]/s//\[\[ \$1 == "On" \]\] || \[\[ \$2 == *"mgba"* \]\]/' /usr/local/bin/perfmax.pic
sudo sed -i '/\[\[ \$1 == "On" \]\]/s//\[\[ \$1 == "On" \]\] || \[\[ \$2 == *"mgba"* \]\]/' /usr/local/bin/perfmax.asc
fi
printf "\n Fix some GlideN64 plugin settings \n" | tee -a "$LOG_FILE"
sed -i "/UseNativeResolutionFactor \=/c\UseNativeResolutionFactor \= 1" /home/ark/.config/mupen64plus/mupen64plus.cfg
sed -i "/ThreadedVideo \=/c\ThreadedVideo \= True" /home/ark/.config/mupen64plus/mupen64plus.cfg
printf "\n Fix scummvm ability to change key configuration \n" | tee -a "$LOG_FILE"
sudo cp -fv /usr/local/bin/ti99keydemon.py /usr/local/bin/scummvmkeydemon.py | tee -a "$LOG_FILE"
sudo chmod 777 /usr/local/bin/scummvmkeydemon.py
sudo sed -i 's/ti99sim-sdl/scummvm/' /usr/local/bin/scummvmkeydemon.py
printf "\n Install and link new SDL 2.0.2800.2 (aka SDL 2.0.28.2) \n" | tee -a "$LOG_FILE"
sudo mv -f -v /home/ark/sdl2-64/libSDL2-2.0.so.0.2800.2.rotated /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.2800.2 | tee -a "$LOG_FILE"
sudo mv -f -v /home/ark/sdl2-32/libSDL2-2.0.so.0.2800.2.rotated /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.2800.2 | tee -a "$LOG_FILE"
sudo rm -rfv /home/ark/sdl2-64 | tee -a "$LOG_FILE"
sudo rm -rfv /home/ark/sdl2-32 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2.so /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.2800.2 /usr/lib/aarch64-linux-gnu/libSDL2.so | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2.so /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0 | tee -a "$LOG_FILE"
sudo ln -sfv /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0.2800.2 /usr/lib/arm-linux-gnueabihf/libSDL2.so | tee -a "$LOG_FILE"
printf "\n Cleanup \n" | tee -a "$LOG_FILE"
sudo rm -v /home/ark/add_gliden64_to_mupen64plus_cfg.txt | tee -a "$LOG_FILE"
sudo rm -rf /dev/shm/*
printf "\nUpdate boot text to reflect final current version of ArkOS for the 351 P/M \n" | tee -a "$LOG_FILE"
sudo sed -i "/title\=/c\title\=ArkOS 351P/M wuMMLe gaming" /usr/share/plymouth/themes/text.plymouth
touch "/home/ark/.config/.update08252023"
fi
if [ ! -f "/home/ark/.config/.update09022023" ]; then
printf "\n Add Sameboy and GearBoy, Update MESS libretro, Show Last Played, Update NesBox Theme \n" | tee -a "$LOG_FILE"
sudo wget --no-check-certificate https://github.com/wummle/arkos/raw/main/09022023/arkosupdate09022023.zip -O /home/ark/arkosupdate09022023.zip -a "$LOG_FILE" || rm -f /home/ark/arkosupdate09022023.zip | tee -a "$LOG_FILE"
if [ -f "/home/ark/arkosupdate09022023.zip" ]; then
sudo unzip -X -o /home/ark/arkosupdate09022023.zip -d / | tee -a "$LOG_FILE"
sudo rm -v /home/ark/arkosupdate09022023.zip | tee -a "$LOG_FILE"
else
printf "\nThe update couldn't complete because the package did not download correctly.\nPlease retry the update again." | tee -a "$LOG_FILE"
sleep 3
echo $c_brightness > /sys/devices/platform/backlight/backlight/backlight/brightness
exit 1
fi
printf "\n ---CORES--- \n" | tee -a "$LOG_FILE"
printf "\n Add sameboy v0.15.4 core for GB and GBC \n" | tee -a "$LOG_FILE"
printf "\n Add GearBoy core for GB and GBC \n" | tee -a "$LOG_FILE"
printf "\n Update MESS libretro core to v0.250 for Adventure Vision and Bally Astrocade \n" | tee -a "$LOG_FILE"
printf "\n Ensure proper ownership on folders \n" | tee -a "$LOG_FILE"
sudo chown -R ark:ark /opt/
sudo chown ark:ark /etc/emulationstation/es_systems.cfg
sudo chown -Rv ark:ark /opt/yabasanshiro
sudo chown -Rv ark:ark /opt/retroarch
sudo chown -Rv ark:ark /opt/hypseus-singe
sudo chown -Rv ark:ark /opt/amiberry
sudo chmod -v 777 /opt/retroarch/bin/*
sudo chown -v ark:ark /opt/retroarch/bin/*
sudo chown -R ark:ark /home/ark
sudo chmod -R 755 /home/ark
sudo chown -R ark:ark /home/ark/.config/gzdoom/
sudo chown -Rv ark:ark /home/ark/.config/mupen64plus/
sudo chmod 755 ~/.config/pulse
sudo chmod 755 ~/.config/retroarch/retroarch-core-options.cfg
sudo chmod 755 ~/.config/retroarch/cores/gearboy_libretro.*
sudo chmod 755 ~/.config/retroarch/cores/sameboy_libretro.*
sudo chmod 755 ~/.config/retroarch/cores/mess_libretro.*
if test -z "$(cat /etc/emulationstation/es_systems.cfg | grep -i '<core>gearboy</core>')"
then