-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathviss
More file actions
executable file
·491 lines (391 loc) · 21.6 KB
/
viss
File metadata and controls
executable file
·491 lines (391 loc) · 21.6 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
#!/bin/bash
# This script is an "orchestrator" for the other scripts that exist in the "setup" directory, and is only responsible for setting values and displaying the TUI.
# This keeps the installer cleaner and easier to manipulate.
# Source installer library
. "$(pwd)/misc/libviss" ||
{ echo "$(pwd)/misc/libviss not found. Cannot continue." ; exit 1 ; }
# Source basic installer setup script
. "$(pwd)/setup/installer" ||
{ commandFailure="$(pwd)/setup/installer not found. Cannot continue." ; die ; }
# Source hidden settings file, if there is one.
if [ "$#" == "1" ]; then
. "$1" ||
{ commandFailure="Sourcing hidden options file has failed." ; die ; }
fi
# Default to voids base-system unless otherwise defined in the hidden settings file
[ -z "$basesystem" ] &&
basesystem="base-system"
drawDialog --msgbox "Welcome!\n\nThis is primarily a guided installer, but at any moment you may press the 'Map' button to jump around the installer in a non-linear way, or to go back and change settings.\n\nYou may use your TAB key, arrow keys, and Enter/Return to navigate this TUI.\n\nPressing Enter now will begin the installation process, but no changes will be made to the disk until you confirm your installation settings." 0 0
# Each section of the installer will have its own function, so the user can go back to a specific spot to change something.
diskConfig() {
local diskList=$(lsblk -d -o NAME,SIZE -n -e7)
local diskIndicator=$(lsblk -o NAME,SIZE,TYPE -e7)
if diskInput=$(drawDialog --begin 2 2 --title "Available Disks" --infobox "$diskIndicator" 0 0 --and-widget --title "Partitioner" --menu "The disk you choose will not be modified until you confirm your installation options.\n\nPlease choose the disk you would like to partition and install Void Linux to:" 0 0 0 $diskList) ; then
diskInput="/dev/$diskInput"
else
exit 0
fi
diskSize=$(lsblk --output SIZE -n -d "$diskInput")
diskFloat=$(echo "$diskSize" | sed 's/G//g')
diskAvailable=$(echo "$diskFloat" - 0.5 | bc)
diskAvailable+="G"
local diskIndicator=$(partitionerOutput)
if drawDialog --title "Partitioner - Encryption" --extra-button --extra-label "Map" --yesno "Should this installation be encrypted?" 0 0 ; then
encryption="Yes"
drawDialog --title "Partitioner - Wipe Disk" --yesno "Would you like to securely wipe the selected disk before setup?\n\nThis can take quite a long time depending on how many passes you choose.\n\nBe aware that doing this on an SSD is likely a bad idea." 0 0 &&
wipedisk=$(drawDialog --title "Partitioner - Wipe Disk" --inputbox "How many passes would you like to do on this disk?\n\nSane values include 1-3. The more passes you choose, the longer this will take." 0 0)
else
[ "$?" == "3" ] && dungeonmap
encryption="No"
fi
if [ "$zfspossible" != "no" ] ; then
filesystem=$(drawDialog --no-cancel --title "Partitioner - Filesystem" --extra-button --extra-label "Map" --menu "If you are unsure, choose 'ext4'" 0 0 0 "ext4" "" "xfs" "" "btrfs" "(Experimental)" "zfs" "(Experimental)")
else
filesystem=$(drawDialog --no-cancel --title "Partitioner - Filesystem" --extra-button --extra-label "Map" --menu "If you are unsure, choose 'ext4'" 0 0 0 "ext4" "" "xfs" "" "btrfs" "(Experimental)")
fi
[ "$?" == "3" ] && dungeonmap
if [ "$filesystem" != "btrfs" ] && [ "$filesystem" != "zfs" ]; then
if drawDialog --title "Partitioner - LVM" --extra-button --extra-label "Map" --yesno "Would you like to use LVM?" 0 0 ; then
lvm="Yes"
else
[ "$?" == "3" ] && dungeonmap
lvm="No"
fi
else
lvm="No"
if [ "$filesystem" == "btrfs" ] ; then
compressionType=$(drawDialog --no-cancel --title "Partitioner - Filesystem" --extra-button --extra-label "Map" --menu "What style of compression would you like to use with btrfs?" 0 0 0 "zstd" "" "lzo" "" "zlib" "" "none" "")
else
compressionType=$(drawDialog --no-cancel --title "Partitioner - Filesystem" --extra-button --extra-label "Map" --menu "What style of compression would you like to use with zfs?" 0 0 0 "zstd" "" "lz4" "" "gzip" "")
fi
[ "$filesystem" == "btrfs" ] &&
if [ "$compressionType" == "None" ]; then
btrfsopts="rw,noatime,nocompress,discard=async"
else
btrfsopts="rw,noatime,compress=$compressionType,discard=async"
fi
fi
if drawDialog --title "Disk Details" --extra-button --extra-label "Map" --no-cancel --title "Partitioner - Swap" --yesno "Would you like to use swap?" 0 0 ; then
if [ "$lvm" == "Yes" ] || [ "$encryption" == "No" ] && [ "$filesystem" != "btrfs" ] && [ "$filesystem" != "zfs" ]; then
swapStyle=$(drawDialog --begin 2 2 --title "Disk Details" --infobox "$diskIndicator" 0 0 --and-widget --no-cancel --title "Partitioner - Swap" --menu "What style of swap would you like to use?\n\nIf you are unsure, 'swapfile' is recommended." 0 0 0 "swapfile" "- On-filesystem swapfile" "zram" "- RAM in your RAM, but smaller" "partition" "- Traditional swap partition" "none" "")
elif [ "$filesystem" == "zfs" ] ; then
swapStyle=$(drawDialog --begin 2 2 --title "Disk Details" --infobox "$diskIndicator" 0 0 --and-widget --no-cancel --title "Partitioner - Swap" --menu "What style of swap would you like to use?\n\nDue to filesystem limitations, zram is the available choice." 0 0 0 "zram" "- RAM in your RAM, but smaller" "none" "")
else
swapStyle=$(drawDialog --begin 2 2 --title "Disk Details" --infobox "$diskIndicator" 0 0 --and-widget --no-cancel --title "Partitioner - Swap" --menu "What style of swap would you like to use?\n\nIf you are unsure, 'swapfile' is recommended." 0 0 0 "swapfile" "- On-filesystem swapfile" "zram" "- RAM in your RAM, but smaller" "none" "")
fi
else
[ "$?" == "3" ] && dungeonmap
fi
case "$swapStyle" in
swapfile) swapSize=$(drawDialog --begin 2 2 --title "Disk Details" --infobox "$diskIndicator" 0 0 --and-widget --no-cancel --title "Partitioner - Swap" --inputbox "How large would you like your swapfile to be?\n(Example: '4G')" 0 0) ;;
zram) swapSize=$(drawDialog --begin 2 2 --title "Disk Details" --infobox "$diskIndicator" 0 0 --and-widget --no-cancel --title "Partitioner - Swap" --inputbox "How large would you like your compressed ramdisk to be?\n(Example: '4G')" 0 0) ;;
partition)
swapSize=$(drawDialog --begin 2 2 --title "Disk Details" --infobox "$diskIndicator" 0 0 --and-widget --no-cancel --title "Partitioner - Swap" --inputbox "How large would you like your swap partition to be?\n(Example: '4G')" 0 0)
local sizeInput=$swapSize && diskCalculator && local diskIndicator=$(partitionerOutput)
;;
esac
if [ "$filesystem" != "btrfs" ] && [ "$filesystem" != "zfs" ]; then
rootSize=$(drawDialog --begin 2 2 --title "Disk Details" --infobox "$diskIndicator" 0 0 --and-widget --no-cancel --title "Partitioner - Root" --extra-button --extra-label "Map" --inputbox "If you would like to limit the size of your root filesystem, such as to have a separate home partition, you can enter a value such as '50G' here.\n\nOtherwise, if you would like your root partition to take up the entire drive, leave this empty and press OK." 0 0)
[ "$?" == "3" ] && dungeonmap
[ -z "$rootSize" ] && rootSize="full"
else
rootSize="full"
fi
if [ "$filesystem" == "btrfs" ] || [ "$filesystem" == "zfs" ]; then
local separateHomePossible="Yes"
elif [ "$rootSize" == "full" ]; then
local separateHomePossible="No"
elif [ "$lvm" == "No" ] && [ "$encryption" == "Yes" ]; then
local separateHomePossible="No"
else
local sizeInput=$rootSize && diskCalculator && local diskIndicator=$(partitionerOutput)
fi
[ "$separateHomePossible" != "No" ] &&
if drawDialog --title "Partitioner - Home" --extra-button --extra-label "Map" --yesno "Would you like to have a separate home volume?\n\nIf using btrfs or zfs, creating a separate home is recommended." 0 0 ; then
if [ "$filesystem" != "btrfs" ] && [ "$filesystem" != "zfs" ]; then
homeSize=$(drawDialog --begin 2 2 --title "Disk Details" --infobox "$diskIndicator" 0 0 --and-widget --no-cancel --title "Partitioner - Home" --inputbox "How large would you like your home partition to be?\n(Example: '100G')\n\nIf you would like the home partition to take up the rest of your disk, leave this empty and press OK." 0 0)
[ -z "$homeSize" ] && homeSize="full"
else
createHome="Yes"
fi
else
[ "$?" == "3" ] && dungeonmap
[ "$filesystem" == "btrfs" ] &&
createHome="No"
fi
suConfig
}
suConfig() {
su=$(drawDialog --no-cancel --title "SU Choice" --extra-button --extra-label "Map" --menu "If you are unsure, choose 'sudo'" 0 0 0 "sudo" "" "doas" "" "none" "")
[ "$?" == "3" ] && dungeonmap
kernelConfig
}
kernelConfig() {
if [ "$filesystem" != "zfs" ]; then
kernel=$(drawDialog --no-cancel --title "Kernel Choice" --extra-button --extra-label "Map" --menu "If you are unsure, choose 'linux'" 0 0 0 "linux" "- Normal Void kernel" "linux-lts" "- Older LTS kernel" "linux-mainline" "- Bleeding edge kernel")
else
kernel=$(drawDialog --no-cancel --title "Kernel Choice" --extra-button --extra-label "Map" --menu "If you are unsure, choose 'linux'" 0 0 0 "linux" "- Normal Void kernel" "linux-lts" "- Older LTS kernel")
fi
[ "$?" == "3" ] && dungeonmap
bootloaderConfig
}
bootloaderConfig() {
[ "$filesystem" == "zfs" ] &&
{ bootloader=zfsbootmenu && hostnameConfig ; }
bootloader=$(drawDialog --no-cancel --title "Bootloader choice" --extra-button --extra-label "Map" --menu "If you are unsure, choose 'grub'" 0 0 0 "grub" "- Traditional bootloader" "uki" "- Unified Kernel Image" "none" "- Installs no bootloader (Advanced)")
[ "$?" == "3" ] && dungeonmap
initrdConfig
}
initrdConfig() {
[ "$filesystem" == "zfs" ] &&
{ initrd="dracut" && hostnameConfig ; }
# TODO: need to test tinyramfs with zfs
# TODO: is mkinitcpio worthwhile to include?
initrd=$(drawDialog --no-cancel --title "Initramfs choice" --extra-button --extra-label "Map" --menu "If you are unsure, choose 'dracut'" 0 0 0 "dracut" "- Default Void initramfs generator" "tinyramfs" "- Small POSIX Shell initramfs generator")
[ "$?" == "3" ] && dungeonmap
hostnameConfig
}
hostnameConfig() {
hostname=$(drawDialog --no-cancel --title "System Hostname" --extra-button --extra-label "Map" --inputbox "Set your system hostname." 0 0)
[ "$?" == "3" ] && dungeonmap
userConfig
}
userConfig() {
username=$(drawDialog --title "Create User" --extra-button --extra-label "Map" --inputbox "What would you like your username to be?\n\nIf you do not want to create a user here, choose 'Skip'\n\nYou will be asked to set a password later." 0 0)
[ "$?" == "3" ] && dungeonmap
timezoneConfig
}
timezoneConfig() {
# Most of this timezone section is taken from the normal Void installer.
local areas=(Africa America Antarctica Arctic Asia Atlantic Australia Europe Indian Pacific)
if area=$(IFS='|'; drawDialog --no-cancel --title "Set Timezone" --menu "" 0 0 0 $(printf '%s||' "${areas[@]}")) ; then
read -a locations -d '\n' < <(find /usr/share/zoneinfo/$area -type f -printf '%P\n' | sort) || echo "Disregard exit code"
local location=$(IFS='|'; drawDialog --no-cancel --title "Set Timezone" --menu "" 0 0 0 $(printf '%s||' "${locations[@]//_/ }"))
fi
local location=$(echo $location | tr ' ' '_')
timezone="$area/$location"
localeConfig
}
localeConfig() {
[ "$libc" == "musl" ] &&
repositoryConfig
# This line is also taken from the normal Void installer.
local localeList=$(grep -E '\.UTF-8' /etc/default/libc-locales | awk '{print $1}' | sed -e 's/^#//')
for i in $localeList
do
# We don't need to specify an item here, only a tag and print it to stdout
local tmp+=("$i" $(printf '\u200b')) # Use a zero width unicode character for the item
done
local localeChoice=$(drawDialog --no-cancel --title "Locale Selection" --menu "Please choose your system locale." 0 0 0 ${tmp[@]})
locale="LANG=$localeChoice"
libclocale="$localeChoice UTF-8"
repositoryConfig
}
repositoryConfig() {
if drawDialog --title "Repository Mirror" --extra-button --extra-label "Map" --yesno "Would you like to set your repo mirror?\n\nIf not, repo-default will be used." 0 0 ; then
xmirror
repository=$(cat /etc/xbps.d/*-repository-main.conf | sed 's/repository=//g')
else
[ "$?" == "3" ] && dungeonmap
[ "$libc" == "glibc" ] && repository="https://repo-default.voidlinux.org/current"
[ "$libc" == "musl" ] && repository="https://repo-default.voidlinux.org/current/musl"
fi
[ "$libc" == "glibc" ] && ARCH="x86_64"
[ "$libc" == "musl" ] && ARCH="x86_64-musl"
graphicsConfig
}
graphicsConfig() {
if [ "$libc" == "glibc" ]; then
graphics=$(drawDialog --title 'Graphics Drivers' --extra-button --extra-label "Map" --checklist 'Select graphics drivers, or choose 'Skip' if you would like to skip:' 0 0 0 'intel' '' 'off' 'intel-32bit' '' 'off' 'amd' '' 'off' 'amd-32bit' '' 'off' 'nvidia' '- Proprietary driver' 'off' 'nvidia-32bit' '' 'off' 'nvidia-nouveau' '- Nvidia Nouveau driver (experimental)' 'off' 'nvidia-nouveau-32bit' '' 'off')
[ "$?" == "3" ] && dungeonmap
else
graphics=$(drawDialog --title 'Graphics Drivers' --extra-button --extra-label "Map" --checklist 'Select graphics drivers, or choose 'Skip' if you would like to skip: ' 0 0 0 'intel' '' 'off' 'amd' '' 'off' 'nvidia-nouveau' '- Nvidia Nouveau driver (experimental)' 'off')
[ "$?" == "3" ] && dungeonmap
fi
[ -n "$graphics" ] &&
IFS=" " read -r -a graphicsArray <<< "$graphics"
networkConfig
}
networkConfig() {
network=$(drawDialog --no-cancel --title "Networking - DHCP client" --extra-button --extra-label "Map" --menu "If you are unsure, choose 'NetworkManager'\n\nIf 'none' is chosen, dhcpcd will still be included but not enabled." 0 0 0 "NetworkManager" "" "dhcpcd" "" "none" "")
[ "$?" == "3" ] && dungeonmap
audioConfig
}
audioConfig() {
audio=$(drawDialog --no-cancel --title "Audio Server" --extra-button --extra-label "Map" --menu "If you are unsure, 'pipewire' is recommended." 0 0 0 "pipewire" "" "pulseaudio" "" "none" "")
[ "$?" == "3" ] && dungeonmap
desktopConfig
}
desktopConfig() {
desktop=$(drawDialog --no-cancel --title "Desktop Environment" --extra-button --extra-label "Map" --menu "" 0 0 0 "gnome" "" "i3" "" "kde" "" "mate" "" "niri" "" "river" "" "sway" "" "swayfx" "" "wayfire" "" "xfce" "" "none" "")
[ "$?" == "3" ] && dungeonmap
case "$desktop" in
sway|swayfx|wayfire|niri|river) drawDialog --title "" --extra-button --extra-label "Map" --yesno "Would you like to install greetd with $desktop?" 0 0 && greetd="Yes" ;;
i3) drawDialog --title "" --extra-button --extra-label "Map" --yesno "Would you like to install lightdm with $desktop?" 0 0 && lightdm="Yes" ;;
esac
modulesConfig
}
modulesConfig() {
# Unset to prevent duplicates
[ -n "$modules" ] &&
unset modulesDialogArray
read -a modulesList -d '\n' < <(ls modules/ | sort)
for i in "${modulesList[@]}"
do
if [ -e "modules/$i" ] && checkModule ; then
local modulesDialogArray+=("'$title' '$description' '$status'")
fi
done
# Using dash here as a simple solution to it misbehaving when ran with bash
modules=( $(sh -c "dialog --stdout --title 'Extra Options' --extra-button --extra-label "Map" --no-mouse --backtitle "https://github.com/kkrruumm/void-install-script" --checklist 'Enable or disable extra install options: ' 0 0 0 $(echo "${modulesDialogArray[@]}")") )
[ "$?" == "3" ] && dungeonmap
confirm
}
confirm() {
# Unset to prevent duplicates
[ -n "$settings" ] &&
unset settings
# Construct confirm menu
# I know this is a fucking mess, but it's better than the previous in-line logic.
[ "$basesystem" != "base-system" ] &&
settings="Base system: custom\n"
settings+="Repo mirror: $repository\n"
settings+="Bootloader: $bootloader\n"
settings+="Kernel: $kernel\n"
settings+="Initramfs: $initrd\n"
settings+="Target disk: $diskInput\n"
settings+="Encryption: $encryption\n"
if [ "$encryption" == "Yes" ] && [ -n "$wipedisk" ]; then
settings+="Disk wipe passes: $wipedisk\n"
elif [ "$encryption" == "Yes" ]; then
settings+="Disk wipe passes: none\n"
fi
[ "$filesystem" != "btrfs" ] &&
settings+="LVM: $lvm\n"
settings+="Filesystem: $filesystem\n"
[ -n "$compressionType" ] &&
settings+="Filesystem compression: $compressionType\n"
if [ -n "$swapStyle" ]; then
settings+="Swap style: $swapStyle\n"
settings+="Swap size: $swapSize\n"
else
settings+="Swap style: none\n"
fi
settings+="Root size: $rootSize\n"
if [ "$filesystem" != "btrfs" ]; then
[ -n "$homeSize" ] &&
settings+="Home size: $homeSize\n"
else
settings+="Create split home: $createHome\n"
fi
settings+="Hostname: $hostname\n"
settings+="Timezone: $timezone\n"
[ "$libc" == "glibc" ] &&
settings+="Locale: $locale\n"
[ -n "$username" ] &&
settings+="User: $username\n"
[ -n "$desktop" ] &&
settings+="DE/WM: $desktop\n"
[ -n "$network" ] &&
settings+="DHCP client: $network\n"
[ -n "$audio" ] &&
settings+="Audio server: $audio\n"
[ -n "$graphics" ] &&
settings+="Graphics drivers: $graphics\n"
[ "$desktop" == "i3" ] && [ -n "$lightdm" ] &&
settings+="Install lightdm with i3?: $lightdm\n"
for i in sway swayfx niri wayfire
do
if [ "$desktop" == "$i" ]; then
[ -z "$greetd" ] && greetd="No"
settings+="Install greetd with $desktop?: $greetd\n"
break
fi
done
[ -n "$modules" ] &&
settings+="Enabled modules: ${modules[@]}\n"
drawDialog --yes-label "Install" --no-label "Exit" --extra-button --extra-label "Map" --title "Installation Overview" --yesno "Selecting 'Install' here will DESTROY ALL DATA on the chosen disk and install with the options below. \n\n
$settings\n
To change any of these settings, choose 'Map'." 0 0
case $? in
0)
_install
;;
1)
exit 0
;;
3)
dungeonmap
;;
esac
}
dungeonmap() {
waypoint=$(drawDialog --no-cancel --title "Dungeon Map" --menu "Choose a section to jump to:" 0 0 0 "Disk" "" "SU" "" "Kernel" "" "Bootloader" "" "Initramfs" "" "Hostname" "" "User" "" "Timezone" "" "Locale" "" "Repository" "" "Graphics" "" "Network" "" "Audio" "" "Desktop" "" "Modules" "" "Overview" "")
case "$waypoint" in
Disk) diskConfig ;;
SU) suConfig ;;
Kernel) kernelConfig ;;
Bootloader) bootloaderConfig ;;
Initramfs) initrdConfig ;;
Hostname) hostnameConfig ;;
User) userConfig ;;
Timezone) timezoneConfig ;;
Locale) localeConfig ;;
Repository) repositoryConfig ;;
Graphics) graphicsConfig ;;
Network) networkConfig ;;
Audio) audioConfig ;;
Desktop) desktopConfig ;;
Modules) modulesConfig ;;
Overview) confirm ;;
esac
}
_install() {
. "$(pwd)"/setup/disk
. "$(pwd)"/setup/base
. "$(pwd)"/setup/desktop
commandFailure="System chroot has failed."
cp /etc/resolv.conf /mnt/etc/resolv.conf || die
syschrootVarPairs=("bootloader $bootloader" \
"su $su" \
"timezone $timezone" \
"encryption $encryption" \
"diskInput $diskInput" \
"username $username" \
"desktop $desktop" \
"root $root")
for i in "${syschrootVarPairs[@]}"
do
set -- $i || die
echo "$1='$2'" >> /mnt/tmp/installerOptions || die
done
cp -f "$(pwd)"/misc/libviss /mnt/tmp/libviss || die
cp -f "$(pwd)"/setup/chroot /mnt/tmp/chroot || die
system "/bin/bash /tmp/chroot"
clear
[ -n "$modules" ] &&
for i in ${modules[@]}
do
. "modules/$i" ||
{ commandFailure="Executing $i module has failed." ; die ; }
main
done
declare -F post_install > /dev/null &&
{ commandFailure="Executing user-defined post_install function has failed." ; post_install ; }
[ "$kernelparam_update" == "true" ] &&
case "$bootloader" in
grub) system 'update-grub' ;;
uki) system 'xbps-reconfigure -f linux"$(find /boot -name vmlinuz\* | tr -d "/boot/vmlinuz-" | cut -f1,2 -d".")"' ;;
esac
# clean the xbps cache of any removed packages that were removed by the user via post_install or by the installer itself
system "xbps-remove -ROO"
clear
if drawDialog --title "Installation Complete" --yes-label "Reboot" --extra-button --extra-label "Chroot" --no-label "Exit" --yesno "The installation has finished.\n\nIf you would like to make changes before rebooting, you may select 'Chroot' to chroot into the new system.\n\nOtherwise, you may choose 'Reboot' to reboot the system now.\n\nYou may also choose 'Exit' to drop back into the void-live shell.\n\nTotal installer runtime: ${SECONDS} seconds." 0 0 ; then
reboot now
else
[ "$?" == "3" ] &&
{ clear && xchroot /mnt 'bin/bash' ; }
fi
exit 0
}
diskConfig