| Hash | Commit message | Author | Date | Files | + | - |
1 | commit 9858475d51f62823687af41c914e57c852275c5d |
2 | Author: nvx1 <[email protected]> |
3 | Date: Thu Mar 31 06:35:39 2022 +0200 |
4 | |
5 | Update. |
6 | --- |
7 | .INSTALL | 4 ++ |
8 | AutoInstall | 8 ++-- |
9 | AutoPart | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
10 | 3 files changed, 153 insertions(+), 4 deletions(-) |
11 | |
12 | diff --git a/.INSTALL b/.INSTALL |
13 | new file mode 100755 |
14 | index 0000000..1325ddc |
15 | --- /dev/null |
16 | +++ b/.INSTALL |
17 | @@ -0,0 +1,4 @@ |
18 | +#!/usr/bin/env bash |
19 | + |
20 | +echo -e "\ |
21 | + \033[31m\e[106m HIIIII" |
22 | diff --git a/AutoInstall b/AutoInstall |
23 | index 053f735..2ed9e93 100755 |
24 | --- a/AutoInstall |
25 | +++ b/AutoInstall |
26 | @@ -400,7 +400,7 @@ for x in curl ca-certificates base-devel archlinux-keyring hwinfo neofetch rsync |
27 | done |
28 | |
29 | pacman-key --init >/dev/null 2>&1; pacman-key --populate >/dev/null 2>&1 |
30 | -dialog --title "AutoLinux Installation" --infobox "Synchronizing system time to ensure successful and secure installation of software..." 4 70 |
31 | +dialog --title "AutoLinux Installation" --infobox "Synchronizing system time to ensure successful and secure installation of software..." 5 70 |
32 | ntpdate 0.us.pool.ntp.org >/dev/null 2>&1 |
33 | |
34 | # newmirrors || err "User exited." |
35 | @@ -467,11 +467,11 @@ grep -q "OTHER_OPTS='-a pulseaudio -m alsa_seq -r 48000'" /etc/conf.d/fluidsynth |
36 | echo "OTHER_OPTS='-a pulseaudio -m alsa_seq -r 48000'" >> /etc/conf.d/fluidsynth |
37 | |
38 | |
39 | -[ "$loader" = "0" ] && installpkg grub && grubtheme && yesGrub |
40 | +[ "$loader" = "0" ] && installpkg grub && grubtheme && yesGrub pkill -15 -x 'pulseaudio'[41m |
41 | |
42 | -pkill -15 -x 'pulseaudio'; sudo -u "$name" pulseaudio --start ; system_config ; finalize |
43 | +sudo -u "$name" pulseaudio --start ; system_config ; finalize ; clear[41m |
44 | |
45 | -clear ; [ $edition = '1' ] || [ $edition = '2' ] && skell |
46 | +[ $edition = '1' ] || [ $edition = '2' ] && skell |
47 | |
48 | |
49 | ######################################################################################################################################################################################### |
50 | diff --git a/AutoPart b/AutoPart |
51 | new file mode 100755 |
52 | index 0000000..6ddc078 |
53 | --- /dev/null |
54 | +++ b/AutoPart |
55 | @@ -0,0 +1,145 @@ |
56 | +#!/bin/sh |
57 | +######################################################################################################################################################################################### |
58 | +## A U T O L I N U X P A R T I T I O N I N G S C R I P T ## |
59 | +######################################################################################################################################################################################### |
60 | + |
61 | +# _ _ _ __ _ _ #[41m |
62 | +# /.\ _ _ FJ_ ____ FJ / J _ _ _ _ _ FJ LJ #[41m |
63 | +# //_\\ J | | LJ _| F __ J J | LFJ J ' \ J J | | L J \/ F #[41m |
64 | +# / ___ \ | | | || |-' | |--| | | | J L | |\\ | | | | | / \ #[41m |
65 | +# / L___J \ F L__J JF |__-.F L__J J F L_____ J L F L \ JJ F L__J J / /\ \ #[41m |
66 | +# J__L J__J\____,__\_____J\______/J________LJ__LJ__L \\J__LJ\____,__LJ__//\\__L #[41m |
67 | +# |__L J__|J____,__J_____FJ______F|________||__||__L J__| J____,__F|__/ \__| #[41m |
68 | + |
69 | +######################################################################################################################################################################################### |
70 | +######################################################################################################################################################################################### |
71 | + |
72 | +dsks=$(mktemp) |
73 | +selDsk=$(mktemp) |
74 | +selPar=$(mktemp) |
75 | +selPart=$(mktemp) |
76 | +selSwap=$(mktemp) |
77 | +selBoot=$(mktemp) |
78 | +selRootFS=$(mktemp) |
79 | +selSwap=$(mktemp) |
80 | +wholeDisk=$(mktemp) |
81 | +confirm=$(mktemp) |
82 | +partitions=$(mktemp) |
83 | + |
84 | + |
85 | +lines(){ cat $1|wc -l; } |
86 | + |
87 | +selectParts(){ selBoot ; selSwap ; selRootFS ; } |
88 | + |
89 | +err(){ echo >&2 "$(tput bold; tput setaf 1)[-] ERROR: ${*}$(tput sgr0)";exit 1; } |
90 | + |
91 | + |
92 | +selDisk(){ \ |
93 | + dialog --stdout --colors --title "Partitioning" \ |
94 | + --menu " Which drive will be used for the AutoLinux installation?" 30 65 0 \ |
95 | + "${drives[@]}" > $selDsk |
96 | +} |
97 | + |
98 | +selBoot(){ \ |
99 | + dialog --stdout --no-cancel --colors --title "Partitioning" \ |
100 | + --menu " Which Partition will be used for the bootloader?" 30 65 0 \ |
101 | + "${parts[@]}" > $selBoot |
102 | +} |
103 | + |
104 | +selSwap(){ \ |
105 | + dialog --stdout --colors --title "Partitioning" \ |
106 | + --ok-label "Continue" \ |
107 | + --cancel-label "No Swap" \ |
108 | + --menu " Which Partition will be used for the swap?" 30 65 0 \ |
109 | + "${parts[@]}" > $selSwap |
110 | +} |
111 | + |
112 | +selRootFS(){ \ |
113 | + dialog --stdout --no-cancel --colors --title "Partitioning" \ |
114 | + --menu " Which Partition will be used for the root filesystem?" 30 65 0 \ |
115 | + "${parts[@]}" > $selRootFS |
116 | +} |
117 | + |
118 | +wholeDisk(){ \ |
119 | + dialog --stdout --colors --extra-button \ |
120 | + --title "Partitioning" \ |
121 | + --extra-label "WIPE DISK" \ |
122 | + --yes-label 'Select Partitions' \ |
123 | + --no-label 'Go Back' \ |
124 | + --yesno "Would you like to wipe the entire drive, or manually select partitions?" 6 80 ;[41m |
125 | + echo $? > $wholeDisk |
126 | +} |
127 | + |
128 | +allDisks(){ \ |
129 | +sudo fdisk -l|grep -B 1 "Disk model:"|sed 's/,.*sectors//g;s/://g;s/Disk\s*\///g;s/Disk model //g'|xargs|sed \ |
130 | +'s/ -- /\n/g;s/dev/"\/dev/g;s/\n/"\n/g;s/^/drives=(\n/g;s/$/"\n)/g'|sed 's/ /" "/;s/iB /iB /' >$dsks ; source $dsks ; } |
131 | + |
132 | +getDisk(){ \ |
133 | +eval $(sudo fdisk -lo Device,Size,Type|grep $(cat $selDsk) >$selPar ; n=1 ; echo "parts=(" >$selPart |
134 | +cat $selPar|while read x; do echo "$(sudo head -n $n $selPar|tail -n1|cut -d' ' -f1|sed "s/^/'/;s/$/'/")\ |
135 | +$(echo $x|cut -d' ' -f2-|sed "s/^/\t\'/;s/$/\'/")"|sed '/Disk.*bytes,.*sectors/d'; ((n++)) ; done >>$selPart && |
136 | +echo -e ")" >>$selPart) ; source $selPart ; } |
137 | + |
138 | +confirm(){ \ |
139 | + dialog --stdout --colors --title "Partitioning" \ |
140 | + --yes-label 'NO. Go Back' \ |
141 | + --no-label 'YES. Continue' \ |
142 | + --yesno "\\nAre you sure you want to completely wipe $(cat $selDsk)?\\n\\nThis action CANNOT be undone." 9 90 ; |
143 | + WIPE=$? ; } |
144 | + |
145 | +wipeDisk(){ \ |
146 | + PRTED="sudo parted -s $(cat $selDsk)" |
147 | + dialog --colors --title "Partitioning" --infobox "Repartitioning $(cat $selDsk). Please be patient..." 3 60 ; |
148 | + $PRTED wipefs >/dev/null 2>&1 |
149 | + $PRTED mklabel gpt >/dev/null 2>&1 |
150 | + $PRTED mkpart primary 1 3 >/dev/null 2>&1 |
151 | + $PRTED name 1 legacy >/dev/null 2>&1 |
152 | + $PRTED set 1 bios_grub on |
153 | + $PRTED mkpart primary fat32 3MiB 256MiB >/dev/null 2>&1 |
154 | + $PRTED name 2 boot >/dev/null 2>&1 |
155 | + $PRTED set 2 boot on |
156 | + $PRTED mkpart primary 256MiB 4352MiB >/dev/null 2>&1 |
157 | + $PRTED name 3 swap >/dev/null 2>&1 |
158 | + $PRTED set 3 swap on |
159 | + $PRTED mkpart primary ext4 4352MiB 100% >/dev/null 2>&1 |
160 | + $PRTED name 4 rootfs >/dev/null 2>&1 |
161 | + yes|sudo mkfs.fat -F32 $(cat $selDsk)2 >/dev/null 2>&1 |
162 | + yes|sudo mkswap $(cat $selDsk)3 >/dev/null 2>&1 ; |
163 | + yes|sudo mkfs.ext4 $(cat $selDsk)4 >/dev/null 2>&1 ;[41m |
164 | + sudo swapon $(cat $selDsk)3 >/dev/null 2>&1 ; } |
165 | + |
166 | +definedPartitioning(){ \ |
167 | + dialog --colors --title "Partitioning" --infobox "Repartitioning $(cat $selDsk). Please be patient..." 3 60 ; |
168 | + yes|sudo mkfs.fat -F32 $(cat $selBoot) >/dev/null 2>&1 |
169 | + [ -n "$(cat $selSwap)" ] && yes|sudo mkswap $(cat $selSwap) >/dev/null 2>&1 |
170 | + yes|sudo mkfs.ext4 $(cat $selRootFS) >/dev/null 2>&1 |
171 | + sudo swapon $(cat $selSwap) >/dev/null 2>&1 |
172 | +} |
173 | + |
174 | +definedConfirm(){ \ |
175 | + dialog --colors --title "Partitioning" \ |
176 | + --yes-label "Im Sure" \ |
177 | + --no-label "Wait, Go Back" \ |
178 | + --yesno "\\nAre you happy with your selection?\\n\\n1. Boot Partition: $(cat $selBoot)\\n2. Swap Partition: $(cat $selSwap)\\n3. Root File System: $(cat $selRootFS)\\n\\nOnce you have confirmed, there in no going back." 14 80 ; |
179 | + defConf=$? ; } |
180 | + |
181 | +completion(){ dialog --colors --title "Partitioning" --infobox "Partitioning has Completed Successfully!" 3 60 ; } |
182 | + |
183 | +begin(){ \ |
184 | +n=1 ; selDisk || err "User Exited." |
185 | +getDisk || err "User Exited." |
186 | +wholeDisk || err "User Exited." |
187 | +[41m |
188 | +case "$(cat $wholeDisk)" in |
189 | + 1) getDisk && begin ;; |
190 | + 0) selectParts && definedConfirm &&[41m |
191 | + definedPartitioning && completion || err "User Exited." ;; |
192 | + 3) confirm && \ |
193 | + [ $WIPE -eq 0 ] && begin ; |
194 | + [ $WIPE -eq 1 ] && wipeDisk &&[41m |
195 | + completion || err "User Exited." ;; |
196 | +esac ; } |
197 | + |
198 | +allDisks || err "Could not find any disks." ; |
199 | +begin || err "User Exited."[41m |
200 | + |