-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·981 lines (891 loc) · 42.5 KB
/
run.sh
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
#!/bin/bash
# d888b d88888b d8b db d888888b .d88b. .d88b. db db d8b db .d8b. d888888b d888888b d88888b d8b db d888888b d88888b d8888b. .d8888. d88888b d888888b db db d8888b.
# 88' Y8b 88' 888o 88 `~~88~~' .8P Y8. .8P Y8. 88 88 888o 88 d8' `8b `~~88~~' `~~88~~' 88' 888o 88 `~~88~~' 88' 88 `8D 88' YP 88' `~~88~~' 88 88 88 `8D
# 88 88ooooo 88V8o 88 88 88 88 88 88 88 88 88V8o 88 88ooo88 88 88 88ooooo 88V8o 88 88 88ooooo 88 88 `8bo. 88ooooo 88 88 88 88oodD'
# 88 ooo 88~~~~~ 88 V8o88 88 88 88 88 88 88 88 88 V8o88 88~~~88 88 88 88~~~~~ 88 V8o88 88 88~~~~~ 88 88 C8888D `Y8b. 88~~~~~ 88 88 88 88~~~
# 88. ~8~ 88. 88 V888 88 `8b d8' `8b d8' 88b d88 88 V888 88 88 88 88 88. 88 V888 88 88. 88 .8D db 8D 88. 88 88b d88 88
# Y888P Y88888P VP V8P YP `Y88P' `Y88P' C88888D ~Y8888P' VP V8P YP YP YP YP Y88888P VP V8P YP Y88888P Y8888D' `8888Y' Y88888P YP ~Y8888P' 88
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# STATUS Readme.md
# github.com/alphaaurigae/gentoo_unattended_modular-setup.sh
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# VARIABLE && FUNCTONS
## PRE
. func/func_main.sh
. var/var_main.sh
. var/1_PRE_main.sh
## CHROOT
. src/CHROOT/DEBUG.sh
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PRE_NOMENU () { # PREPARE CHROOT ALL without menu
NOTICE_START
PRE_RUNALL () {
printf "%s%s%s\n" "${BOLD}${GREEN}" "PPPPPPPPPPPPPPPPP RRRRRRRRRRRRRRRRR EEEEEEEEEEEEEEEEEEEEEE" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "P::::::::::::::::P R::::::::::::::::R E::::::::::::::::::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "P::::::PPPPPP:::::P R::::::RRRRRR:::::R E::::::::::::::::::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "PP:::::P P:::::PRR:::::R R:::::REE::::::EEEEEEEEE::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P P:::::P R::::R R:::::R E:::::E EEEEEE" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P P:::::P R::::R R:::::R E:::::E " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::PPPPPP:::::P R::::RRRRRR:::::R E::::::EEEEEEEEEE " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P:::::::::::::PP R:::::::::::::RR E:::::::::::::::E " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::PPPPPPPPP R::::RRRRRR:::::R E:::::::::::::::E " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P R::::R R:::::R E::::::EEEEEEEEEE " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P R::::R R:::::R E:::::E " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P R::::R R:::::R E:::::E EEEEEE" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "PP::::::PP RR:::::R R:::::REE::::::EEEEEEEE:::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "P::::::::P R::::::R R:::::RE::::::::::::::::::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "P::::::::P R::::::R R:::::RE::::::::::::::::::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "PPPPPPPPPP RRRRRRRR RRRRRRREEEEEEEEEEEEEEEEEEEEEE" "${RESET}"
INIT
PARTITIONING
CRYPTSETUP
LVMSETUP
STAGE3
MNTFS
COPY_CONFIGS
}
for f in src/PRE/*; do . $f && echo $f; done # source src/PRE/
PRE_RUNALL
}
PRE_MENU () { # PREPARE CHROOT with menu
NOTICE_START
PRE_CHOOSE() {
printf "%s%s%s\n" "${BOLD}${GREEN}" "PPPPPPPPPPPPPPPPP RRRRRRRRRRRRRRRRR EEEEEEEEEEEEEEEEEEEEEE" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "P::::::::::::::::P R::::::::::::::::R E::::::::::::::::::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "P::::::PPPPPP:::::P R::::::RRRRRR:::::R E::::::::::::::::::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "PP:::::P P:::::PRR:::::R R:::::REE::::::EEEEEEEEE::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P P:::::P R::::R R:::::R E:::::E EEEEEE" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P P:::::P R::::R R:::::R E:::::E " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::PPPPPP:::::P R::::RRRRRR:::::R E::::::EEEEEEEEEE " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P:::::::::::::PP R:::::::::::::RR E:::::::::::::::E " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::PPPPPPPPP R::::RRRRRR:::::R E:::::::::::::::E " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P R::::R R:::::R E::::::EEEEEEEEEE " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P R::::R R:::::R E:::::E " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " P::::P R::::R R:::::R E:::::E EEEEEE" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "PP::::::PP RR:::::R R:::::REE::::::EEEEEEEE:::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "P::::::::P R::::::R R:::::RE::::::::::::::::::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "P::::::::P R::::::R R:::::RE::::::::::::::::::::E" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "PPPPPPPPPP RRRRRRRR RRRRRRREEEEEEEEEEEEEEEEEEEEEE" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "PRE menu:" "${RESET}"
#printf "OPTION1 Menu:\n"
printf "1. INIT (src/PRE/INIT.sh)\n"
printf "2. PARTITIONING (src/PRE/INIT.sh)\n"
printf "3. CRYPTSETUP (src/PRE/INIT.sh)\n"
printf "4. LVMSETUP (src/PRE/INIT.sh)\n"
printf "5. STAGE3 (src/PRE/INIT.sh)\n"
printf "6. MNTFS (src/PRE/INIT.sh)\n"
printf "7. COPY_CONFIGS (src/PRE/INIT.sh)\n"
printf "8. ALL PRE functions (src/PRE/....)\n"
printf "0. Return to Main Menu\n"
read -p "Enter your choice: " choice
printf "\n"
case $choice in
1)
printf "INIT\n"
INIT
;;
2)
printf "PARTITIONING\n"
PARTITIONING
;;
3)
printf "CRYPTSETUP\n"
CRYPTSETUP
;;
4)
printf "LVMSETUP\n"
LVMSETUP
;;
5)
printf "STAGE3\n"
STAGE3
;;
6)
printf "MNTFS\n"
MNTFS
;;
7)
printf "COPY_CONFIGS\n"
COPY_CONFIGS
;;
8)
printf "running INIT;PARTITIONING;CRYPTSETUP;LVMSETUP;STAGE3;MNTFS;COPY_CONFIGS\n"
INIT
PARTITIONING
CRYPTSETUP
LVMSETUP
STAGE3
MNTFS
COPY_CONFIGS
;;
0)
printf "Returning to Main Menu...\n"
return
;;
*)
printf "Invalid choice. Please try again.\n"
;;
esac
printf "\n"
PRE_CHOOSE
}
for f in src/PRE/*; do . $f && echo $f; done # source src/PRE/
PRE_CHOOSE
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CHROOT_NOMENU () { # 4.0 CHROOT # https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Entering_the_new_environment
NOTICE_START
CHROOT_RUNALL () {
INNER_SCRIPT=$(cat <<- 'INNERSCRIPT'
#!/bin/bash
# https://github.com/alphaaurigae/gentoo_unattented-setup
### +++ lines for quick scrolling section indication
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
. $CHROOTX/gentoo_unattented-setup/func/func_main.sh
. $CHROOTX/gentoo_unattented-setup/func/func_chroot_main.sh
. $CHROOTX/gentoo_unattented-setup/var/var_main.sh
. $CHROOTX/gentoo_unattented-setup/var/chroot_variables.sh
#. $CHROOTX//gentoo_unattented-setup/configs/required/kern.config.sh
#. $CHROOTX/gentoo_unattented-setup/func/chroot_static-functions.sh
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
BASE () {
NOTICE_START
for f in $CHROOTX/gentoo_unattented-setup/src/CHROOT/BASE/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" "###### # ##### ####### " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "# # # # # # # " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "# # # # # # " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "###### # # ##### ##### " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "# # ####### # # " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "# # # # # # # " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "###### # # ##### ####### " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "chroot base:" "${RESET}"
SWAPFILE # run SWAPFILE
MAKECONF # run MAKECONF
CONF_LOCALES # run CONF_LOCALES
PORTAGE # run PORTAGE
##EMERGE_SYNC # run EMERGE_SYNC
ESELECT_PROFILE # run ESELECT_PROFILE
##SETFLAGS1 # run SETFLAGS1 # PLACEHOLDER
EMERGE_ATWORLD_A # run EMERGE_ATWORLD_A
##MISC1_CHROOT # run MISC1_CHROOT # PLACEHOLDER
##RELOADING_SYS # run RELOADING_SYS # PLACEHOLDER
SYSTEMTIME # run SYSTEMTIME
KEYMAP_CONSOLEFONT # run KEYMAP_CONSOLEFONT
FIRMWARE # run FIRMWARE
CP_BASHRC # run CP_BASHRC
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CORE () {
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/CORE/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" " .d8888b. .d88888b. 8888888b. 8888888888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " d88P Y88bd88P* *Y88b888 Y88b888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " 888 888888 888888 888888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " 888 888 888888 d88P8888888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " 888 888 8888888888P* 888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " 888 888888 888888 T88b 888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " Y88b d88PY88b. .d88P888 T88b 888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " *Y8888P* *Y88888P* 888 T88b8888888888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "chroot core:" "${RESET}"
SYSCONFIG_CORE # run SYSCONFIG_CORE
SYSFS # run SYSFS
APPADMIN # run APPADMIN
SYSAPP # run SYSAPP
APP # run APP
SYSPROCESS # run SYSPROCESS
KERNEL # run KERNEL
INITRAM # run INITRAM
SYSBOOT # run SYSBOOT
## MODPROBE_CHROOT # run MODPROBE_CHROOT
APPEMULATION # run APPEMULATION
AUDIO # run AUDIO
## GPU # run GPU
NETWORK # run NETWORK
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SCREENDSP () { # note: replace visual header with "screen and desktop"
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/SCREENDSP/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" " ******** ****** ******* ******** ******** **** ** ******* ******** ******* " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " **////// **////**/**////** /**///// /**///// /**/** /**/**////** **////// /**////**" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "/** ** // /** /** /** /** /**//** /**/** /**/** /** /**" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "/*********/** /******* /******* /******* /** //** /**/** /**/*********/******* " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "////////**/** /**///** /**//// /**//// /** //**/**/** /**////////**/**//// " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " /**//** **/** //** /** /** /** //****/** ** /**/** " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " ******** //****** /** //**/********/********/** //***/******* ******** /** " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "//////// ////// // // //////// //////// // /// /////// //////// // " "${RESET}"
WINDOWSYS
DESKTOP_ENV
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
USERAPP () { # (!todo)
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/USERAPP/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" " ::: ::: :::::::: ::::::::::::::::::: ::: ::::::::: ::::::::: " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " :+: :+::+: :+::+: :+: :+: :+: :+: :+: :+::+: :+: " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " +:+ +:++:+ +:+ +:+ +:+ +:+ +:+ +:+ +:++:+ +:+ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " +#+ +:++#++:++#+++#++:++# +#++:++#: +#++:++#++:+#++:++#+ +#++:++#+ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " +#+ +#+ +#++#+ +#+ +#++#+ +#++#+ +#+ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "#+# #+##+# #+##+# #+# #+##+# #+##+# #+# " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "######## ######## ############# ###### ###### ### " "${RESET}"
# GIT
WEBBROWSER
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
USERS () {
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/USERS/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" "_| _| _|_|_| _|_|_|_| _|_|_| _|_|_| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "_| _| _| _| _| _| _| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "_| _| _|_| _|_|_| _|_|_| _|_| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "_| _| _| _| _| _| _| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " _|_| _|_|_| _|_|_|_| _| _| _|_|_| " "${RESET}"
ROOT
ADMIN
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FINISH () { # tidy up installation files - ok
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/FINISH/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" " ________________________________________ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " / CONGRATS! \\" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " \\ Setup done, you did it! /" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " ---------------------------------------- " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " \ ^__^ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " \ (xx)\_______ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " (__)\ )\/\ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " ||----- | " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " || || " "${RESET}"
TIDY_STAGE3
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## (RUN ENTIRE SCRIPT) (!changeme)
CHROOT_NOMENU () {
printf "%s%s%s\n" "${BOLD}${GREEN}" " CCCCC HH HH RRRRRR OOOOO OOOOO TTTTTTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "CC C HH HH RR RR OO OO OO OO TTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "CC HHHHHHH RRRRRR OO OO OO OO TTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "CC C HH HH RR RR OO OO OO OO TTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " CCCCC HH HH RR RR OOOO0 OOOO0 TTT " "${RESET}"
BASE # src/CHROOT/BASE/* # as defined in var/
CORE # src/CHROOT/CORE/* # as defined in var/
SCREENDSP # src/CHROOT/SCREENDSP/* # as defined in var/
USERAPP # src/CHROOT/USERAPP/* # as defined in var/
USERS # src/CHROOT/USERS/* # as defined in var/
FINISH # src/CHROOT/FINISH/* # as defined in var/
}
CHROOT_NOMENU
NOTICE_END
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
########## CHROOT ENDS HERE ##########
INNERSCRIPT
)
CP_CHROOT () {
NOTICE_START
# since the chroot script cant be run outside of chroot the script and possibly sourced functions and variables scripts need to be copied accordingly.
# for the onefile setup this is simply done by echoing the 'INNERSCRIPT" ... if the setup is split in multiple files for readability, every file or alt the gentoo script repo needs to be copied to make all functions and variables available.
# only variables outside the chroot innerscript for now 27.8.22
# IMPORTANT blow commands are executed BEFORE the above INNERSCRIPT! (BELOW chroot $CHROOTX /bin/bash ./chroot_run.sh). if a file needs to be made available in the INNERSCRIPT, copy it before ( chroot $CHROOTX /bin/bash ./chroot_run.sh ) below in this CHROOT function!!!
rm -rf $CHROOTX/gentoo_unattented-setup
cp /root/gentoo_unattented-setup $CHROOTX/gentoo_unattented-setup
NOTICE_END
}
CHROOT_INNER () { # https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Entering_the_new_environment
NOTICE_START
echo "$INNER_SCRIPT" > $CHROOTX/chroot_main.sh
chmod +x $CHROOTX/chroot_main.sh
chroot $CHROOTX /bin/bash ./chroot_main.sh
NOTICE_END
}
CP_CHROOT
CHROOT_INNER
}
CHROOT_RUNALL
NOTICE_END
}
CHROOT_MENU () { # 4.0 CHROOT # https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Entering_the_new_environment
NOTICE_START
CHROOT_CHOOSE () {
INNER_SCRIPT=$(cat <<- 'INNERSCRIPT'
#!/bin/bash
# https://github.com/alphaaurigae/gentoo_unattented-setup
### +++ lines for quick scrolling section indication
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
. $CHROOTX/gentoo_unattented-setup/func/func_main.sh
. $CHROOTX/gentoo_unattented-setup/func/func_chroot_main.sh
. $CHROOTX/gentoo_unattented-setup/var/var_main.sh
. $CHROOTX/gentoo_unattented-setup/var/chroot_variables.sh
#. $CHROOTX//gentoo_unattented-setup/configs/required/kern.config.sh
#. $CHROOTX/gentoo_unattented-setup/func/chroot_static-functions.sh
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
BASE () {
NOTICE_START
for f in $CHROOTX/gentoo_unattented-setup/src/CHROOT/BASE/*; do . $f && echo $f; done
CHROOT_BASE_MENU () {
CHROOT_BASE_CHOOSE() {
printf "%s%s%s\n" "${BOLD}${GREEN}" "###### # ##### ####### " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "# # # # # # # " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "# # # # # # " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "###### # # ##### ##### " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "# # ####### # # " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "# # # # # # # " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "###### # # ##### ####### " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "chroot base:" "${RESET}"
printf "1. step 1. SWAPFILE\n"
printf "2. step 2. MAKECONF\n"
printf "3. step 3. CONF_LOCALES\n"
printf "4. step 4. PORTAGE\n"
## PLACEHOLDER for later use (maybe) EMERGE_SYNC # run EMERGE_SYNC
printf "5. step 5. ESELECT_PROFILE\n"
printf "6. (just a placeholder NOT REQUIRED) step 6. SETFLAGS1\n"
printf "7. step 7. EMERGE_ATWORLD_A\n" # temporary added rust emere as bugfix for srvg lib error as suggested by sam_ #gentoo librachat irc - see https://bugs.gentoo.org/907492
## PLACEHOLDER for later use (maybe) #MISC1_CHROOT # run MISC1_CHROOT # PLACEHOLDER
## PLACEHOLDER for later use (maybe) RELOADING_SYS # run RELOADING_SYS # PLACEHOLDER
printf "8. step 8. SYSTEMTIME\n"
printf "9. step 9. KEYMAP_CONSOLEFONT\n"
printf "10. step 10. FIRMWARE\n"
printf "11. step 11. CP_BASHRC\n"
printf "\n"
printf "run multi step\n"
printf "21. run steps 1.; 2. & 3. create swap for setup; copy make.conf locales to run portage in next step - prints emerge at world which is neede dfor make.conf\n"
printf "22. run steps 2. & 3. to run portage in next step - prints emerge at world which is neede dfor make.conf\n"
printf "23. run steps 4. 5, 6. 7.. eselect profile and 6. emergeatworld \n"
printf "24. run steps 8. & 9. .. setup system time and keymap \n"
printf "25. run steps 10. & 11. .. setup firmaware and copy bashrc\n"
printf "26. run steps 2-10\n"
printf "27. run steps 1-10\n"
printf "0. Exit\n"
read -p "Enter your choice: " choice
printf "\n"
case $choice in
1)
SWAPFILE # step 1.
;;
2)
MAKECONF # step 2.
;;
3)
CONF_LOCALES # step 3.
;;
4)
PORTAGE # step 4.
;;
5)
ESELECT_PROFILE # step 5.
;;
6)
SETFLAGS1 # step 6.
;;
7)
EMERGE_ATWORLD_A # step 6.
;;
8)
SYSTEMTIME # step 7.
;;
9)
KEYMAP_CONSOLEFONT # step 8.
;;
10)
FIRMWARE # step 9.
;;
11)
CP_BASHRC # step 10.
;;
21)
SWAPFILE # step 1.
MAKECONF # step 2.
CONF_LOCALES # step 3.
;;
22)
MAKECONF # step 2.
CONF_LOCALES # step 3.
;;
23)
PORTAGE # step 4.
ESELECT_PROFILE # step 5.
SETFLAGS1 # step 6.
EMERGE_ATWORLD_A # step 7.
;;
24)
SYSTEMTIME # step 8.
KEYMAP_CONSOLEFONT # step 9.
;;
25)
FIRMWARE # step 10.
CP_BASHRC # step 11.
;;
26)
MAKECONF # step 2.
CONF_LOCALES # step 3.
PORTAGE # step 4.
ESELECT_PROFILE # step 5
SETFLAGS1 # step 6.
EMERGE_ATWORLD_A # step 7.
SYSTEMTIME # step 8.
KEYMAP_CONSOLEFONT # step 9.
FIRMWARE # step 10.
CP_BASHRC # step 11.
;;
27)
SWAPFILE # step 1.
MAKECONF # step 2.
CONF_LOCALES # step 3.
PORTAGE # step 4.
ESELECT_PROFILE # step 5.
SETFLAGS1 # step 6.
EMERGE_ATWORLD_A # step 7.
SYSTEMTIME # step 8.
KEYMAP_CONSOLEFONT # step 9.
FIRMWARE # step 10.
CP_BASHRC # step 11.
;;
0)
printf "Returning to Main Menu...\n"
return
;;
*)
printf "Invalid choice. Please try again.\n"
;;
esac
printf "\n"
CHROOT_BASE_CHOOSE
}
CHROOT_BASE_CHOOSE
}
CHROOT_BASE_MENU
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CORE () {
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/CORE/*; do . $f && echo $f; done
CHROOT_CORE_MENU () {
CHROOT_CORE_CHOOSE() {
printf "%s%s%s\n" "${BOLD}${GREEN}" " .d8888b. .d88888b. 8888888b. 8888888888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " d88P Y88bd88P* *Y88b888 Y88b888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " 888 888888 888888 888888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " 888 888 888888 d88P8888888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " 888 888 8888888888P* 888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " 888 888888 888888 T88b 888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " Y88b d88PY88b. .d88P888 T88b 888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " *Y8888P* *Y88888P* 888 T88b8888888888 " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "chroot core:" "${RESET}"
printf "1. step 1. SYSCONFIG_CORE\n"
printf "2. step 2. SYSFS\n"
printf "3. step 3. APPADMIN\n"
printf "4. step 4. SYSAPP\n"
printf "5. step 5. APP\n"
printf "6. step 6. SYSPROCESS\n"
printf "7. step 7. KERNEL\n"
printf "8. step 8. INITRAM\n"
printf "9. step 9. SYSBOOT\n"
# printf "10. step 10. MODPROBE_CHROOT\n"
printf "11. step 11. APPEMULATION\n"
printf "12. step 12. AUDIO\n"
# printf "13. step 13. GPU\n"
printf "14. step 14. NETWORK\n"
printf "\n"
printf "\e[1m run multi step\e[0m\n"
printf "21. steps 1. 2. 3. \n"
printf "22. steps 2. 3. \n"
printf "23. steps 4. 5. 6.\n"
printf "24. steps 7. 8. \n"
printf "25. steps 9-11 *modprobe not necessary here - skip 10* \n"
printf "26. steps 12-14 *gpu driver deaktivated - skip 13.* \n"
printf "27. steps 1-5\n"
printf "28. steps 6-10 \n"
printf "29. steps 11-14 *gpu driver deaktivated - skip 13.* \n"
printf "30. ALL ... steps 1-14 *modprobe not nessecary here - skip 10., gpu driver deactivated - skip 13.* \n"
printf "0. Exit\n"
read -p "Enter your choice: " choice
printf "\n"
case $choice in
1)
SYSCONFIG_CORE # step 1.
;;
2)
SYSFS # step 2.
;;
3)
APPADMIN # step 3.
;;
4)
SYSAPP # step 4.
;;
5)
APP # step 5.
;;
6)
SYSPROCESS # step 6.
;;
7)
KERNEL # step 7.
;;
8)
INITRAM # step 8.
;;
9)
SYSBOOT # step 9.
;;
10)
MODPROBE_CHROOT # step 10.
;;
11)
APPEMULATION # step 11.
;;
12)
AUDIO # step 12.
;;
13)
GPU # step 13.
;;
14)
NETWORK # step 10.
;;
21)
SYSCONFIG_CORE # step 1.
SYSFS # step 2.
APPADMIN # step 3.
;;
22)
SYSFS # step 2.
APPADMIN # step 3.
;;
23)
SYSAPP # step 4.
APP # step 5.
SYSPROCESS # step 6.
;;
24)
KERNEL # step 7.
INITRAM # step 8.
;;
25)
SYSBOOT # step 9.
#MODPROBE_CHROOT # step 10.
APPEMULATION # step. 11
;;
26)
AUDIO # step 12.
#GPU # step 13.
NETWORK # step. 14.
;;
27)
SYSCONFIG_CORE # step 1.
SYSFS # step 2.
APPADMIN # step 3.
SYSAPP # step 4.
APP # step 5
;;
28)
SYSPROCESS # step 6.
KERNEL # step 7.
INITRAM # step 8.
SYSBOOT # step 9.
# MODPROBE_CHROOT # step 10.
;;
29)
APPEMULATION # step 11.
AUDIO # step 12.
# GPU # step 13.
NETWORK # step 14.
;;
30)
SYSCONFIG_CORE # step 1.
SYSFS # step 2.
APPADMIN # step 3.
SYSAPP # step 4.
APP # step 5
SYSPROCESS # step 6.
KERNEL # step 7.
INITRAM # step 8.
SYSBOOT # step 9.
# MODPROBE_CHROOT # step 10.
APPEMULATION # step 11.
AUDIO # step 12.
# GPU # step 13.
NETWORK # step 14.
;;
0)
printf "Returning to Main Menu...\n"
return
;;
*)
printf "Invalid choice. Please try again.\n"
;;
esac
printf "\n"
CHROOT_CORE_CHOOSE
}
CHROOT_CORE_CHOOSE
}
CHROOT_CORE_MENU
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SCREENDSP () { # note: replace visual header with "screen and desktop"
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/SCREENDSP/*; do . $f && echo $f; done
CHROOT_SCREENDSP_MENU () {
CHROOT_SCREENDSP_CHOOSE() {
printf "%s%s%s\n" "${BOLD}${GREEN}" " ******** ****** ******* ******** ******** **** ** ******* ******** ******* " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " **////// **////**/**////** /**///// /**///// /**/** /**/**////** **////// /**////**" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "/** ** // /** /** /** /** /**//** /**/** /**/** /** /**" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "/*********/** /******* /******* /******* /** //** /**/** /**/*********/******* " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "////////**/** /**///** /**//// /**//// /** //**/**/** /**////////**/**//// " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " /**//** **/** //** /** /** /** //****/** ** /**/** " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " ******** //****** /** //**/********/********/** //***/******* ******** /** " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "//////// ////// // // //////// //////// // /// /////// //////// // " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "chroot screen and display" "${RESET}"
printf "1. step 1. WINDOWSYS\n"
printf "2. step 2. DESKTOP_ENV\n"
printf "\n"
printf "run multi step\n"
printf "21. run steps 1 && 2\n"
printf "0. Exit\n"
read -p "Enter your choice: " choice
printf "\n"
case $choice in
1)
WINDOWSYS # step 1.
;;
2)
DESKTOP_ENV # step 2.
;;
21)
WINDOWSYS # step 1.
DESKTOP_ENV # step 2.
;;
0)
printf "Returning to Main Menu...\n"
return
;;
*)
printf "Invalid choice. Please try again.\n"
;;
esac
printf "\n"
CHROOT_SCREENDSP_CHOOSE
}
CHROOT_SCREENDSP_CHOOSE
}
CHROOT_SCREENDSP_MENU
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
USERAPP () { # (!todo)
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/USERAPP/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" " ::: ::: :::::::: ::::::::::::::::::: ::: ::::::::: ::::::::: " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " :+: :+::+: :+::+: :+: :+: :+: :+: :+: :+::+: :+: " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " +:+ +:++:+ +:+ +:+ +:+ +:+ +:+ +:+ +:++:+ +:+ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " +#+ +:++#++:++#+++#++:++# +#++:++#: +#++:++#++:+#++:++#+ +#++:++#+ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " +#+ +#+ +#++#+ +#+ +#++#+ +#++#+ +#+ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "#+# #+##+# #+##+# #+# #+##+# #+##+# #+# " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "######## ######## ############# ###### ###### ### " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "chroot userapp" "${RESET}"
# GIT
WEBBROWSER
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
USERS () {
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/USERS/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" "_| _| _|_|_| _|_|_|_| _|_|_| _|_|_| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "_| _| _| _| _| _| _| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "_| _| _|_| _|_|_| _|_|_| _|_| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "_| _| _| _| _| _| _| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " _|_| _|_|_| _|_|_|_| _| _| _|_|_| " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "chroot users" "${RESET}"
ROOT
ADMIN
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FINISH () { # tidy up installation files - ok
NOTICE_START
for f in gentoo_unattented-setup/src/CHROOT/FINISH/*; do . $f && echo $f; done
printf "%s%s%s\n" "${BOLD}${GREEN}" " ________________________________________ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " / CONGRATS! \\" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " \\ Setup done, you did it! /" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " ---------------------------------------- " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " \ ^__^ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " \ (xx)\_______ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " (__)\ )\/\ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " ||----- | " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " || || " "${RESET}"
TIDY_STAGE3
NOTICE_END
}
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CHROOT_MENU () {
CHROOT_CHOOSE() {
printf "%s%s%s\n" "${BOLD}${GREEN}" " CCCCC HH HH RRRRRR OOOOO OOOOO TTTTTTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "CC C HH HH RR RR OO OO OO OO TTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "CC HHHHHHH RRRRRR OO OO OO OO TTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "CC C HH HH RR RR OO OO OO OO TTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " CCCCC HH HH RR RR OOOO0 OOOO0 TTT " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "CHROOT Menu:" "${RESET}"
printf "1. BASE steps menu\n"
printf "2. CORE steps menu\n"
printf "3. SCREENDSP steps menu\n"
printf "4. USERAPP run as predefined in variables\n"
printf "5. USERS run as predefined in variables\n"
printf "6. FINISH run as predefined\n"
printf "0. Exit\n"
read -p "Enter your choice: " choice
printf "\n"
case $choice in
1)
BASE
;;
2)
CORE
;;
3)
SCREENDSP
;;
4)
USERAPP
;;
5)
USERS
;;
6)
FINISH
;;
0)
printf "Returning to Main Menu...\n"
return
;;
*)
printf "Invalid choice. Please try again.\n"
;;
esac
printf "\n"
CHROOT_CHOOSE
}
CHROOT_CHOOSE
}
CHROOT_MENU
NOTICE_END
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
########## CHROOT ENDS HERE ##########
INNERSCRIPT
)
CP_CHROOT () {
NOTICE_START
# Since the chroot script can't be run outside of chroot, the script, and possibly sourced functions as well as variable scripts, need to be copied accordingly. For simplicity, copy the whole repo.
# IMPORTANT: The following commands are executed BEFORE the above INNERSCRIPT (BELOW chroot $CHROOTX /bin/bash ./chroot_run.sh). If a file needs to be made available in the INNERSCRIPT, copy it before (chroot $CHROOTX /bin/bash ./chroot_run.sh) within this CHROOT function!
rm -rf $CHROOTX/gentoo_unattented-setup
ls -la /root
echo $CHROOTX
cp -R /root/gentoo_unattented-setup $CHROOTX/gentoo_unattented-setup
ls -la $CHROOTX
NOTICE_END
}
CHROOT_INNER () { # https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Entering_the_new_environment
NOTICE_START
echo "$INNER_SCRIPT" > $CHROOTX/chroot_main.sh
chmod +x $CHROOTX/chroot_main.sh
chroot $CHROOTX /bin/bash ./chroot_main.sh
NOTICE_END
}
CP_CHROOT
CHROOT_INNER
}
CHROOT_CHOOSE
NOTICE_END
}
MAIN_MENU() {
printf "%s%s%s\n" "${BOLD}${GREEN}" " / \ / \ / \ / \ / \ / \ / \ / \ / \ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "( M | A | I | N | | M | E | N | U )" "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" " \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ " "${RESET}"
printf "%s%s%s\n" "${BOLD}${GREEN}" "MAIN Menu:" "${RESET}"
printf "1. PRE - no menu\n"
printf "2. CHROOT - no menu\n"
printf "3. PRE && CHROOT - no menu\n"
printf "4. PRE menu\n"
printf "5. CHROOT menu\n"
printf "6. PRE menu && CHROOT menu\n"
printf "0. Exit\n"
read -p "Enter your choice: " choice
printf "\n"
case $choice in
1)
printf "Running the semi unattended PRE setup as configured in 10 seconds... Exit now to see options with -h or enter the menu when running the program with -m.\n"
printf "(default PRE asks for crypt password and disk wipe confirmation)"
sleep 10
PRE_NOMENU
;;
2)
printf "Running the semi unattended CHROOT setup as configured in 10 seconds... Exit now to see options with -h or enter the menu when running the program with -m.\n"
printf "(Default CHROOT asks for kernel config menuconfig confirmation or edit and GPG password)"
sleep 10
CHROOT_NOMENU
;;
3)
printf "Running the semi unattended setup as configured in 10 seconds... Exit now to see options with -h or enter the menu when running the program with -m.\n"
printf "(Default PRE asks for crypt password and disk wipe confirmation)"
printf "(Default CHROOT asks for kernel config menuconfig confirmation or edit and GPG password)"
sleep 10
PRE_NOMENU
CHROOT_NOMENU
;;
4)
PRE_MENU
;;
5)
CHROOT_MENU
;;
6)
PRE_MENU
CHROOT_MENU
;;
0)
printf "Exiting...\n"
exit
;;
*)
printf "Invalid choice. Please try again.\n"
;;
esac
printf "\n"
MAIN_MENU
}
# Check if the script is run with the -h option
if [[ "$1" == "-a" ]]; then
printf "Running the semi unattended setup as configured in 10 seconds... Exit now to see options with -h or enter the menu when running the program with -m.\n"
printf "(Default PRE asks for crypt password and disk wipe confirmation)"
printf "(Default CHROOT asks for kernel config menuconfig confirmation or edit and GPG password)"
sleep 10
PRE_NOMENU
CHROOT_NOMENU
elif [[ "$1" == "-m" ]]; then
MAIN_MENU # Run the program with the menu
else
#printf "WELCOME TO THE GENTOO SETUP (unattended by default testing in virtualbox) .... \n"
printf "\n"
printf "%s%s%s\n" "${BOLD}${BRIGHT_GREEN}" "WELCOME :)" "${RESET}"
printf "%s%s%s\n" "${BOLD}${MAGENTA}" "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" "${RESET}"
printf "%s%s%s\n" "${BOLD}${MAGENTA}" "|g|e|n|t|o|o|_|u|n|a|t|t|e|n|t|e|d|-|s|e|t|u|p|" "${RESET}"
printf "%s%s%s\n" "${BOLD}${MAGENTA}" "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" "${RESET}"
printf "%s%s%s\n" "${BOLD}${BRIGHT_GREEN}" "https://github.com/alphaaurigae/gentoo_unattented-setup" "${RESET}"$'\n'
printf "%s%s%s\n" "${BOLD}${YELLOW}" "Usage: ./run.sh ARG" "${RESET}"
printf "%s%s%s\n" "${BOLD}${YELLOW}" "ARG -a run entire setup ... CHECK gentoo_unattented-setup/var/*" "${RESET}"
printf "%s%s%s\n" "${BOLD}${YELLOW}" "ARG -m enters menu mode (useful fe to save state in vm's" "${RESET}"
printf "\n"
printf "Refer to the readme.md file for more information. Check the readme.md file for the latest status message at the top. \n"
printf "Check the variables if its not a VM!!!\n"
printf "PRE setup wipes and encrypts the defined main disk but issues warning. \n"
printf "Works by default in virtualbox. \n"
printf "Cloning the VM for testing works fine if its a full clone ... \n"
printf "\n"
exit
fi
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++