| Hash | Commit message | Author | Date | Files | + | - |
1 | commit 6a27469723cdd6528551b3620342e7fe71b79ad4 |
2 | Author: a4to <[email protected]> |
3 | Date: Fri Apr 8 04:45:37 2022 +0200 |
4 | |
5 | Update. |
6 | --- |
7 | LICENSE | 29 ---- |
8 | PKGBUILD | 23 --- |
9 | README.md | 45 ------ |
10 | auto.install | 32 ---- |
11 | autoCleanInstall | 243 ---------------------------- |
12 | autoInstall | 480 ------------------------------------------------------- |
13 | autoPart | 151 ----------------- |
14 | bare.csv | 1 + |
15 | dwm.csv | 111 +++++++++++++ |
16 | plasma.csv | 102 ++++++++++++ |
17 | 10 files changed, 214 insertions(+), 1003 deletions(-) |
18 | |
19 | diff --git a/LICENSE b/LICENSE |
20 | deleted file mode 100644 |
21 | index e130fff..0000000 |
22 | --- a/LICENSE |
23 | +++ /dev/null |
24 | @@ -1,29 +0,0 @@ |
25 | -MIT/X Consortium License |
26 | - |
27 | -Creator and Maintainer : |
28 | -© 2020-2022 Connor Etherington <[email protected]> |
29 | ---------------------------------------------------------------------------- |
30 | -Contributors: |
31 | - |
32 | - |
33 | ---------------------------------------------------------------------------- |
34 | - |
35 | -Permission is hereby granted, free of charge, to any person obtaining a copy |
36 | -of this software and associated documentation files (the "Software"), to deal |
37 | -in the Software without restriction, including without limitation the rights |
38 | -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
39 | -copies of the Software, and to permit persons to whom the Software is |
40 | -furnished to do so, subject to the following conditions: |
41 | - |
42 | -THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN ALL |
43 | -COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. |
44 | - |
45 | - |
46 | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
47 | -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
48 | -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
49 | -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
50 | -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
51 | -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
52 | -SOFTWARE. |
53 | - |
54 | diff --git a/PKGBUILD b/PKGBUILD |
55 | deleted file mode 100644 |
56 | index 29a00b0..0000000 |
57 | --- a/PKGBUILD |
58 | +++ /dev/null |
59 | @@ -1,23 +0,0 @@ |
60 | -# Maintainer: Connor Etherington <[email protected]> |
61 | -# --- |
62 | -_pkgname=AutoLinux |
63 | -pkgname=auto |
64 | -pkgver=3.0.5 |
65 | -pkgrel=1 |
66 | -pkgdesc='ArchLinux bootstrap and partitioning scripts, with optional AutoLinux configs.' |
67 | -arch=(x86_64) |
68 | -url="https://gitlab.com/a4to/${_pkgname}" |
69 | -install="auto.install" |
70 | -license=('MIT') |
71 | -depends=(dialog parted) |
72 | -makedepends=(git) |
73 | -source=("git+$url.git") |
74 | -sha256sums=('SKIP') |
75 | - |
76 | -package() { |
77 | - cd "$srcdir" |
78 | - install -Dm755 ${_pkgname}/{autoInstall,autoCleanInstall,autoPart} -t "${pkgdir}/opt/${_pkgname}" |
79 | - install -Dm755 ${_pkgname}/{autoCleanInstall,autoInstall,autoPart} -t "${pkgdir}/usr/bin" |
80 | - install -Dm644 ${_pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" |
81 | - install -Dm644 ${_pkgname}/README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" |
82 | -} |
83 | diff --git a/README.md b/README.md |
84 | deleted file mode 100644 |
85 | index 6177163..0000000 |
86 | --- a/README.md |
87 | +++ /dev/null |
88 | @@ -1,45 +0,0 @@ |
89 | -# Automate BootStrapping Scripts |
90 | - |
91 | -Auto, is a tool providing users with simple and easy way to bootstrap and install Arch Linux. |
92 | - |
93 | -During the installation process, you will be given the option to install either bare Arch Linux, and make all further installations decisions yourself, |
94 | -or to choose from a selection of the AutoLinux pre-configured desktop environment and window managers profiles, the flagship being the DWM edition. |
95 | - |
96 | - |
97 | - |
98 | -## Usage: |
99 | - |
100 | -The package consists of 3 scripts: |
101 | - |
102 | -+ `autoPart`: A partitioning script. |
103 | -+ `autoInstall`: The base install script. |
104 | -+ `autoCleanInstall`: The clean install script. |
105 | - |
106 | - |
107 | -**autoInstall**: This script is to be used for installing AutoLinux ontop of an existing Arch Linux installation, as a new user profile. |
108 | - |
109 | - |
110 | -**autoCleanInstall**: This script is intended for use when performing a clean/fresh installation, with no pre-existing OS installed on the partition(s) reserved for AutoLinux. |
111 | -This script also includes section for partitioning your drive, so running the autoPart script is *NOT* required. |
112 | - |
113 | - |
114 | -**autoPart**: This script is for useage outside of the AutoLinux installation process, and serves simply as a helper when partitioning your drive for any fresh installation. |
115 | - |
116 | -*NOTE*: The options are limited to partition selection, or drive wipe. |
117 | -As for creating new partitions and deleting existing partitions, an external program such as cfdisk, fdisk or parted will be required if necessary. |
118 | -The script also does not allow for manual selection of a file system type, and the rootfs is automatially set to ext4. |
119 | - |
120 | - |
121 | -Upon installation, please read the function of both the `autoInstall` and `autoCleanInstall` script, and select *EITHER* `autoInstall` or `autoCleanInstall` to carry out |
122 | -the installation process. The `autoCleanInstall` script calls the `autoInstall` script upon completion of the base installation, so running both scripts is *NOT* required. |
123 | - |
124 | - |
125 | - |
126 | -**Prerequisites** |
127 | - |
128 | -- The script takes care of all requirements dependencies do not have to be manually installed. ✔ |
129 | - |
130 | - |
131 | - |
132 | -I hope these scripts are helpful and you enjoy your time in AutoLinux! - a4to |
133 | - |
134 | diff --git a/auto.install b/auto.install |
135 | deleted file mode 100644 |
136 | index ac3b8b9..0000000 |
137 | --- a/auto.install |
138 | +++ /dev/null |
139 | @@ -1,32 +0,0 @@ |
140 | -post_install() { |
141 | -echo -e '\n\033[1m\033[32m\033[4mAutomate BootStrapping Scripts |
142 | - |
143 | -\033[0m\033[36mAuto, is a tool providing users with simple and easy way to bootstrap and install Arch Linux. |
144 | - |
145 | -During the installation process, you will be given the option to install either bare Arch Linux, and make all further installations decisions yourself, |
146 | -or to choose from a selection of the AutoLinux pre-configured desktop environment and window managers profiles, the flagship being the DWM edition.\n |
147 | - |
148 | -The package consists of 3 scripts: |
149 | - |
150 | -\033[1m\033[35mautoPart:\033[0m\033[36m A partitioning script.\033[0m |
151 | -\033[1m\033[35mautoInstall:\033[0m\033[36m The base install script.\033[0m |
152 | -\033[1m\033[35mautoCleanInstall:\033[0m\033[36m The clean install script.\033[0m\n |
153 | - |
154 | -\033[1m\033[33mautoInstall:\033[0m\033[36m This script is to be used for installing AutoLinux ontop of an existing Arch Linux installation, as a new user profile. |
155 | - |
156 | -\033[1m\033[33mautoCleanInstall:\033[0m\033[36m This script is intended for use when performing a clean/fresh installation, with no pre-existing OS installed on the partition(s) reserved for AutoLinux. |
157 | -This script also includes section for partitioning your drive, so running the autoPart script is \033[35m\033[1mNOT\033[0m\033[36m required. |
158 | - |
159 | -\033[1m\033[33mautoPart:\033[0m\033[36m This script is for useage outside of the AutoLinux installation process, and serves simply as a helper when partitioning your drive for any fresh installation. |
160 | - |
161 | -\033[3m\033[1m\033[36mNOTE:\033[0m\033[36m The options are limited to partition selection, or drive wipe. |
162 | -As for creating new partitions and deleting existing partitions, an external program such as cfdisk, fdisk or parted will be required if necessary. |
163 | -The script also does not allow for manual selection of a file system type, and the rootfs is automatially set to ext4.\n\n |
164 | - |
165 | -\033[32m\033[1mUsage: \033[36m |
166 | - |
167 | -Please read the function of both the \033[33m\033[3m\033[1mautoInstall\033[0m\033[36m and \033[3m\033[33m\033[1mautoCleanInstall\033[0m\033[36m script, and select \033[35m\033[1mEITHER\033[0m\033[36m \033[1m\033[33m\033[3mautoInstall\033[0m\033[36m or \033[33m\033[1m\033[3mautoCleanInstall\033[0m\033[36m to carry out |
168 | -the installation process. The \033[33m\033[1m\033[3mautoCleanInstall\033[0m\033[36m script calls the \033[33m\033[1m\033[3mautoInstall\033[0m\033[36m script upon completion of the base installation, so running both scripts is \033[35m\033[1mNOT\033[0m\033[36m required.\n\n |
169 | - |
170 | -\033[32mI hope these scripts are helpful and you enjoy your time in AutoLinux! - \033[3m\033[1m\033[33ma4to' |
171 | -} |
172 | diff --git a/autoCleanInstall b/autoCleanInstall |
173 | deleted file mode 100755 |
174 | index 0afc3cd..0000000 |
175 | --- a/autoCleanInstall |
176 | +++ /dev/null |
177 | @@ -1,243 +0,0 @@ |
178 | -#!/usr/bin/env bash |
179 | -######################################################################################################################################################################################### |
180 | -## A U T O L I N U X B O O T S T R A P S C R I P T ## |
181 | -######################################################################################################################################################################################### |
182 | - |
183 | -# _ _ _ __ _ _ # |
184 | -# /.\ _ _ FJ_ ____ FJ / J _ _ _ _ _ FJ LJ # |
185 | -# //_\\ J | | LJ _| F __ J J | LFJ J ' \ J J | | L J \/ F # |
186 | -# / ___ \ | | | || |-' | |--| | | | J L | |\\ | | | | | / \ # |
187 | -# / L___J \ F L__J JF |__-.F L__J J F L_____ J L F L \ JJ F L__J J / /\ \ # |
188 | -# J__L J__J\____,__\_____J\______/J________LJ__LJ__L \\J__LJ\____,__LJ__//\\__L # |
189 | -# |__L J__|J____,__J_____FJ______F|________||__||__L J__| J____,__F|__/ \__| # |
190 | - |
191 | -######################################################################################################################################################################################### |
192 | -######################################################################################################################################################################################### |
193 | - |
194 | -drives(){ |
195 | - |
196 | -## If you would like to include any additional drives or partitions |
197 | -## in the file system table, please use the 'mkmnt' command, followed |
198 | -## by a name for the folder in which you would like it to be mounted, |
199 | -## followed by the name of partition ( NOT THE FULL PATH ). The 3 words |
200 | -## should be seperated by a single space in between them. |
201 | - |
202 | -## For example: ' mkmnt newFolderName partition/driveName ' |
203 | -## : ' mkmnt myFolder sda1 ' |
204 | - |
205 | -# mkmnt |
206 | -# mkmnt |
207 | -# mkmnt |
208 | - |
209 | -## If you have any extra swap partitions you would like to turn on, |
210 | -## insert them below, following '/dev/' for every line below.. |
211 | - |
212 | -# swapon /dev/ |
213 | -# swapon /dev/ |
214 | -# swapon /dev/ |
215 | - |
216 | - |
217 | -genfstab -U /mnt > /mnt/etc/fstab ; } |
218 | - |
219 | -######################################################################################################################################################################################### |
220 | - |
221 | -lines(){ cat $1|wc -l; } |
222 | - |
223 | -selectParts(){ selBoot ; selSwap ; selRootFS ; } |
224 | - |
225 | -err(){ echo >&2 "$(tput bold; tput setaf 1)[-] ERROR: ${*}$(tput sgr0)";exit 1; } |
226 | - |
227 | -dsks=$(mktemp) ; selDsk=$(mktemp) |
228 | -selPar=$(mktemp) ; selPart=$(mktemp) |
229 | -selSwap=$(mktemp) ; selBoot=$(mktemp) |
230 | -selRootFS=$(mktemp) ; selSwap=$(mktemp) |
231 | -wholeDisk=$(mktemp) ; confirm=$(mktemp) |
232 | -partitions=$(mktemp) |
233 | - |
234 | -srcdir=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd && echo) |
235 | - |
236 | -warn(){ echo >&2 "$(tput bold; tput setaf 1)[!] WARNING: ${*}$(tput sgr0)"; } |
237 | - |
238 | -check_root(){ [ "$(id -u)" -ne 0 ] && err "root priviledges are required to run this script."; } |
239 | - |
240 | -mkmnt(){ $(sudo mkdir -p /mnt/home/drives/"$1" >/dev/null 2>&1 && $(mount /dev/"$2" /mnt/home/drives/"$1") >/dev/null 2>&1) ; } |
241 | - |
242 | -fail(){ err " ERROR! CATASTROPHIC FAILIURE CAPTAIN . . ." ; sleep 2 ; } |
243 | - |
244 | -requierments(){ pacman -Syy figlet lolcat parted sudo --needed --noconfirm 2>/dev/null && setfont ter-p16n >/dev/null 2>&1 ; } |
245 | - |
246 | -welcome(){ clear ; figlet -toc '|-WELCOME-| - TO - |-AUTOLINUX-|' | lolcat ; sleep 1; } |
247 | - |
248 | - |
249 | -refreshkeys() { \ |
250 | - pacman -U --noconfirm https://gitlab.com/a4to/concise/-/raw/master/concise-keyring-1.0.3-1-any.pkg.tar.xz |
251 | - /opt/Concise/init.sh ; } |
252 | - |
253 | -init(){ |
254 | -pacConf /etc/pacman.conf && |
255 | -timedatectl set-ntp true ; } |
256 | - |
257 | -pacConf(){ \ |
258 | -dialog --infobox "Updating Repos and Keys..." 4 40 |
259 | -for repo in core extra community multilib; do |
260 | -grep -q "^\[$repo\]" /etc/pacman.conf || echo "[$repo] |
261 | -Include = /etc/pacman.d/mirrorlist |
262 | -" >> $1 ; done ; } |
263 | - |
264 | -selDisk(){ \ |
265 | - dialog --stdout --colors --title "Partitioning" \ |
266 | - --menu " Which drive will be used for the AutoLinux installation?" 30 65 0 \ |
267 | - "${drives[@]}" > $selDsk |
268 | -} |
269 | - |
270 | -selBoot(){ \ |
271 | - dialog --stdout --no-cancel --colors --title "Partitioning" \ |
272 | - --menu " Which Partition will be used for the bootloader?" 30 65 0 \ |
273 | - "${parts[@]}" > $selBoot |
274 | -} |
275 | - |
276 | -selSwap(){ \ |
277 | - dialog --stdout --colors --title "Partitioning" \ |
278 | - --ok-label "Continue" \ |
279 | - --cancel-label "No Swap" \ |
280 | - --menu " Which Partition will be used for the swap?" 30 65 0 \ |
281 | - "${parts[@]}" > $selSwap |
282 | -} |
283 | - |
284 | -selRootFS(){ \ |
285 | - dialog --stdout --no-cancel --colors --title "Partitioning" \ |
286 | - --menu " Which Partition will be used for the root filesystem?" 30 65 0 \ |
287 | - "${parts[@]}" > $selRootFS |
288 | -} |
289 | - |
290 | -wholeDisk(){ \ |
291 | - dialog --stdout --colors --extra-button \ |
292 | - --title "Partitioning" \ |
293 | - --extra-label "WIPE DISK" \ |
294 | - --yes-label 'Select Partitions' \ |
295 | - --no-label 'Go Back' \ |
296 | - --yesno "Would you like to wipe the entire drive, or manually select partitions?" 6 80 ; |
297 | - echo $? > $wholeDisk |
298 | -} |
299 | - |
300 | -allDisks(){ \ |
301 | -sudo fdisk -l|grep -B 1 "Disk model:"|sed 's/,.*sectors//g;s/://g;s/Disk\s*\///g;s/Disk model //g'|xargs|sed \ |
302 | -'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 ; } |
303 | - |
304 | -getDisk(){ \ |
305 | -eval $(sudo fdisk -lo Device,Size,Type|grep $(cat $selDsk) >$selPar ; n=1 ; echo "parts=(" >$selPart |
306 | -cat $selPar|while read x; do echo "$(sudo head -n $n $selPar|tail -n1|cut -d' ' -f1|sed "s/^/'/;s/$/'/")\ |
307 | -$(echo $x|cut -d' ' -f2-|sed "s/^/\t\'/;s/$/\'/")"|sed '/Disk.*bytes,.*sectors/d'; ((n++)) ; done >>$selPart && |
308 | -echo -e ")" >>$selPart) ; source $selPart ; } |
309 | - |
310 | -confirm(){ \ |
311 | - dialog --stdout --colors --title "Partitioning" \ |
312 | - --yes-label 'NO. Go Back' \ |
313 | - --no-label 'YES. Continue' \ |
314 | - --yesno "\\nAre you sure you want to completely wipe $(cat $selDsk)?\\n\\nThis action CANNOT be undone." 9 90 ; |
315 | - WIPE=$? ; } |
316 | - |
317 | -wipeDisk(){ \ |
318 | - PRTED="sudo parted -s $(cat $selDsk)" |
319 | - sudo wipefs $(cat $selDsk) |
320 | - dialog --colors --title "Partitioning" --infobox "Preparing $(cat $selDsk)1 - the legacy boot partition, Pease be patient..." 3 80 ; |
321 | - $PRTED mklabel gpt >/dev/null 2>&1 |
322 | - $PRTED mkpart primary 1 3 >/dev/null 2>&1 |
323 | - $PRTED name 1 legacy >/dev/null 2>&1 |
324 | - $PRTED set 1 bios_grub on |
325 | - dialog --colors --title "Partitioning" --infobox "Preparing $(cat $selDsk)2 - the uefi boot partition, Pease be patient..." 3 80 ; |
326 | - $PRTED mkpart primary fat32 3MiB 256MiB >/dev/null 2>&1 |
327 | - $PRTED name 2 boot >/dev/null 2>&1 |
328 | - $PRTED set 2 boot on |
329 | - yes|sudo mkfs.fat -F32 $(cat $selDsk)2 >/dev/null 2>&1 |
330 | - dialog --colors --title "Partitioning" --infobox "Preparing $(cat $selDsk)3 - the swap partition, Pease be patient..." 3 80 ; |
331 | - $PRTED mkpart primary 256MiB 4352MiB >/dev/null 2>&1 |
332 | - $PRTED name 3 swap >/dev/null 2>&1 |
333 | - $PRTED set 3 swap on |
334 | - yes|sudo mkswap $(cat $selDsk)3 >/dev/null 2>&1 ; |
335 | - sudo swapon $(cat $selDsk)3 >/dev/null 2>&1 |
336 | - dialog --colors --title "Partitioning" --infobox "Preparing $(cat $selDsk)4 - the root filesystem, Pease be patient..." 3 80 ; |
337 | - $PRTED mkpart primary ext4 4352MiB 100% >/dev/null 2>&1 |
338 | - $PRTED name 4 rootfs >/dev/null 2>&1 |
339 | - yes|sudo mkfs.ext4 $(cat $selDsk)4 >/dev/null 2>&1 ; } |
340 | - |
341 | -definedPartitioning(){ \ |
342 | - dialog --colors --title "Partitioning" --infobox "Preparing the $(cat $selBoot) - the boot partition, Pease be patient..." 3 80 ; |
343 | - yes|sudo mkfs.fat -F32 $(cat $selBoot) >/dev/null 2>&1 |
344 | - [ -n "$(cat $selSwap)" ] && dialog --colors --title "Partitioning" --infobox "Preparing the $(cat $selSwap) - the swap partition, Pease be patient..." 3 80 ; |
345 | - [ -n "$(cat $selSwap)" ] && yes|sudo mkswap $(cat $selSwap) >/dev/null 2>&1 |
346 | - dialog --colors --title "Partitioning" --infobox "Preparing $(cat $selRootFS) - the root filesystem, Pease be patient..." 3 80 ; |
347 | - yes|sudo mkfs.ext4 $(cat $selRootFS) >/dev/null 2>&1 |
348 | - [ -n "$(cat $selSwap)" ] && sudo swapon $(cat $selSwap) >/dev/null 2>&1 |
349 | -} |
350 | - |
351 | -definedConfirm(){ \ |
352 | - dialog --colors --title "Partitioning" \ |
353 | - --yes-label "Im Sure" \ |
354 | - --no-label "Wait, Go Back" \ |
355 | - --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 ; |
356 | - defConf=$? ; } |
357 | - |
358 | -completion(){ dialog --colors --title " ~ AutoLinux ~ " \ |
359 | - --infobox "Partitioning Completed Successfully! Now continuing to install base system..." 5 85 ; } |
360 | - |
361 | -begin(){ \ |
362 | -n=1 ; selDisk || err "User Exited." |
363 | -getDisk || err "User Exited." |
364 | -wholeDisk || err "User Exited." |
365 | - |
366 | -case "$(cat $wholeDisk)" in |
367 | - 1) getDisk && begin ;; |
368 | - 0) selectParts && definedConfirm && definedPartitioning && wipeType='manual' && completion && sleep 5 ;; |
369 | - 3) confirm && case "$(echo $WIPE)" in |
370 | - '0') begin ;; |
371 | - '1') wipeDisk && completion ; sleep 4 && wipeType='automatic'; mount $(cat $selDsk)4 /mnt |
372 | - esac ;; |
373 | -esac ; } |
374 | - |
375 | -base_install(){ \ |
376 | - for x in linux-firmware base base-devel; do |
377 | - dialog --colors --title " ~ AutoLinux ~ " --infobox "Installing $x, part of the fundaemental system packages..." 3 80 ; |
378 | - pacstrap /mnt $x --needed --noconfirm >/dev/null 2>&1 && |
379 | - pacConf /mnt/etc/pacman.conf >/dev/null 2>&1 ; done ; } |
380 | - |
381 | -post_install(){ \ |
382 | - for x in efibootmgr dosfstools mtools pacman-contrib os-prober; do |
383 | - dialog --colors --title " ~ AutoLinux ~ " --infobox "Installing $x, needed for the installation..." 3 80 ; |
384 | - pacstrap /mnt $x --needed --noconfirm >/dev/null 2>&1 ; clear ; done ; } |
385 | - |
386 | -cp_scripts(){ cd $srcdir && cp autoInstall /mnt/usr/bin >/dev/null 2>&1 ; } |
387 | - |
388 | -success(){ \ |
389 | -figlet -toc 'Success!'|lolcat ; echo -e "\n" ; sleep 2 && |
390 | -arch-chroot /mnt bash /usr/bin/autoInstall |
391 | -} |
392 | - |
393 | - |
394 | -check_root ; requierments ; welcome ; init |
395 | - |
396 | -allDisks || err "Could not find any disks." |
397 | - |
398 | -begin || err "User Exited." |
399 | - |
400 | - |
401 | -case "$wipeType" in |
402 | - 'manual') sudo mount $(cat $selRootFS) /mnt && completion && sleep 4 || |
403 | - ! [ -d /mnt/boot/EFI ] && mkdir -p /mnt/boot/EFI; sudo mount $(cat $selBoot) /mnt/boot/EFI ;; |
404 | - 'automatic') sudo mount $(cat $selDsk)4 /mnt && completion && sleep 4 || |
405 | - ! [ -d /mnt/boot/EFI ] && mkdir -p /mnt/boot/EFI; sudo mount $(cat $selDsk)2 /mnt/boot/EFI ;; |
406 | -esac |
407 | - |
408 | -base_install || err "User Exited." |
409 | - |
410 | -drives || err "User Exited." |
411 | - |
412 | -post_install || err "User Exited." |
413 | - |
414 | - |
415 | - |
416 | -cp_scripts ; success && exit 0 || fail && exit 1 |
417 | - |
418 | - |
419 | -######################################################################################################################################################################################### |
420 | -######################################################################################################################################################################################### |
421 | diff --git a/autoInstall b/autoInstall |
422 | deleted file mode 100755 |
423 | index 5adfdf3..0000000 |
424 | --- a/autoInstall |
425 | +++ /dev/null |
426 | @@ -1,480 +0,0 @@ |
427 | -#!/usr/bin/env sh |
428 | -######################################################################################################################################################################################### |
429 | -## A U T O L I N U X B O O T S T R A P S C R I P T ## |
430 | -######################################################################################################################################################################################### |
431 | - |
432 | -# _ _ _ __ _ _ # |
433 | -# /.\ _ _ FJ_ ____ FJ / J _ _ _ _ _ FJ LJ # |
434 | -# //_\\ J | | LJ _| F __ J J | LFJ J ' \ J J | | L J \/ F # |
435 | -# / ___ \ | | | || |-' | |--| | | | J L | |\\ | | | | | / \ # |
436 | -# / L___J \ F L__J JF |__-.F L__J J F L_____ J L F L \ JJ F L__J J / /\ \ # |
437 | -# J__L J__J\____,__\_____J\______/J________LJ__LJ__L \\J__LJ\____,__LJ__//\\__L # |
438 | -# |__L J__|J____,__J_____FJ______F|________||__||__L J__| J____,__F|__/ \__| # |
439 | - |
440 | -######################################################################################################################################################################################### |
441 | -######################################################################################################################################################################################### |
442 | - |
443 | - #-------------------------------# |
444 | -## ### VARIABLES & FUNCTIONS ### ## |
445 | - #-------------------------------# |
446 | - |
447 | - |
448 | -pkgdir="/opt" |
449 | - |
450 | -aurhelper="yay" |
451 | - |
452 | -TITLE=' ~ Automate OS ~ ' |
453 | - |
454 | -mirlist="/etc/pacman.d/mirrorlist" |
455 | - |
456 | -lmirlist="/etc/pacman.d/local-mirrorlist" |
457 | - |
458 | -dotfiles="https://gitlab.com/a4to/dotfiles.git" |
459 | - |
460 | - |
461 | -arch="$(uname -m)" |
462 | - |
463 | -srcdir=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd && echo) |
464 | - |
465 | -area="$(curl -4 ifconfig.co/country-iso)" |
466 | - |
467 | -bootid="$(lsblk|grep boot |sed 's/p.*$//;s/├─//;s/└─//'|sed 's/^/\/dev\//;s/$/\//')" |
468 | - |
469 | -rmdblck="$([ -f /var/lib/pacman/db.lck ] && rm -rf /var/lib/pacman/db.lck)" |
470 | - |
471 | - |
472 | -KERNELS=( |
473 | - '1' 'linux ' |
474 | - '2' 'linux-lts ' |
475 | - '3' 'linux-hardened ' |
476 | - '4' 'linux-zen ') |
477 | - |
478 | -EDITIONS=( |
479 | - '1' 'DWM ' |
480 | - '2' 'Plasma ' |
481 | - '3' 'Server Install (Bare ArchLinux) ') |
482 | - |
483 | - |
484 | -installpkg(){ pacman --noconfirm --needed -S "$*" >/dev/null 2>&1 ; } |
485 | - |
486 | -check_root(){ [ "$(id -u)" -ne 0 ] && err "Root priviledges are required to run this script!"; } |
487 | - |
488 | -err(){ echo >&2 "$(tput bold; tput setaf 1)[-] ERROR: ${*}$(tput sgr0)" && $rmdblck ; exit 1337; } |
489 | - |
490 | - |
491 | -newmirrors(){ \ |
492 | - dialog --title "$TITLE" --infobox " Testing fastest mirrors for most efficient downloads..." 4 50 |
493 | - mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup && reflector --sort rate -a48 -f20 -l20 -c 'ZA,US,UK,Germany,Netherlands' \ |
494 | --p 'http,https' --save /etc/pacman.d/mirrorlist >/dev/null 2>&1 ; } |
495 | - |
496 | -initmsg1(){ \ |
497 | - dialog --title " Welcome to Automate OS! " --msgbox "\\n Welcome, and thank you for choosing AutoLinux!\\n\\n This script will now install the AutoLinux edition of your choice.\\n" 9 80 ; } |
498 | - |
499 | -whichedition(){ |
500 | - edition="$(dialog --title "$TITLE" --colors --menu " Please Select the AutoLinux Edition to Install :" 14 56 5 "${EDITIONS[@]}" 3>&1 1>&2 2>&3 3>&1)" ; } |
501 | - |
502 | -initmsg2(){ |
503 | - dialog --colors --title " Please Note :" --yes-label " Lets Boogie! " --no-label " Lets not boogie :| " --yesno "\\n An Arch Linux, or Arch based system is required for the installation of AutoLinux.\\n\\n If you are running any other distrobution the installation will fail." 9 90 ; } |
504 | - |
505 | -selKernel(){ |
506 | - kernel="$(dialog --colors --title "Kernel Selection" --menu " Please choose your kernel:\\n (If unsure, just select the default linux kernel)" 14 56 6 "${KERNELS[@]}" 3>&1 1>&2 2>&3 3>&1)" ; } |
507 | - |
508 | - |
509 | -user_and_password() { |
510 | - name=$(dialog --inputbox " Please enter a name for the user account: " 10 60 3>&1 1>&2 2>&3 3>&1) || exit 1 |
511 | - while ! echo "$name" | grep -q "^[a-z_][a-z0-9_-]*$"; do |
512 | - name=$(dialog --no-cancel --inputbox "Username not valid. Give a username beginning with a letter, with only lowercase letters, - or _." 10 60 3>&1 1>&2 2>&3 3>&1) |
513 | - done |
514 | - pass1=$(dialog --no-cancel --passwordbox "Enter a password for that user:" 10 60 3>&1 1>&2 2>&3 3>&1) |
515 | - pass2=$(dialog --no-cancel --passwordbox "Retype the password." 10 60 3>&1 1>&2 2>&3 3>&1) |
516 | - while ! [ "$pass1" = "$pass2" ]; do |
517 | - unset pass2 |
518 | - pass1=$(dialog --no-cancel --passwordbox "Passwords do not match.\\n\\nEnter password again." 10 60 3>&1 1>&2 2>&3 3>&1) |
519 | - pass2=$(dialog --no-cancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1) |
520 | - done ; } |
521 | - |
522 | -root_user_password(){ |
523 | - dialog --colors --title "$TITLE" --yes-label ' Change Root Password ' --no-label ' Keep Current Password ' --yesno "\\nWould you like to change the root password?\\n\\nIf this is a clean install and not an addition to an existing system, it is essential that you change the root password.\\n\\nChange root password?" 12 66 3>&1 1>&2 2>&3 3>&1 || return 0 ; |
524 | - pass3=$(dialog --no-cancel --passwordbox "Enter a password for the root user:" 10 60 3>&1 1>&2 2>&3 3>&1) |
525 | - pass4=$(dialog --no-cancel --passwordbox "Retype the password." 10 60 3>&1 1>&2 2>&3 3>&1) |
526 | - while ! [ "$pass3" = "$pass4" ]; do |
527 | - unset pass2 |
528 | - pass3=$(dialog --no-cancel --passwordbox "Passwords do not match.\\n\\nEnter password again." 10 60 3>&1 1>&2 2>&3 3>&1) |
529 | - pass4=$(dialog --no-cancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1) |
530 | - done ; } |
531 | - |
532 | -usercheck() { \ |
533 | - ! { id -u "$name" >/dev/null 2>&1; } || |
534 | - dialog --colors --title "WARNING!" --yes-label " CONTINUE " --no-label " RETURN " --yesno "\nThe user '$name' already exists on this system. AutoLinux can install for this user, but will overwrite any existing configuration files existing on \\nthis users account. \\n\\nHowever, it will not overwrite any other user files, documents, videos, or personal files of any sorts.\\n\\nIrrespective, only click <CONTINUE> if you are certain you have backed up any wanted system 'config' files.\\n\\nThe users password will also be changed to the one you just provided." 17 85 ; } |
535 | - |
536 | -preinstall() { \ |
537 | - dialog --title " The calm before the STORM!" --yes-label "CONTINUE" --no-label " EXIT " --yesno "\\nThe rest of the proccess is automated and might take a while, depending on your connection. \\n\\nSo sit back, relax and please do not stop the process if it seems stuck.\\nSome packages just take longer to compile than others.\\n\\n\\nReady when you are?" 14 82 ; } |
538 | - |
539 | - |
540 | -adduserandpass() { \ |
541 | - dialog --infobox " Adding user \"$name\"..." 4 50 |
542 | - useradd -m "$name" >/dev/null 2>&1 |
543 | - usermod -aG wheel,audio,optical,video,kvm,network,adm "$name" && chown $name /home/"$name" >/dev/null 2>&1 |
544 | - export repodir="/home/$name/.local/src"; mkdir -p "$repodir"; chown -R "$name":wheel "$(dirname "$repodir")" |
545 | - echo "$name:$pass1" | chpasswd >/dev/null 2>&1 |
546 | - unset pass1 pass2 ; } |
547 | - |
548 | -setrootpass(){ |
549 | - dialog --infobox " Changing password for root user..." 4 50 |
550 | - [ -z "$pass3" ] && pass3="autolinux" ; |
551 | - echo "root:$pass3" | chpasswd >/dev/null 2>&1 |
552 | - unset pass3 pass4 ; } |
553 | - |
554 | -bootload(){ |
555 | - dialog --colors --title " Clean Install or Existing System? " --yes-label " Install GRUB! " --no-label " I have a bootloader. " --yesno "\\n Would you like AutoLinux to install the GRUB bootloader? \\n\\n If it is your first time installing an OS and you have not yet installed or \n configured a bootloader, then selecting 'yes' would be a required for the \n system to function or boot." 11 82 && |
556 | - loader="$?" ; } |
557 | - |
558 | -addmirrors(){ |
559 | - dialog --colors --title " Additional Mirrors and Repositories " --yes-label " Yes, Add Them! " --no-label " No Thanks. " --yesno "\\n Would you like to add the additional Mirrors and Repositories to the build?\\n\\n These mirrors would be beneficial as they would give you access/availability to many extra\n resources and repositories to acquire packages and other software.\n\n\n NOTE: Adding these extra mirrors would also significantly speed up the installation process,\n since you will be downloading binary versions of most aur packages, instead of compiling \n everything from source." 15 100 |
560 | - yesmir="$?" ; } |
561 | - |
562 | -chshell(){ |
563 | -chsh -s /bin/zsh >/dev/null 2>&1 |
564 | -chsh -s /bin/zsh "$name" >/dev/null 2>&1 |
565 | -sudo -u "$name" mkdir -p "/home/$name/.cache/zsh/" ; } |
566 | - |
567 | -refreshkeys() { \ |
568 | - dialog --infobox "Refreshing Arch Keyring..." 4 40 |
569 | - pacman --noconfirm -S archlinux-keyring >/dev/null 2>&1 |
570 | - dialog --infobox "Adding Concise Keyring..." 4 40 |
571 | - |
572 | - yes|pacman-key --recv-key 81BACEEBC3EA26E127166E4A819BB92A9A48160E --keyserver keyserver.ubuntu.com >/dev/null 2>&1 |
573 | - yes|pacman-key --lsign-key 81BACEEBC3EA26E127166E4A819BB92A9A48160E >/dev/null 2>&1 |
574 | - yes|pacman -U 'https://gitlab.com/a4to/concise/-/raw/master/x86_64/concise-keyring-1.0.3-1-any.pkg.tar.zst' >/dev/null 2>&1 |
575 | - |
576 | - cat /etc/pacman.conf|grep -q "^\[concise\]"|| cat << EOF >>/etc/pacman.conf |
577 | - |
578 | -[concise] |
579 | -SigLevel = Required DatabaseOptional |
580 | -Server = https://gitlab.com/a4to/\$repo/-/raw/master/\$arch |
581 | - |
582 | -EOF |
583 | - dialog --infobox "Updating Repos and Keys..." 4 40 |
584 | - for repo in core extra community multilib; do |
585 | - grep -q "^\[$repo\]" /etc/pacman.conf || echo "[$repo] |
586 | -Include = /etc/pacman.d/mirrorlist |
587 | -" >> /etc/pacman.conf |
588 | -done |
589 | - |
590 | - pacman-key --init >/dev/null 2>&1 |
591 | - pacman-key --populate >/dev/null 2>&1 |
592 | - pacman -Syy >/dev/null 2>&1 |
593 | -} |
594 | - |
595 | -sudoers(){ echo -e "\n$*" >> /etc/sudoers ; } |
596 | - |
597 | -gpudrivers(){ \ |
598 | - dialog --infobox " Detecting Graphics Card..." 4 40 |
599 | - local GPU="$(neofetch |grep GPU|sed 's/^\.*.s//' |cut -d" " -f2)" |
600 | - |
601 | - case $GPU in |
602 | - AMD) dialog --infobox " Installing AMD GPU Drivers..." 4 40 |
603 | - yes|pacman -S --needed xf86-video-amdgpu >/dev/null 2>&1 ;; |
604 | - NVIDIA) dialog --infobox " Installing NVIDIA GPU Drivers..." 4 40 |
605 | - yes|pacman -S --needed nvidia-470xx-dkms nvidia-470xx-settings nvidia-470xx-utils >/dev/null 2>&1 ;; |
606 | - Intel) dialog --infobox " Installing Intel GPU Drivers..." 4 40 |
607 | - yes|pacman -S --needed vulkan-intel xf86-video-intel intel-gpu-tools >/dev/null 2>&1 ;; |
608 | - Radeon) dialog --infobox " Installing Radeon GPU Drivers..." 4 40 |
609 | - yes|pacman -S --needed opencl-mesa vulkan-raedon >/dev/null 2>&1 ;; |
610 | - *) dialog --infobox " Unknown GPU Detected, Skipping GPU Driver Installation..." 4 40 && sleep 2 ;; |
611 | - |
612 | - esac; unset x ; } |
613 | - |
614 | -cpudrivers(){ \ |
615 | - dialog --infobox " Detecting CPU..." 4 40 |
616 | - local CPU="$(neofetch |grep CPU |sed 's/^\.*.s//' |cut -d" " -f2)" |
617 | - |
618 | - case $CPU in |
619 | - Intel) dialog --infobox " Installing Intel CPU Drivers..." 4 40 |
620 | - yes|pacman -S --needed intel-ucode >/dev/null 2>&1 ;; |
621 | - AMD) dialog --infobox " Installing AMD CPU Drivers..." 4 40 |
622 | - yes|pacman -S --needed amd-ucode >/dev/null 2>&1 ;; |
623 | - *) dialog --infobox " Unknown CPU Detected, Skipping CPU Driver Installation..." 4 40 ; sleep 2 ;; |
624 | - |
625 | - esac ; unset x ; } |
626 | - |
627 | -replacedir(){ \ |
628 | - dialog --infobox "Installing AutoLinux custom builds of '$(basename "$1")' ($n of $total). $2" 5 70 |
629 | - destdir="/usr/share" |
630 | - clonename="$(basename "$1" .git)" |
631 | - clonepath="$destdir/$clonename" |
632 | - [ -e "$clonepath" ] && sudo mv $clonepath "$clonepath'-old'" ; |
633 | - git clone "$1" $clonepath >/dev/null 2>&1 |
634 | - cd /tmp || return 1 ; } |
635 | - |
636 | -archlinuxinstall(){ |
637 | - dialog --infobox "Installing "$1", an AUR helper..." 4 50 |
638 | - [ -d "$pkgdir"/"$1" ] && rm -rf "$pkgdir"/"$1" ; |
639 | - sudo git clone --depth 1 https://aur.archlinux.org/"$1".git $pkgdir/"$1" >/dev/null 2>&1 ; |
640 | - chown "$name":wheel $pkgdir/"$1" ||{ cd "$pkgdir/$1" || return 1 ; sudo -u "$name" git pull --force origin master;} |
641 | - cd "$pkgdir/$1"&&sudo -u "$name" makepkg --noconfirm -si >/dev/null 2>&1 || return 1 ; cd /tmp ; } |
642 | - |
643 | -maininstall(){ |
644 | - dialog --title "AutoLinux Installation" --infobox "Installing '$1' ($n of $total). $2" 5 70 |
645 | - installpkg "$1" ; } |
646 | - |
647 | -gitinstall(){ |
648 | - progname="$(basename "$1" .git)" |
649 | - dir="$repodir/$progname" |
650 | - dialog --title "AutoLinux Installation" --infobox "Cloning and Building '$progname' ($n of $total). '$(basename "$1")' $2" 5 70 |
651 | - sudo -u "$name" git clone --depth 1 "$1" "$dir" >/dev/null 2>&1 || { cd "$dir" || return 1 ; sudo -u "$name" git pull --force origin master;} |
652 | - cd "$dir" || exit 1 |
653 | - makepkg -sri >/dev/null 2>&1 |
654 | - cd /tmp || return 1 ; } |
655 | - |
656 | -gitcompile(){ |
657 | - progname="$(basename "$1" .git)" |
658 | - dir="$repodir/$progname" |
659 | - dialog --title "AutoLinux Installation" --infobox "Installing the AutoLinux build of '$progname' ($n of $total). $(basename "$1") $2" 5 70 |
660 | - sudo -u "$name" git clone --depth 1 "$1" "$dir" >/dev/null 2>&1 || { cd "$dir" || return 1 ; sudo -u "$name" git pull --force origin master;} |
661 | - cd "$dir" || exit 1 |
662 | - make >/dev/null 2>&1 |
663 | - make install >/dev/null 2>&1 |
664 | - cd /tmp || return 1 ; } |
665 | - |
666 | -aurinstall(){ \ |
667 | - dialog --title "AutoLinux Installation" --infobox "Installing '$1' ($n of $total) from the AUR. $2" 5 70 |
668 | - echo "$aurinstalled" | grep -q "^$1$" && return 1 |
669 | - sudo -u "$name" $aurhelper -S --noconfirm "$1" >/dev/null 2>&1 |
670 | - } |
671 | - |
672 | -pipinstall(){ \ |
673 | - dialog --title "AutoLinux Installation" --infobox "Installing the Python package '$1' ($n of $total). $2" 5 70 |
674 | - [ -x "$(command -v "pip")" ] || installpkg python-pip >/dev/null 2>&1 |
675 | - yes | pip install "$1" ; } |
676 | - |
677 | -installationloop(){ \ |
678 | - ([ -f "$pkgsfile" ] && cp "$pkgsfile" /tmp/editions.csv) || curl -Ls "$pkgsfile" | sed '/^#/d' > /tmp/editions.csv |
679 | - total=$(wc -l < /tmp/editions.csv) |
680 | - aurinstalled=$(pacman -Qqm) |
681 | - while IFS=, read -r tag program comment; do |
682 | - n=$((n+1)) |
683 | - echo "$comment" | grep -q "^\".*\"$" && comment="$(echo "$comment" | sed "s/\(^\"\|\"$\)//g")" |
684 | - case "$tag" in |
685 | - "A") aurinstall "$program" "$comment" ;; |
686 | - "M") gitinstall "$program" "$comment" ;; |
687 | - "G") gitcompile "$program" "$comment" ;; |
688 | - "P") pipinstall "$program" "$comment" ;; |
689 | - "R") replacedir "$program" "$comment" ;; |
690 | - *) maininstall "$program" "$comment" ;; |
691 | - esac |
692 | - done < /tmp/editions.csv ; } |
693 | - |
694 | -placeconfigs() { |
695 | - dialog --infobox " Downloading and installing config files..." 4 60 |
696 | - branch="$gitbranch" ; dir=$(mktemp -d) |
697 | - [ ! -d "$2" ] && mkdir -p "$2" |
698 | - chown "$name":wheel "$dir" "$2" |
699 | - sudo -u "$name" git clone --recursive -b "$branch" --depth 1 --recurse-submodules "$1" "$dir" >/dev/null 2>&1 |
700 | - sudo -u "$name" cp -rfT "$dir" "$2" ; } |
701 | - |
702 | -systembeepoff() { dialog --infobox "Getting rid of that retarded error beep sound..." 4 40 |
703 | - rmmod pcspkr >/dev/null 2>&1 & echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf >/dev/null 2>&1 ; sleep 2 ; } |
704 | - |
705 | -promptfix(){ \ |
706 | - dialog --infobox " Fixing Shell Syntax Coloring Issue..." 4 45 |
707 | - pacman -R lolcat --noconfirm >/dev/null 2>&1 |
708 | - sudo -u $name paru -S --noconfirm python-lolcat >/dev/null 2>&1 ; } |
709 | - |
710 | -mirrors(){ |
711 | -cd /tmp |
712 | - dialog --infobox " Adding ArcoLinux Mirrors and Keys..." 4 50 |
713 | - sudo wget https://github.com/arcolinux/arcolinux_repo/raw/master/x86_64/arcolinux-keyring-20230919-6-any.pkg.tar.zst -O /tmp/arcolinux-keyring-20230919-6-any.pkg.tar.zst >/dev/null 2>&1 |
714 | -yes |sudo pacman -U --noconfirm --needed /tmp/arcolinux-keyring-20230919-6-any.pkg.tar.zst >/dev/null 2>&1 |
715 | - sudo wget https://raw.githubusercontent.com/arcolinux/arcolinux-mirrorlist/master/etc/pacman.d/arcolinux-mirrorlist -O /etc/pacman.d/arcolinux-mirrorlist >/dev/null 2>&1 |
716 | -sed -i '/arcolinux_repo/{N;d}' /etc/pacman.conf; sed -i '/arcolinux_repo_3party/{N;d}' /etc/pacman.conf; sed -i '/arcolinux_repo_xlarge/{N;d}' /etc/pacman.conf ; |
717 | -echo -e "[arcolinux_repo]\nInclude = /etc/pacman.d/arcolinux-mirrorlist\n\n[arcolinux_repo_3party]\nInclude = /etc/pacman.d/arcolinux-mirrorlist\n\n[arcolinux_repo_xlarge]\nInclude = /etc/pacman.d/arcolinux-mirrorlist\n" >> /etc/pacman.conf ; |
718 | - |
719 | - dialog --infobox " Adding Chaotic Mirrors and Keys..." 4 50 && |
720 | -yes|pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com >/dev/null 2>&1 |
721 | -yes|pacman-key --lsign-key FBA220DFC880C036 >/dev/null 2>&1 |
722 | -yes|pacman -U \ |
723 | - 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' >/dev/null 2>&1 \ |
724 | - 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' >/dev/null 2>&1 && |
725 | -sed -i '/chaotic-aur/{N;d}' /etc/pacman.conf |
726 | -echo -e "[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist\n" >> /etc/pacman.conf ; |
727 | - |
728 | - dialog --infobox " Adding BlackArch Mirrors and Keys..." 4 50 && |
729 | -curl -LO blackarch.org/strap.sh >/dev/null 2>&1 && |
730 | -echo 46f035c31d758c077cce8f16cf9381e8def937bb strap.sh | sha1sum -c >/dev/null 2>&1 && |
731 | -chmod +x strap.sh ; sudo sh strap.sh >/dev/null 2>&1 && |
732 | - |
733 | - dialog --infobox " Updating System Keys and Mirrors..." 4 50 |
734 | -yes|pacman -Syyu >/dev/null 2>&1 ; } |
735 | - |
736 | -system_config(){ \ |
737 | - hostname="AutoLinux" |
738 | - dialog --infobox "Setting System Information..." 4 40 ; sleep 2 && |
739 | - |
740 | - grep -q "ILoveCandy" /etc/pacman.conf || sed -i "/#VerbosePkgLists/a ILoveCandy" /etc/pacman.conf |
741 | - sed -i "s/^#ParallelDownloads = *.*$/ParallelDownloads = 10/;s/^#Color$/Color/" /etc/pacman.conf |
742 | - [ $edition = '3' ] && hostname="ArchLinux" ; [ -f /etc/localtime ] && rm /etc/localtime ; |
743 | - ln -sF /usr/share/zoneinfo/Africa/Harare /etc/localtime |
744 | - sed -i 's/#en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen |
745 | - sed -i 's/#en_ZA.UTF-8/en_ZA.UTF-8/g' /etc/locale.gen |
746 | - sed -i "s/#en_"$area".UTF-8/en_"$area".UTF-8/g" /etc/locale.gen |
747 | - echo -e "\nLANG=en_ZA.UTF-8\nLANG=en_US.UTF-8" > /etc/locale.conf && |
748 | - [ "$(cat /etc/locale.conf|grep "$area"|wc -l)" -eq "0" ] && |
749 | - echo "LANG=en_"$area".UTF-8" >>/etc/locale.conf ; locale-gen &>/dev/null |
750 | - echo -e "127.0.0.1 localhost\n::1 localhost\n127.0.1.1 $hostname.localhost $hostname" >/etc/hosts |
751 | - [ $edition = '2' ] && systemctl enable sddm.service >/dev/null 2>&1 ; systemctl enable NetworkManager.service >/dev/null 2>&1 ; |
752 | - [ $edition = '1' ] || [ $edition = '2' ] && systemctl enable bluetooth-autoconnect.service >/dev/null 2>&1 ; |
753 | - systemctl enable bluetooth.service >/dev/null 2>&1 ; [ $edition = '1' ] && |
754 | - systemctl enable mpd.service >/dev/null 2>&1 ; echo "$hostname" > /etc/hostname |
755 | - rm -rf /tmp/pulse* ~/.pulse* ~/.config/pulse /home/$name/.pulse* /home/$name/.config/pulse* ; } |
756 | - |
757 | -xftlib(){ \ |
758 | - dialog --title "AutoLinux Installation" --infobox "Lastly installing 'libxft-bgra' .\nSuckless software to display color emojis without causing any errors." 6 80 |
759 | - ! pacman -Qq libxft-bgra >/dev/null 2>&1 && pacman -R --noconfirm libxft-bgra >/dev/null 2>&1 ; |
760 | - yes | sudo -u "$name" $aurhelper -S libxft-bgra-git >/dev/null 2>&1 ; } |
761 | - |
762 | - |
763 | -yesGrub(){ \ |
764 | - dialog --infobox "Initiating the Grub Bootloader..." 4 40 |
765 | - pacman -S --noconfirm --needed grub >/dev/null 2>&1 |
766 | - ! [ -d /sys/firmware/efi/efivars ] && |
767 | - grub-install --target=i386-pc --bootloader-id=AutoLinux --force >/dev/null 2>&1 ; |
768 | - [ -d /sys/firmware/efi/efivars ] && pacman -S --noconfirm --needed grub efibootmgr >/dev/null 2>&1 && |
769 | - grub-install --target=x86_64-efi --bootloader-id=AutoLinux --recheck >/dev/null 2>&1 ; |
770 | - grub-mkconfig -o /boot/grub/grub.cfg >/dev/null 2>&1 ; grubtheme ; } |
771 | - |
772 | -grubtheme(){ \ |
773 | - dialog --infobox "Setting Grub theme..." 4 30 |
774 | - sleep 1 && mkdir -p /boot/grub/themes/AutoLinux && |
775 | - cp /home/$name/.local/share/wallpapers/0.jpg /boot/grub/themes/AutoLinux/wp1jpg >/dev/null 2>&1 |
776 | - sed -i 's/#GRUB_BACKGROUND.*/GRUB_BACKGROUND="\/boot\/grub\/themes\/AutoLinux\/wp1jpg"/g' /etc/default/grub >/dev/null 2>&1 |
777 | - sed -i 's/GRUB_BACKGROUND.*/GRUB_BACKGROUND="\/boot\/grub\/themes\/AutoLinux\/wp1jpg"/g' /etc/default/grub >/dev/null 2>&1 |
778 | - sed -i 's/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=10/g' /etc/default/grub >/dev/null 2>&1 |
779 | - sed -i 's/#GRUB_GFXMODE.*/GRUB_GFXMODE=1920x1080x32/g' /etc/default/grub >/dev/null 2>&1 |
780 | -} |
781 | - |
782 | - |
783 | -finalize(){ \ |
784 | - dialog --infobox "Preparing welcome message..." 4 50 |
785 | - case $edition in |
786 | - 2) sed -i 's/Name=.*$/Name=AutoLinux (Plasma)/g' /usr/share/xsessions/plasma.desktop && cp -r /home/$name/.local/bin/* /usr/local/bin/ && dialog --title "Time to Celebrate" --msgbox "\\n The AutoLinux installation process has completed successfully\!\\n\\n\\n Provided there were no hidden errors, all the programs and configuration files should be in place.\\n\\nautolinux-Plasma will automatically start up in the login manager the next time you reboot your computer.\\n\\n\\n\\n Enjoy AutoLinux! - a4to" 17 110 ;; |
787 | - *) dialog --title "Time to Celebrate!" --msgbox "\\nInstallation completed successfully! Provided there were no hidden errors, all the programs and configuration files should be in place.\\n\\nTo run the new graphical environment, log out and log back in as your new user, then run the command 'startx' to start the graphical environment \\n(it will start automatically in tty1).\\n\\n Enjoy AutoLinux! - a4to" 13 80 ;; esac ; } |
788 | - |
789 | - |
790 | -rebootmsg(){ \ |
791 | - i=10 ; i=$i ; clear |
792 | - until [ $i -lt 0 ] ; do |
793 | - echo -e " Exiting in: $i\n" | figlet -tc |lolcat && sleep 1 && clear && |
794 | - ((i=$i-1)) ; done && umount -l /mnt && exit 0 || rebootmsg ; } |
795 | - |
796 | - |
797 | - |
798 | -### SCRIPT BEGIN ### |
799 | - |
800 | -check_root |
801 | - |
802 | -installpkg dialog || err "Root priviledges are required to run this script!" |
803 | - |
804 | -initmsg1 || err "User exited." |
805 | - |
806 | -initmsg2 || err "User exited." |
807 | - |
808 | -whichedition || err "User exited." |
809 | - |
810 | -user_and_password || err "User exited." |
811 | - |
812 | -root_user_password || err "User exited." |
813 | - |
814 | -selKernel || err "User exited." |
815 | - |
816 | -usercheck || err "User exited." |
817 | - |
818 | -bootload |
819 | - |
820 | -preinstall || err "User exited." |
821 | - |
822 | -refreshkeys || err "Automatically refreshing Arch keyring. Consider doing so manually." |
823 | - |
824 | -for x in curl ca-certificates base-devel archlinux-keyring hwinfo neofetch rsync git ntp zsh ; do |
825 | - dialog --title "$TITLE" --infobox "Installing '$x' which is required to install and configure other programs." 5 70 |
826 | - installpkg "$x" |
827 | -done |
828 | - |
829 | -pacman-key --init >/dev/null 2>&1; pacman-key --populate >/dev/null 2>&1 |
830 | -dialog --title "AutoLinux Installation" --infobox "Synchronizing system time to ensure successful and secure installation of software..." 5 70 |
831 | -ntpdate 0.us.pool.ntp.org >/dev/null 2>&1 |
832 | - |
833 | -# newmirrors || err "User exited." |
834 | - |
835 | -adduserandpass || err "Adding username and/or password." |
836 | - |
837 | -setrootpass || err "Changing root password." |
838 | - |
839 | -sudoers "%wheel ALL=(ALL) NOPASSWD: ALL #AutoLinux" |
840 | - |
841 | - |
842 | -[ -f /etc/sudoers.pacnew ] && cp /etc/sudoers.pacnew /etc/sudoers |
843 | - |
844 | - |
845 | -archlinuxinstall yay-bin |
846 | - |
847 | -case $edition in |
848 | - 1) pkgsfile="https://gitlab.com/a4to/autolinux/-/raw/editions/dwm.csv" && gitbranch="dwm" ;; |
849 | - 2) pkgsfile="https://gitlab.com/a4to/autolinux/-/raw/editions/plasma.csv" && gitbranch="plasma" ;; |
850 | - 2) pkgsfile="https://gitlab.com/a4to/autolinux/-/raw/editions/bare.csv" && gitbranch="bare" ;; |
851 | -esac |
852 | - |
853 | -case $kernel in |
854 | - 1) kernelChoice='linux' ;; |
855 | - 2) kernelChoice='linux-lts' ;; |
856 | - 3) kernelChoice='linux-hardened' ;; |
857 | - 4) kernelChoice='linux-zen' ;; |
858 | -esac |
859 | - |
860 | - |
861 | -for x in $kernelChoice ; do |
862 | - dialog --title "$TITLE" --infobox "\\nInstalling the "$x" kernel..." 5 70 && installpkg "$x" |
863 | - dialog --title "$TITLE" --infobox "\\nInstalling the "$x" headers..." 5 70 && installpkg "$x"-headers |
864 | -done |
865 | - |
866 | - |
867 | -! [ $edition = '3' ] && installationloop && cpudrivers && gpudrivers |
868 | - |
869 | -[ $edition = '1' ] && xftlib |
870 | - |
871 | -systembeepoff ; promptfix |
872 | - |
873 | - |
874 | -placeconfigs "$dotfiles" "/home/$name" "$gitbranch" && rm -rf "/home/$name/.git" |
875 | - |
876 | -chshell || err "Changing default shell for root and "$name"." |
877 | - |
878 | - |
879 | -mkdir -p /etc/X11/xinit/xinitrc.d >/dev/null 2>&1 && |
880 | - [ -f /home/$name/.config/shell/profile ] && cat /home/$name/.config/shell/profile > /etc/zsh/zprofile >/dev/null 2>&1 |
881 | - [ -f /home/$name/.config/x11/xinitrc ] && cat /home/$name/.config/x11/xinitrc > /etc/X11/xinit/xinitrc >/dev/null 2>&1 |
882 | - |
883 | -[ -d /root/.config ] && mv /root/.config /root/.config-old >/dev/null 2>&1 |
884 | -[ -d /root/.local/ ] && mv /root/.local/ /root/.local-old >/dev/null 2>&1 |
885 | - ln -s /home/$name/{.config,.local/} /root >/dev/null 2>&1 && |
886 | - cp /home/$name/.config/shell/profile /root/.zprofile >/dev/null 2>&1 |
887 | - |
888 | -[ $edition = '1' ] && cp /home/$name/.local/src/dwm/dwm /usr/bin/dwm && |
889 | - cp /home/$name/.local/src/dwm/dwm /usr/bin/AutoLinux-dwm |
890 | - |
891 | -[ $edition = '2' ] && pacman -S plasma-desktop plasma-meta --noconfirm >/dev/null 2>&1 && |
892 | - cp /usr/bin/startplasma-x11 /usr/bin/AutoLinux-plasma >/dev/null 2>&1 |
893 | - |
894 | -grep -q "OTHER_OPTS='-a pulseaudio -m alsa_seq -r 48000'" /etc/conf.d/fluidsynth || |
895 | - echo "OTHER_OPTS='-a pulseaudio -m alsa_seq -r 48000'" >> /etc/conf.d/fluidsynth |
896 | - |
897 | -pkill -15 -x 'pulseaudio'; sudo -u "$name" pulseaudio --start |
898 | - |
899 | - |
900 | -system_config ; [ "$loader" = "0" ] && yesGrub |
901 | - |
902 | -finalize ; clear ; [ $edition = '1' ] || [ $edition = '2' ] && skell |
903 | - |
904 | - |
905 | -######################################################################################################################################################################################### |
906 | -######################################################################################################################################################################################### |
907 | diff --git a/autoPart b/autoPart |
908 | deleted file mode 100755 |
909 | index 6a20bd8..0000000 |
910 | --- a/autoPart |
911 | +++ /dev/null |
912 | @@ -1,151 +0,0 @@ |
913 | -#!/usr/bin/env sh |
914 | -######################################################################################################################################################################################### |
915 | -## 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 ## |
916 | -######################################################################################################################################################################################### |
917 | - |
918 | -# _ _ _ __ _ _ # |
919 | -# /.\ _ _ FJ_ ____ FJ / J _ _ _ _ _ FJ LJ # |
920 | -# //_\\ J | | LJ _| F __ J J | LFJ J ' \ J J | | L J \/ F # |
921 | -# / ___ \ | | | || |-' | |--| | | | J L | |\\ | | | | | / \ # |
922 | -# / L___J \ F L__J JF |__-.F L__J J F L_____ J L F L \ JJ F L__J J / /\ \ # |
923 | -# J__L J__J\____,__\_____J\______/J________LJ__LJ__L \\J__LJ\____,__LJ__//\\__L # |
924 | -# |__L J__|J____,__J_____FJ______F|________||__||__L J__| J____,__F|__/ \__| # |
925 | - |
926 | -######################################################################################################################################################################################### |
927 | -######################################################################################################################################################################################### |
928 | - |
929 | -dsks=$(mktemp) |
930 | -selDsk=$(mktemp) |
931 | -selPar=$(mktemp) |
932 | -selPart=$(mktemp) |
933 | -selSwap=$(mktemp) |
934 | -selBoot=$(mktemp) |
935 | -selRootFS=$(mktemp) |
936 | -selSwap=$(mktemp) |
937 | -wholeDisk=$(mktemp) |
938 | -confirm=$(mktemp) |
939 | -partitions=$(mktemp) |
940 | - |
941 | - |
942 | -lines(){ cat $1|wc -l; } |
943 | - |
944 | -selectParts(){ selBoot ; selSwap ; selRootFS ; } |
945 | - |
946 | -err(){ echo >&2 "$(tput bold; tput setaf 1)[-] ERROR: ${*}$(tput sgr0)";exit 1; } |
947 | - |
948 | - |
949 | -selDisk(){ \ |
950 | - dialog --stdout --colors --title "Partitioning" \ |
951 | - --menu " Which drive will be used for the AutoLinux installation?" 30 65 0 \ |
952 | - "${drives[@]}" > $selDsk |
953 | -} |
954 | - |
955 | -selBoot(){ \ |
956 | - dialog --stdout --no-cancel --colors --title "Partitioning" \ |
957 | - --menu " Which Partition will be used for the bootloader?" 30 65 0 \ |
958 | - "${parts[@]}" > $selBoot |
959 | -} |
960 | - |
961 | -selSwap(){ \ |
962 | - dialog --stdout --colors --title "Partitioning" \ |
963 | - --ok-label "Continue" \ |
964 | - --cancel-label "No Swap" \ |
965 | - --menu " Which Partition will be used for the swap?" 30 65 0 \ |
966 | - "${parts[@]}" > $selSwap |
967 | -} |
968 | - |
969 | -selRootFS(){ \ |
970 | - dialog --stdout --no-cancel --colors --title "Partitioning" \ |
971 | - --menu " Which Partition will be used for the root filesystem?" 30 65 0 \ |
972 | - "${parts[@]}" > $selRootFS |
973 | -} |
974 | - |
975 | -wholeDisk(){ \ |
976 | - dialog --stdout --colors --extra-button \ |
977 | - --title "Partitioning" \ |
978 | - --extra-label "WIPE DISK" \ |
979 | - --yes-label 'Select Partitions' \ |
980 | - --no-label 'Go Back' \ |
981 | - --yesno "Would you like to wipe the entire drive, or manually select partitions?" 6 80 ; |
982 | - echo $? > $wholeDisk |
983 | -} |
984 | - |
985 | -allDisks(){ \ |
986 | -sudo fdisk -l|grep -B 1 "Disk model:"|sed 's/,.*sectors//g;s/://g;s/Disk\s*\///g;s/Disk model //g'|xargs|sed \ |
987 | -'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 ; } |
988 | - |
989 | -getDisk(){ \ |
990 | -eval $(sudo fdisk -lo Device,Size,Type|grep $(cat $selDsk) >$selPar ; n=1 ; echo "parts=(" >$selPart |
991 | -cat $selPar|while read x; do echo "$(sudo head -n $n $selPar|tail -n1|cut -d' ' -f1|sed "s/^/'/;s/$/'/")\ |
992 | -$(echo $x|cut -d' ' -f2-|sed "s/^/\t\'/;s/$/\'/")"|sed '/Disk.*bytes,.*sectors/d'; ((n++)) ; done >>$selPart && |
993 | -echo -e ")" >>$selPart) ; source $selPart ; } |
994 | - |
995 | -confirm(){ \ |
996 | - dialog --stdout --colors --title "Partitioning" \ |
997 | - --yes-label 'NO. Go Back' \ |
998 | - --no-label 'YES. Continue' \ |
999 | - --yesno "\\nAre you sure you want to completely wipe $(cat $selDsk)?\\n\\nThis action CANNOT be undone." 9 90 ; |