-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
5654 lines (4938 loc) · 158 KB
/
Copy pathscript.sh
File metadata and controls
5654 lines (4938 loc) · 158 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
#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_NAME=$(basename "$0")
SCRIPT_VERSION="2026-04-12-main-ui-polish"
WORKDIR="/tmp/arch-installer"
LOG_FILE="$WORKDIR/install.log"
TARGET_MOUNT="/mnt"
ARCH_CONFIG_PATH="$TARGET_MOUNT/root/arch-install.conf"
ARCH_CHROOT_SCRIPT="$TARGET_MOUNT/root/arch-postinstall.sh"
UI_BACKEND=""
UI_HEIGHT=22
UI_WIDTH=86
UI_MENU_HEIGHT=14
DEBUG_INSTALL="yes"
CURRENT_STEP="Initialisation"
UI_CANCEL_STATUS=252
SCRIPT_LANG="fr"
declare -A T=()
mkdir -p "$WORKDIR"
touch "$LOG_FILE"
exec > >(tee -a "$LOG_FILE") 2>&1
declare -a PACSTRAP_PACKAGES=()
declare -a OFFICIAL_PACKAGES=()
declare -a CHAOTIC_PACKAGES=()
declare -a AUR_PACKAGES=()
declare -a SERVICES_TO_ENABLE=()
HOSTNAME="archlinux"
USERNAME="user"
TIMEZONE="Europe/Paris"
LOCALE="fr_FR.UTF-8"
KEYMAP="fr-latin9"
XKB_LAYOUT="fr"
CPU_VENDOR="amd"
GPU_VENDOR="headless"
NETWORK_STACK="networkmanager"
AUDIO_STACK="pipewire"
DESKTOP_CHOICE="gnome"
SESSION_STACK="both"
DISPLAY_MANAGER="gdm"
ENABLE_MULTILIB="yes"
ENABLE_AVAHI="yes"
ENABLE_BLUETOOTH="yes"
ENABLE_OPENSSH="no"
ENABLE_CUPS="no"
DISABLE_NM_WAIT_ONLINE="yes"
ENABLE_SWAPFILE="no"
SWAPFILE_SIZE_GIB="4"
ENABLE_ZRAM="no"
INSTALL_PICOM="no"
USER_SHELL_CHOICE="bash"
INSTALL_OH_MY_ZSH="no"
INSTALL_POWERLEVEL10K="no"
EXTRA_UTILITY_PACKAGES="fastfetch"
EXTRA_APP_PACKAGES=""
INSTALL_VIRT_SUITE="no"
INSTALL_GNS3="no"
GAMING_TWEAKS="no"
GNOME_DEBLOAT="no"
GNOME_DEBLOAT_PACKAGES="gnome-software gnome-weather epiphany gnome-maps gnome-music gnome-photos gnome-contacts gnome-calendar gnome-clocks gnome-tour gnome-user-docs yelp totem simple-scan malcontent"
GNOME_NAUTILUS_TWEAKS="no"
USE_OS_PROBER="yes"
PREPARE_CHAOTIC="no"
BOOTLOADER="grub"
EFI_MOUNT_TARGET="/boot/efi"
KERNEL_REPO_URL=""
STORAGE_STACK="standard"
USE_BTRFS_SUBVOLUMES="no"
FORMAT_ROOT_CONTAINER="no"
LUKS_NAME="cryptroot"
LUKS_PASSWORD=""
LVM_VG_NAME="vg0"
LVM_ROOT_NAME="root"
LVM_HOME_NAME="home"
LVM_SWAP_NAME="swap"
LVM_CREATE_HOME="no"
LVM_CREATE_SWAP="yes"
ROOT_LV_SIZE_GIB="80"
LVM_SWAP_SIZE_GIB="8"
FINAL_ROOT_DEVICE=""
FINAL_HOME_DEVICE=""
FINAL_SWAP_DEVICE=""
KERNEL_MODE="official"
KERNEL_PACKAGE="linux"
KERNEL_HEADERS_PACKAGE="linux-headers"
MESA_MODE="official"
CUSTOM_MESA_PACKAGE=""
CUSTOM_MESA_LIB32_PACKAGE=""
TARGET_DISK=""
PARTITION_MODE="manual"
EFI_PART=""
ROOT_PART=""
HOME_PART=""
SWAP_PART=""
FORMAT_EFI="no"
FORMAT_ROOT="yes"
FORMAT_HOME="no"
ROOT_FS="ext4"
HOME_FS="ext4"
AUTO_CREATE_HOME="no"
AUTO_CREATE_SWAP="yes"
AUTO_SWAP_SIZE_GIB="4"
AUTO_ROOT_SIZE_GIB="80"
AUTOLOGIN="no"
AUTOSTART_WM="no"
# ─── i18n: chargement des traductions ───
load_lang_fr() {
T=(
# --- Sections ---
[sec_init]="Initialisation"
[sec_memory]="MEMOIRE"
[sec_network]="RESEAU"
[sec_identity]="IDENTITE"
[sec_system]="SYSTEME"
[sec_user]="UTILISATEUR"
[sec_tkg]="LINUX-TKG"
[sec_storage]="STOCKAGE"
[sec_part_auto]="PARTITIONNEMENT AUTO"
[sec_part_manual]="PARTITIONNEMENT MANUEL"
[sec_disks]="DISQUES"
[sec_partitions]="PARTITIONS"
[sec_menu]="MENU"
[sec_verify]="VERIFICATION"
[sec_save_profile]="SAUVEGARDE PROFIL"
[sec_load_profile]="CHARGEMENT PROFIL"
# --- Main menu ---
[menu_title]="ARCH INSTALLER"
[menu_identity]="Identite"
[menu_system]="Systeme"
[menu_user]="Utilisateur"
[menu_storage]="Stockage"
[menu_network]="Connexion live"
[menu_tkg]="Linux-tkg"
[menu_save]="Sauver"
[menu_save_desc]="Sauvegarder le profil"
[menu_load]="Charger"
[menu_load_desc]="Restaurer un profil"
[menu_summary]="Resume"
[menu_summary_desc]="Verification pre-install"
[menu_install]="Installer"
[menu_install_desc]="Lancer l'installation"
[menu_quit]="Quitter"
[menu_main]="MENU PRINCIPAL"
# --- Dashboard ---
[dash_pc]="PC"
[dash_hw]="HW"
[dash_state]="Etat"
[dash_cancel]="[Cancel] Retour [Ctrl+C] Quitter"
# --- Identity ---
[hostname]="Hostname"
[hostname_invalid]="HOSTNAME INVALIDE"
[hostname_rule]="Doit commencer par a-z, contenir a-z 0-9 - (max 63 car.)"
[username]="Utilisateur"
[username_invalid]="NOM INVALIDE"
[username_root]="Le nom d'utilisateur ne peut pas etre root."
[username_rule]="Doit commencer par a-z ou _, contenir a-z 0-9 _ - (max 32 car.)"
[timezone]="Timezone"
[locale_label]="LOCALE"
[keymap_label]="CLAVIER"
[password_root]="Mot de passe ROOT"
[password_same]="Meme mot de passe pour %s ?"
[password_user]="Mot de passe %s"
[cpu_label]="MICROCODE CPU"
[cpu_none]="Aucun"
# --- System ---
[enable_multilib]="Activer le depot multilib ?"
[add_chaotic]="Ajouter Chaotic-AUR ?"
[net_label]="RESEAU"
[net_none]="Aucun"
[audio_label]="AUDIO"
[audio_alsa]="ALSA uniquement"
[boot_label]="BOOTLOADER"
[osprober]="Activer os-prober (detection multi-boot) ?"
[sdboot_warn]="systemd-boot stocke noyau et initramfs sur l'ESP (/boot). Verifier la taille en dual-boot."
[desktop_label]="BUREAU / WM"
[desktop_tty]="TTY uniquement"
[session_label]="SESSION GRAPHIQUE"
[dm_label]="DISPLAY MANAGER"
[dm_none]="Aucun"
[autologin]="Autologin TTY1 ?"
[autostart_wm]="Demarrage auto du DE/WM apres login TTY ?"
[gpu_label]="GPU"
[gpu_nvidia]="NVIDIA (proprietaire)"
[gpu_generic]="Generique / VM"
[mesa_label]="SOURCE MESA"
[mesa_official]="Officiel"
[mesa_compilation]="AUR (compilation)"
[mesa_pkg_chaotic]="Package Mesa Chaotic"
[mesa_pkg_aur]="Package Mesa AUR"
[mesa_pkg_lib32]="Package lib32 Mesa"
[mesa_pkg_lib32_aur]="Package lib32 Mesa AUR"
[kernel_label]="NOYAU"
[kernel_tkg]="linux-tkg (compilation Git)"
[kernel_chaotic]="Chaotic-AUR (custom)"
[kernel_aur]="AUR (compilation)"
[kernel_pkg_chaotic]="Package noyau Chaotic-AUR"
[kernel_pkg_aur]="Package noyau AUR"
[kernel_pkg_headers]="Package headers"
[enable_avahi]="Activer Avahi (mDNS) ?"
[enable_bt]="Activer Bluetooth ?"
[enable_ssh]="Activer OpenSSH ?"
[enable_cups]="Activer CUPS (impression) ?"
[disable_nm_wait]="Desactiver NetworkManager-wait-online (boot plus rapide) ?"
[gnome_debloat]="Supprimer les apps GNOME inutiles (debloat) ?"
[gnome_debloat_select]="GNOME DEBLOAT - Selectionnez les paquets a supprimer"
[gnome_nautilus_tweaks]="Appliquer les tweaks Nautilus (cache miniatures, pas de recherche recursive, tracker desactive) ?"
# --- User extras ---
[install_picom]="Installer picom (compositeur X11) ?"
[shell_label]="SHELL"
[install_ohmyzsh]="Installer Oh My Zsh ?"
[install_p10k]="Installer Powerlevel10k ?"
[cli_label]="OUTILS CLI"
[apps_label]="APPLICATIONS"
[steam_note]="Steam (multilib requis)"
[install_virt]="Installer QEMU + libvirt + virt-manager ?"
[install_gns3]="Installer GNS3 ?"
[gaming_tweaks]="Appliquer les tweaks gaming ?"
# --- TKG ---
[tkg_warn_select]="Selectionner d'abord 'linux-tkg (compilation Git)' dans SYSTEME > NOYAU."
[tkg_warn]="linux-tkg sera compile localement — la compilation prend du temps."
[tkg_info]="linux-tkg utilise ses propres menus interactifs.\nLe script se contente de cloner le depot et lancer makepkg -si."
[tkg_url_official]="URL officielle du depot linux-tkg ?"
[tkg_url_custom]="URL du depot linux-tkg"
# --- Storage ---
[storage_schema]="SCHEMA DE STOCKAGE"
[luks_name]="Nom LUKS"
[luks_reuse]="Reutiliser le mot de passe LUKS ?"
[luks_password]="Mot de passe LUKS"
[lvm_vg]="Nom du VG"
[lvm_lv_root]="Nom du LV /"
[lvm_create_home]="Creer un LV /home ?"
[lvm_root_size]="Taille LV / (GiB)"
[lvm_lv_home]="Nom du LV /home"
[lvm_create_swap]="Creer un LV swap ?"
[lvm_swap_size]="Taille LV swap (GiB)"
[lvm_lv_swap]="Nom du LV swap"
# --- Partitioning ---
[part_mode]="MODE DE PARTITIONNEMENT"
[part_existing]="Partitions existantes"
[part_cfdisk]="cfdisk + selection manuelle"
[part_auto]="Partitionnement auto (efface le disque)"
[auto_wipe_warn]="ATTENTION: toutes les donnees sur %s seront effacees.\n\nLancer le partitionnement automatique ?"
[auto_cancelled]="Partitionnement automatique annule."
[fs_root]="Systeme de fichiers pour la racine /"
[fs_home]="Systeme de fichiers pour /home"
[fs_home_lv]="Systeme de fichiers du volume logique /home"
[fs_lv_home]="Systeme de fichiers du volume logique /home"
[fs_root_lv]="Systeme de fichiers du volume logique /"
[fs_lv_root]="Systeme de fichiers du volume logique /"
[fs_luks_existing]="Systeme de fichiers deja present dans le conteneur LUKS"
[fs_for]="Systeme de fichiers pour %s"
[btrfs_layout]="Layout btrfs (@, @home, @log, @pkg, @snapshots) ?"
[auto_swap]="Creer une partition swap ?"
[auto_swap_size]="Taille swap (GiB)"
[auto_home]="Creer une partition /home ?"
[auto_root_size]="Taille / (GiB)"
[select_disk]="Selectionner le disque."
[disk_target]="DISQUE CIBLE"
[disk_path]="Chemin du disque cible (ex: /dev/nvme0n1)"
[disk_invalid]="Le disque saisi n'est pas valide."
[part_select]="PARTITION"
[part_skip]="Ne pas utiliser cette partition"
[part_efi]="Partition EFI a utiliser"
[part_root]="Partition racine / a utiliser"
[part_home]="Partition /home a utiliser"
[part_swap]="Partition swap a utiliser"
[part_format]="Reformater %s (FAT32) ?"
[part_luks_init]="Initialiser LUKS sur %s ?"
[part_reformat_root]="Reformater / ?"
[part_sep_home]="Partition /home separee ?"
[part_reformat]="Reformater %s ?"
[part_swap_ded]="Partition swap dediee ?"
# --- Memory ---
[create_swapfile]="Creer un swapfile ?"
[swapfile_size]="Taille swapfile (GiB)"
[enable_zram]="Activer zram ?"
# --- Network (live) ---
[net_detected]="Connexion Internet detectee dans l'environnement live."
[net_no_auto]="La connectivite n'a pas pu etre validee automatiquement. L'installation continue; pacstrap echouera si le reseau du live n'est pas pret."
[net_none_detected]="Aucune connexion Internet detectee."
[net_no_conn]="Pas de connexion Internet."
[net_iwctl]="Lancer iwctl (Wi-Fi)"
[net_continue]="Continuer sans reseau"
[net_abort]="Annuler"
[net_detected_manual]="Connexion Internet detectee apres configuration manuelle."
[net_still_none]="Toujours aucune connexion validee. Pacstrap risque d'echouer."
[net_continue_warn]="Installation poursuivie sans verification reseau."
[net_abort_die]="Installation annulee a ta demande."
# --- Summary ---
[summary_title]="RESUME"
[summary_confirm]="Confirmer et lancer l'installation ?"
[danger_title]="⚠ CONFIRMATION DESTRUCTIVE"
[danger_msg_header]="⚠ AVERTISSEMENT — OPÉRATION IRRÉVERSIBLE"
[danger_msg_body]="Les données suivantes vont être DÉTRUITES :"
[danger_no_undo]="Il n'est pas possible d'annuler après cette étape."
[danger_confirm]="Confirmer la destruction des données ?"
[danger_confirm_cli]="Confirmer la destruction ?"
[unknown]="inconnu"
# --- Summary labels ---
[sum_identity]="IDENTITE"
[sum_machine]="Machine"
[sum_user]="Utilisateur"
[sum_locale]="Locale"
[sum_timezone]="Timezone"
[sum_secrets]="Secrets"
[sum_system]="SYSTEME"
[sum_boot]="Boot"
[sum_kernel]="Noyau"
[sum_desktop]="Bureau"
[sum_gpu]="GPU"
[sum_network]="Reseau"
[sum_audio]="Audio"
[sum_shell]="Shell"
[sum_cli]="CLI"
[sum_options]="Options"
[sum_virt]="Virt"
[sum_extras]="Extras"
[sum_none]="aucun"
[sum_storage]="STOCKAGE"
[sum_mode]="Mode"
[sum_disk]="Disque"
[sum_efi]="EFI"
[sum_root]="Racine"
[sum_home]="Home"
[sum_swap]="Swap"
[sum_swapfile]="Swapfile"
[sum_zram]="Zram"
[sum_luks]="LUKS"
[sum_lvm]="LVM"
[sum_btrfs]="btrfs"
[sum_packages]="PAQUETS"
[sum_base]="Base"
[sum_official]="Officiels"
[sum_chaotic]="Chaotic"
[sum_aur]="AUR"
[sum_services]="Services"
# --- Profile ---
[profile_path]="Chemin du profil"
[profile_saved]="Profil enregistre dans %s"
[profile_no_pass]="Les mots de passe ne sont pas sauvegardes dans les profils."
[profile_notfound]="Profil introuvable: %s"
[profile_loaded]="Profil charge depuis %s"
[profile_pass_warn]="Les mots de passe restent a ressaisir avant l'installation."
# --- Pre-install checks ---
[check_no_pass]="Les mots de passe systeme n'ont pas encore ete saisis."
[check_no_luks]="Le mot de passe LUKS n'a pas encore ete saisi."
[check_no_part]="Le partitionnement n'est pas encore defini."
# --- pretty_label ---
[pl_none]="Aucun"
[pl_nvidia]="NVIDIA proprietaire"
[pl_generic]="Generique / VM"
[pl_no_gpu]="Sans GPU"
[pl_manual]="Manuel"
[pl_simple]="Simple"
[pl_official]="officiel"
[pl_git_repo]="depot Git"
# --- Describe ---
[desc_secrets]="secrets"
[desc_no_extra]="aucun extra"
[desc_extra_s]="extra"
[desc_extras_s]="extras"
[desc_active]="Actif"
[desc_inactive]="Inactif"
# --- Misc errors ---
[err_root]="Ce script doit etre lance en root depuis l'Arch ISO."
[err_uefi]="Ce script cible un demarrage UEFI avec une partition EFI montee sur /boot/efi ou /boot selon le bootloader choisi."
[err_cmd_missing]="Commande requise introuvable: %s"
[err_value_empty]="La valeur ne peut pas etre vide."
[err_integer]="Merci de saisir un entier strictement positif."
[err_password_empty]="Le mot de passe ne peut pas etre vide."
[err_password_mismatch]="Les mots de passe ne correspondent pas."
[err_choice_invalid]="Choix invalide."
[err_part_invalid]="La partition saisie n'est pas valide."
[err_umount]="Impossible de preparer l'installation tant que %s est occupe."
[umount_ask]="Tout demonter sous %s avant de preparer l'installation ?"
[umount_busy]="Le point de montage %s est deja utilise."
# --- Whiptail titles ---
[wt_confirm]="Confirmation"
[wt_input]="Saisie"
[wt_required]="Valeur requise"
[wt_password]="Mot de passe"
[wt_password_confirm]="Confirmation"
[wt_password_confirm_msg]="Confirmer %s"
[wt_password_required]="Mot de passe requis"
[wt_integer]="Nombre"
[wt_integer_invalid]="Entier invalide"
[wt_select]="Selection"
[wt_multi_select]="Selection multiple"
# --- Language chooser ---
[lang_label]="LANGUE"
# --- Steam multilib warn ---
[steam_multilib_warn]="Steam necessite le depot multilib. Activation automatique de multilib."
# --- Misc prompts ---
[yn_invalid]="Reponse invalide. Merci de repondre par oui/non."
)
}
load_lang_en() {
T=(
# --- Sections ---
[sec_init]="Initialization"
[sec_memory]="MEMORY"
[sec_network]="NETWORK"
[sec_identity]="IDENTITY"
[sec_system]="SYSTEM"
[sec_user]="USER"
[sec_tkg]="LINUX-TKG"
[sec_storage]="STORAGE"
[sec_part_auto]="AUTO PARTITIONING"
[sec_part_manual]="MANUAL PARTITIONING"
[sec_disks]="DISKS"
[sec_partitions]="PARTITIONS"
[sec_menu]="MENU"
[sec_verify]="VERIFICATION"
[sec_save_profile]="SAVE PROFILE"
[sec_load_profile]="LOAD PROFILE"
# --- Main menu ---
[menu_title]="ARCH INSTALLER"
[menu_identity]="Identity"
[menu_system]="System"
[menu_user]="User"
[menu_storage]="Storage"
[menu_network]="Live connection"
[menu_tkg]="Linux-tkg"
[menu_save]="Save"
[menu_save_desc]="Save profile"
[menu_load]="Load"
[menu_load_desc]="Restore profile"
[menu_summary]="Summary"
[menu_summary_desc]="Pre-install check"
[menu_install]="Install"
[menu_install_desc]="Start installation"
[menu_quit]="Quit"
[menu_main]="MAIN MENU"
# --- Dashboard ---
[dash_pc]="PC"
[dash_hw]="HW"
[dash_state]="Status"
[dash_cancel]="[Cancel] Back [Ctrl+C] Quit"
# --- Identity ---
[hostname]="Hostname"
[hostname_invalid]="INVALID HOSTNAME"
[hostname_rule]="Must start with a-z, contain a-z 0-9 - (max 63 chars)"
[username]="Username"
[username_invalid]="INVALID NAME"
[username_root]="Username cannot be root."
[username_rule]="Must start with a-z or _, contain a-z 0-9 _ - (max 32 chars)"
[timezone]="Timezone"
[locale_label]="LOCALE"
[keymap_label]="KEYBOARD"
[password_root]="ROOT password"
[password_same]="Same password for %s?"
[password_user]="Password for %s"
[cpu_label]="CPU MICROCODE"
[cpu_none]="None"
# --- System ---
[enable_multilib]="Enable multilib repository?"
[add_chaotic]="Add Chaotic-AUR?"
[net_label]="NETWORK"
[net_none]="None"
[audio_label]="AUDIO"
[audio_alsa]="ALSA only"
[boot_label]="BOOTLOADER"
[osprober]="Enable os-prober (multi-boot detection)?"
[sdboot_warn]="systemd-boot stores kernel and initramfs on ESP (/boot). Check size for dual-boot."
[desktop_label]="DESKTOP / WM"
[desktop_tty]="TTY only"
[session_label]="GRAPHICAL SESSION"
[dm_label]="DISPLAY MANAGER"
[dm_none]="None"
[autologin]="Autologin TTY1?"
[autostart_wm]="Auto-start DE/WM after TTY login?"
[gpu_label]="GPU"
[gpu_nvidia]="NVIDIA (proprietary)"
[gpu_generic]="Generic / VM"
[mesa_label]="MESA SOURCE"
[mesa_official]="Official"
[mesa_compilation]="AUR (build from source)"
[mesa_pkg_chaotic]="Mesa Chaotic package"
[mesa_pkg_aur]="Mesa AUR package"
[mesa_pkg_lib32]="lib32 Mesa package"
[mesa_pkg_lib32_aur]="lib32 Mesa AUR package"
[kernel_label]="KERNEL"
[kernel_tkg]="linux-tkg (Git build)"
[kernel_chaotic]="Chaotic-AUR (custom)"
[kernel_aur]="AUR (build from source)"
[kernel_pkg_chaotic]="Chaotic-AUR kernel package"
[kernel_pkg_aur]="AUR kernel package"
[kernel_pkg_headers]="Headers package"
[enable_avahi]="Enable Avahi (mDNS)?"
[enable_bt]="Enable Bluetooth?"
[enable_ssh]="Enable OpenSSH?"
[enable_cups]="Enable CUPS (printing)?"
[disable_nm_wait]="Disable NetworkManager-wait-online (faster boot)?"
[gnome_debloat]="Remove unnecessary GNOME apps (debloat)?"
[gnome_debloat_select]="GNOME DEBLOAT - Select packages to remove"
[gnome_nautilus_tweaks]="Apply Nautilus tweaks (thumbnail cache, no recursive search, tracker disabled)?"
# --- User extras ---
[install_picom]="Install picom (X11 compositor)?"
[shell_label]="SHELL"
[install_ohmyzsh]="Install Oh My Zsh?"
[install_p10k]="Install Powerlevel10k?"
[cli_label]="CLI TOOLS"
[apps_label]="APPLICATIONS"
[steam_note]="Steam (multilib required)"
[install_virt]="Install QEMU + libvirt + virt-manager?"
[install_gns3]="Install GNS3?"
[gaming_tweaks]="Apply gaming tweaks?"
# --- TKG ---
[tkg_warn_select]="Select 'linux-tkg (Git build)' in SYSTEM > KERNEL first."
[tkg_warn]="linux-tkg will be compiled locally — this takes time."
[tkg_info]="linux-tkg uses its own interactive menus.\nThe script just clones the repo and runs makepkg -si."
[tkg_url_official]="Use official linux-tkg repo URL?"
[tkg_url_custom]="linux-tkg repo URL"
# --- Storage ---
[storage_schema]="STORAGE SCHEME"
[luks_name]="LUKS name"
[luks_reuse]="Reuse LUKS password?"
[luks_password]="LUKS password"
[lvm_vg]="VG name"
[lvm_lv_root]="LV / name"
[lvm_create_home]="Create /home LV?"
[lvm_root_size]="LV / size (GiB)"
[lvm_lv_home]="LV /home name"
[lvm_create_swap]="Create swap LV?"
[lvm_swap_size]="LV swap size (GiB)"
[lvm_lv_swap]="LV swap name"
# --- Partitioning ---
[part_mode]="PARTITIONING MODE"
[part_existing]="Existing partitions"
[part_cfdisk]="cfdisk + manual selection"
[part_auto]="Auto partitioning (wipes disk)"
[auto_wipe_warn]="WARNING: all data on %s will be erased.\n\nProceed with auto partitioning?"
[auto_cancelled]="Auto partitioning cancelled."
[fs_root]="Filesystem for root /"
[fs_home]="Filesystem for /home"
[fs_home_lv]="Filesystem for /home logical volume"
[fs_lv_home]="Filesystem for /home logical volume"
[fs_root_lv]="Filesystem for / logical volume"
[fs_lv_root]="Filesystem for / logical volume"
[fs_luks_existing]="Existing filesystem inside LUKS container"
[fs_for]="Filesystem for %s"
[btrfs_layout]="Btrfs layout (@, @home, @log, @pkg, @snapshots)?"
[auto_swap]="Create a swap partition?"
[auto_swap_size]="Swap size (GiB)"
[auto_home]="Create a /home partition?"
[auto_root_size]="Root / size (GiB)"
[select_disk]="Select disk."
[disk_target]="TARGET DISK"
[disk_path]="Target disk path (e.g. /dev/nvme0n1)"
[disk_invalid]="The specified disk is not valid."
[part_select]="PARTITION"
[part_skip]="Skip this partition"
[part_efi]="EFI partition to use"
[part_root]="Root / partition to use"
[part_home]="/home partition to use"
[part_swap]="Swap partition to use"
[part_format]="Reformat %s (FAT32)?"
[part_luks_init]="Initialize LUKS on %s?"
[part_reformat_root]="Reformat /?"
[part_sep_home]="Separate /home partition?"
[part_reformat]="Reformat %s?"
[part_swap_ded]="Dedicated swap partition?"
# --- Memory ---
[create_swapfile]="Create a swapfile?"
[swapfile_size]="Swapfile size (GiB)"
[enable_zram]="Enable zram?"
# --- Network (live) ---
[net_detected]="Internet connection detected in live environment."
[net_no_auto]="Connectivity could not be validated automatically. Installation continues; pacstrap will fail if network is not ready."
[net_none_detected]="No Internet connection detected."
[net_no_conn]="No Internet connection."
[net_iwctl]="Launch iwctl (Wi-Fi)"
[net_continue]="Continue without network"
[net_abort]="Cancel"
[net_detected_manual]="Internet connection detected after manual configuration."
[net_still_none]="Still no validated connection. Pacstrap may fail."
[net_continue_warn]="Installation continues without network verification."
[net_abort_die]="Installation cancelled at your request."
# --- Summary ---
[summary_title]="SUMMARY"
[summary_confirm]="Confirm and start installation?"
[danger_title]="⚠ DESTRUCTIVE CONFIRMATION"
[danger_msg_header]="⚠ WARNING — IRREVERSIBLE OPERATION"
[danger_msg_body]="The following data will be DESTROYED:"
[danger_no_undo]="This cannot be undone after this step."
[danger_confirm]="Confirm data destruction?"
[danger_confirm_cli]="Confirm destruction?"
[unknown]="unknown"
# --- Summary labels ---
[sum_identity]="IDENTITY"
[sum_machine]="Machine"
[sum_user]="User"
[sum_locale]="Locale"
[sum_timezone]="Timezone"
[sum_secrets]="Secrets"
[sum_system]="SYSTEM"
[sum_boot]="Boot"
[sum_kernel]="Kernel"
[sum_desktop]="Desktop"
[sum_gpu]="GPU"
[sum_network]="Network"
[sum_audio]="Audio"
[sum_shell]="Shell"
[sum_cli]="CLI"
[sum_options]="Options"
[sum_virt]="Virt"
[sum_extras]="Extras"
[sum_none]="none"
[sum_storage]="STORAGE"
[sum_mode]="Mode"
[sum_disk]="Disk"
[sum_efi]="EFI"
[sum_root]="Root"
[sum_home]="Home"
[sum_swap]="Swap"
[sum_swapfile]="Swapfile"
[sum_zram]="Zram"
[sum_luks]="LUKS"
[sum_lvm]="LVM"
[sum_btrfs]="btrfs"
[sum_packages]="PACKAGES"
[sum_base]="Base"
[sum_official]="Official"
[sum_chaotic]="Chaotic"
[sum_aur]="AUR"
[sum_services]="Services"
# --- Profile ---
[profile_path]="Profile path"
[profile_saved]="Profile saved to %s"
[profile_no_pass]="Passwords are not saved in profiles."
[profile_notfound]="Profile not found: %s"
[profile_loaded]="Profile loaded from %s"
[profile_pass_warn]="Passwords still need to be entered before installation."
# --- Pre-install checks ---
[check_no_pass]="System passwords have not been entered yet."
[check_no_luks]="LUKS password has not been entered yet."
[check_no_part]="Partitioning has not been defined yet."
# --- pretty_label ---
[pl_none]="None"
[pl_nvidia]="NVIDIA proprietary"
[pl_generic]="Generic / VM"
[pl_no_gpu]="No GPU"
[pl_manual]="Manual"
[pl_simple]="Simple"
[pl_official]="official"
[pl_git_repo]="Git repo"
# --- Describe ---
[desc_secrets]="secrets"
[desc_no_extra]="no extras"
[desc_extra_s]="extra"
[desc_extras_s]="extras"
[desc_active]="Active"
[desc_inactive]="Inactive"
# --- Misc errors ---
[err_root]="This script must be run as root from the Arch ISO."
[err_uefi]="This script targets UEFI boot with an EFI partition mounted on /boot/efi or /boot."
[err_cmd_missing]="Required command not found: %s"
[err_value_empty]="Value cannot be empty."
[err_integer]="Please enter a strictly positive integer."
[err_password_empty]="Password cannot be empty."
[err_password_mismatch]="Passwords do not match."
[err_choice_invalid]="Invalid choice."
[err_part_invalid]="The specified partition is not valid."
[err_umount]="Cannot prepare installation while %s is busy."
[umount_ask]="Unmount everything under %s before preparing installation?"
[umount_busy]="Mount point %s is already in use."
# --- Whiptail titles ---
[wt_confirm]="Confirm"
[wt_input]="Input"
[wt_required]="Required"
[wt_password]="Password"
[wt_password_confirm]="Confirm"
[wt_password_confirm_msg]="Confirm %s"
[wt_password_required]="Password required"
[wt_integer]="Number"
[wt_integer_invalid]="Invalid integer"
[wt_select]="Selection"
[wt_multi_select]="Multiple selection"
# --- Language chooser ---
[lang_label]="LANGUAGE"
# --- Steam multilib warn ---
[steam_multilib_warn]="Steam requires multilib repository. Enabling multilib automatically."
# --- Misc prompts ---
[yn_invalid]="Invalid answer. Please answer yes/no."
)
}
# Load default language
load_lang_fr
section() {
CURRENT_STEP=$1
printf '\n== %s ==\n' "$1"
}
info() {
printf '[INFO] %s\n' "$1"
}
warn() {
printf '[WARN] %s\n' "$1" >&2
}
die() {
printf '[ERR ] %s\n' "$1" >&2
exit 1
}
format_command() {
local item
for item in "$@"; do
printf '%q ' "$item"
done
}
log_command() {
printf '[CMD ] '
format_command "$@"
printf '\n'
}
run_logged() {
log_command "$@"
"$@"
}
# Exécute une commande dans un pseudo-terminal (pty) via script(1).
# Pacman/pacstrap détectent si stdout est un tty ; sans pty ils désactivent
# les barres de progression et bufferisent la sortie.
run_pty() {
log_command "$@"
script -qefc "$(printf '%q ' "$@")" /dev/null
}
handle_error() {
local exit_code=$1
local line_no=$2
local failed_command=$3
printf '\n[ERR ] Echec pendant: %s\n' "${CURRENT_STEP:-etape inconnue}" >&2
printf '[ERR ] Ligne: %s\n' "$line_no" >&2
printf '[ERR ] Commande: %s\n' "$failed_command" >&2
printf '[ERR ] Log: %s\n' "$LOG_FILE" >&2
exit "$exit_code"
}
handle_interrupt() {
local signal_name=${1:-INT}
trap - ERR INT TERM
printf '\n[WARN] Interruption recue (%s). Installation stoppee.\n' "$signal_name" >&2
printf '[WARN] Log: %s\n' "$LOG_FILE" >&2
exit 130
}
trap 'handle_error $? $LINENO "$BASH_COMMAND"' ERR
trap 'handle_interrupt INT' INT
trap 'handle_interrupt TERM' TERM
is_ui_cancel_status() {
[[ "${1:-0}" -eq "$UI_CANCEL_STATUS" ]]
}
capture_value() {
local var_name=$1
shift
local value status=0
value=$("$@") || status=$?
if is_ui_cancel_status "$status"; then
return "$UI_CANCEL_STATUS"
fi
if (( status != 0 )); then
return "$status"
fi
printf -v "$var_name" '%s' "$value"
}
set_yes_no_var() {
local var_name=$1
local prompt=$2
local default=${3:-y}
local status=0
if prompt_yes_no "$prompt" "$default"; then
printf -v "$var_name" 'yes'
return 0
fi
status=$?
if is_ui_cancel_status "$status"; then
return "$UI_CANCEL_STATUS"
fi
printf -v "$var_name" 'no'
}
run_menu_action() {
local status=0
"$@" || status=$?
if is_ui_cancel_status "$status"; then
return 0
fi
return "$status"
}
append_unique() {
local -n array_ref=$1
shift
local candidate existing found
for candidate in "$@"; do
[[ -z "$candidate" ]] && continue
found=0
for existing in "${array_ref[@]}"; do
if [[ "$existing" == "$candidate" ]]; then
found=1
break
fi
done
if (( ! found )); then
array_ref+=("$candidate")
fi
done
}
require_root() {
if (( EUID != 0 )); then
die "${T[err_root]}"
fi
}
require_uefi() {
if [[ ! -d /sys/firmware/efi ]]; then
die "${T[err_uefi]}"
fi
}
require_command() {
if ! command -v "$1" >/dev/null 2>&1; then
die "$(printf "${T[err_cmd_missing]}" "$1")"
fi
}
use_tui() {
[[ "$UI_BACKEND" == "whiptail" ]] && [[ -e /dev/tty ]]
}
init_ui() {
if command -v whiptail >/dev/null 2>&1 && [[ -e /dev/tty ]]; then
UI_BACKEND="whiptail"
else
UI_BACKEND="cli"
fi
}
choose_script_language() {
local lang_choice status=0
if use_tui; then
lang_choice=$(run_whiptail_capture --backtitle "$SCRIPT_NAME" --title "LANGUAGE / LANGUE" --menu \
"Choose the installer language / Choisir la langue" \
10 "$UI_WIDTH" 2 \
"fr" "Francais" \
"en" "English") || status=$?
if (( status != 0 )); then
lang_choice="fr"
fi
else
printf '1) Francais\n2) English\n'
local reply
read -rp "Language / Langue [1]: " reply
case "${reply:-1}" in
2|en) lang_choice="en" ;;
*) lang_choice="fr" ;;
esac
fi
SCRIPT_LANG="$lang_choice"
case "$SCRIPT_LANG" in
en) load_lang_en ;;
*) load_lang_fr ;;
esac
}
run_whiptail_capture() {
local output status
output=$(whiptail "$@" --output-fd 3 3>&1 1>/dev/tty 2>/dev/tty) || status=$?
status=${status:-0}
printf '%s' "$output"
return "$status"
}
show_message() {
local title=$1
local message=$2
if use_tui; then
whiptail --backtitle "$SCRIPT_NAME" --title "$title" --msgbox "$message" "$UI_HEIGHT" "$UI_WIDTH" </dev/tty >/dev/tty 2>/dev/tty
else
section "$title"
printf '%s\n' "$message"
fi
}
run_interactive_command() {
"$@" </dev/tty >/dev/tty 2>/dev/tty
}
prompt_yes_no() {
local prompt=$1
local default=${2:-y}
local suffix reply status
if use_tui; then
if [[ "$default" == "n" ]]; then
whiptail --backtitle "$SCRIPT_NAME" --title "${T[wt_confirm]}" --defaultno --yesno "$prompt" 10 "$UI_WIDTH" </dev/tty >/dev/tty 2>/dev/tty
else
whiptail --backtitle "$SCRIPT_NAME" --title "${T[wt_confirm]}" --yesno "$prompt" 10 "$UI_WIDTH" </dev/tty >/dev/tty 2>/dev/tty
fi
status=$?
case "$status" in
0)
return 0
;;
1)
return 1
;;
*)
return "$UI_CANCEL_STATUS"
;;
esac
fi
if [[ "$default" == "y" ]]; then
suffix="[Y/n]"
else
suffix="[y/N]"
fi
while true; do
read -rp "$prompt $suffix " reply
reply=${reply:-$default}
case "${reply,,}" in
y|yes|o|oui)