Cleanup
This commit is contained in:
parent
303f2615f1
commit
3e4e965763
33
installer
33
installer
@ -393,7 +393,7 @@ main()
|
|||||||
tput civis
|
tput civis
|
||||||
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " Prepare " \
|
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " Prepare " \
|
||||||
--default-item $SEL --cancel-label 'Exit' --menu "$_prep" 0 0 0 \
|
--default-item $SEL --cancel-label 'Exit' --menu "$_prep" 0 0 0 \
|
||||||
1 "Device management" \
|
1 "Storage device management" \
|
||||||
2 "* Mount partitions" \
|
2 "* Mount partitions" \
|
||||||
3 "* Select bootloader" \
|
3 "* Select bootloader" \
|
||||||
4 "* Username and password" \
|
4 "* Username and password" \
|
||||||
@ -862,9 +862,9 @@ dev_menu()
|
|||||||
[[ $txt ]] && back="Return to mounting"
|
[[ $txt ]] && back="Return to mounting"
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
dlg DEVMNG_OPT menu "Device Management" "\nSelect an operation from the list below.$txt" \
|
dlg DEVMNG_OPT menu "Device Management" "\nHere you can perform some basic operations to modify system storage devices.\n$txt" \
|
||||||
'view' 'View the device tree output from lsblk' \
|
'view' 'View the device tree output from lsblk' \
|
||||||
'part' 'Change the partition layout of a device' \
|
'part' 'Modify the partition layout of a device' \
|
||||||
'luks' 'Setup LUKS encryption on a partition or LVM' \
|
'luks' 'Setup LUKS encryption on a partition or LVM' \
|
||||||
'lvm' 'Setup logical volume management on partition(s)' \
|
'lvm' 'Setup logical volume management on partition(s)' \
|
||||||
'Back' "$back" || return 0
|
'Back' "$back" || return 0
|
||||||
@ -1508,7 +1508,7 @@ select_filesystem()
|
|||||||
|
|
||||||
BTRFS=0
|
BTRFS=0
|
||||||
until [[ $fs ]]; do
|
until [[ $fs ]]; do
|
||||||
dlg fs menu "File System" "$txt" $([[ $cur ]] && printf 'skip -') \
|
dlg fs menu "File System" "$txt" $([[ $cur ]] && printf "skip 'Do not format this partition'") \
|
||||||
ext4 "The evolution of the most used Linux file system, successor to Ext3" \
|
ext4 "The evolution of the most used Linux file system, successor to Ext3" \
|
||||||
ext3 "Third extended file system, successor to Ext2" \
|
ext3 "Third extended file system, successor to Ext2" \
|
||||||
ext2 "Second extended file system, unlike 3/4 it is not journaled and obsolete" \
|
ext2 "Second extended file system, unlike 3/4 it is not journaled and obsolete" \
|
||||||
@ -3302,17 +3302,15 @@ system_identify()
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# entry point
|
# entry point
|
||||||
|
|
||||||
# enable some nicer colours in the linux console
|
|
||||||
termcol
|
termcol
|
||||||
|
|
||||||
MISS=""
|
MISSING=""
|
||||||
for i in dialog find parted curl arch-chroot; do
|
for i in dialog find parted curl arch-chroot; do
|
||||||
hash $i >/dev/null 2>&1 || MISS+="$i "
|
hash $i >/dev/null 2>&1 || MISSING+="$i "
|
||||||
done
|
done
|
||||||
|
|
||||||
# ensure the required packages are installed and that we're running as root on x86_64 architecture
|
if [[ $MISSING ]]; then
|
||||||
if [[ $MISS ]]; then
|
printf "This installer requires the following package(s) to be installed:\n\n\t%s" "$MISSING"
|
||||||
printf "This installer requires the following package(s) to be installed:\n\n\t%s" "$MISS"
|
|
||||||
die 1
|
die 1
|
||||||
elif (( UID != 0 )); then
|
elif (( UID != 0 )); then
|
||||||
msg "Not Root" "\nThis installer must be run as root.\n\nExiting..\n" 2
|
msg "Not Root" "\nThis installer must be run as root.\n\nExiting..\n" 2
|
||||||
@ -3322,7 +3320,6 @@ elif ! grep -qm 1 ' lm ' /proc/cpuinfo; then
|
|||||||
die 1
|
die 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# trap ^C to perform cleanup
|
|
||||||
trap 'printf "\n^C\n" && die 1' INT
|
trap 'printf "\n^C\n" && die 1' INT
|
||||||
|
|
||||||
while getopts ":htl:Dnr:b:m:d:" OPT; do
|
while getopts ":htl:Dnr:b:m:d:" OPT; do
|
||||||
@ -3347,28 +3344,26 @@ while getopts ":htl:Dnr:b:m:d:" OPT; do
|
|||||||
;;
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "invalid option: $OPTARG"
|
echo "invalid option: $OPTARG"
|
||||||
die 1
|
die 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# verify mountpoint and distro name
|
|
||||||
if [[ ! -d $MNT ]]; then
|
if [[ ! -d $MNT ]]; then
|
||||||
msg "Invalid Mountpoint" "\nThe installer expects an existing directory for mounting.\n\nExiting..\n" 2
|
msg "Invalid Mountpoint" "\nThe installer expects an existing directory for mounting.\n\nExiting..\n" 2
|
||||||
die 1
|
die 2
|
||||||
elif [[ -z $DIST ]]; then
|
elif [[ -z $DIST ]]; then
|
||||||
msg "Invalid Distribution" "\nThe distribution name cannot be empty.\n\nExiting..\n" 2
|
msg "Invalid Distribution" "\nThe distribution name cannot be empty.\n\nExiting..\n" 2
|
||||||
die 1
|
die 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
system_identify
|
system_identify
|
||||||
system_devices
|
system_devices
|
||||||
|
|
||||||
# verify partitions for self mounted installs
|
|
||||||
if [[ $NOMOUNT ]]; then
|
if [[ $NOMOUNT ]]; then
|
||||||
if [[ -z $ROOT || ($SYS == 'UEFI' && -z $BOOT) ]]; then
|
if [[ -z $ROOT || ($SYS == 'UEFI' && -z $BOOT) ]]; then
|
||||||
msg "Invalid Partitions" "$_errpart" 0
|
msg "Invalid Partitions" "$_errpart" 0
|
||||||
die 1
|
die 2
|
||||||
fi
|
fi
|
||||||
if [[ $BOOT ]]; then
|
if [[ $BOOT ]]; then
|
||||||
part_bootdev
|
part_bootdev
|
||||||
@ -3376,7 +3371,6 @@ if [[ $NOMOUNT ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# linux console font setup
|
|
||||||
if [[ $TERM == 'linux' ]]; then
|
if [[ $TERM == 'linux' ]]; then
|
||||||
if [[ -f /tmp/font ]]; then
|
if [[ -f /tmp/font ]]; then
|
||||||
FONT="$(< /tmp/font)"
|
FONT="$(< /tmp/font)"
|
||||||
@ -3396,7 +3390,6 @@ if [[ $TERM == 'linux' ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# welcome once
|
|
||||||
if [[ ! -f /tmp/weld ]]; then
|
if [[ ! -f /tmp/weld ]]; then
|
||||||
msg "Welcome to the $DIST Installer" "\nThis will help you get $DIST installed and setup on your system.\n\nIf you are unsure about an option, the default or most common\nwill be mentioned or the first selected entry will be the default.\n\n\nMenu Navigation:\n\n - Select items with the arrow keys or the option number.\n - Use [Space] to toggle check boxes and [Enter] to accept.\n - Switch between fields using [Tab] or the arrow keys.\n - Use [Page Up] and [Page Down] to jump whole pages\n - Press the highlighted key of an option to select it.\n"
|
msg "Welcome to the $DIST Installer" "\nThis will help you get $DIST installed and setup on your system.\n\nIf you are unsure about an option, the default or most common\nwill be mentioned or the first selected entry will be the default.\n\n\nMenu Navigation:\n\n - Select items with the arrow keys or the option number.\n - Use [Space] to toggle check boxes and [Enter] to accept.\n - Switch between fields using [Tab] or the arrow keys.\n - Use [Page Up] and [Page Down] to jump whole pages\n - Press the highlighted key of an option to select it.\n"
|
||||||
touch /tmp/weld
|
touch /tmp/weld
|
||||||
@ -3410,7 +3403,6 @@ elif ! net_connect; then
|
|||||||
die 1
|
die 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check for update once
|
|
||||||
if [[ ! -f /tmp/new ]]; then
|
if [[ ! -f /tmp/new ]]; then
|
||||||
msg "Installer Update" "\nChecking for newer installer versions.\n" 1
|
msg "Installer Update" "\nChecking for newer installer versions.\n" 1
|
||||||
if curl -fsSL 'https://bitbucket.org/archlabslinux/installer/raw/master/installer' -o /tmp/new; then
|
if curl -fsSL 'https://bitbucket.org/archlabslinux/installer/raw/master/installer' -o /tmp/new; then
|
||||||
@ -3418,7 +3410,6 @@ if [[ ! -f /tmp/new ]]; then
|
|||||||
cp /tmp/new /usr/bin/installer
|
cp /tmp/new /usr/bin/installer
|
||||||
chmod +x /usr/bin/installer
|
chmod +x /usr/bin/installer
|
||||||
exec /usr/bin/installer "$@"
|
exec /usr/bin/installer "$@"
|
||||||
die
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
msg "Download Failed" "\nUnable to download the latest version, continuing with the current.\n" 2
|
msg "Download Failed" "\nUnable to download the latest version, continuing with the current.\n" 2
|
||||||
|
Reference in New Issue
Block a user