Rename script, cleanup btrfs functions and simplify
This commit is contained in:
parent
43a31435be
commit
c30b103b82
@ -18,7 +18,7 @@
|
|||||||
#### Manual Installation
|
#### Manual Installation
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -fSL https://bitbucket.org/archlabslinux/installer/raw/master/archlabs-installer -o /usr/bin/archlabs-installer
|
curl -fSL https://bitbucket.org/archlabslinux/installer/raw/master/installer -o /usr/bin/installer
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -259,7 +259,7 @@ declare -A FS_CMD_FLAGS=(
|
|||||||
[ntfs]='-q'
|
[ntfs]='-q'
|
||||||
[reiserfs]='-q'
|
[reiserfs]='-q'
|
||||||
[vfat]='-F32'
|
[vfat]='-F32'
|
||||||
[xfs]='-f'
|
[xfs]='-fq'
|
||||||
) # }
|
) # }
|
||||||
|
|
||||||
# mount options for each filesystem {
|
# mount options for each filesystem {
|
||||||
@ -315,7 +315,7 @@ _device="\nSelect a device to use from the list below.\n\nDevices (/dev) are the
|
|||||||
_mount="\nUse [Space] to toggle mount options from below, press [Enter] when done to confirm selection.\n\nNot selecting any and confirming will run an automatic mount."
|
_mount="\nUse [Space] to toggle mount options from below, press [Enter] when done to confirm selection.\n\nNot selecting any and confirming will run an automatic mount."
|
||||||
_warn="\nIMPORTANT: Choose carefully when editing, formatting, and mounting partitions or your DATA MAY BE LOST.\n\nTo mount a partition without formatting it, select 'skip' when prompted to choose a file system during the mounting stage.\nThis can only be used for partitions that already contain a file system and cannot be the root (/) partition, it needs to be formatted before install.\n"
|
_warn="\nIMPORTANT: Choose carefully when editing, formatting, and mounting partitions or your DATA MAY BE LOST.\n\nTo mount a partition without formatting it, select 'skip' when prompted to choose a file system during the mounting stage.\nThis can only be used for partitions that already contain a file system and cannot be the root (/) partition, it needs to be formatted before install.\n"
|
||||||
_part="\nFull device auto partitioning is available for beginners otherwise cfdisk is recommended.\n\n - All systems will require a root partition (8G or greater).\n - UEFI or BIOS using LUKS without LVM require a separate boot partition (100-512M)."
|
_part="\nFull device auto partitioning is available for beginners otherwise cfdisk is recommended.\n\n - All systems will require a root partition (8G or greater).\n - UEFI or BIOS using LUKS without LVM require a separate boot partition (100-512M)."
|
||||||
_btrfs="\nBtrfs can create branching subvolumes.\n\nAn initial subvolume will be created and mounted with additional subvolumes branching from this created after.\nOtherwise you can skip directly to mounting options.\n\nCreate subvolumes?\n"
|
_btrfs="\nBtrfs can be used with or without the use of subvolumes.\n\nAn initial subvolume will be created and mounted with additional subvolumes branching from this created after.\n\nUse subvolumes?\n"
|
||||||
_uefi="\nSelect the EFI boot partition (/boot), required for UEFI boot.\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as vfat/fat32 if not already."
|
_uefi="\nSelect the EFI boot partition (/boot), required for UEFI boot.\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as vfat/fat32 if not already."
|
||||||
_bios="\nDo you want to use a separate boot partition? (optional)\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as ext3/4 if not already."
|
_bios="\nDo you want to use a separate boot partition? (optional)\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as ext3/4 if not already."
|
||||||
_biosluks="\nSelect the boot partition (/boot), required for LUKS.\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as ext3/4 if not already."
|
_biosluks="\nSelect the boot partition (/boot), required for LUKS.\n\nIt's usually the first partition on the device, 100-512M, and will be formatted as ext3/4 if not already."
|
||||||
@ -357,7 +357,7 @@ _lvmdelask="\nConfirm deletion of volume group(s) and logical volume(s).\n\nDele
|
|||||||
# Errors
|
# Errors
|
||||||
_errexpart="\nCannot mount partition due to a problem with the mountpoint.\n\nEnsure it begins with a slash (/) followed by at least one character.\n"
|
_errexpart="\nCannot mount partition due to a problem with the mountpoint.\n\nEnsure it begins with a slash (/) followed by at least one character.\n"
|
||||||
_errpart="\nYou need to create the partition(s) first.\n\n\nBIOS systems require at least one partition (ROOT).\n\nUEFI systems require at least two (ROOT and EFI).\n"
|
_errpart="\nYou need to create the partition(s) first.\n\n\nBIOS systems require at least one partition (ROOT).\n\nUEFI systems require at least two (ROOT and EFI).\n"
|
||||||
_errchoice="\nIf you want to fix the issue yourself use Ctrl-z to pause the installer. From there you can do whatever is needed to resolve the error.\nOnce finished use the 'fg' command to resume the installer, then select 'Continue'.\n"
|
_errchoice="\nIf you want to fix the issue yourself use Ctrl-z to pause the installer.\nFrom there you can do whatever is needed to resolve the error.\nOnce finished use the 'fg' command to resume the installer and select 'Continue'.\n"
|
||||||
_lukserr="\nA minimum of two partitions are required for encryption:\n\n 1. root (/) - standard or LVM.\n 2. boot (/boot) - standard (unless using LVM on BIOS systems).\n"
|
_lukserr="\nA minimum of two partitions are required for encryption:\n\n 1. root (/) - standard or LVM.\n 2. boot (/boot) - standard (unless using LVM on BIOS systems).\n"
|
||||||
_lvmerr="\nThere are no viable partitions available to use for LVM, a minimum of one is required.\n\nIf LVM is already in use, deactivating it will allow the partition(s) to be used again.\n"
|
_lvmerr="\nThere are no viable partitions available to use for LVM, a minimum of one is required.\n\nIf LVM is already in use, deactivating it will allow the partition(s) to be used again.\n"
|
||||||
_lvmerrvgname="\nInvalid name entered.\n\nThe volume group name may be alpha-numeric, but may not contain spaces, start with a '/', or already be in use.\n"
|
_lvmerrvgname="\nInvalid name entered.\n\nThe volume group name may be alpha-numeric, but may not contain spaces, start with a '/', or already be in use.\n"
|
||||||
@ -1036,30 +1036,24 @@ part_swap()
|
|||||||
part_mount()
|
part_mount()
|
||||||
{
|
{
|
||||||
local part="$1"
|
local part="$1"
|
||||||
local mntpt="${MNT}$2"
|
local mntp="${MNT}$2"
|
||||||
local ignore=0
|
|
||||||
[[ $part == "$ROOT" && $3 ]] && ignore=$3
|
|
||||||
local fs
|
local fs
|
||||||
fs="$(lsblk -lno FSTYPE "$part")"
|
fs="$(lsblk -lno FSTYPE "$part")"
|
||||||
|
|
||||||
mkdir -p "$mntpt"
|
mkdir -p "$mntp"
|
||||||
|
|
||||||
if [[ $ignore -ne 2 && $fs && ${FS_OPTS[$fs]} && $part != "$BOOT" && $part != "$AUTO_ROOT" ]] && select_mntopts "$fs"; then
|
if [[ $BTRFS -ne 2 && $fs && ${FS_OPTS[$fs]} && $part != "$BOOT" && $part != "$AUTO_ROOT" ]] && select_mntopts "$part" "$fs"; then
|
||||||
mount -o $MNT_OPTS "$part" "$mntpt" > /dev/null 2> "$ERR" || mount -o $MNT_OPTS "$part" "$mntpt" > /dev/null 2> "$ERR"
|
mount -o $MNT_OPTS "$part" "$mntp" > /dev/null 2> "$ERR" || mount -o $MNT_OPTS "$part" "$mntp" > /dev/null 2> "$ERR"
|
||||||
errshow 0 "mount -o $MNT_OPTS $part $mntpt" || return 1
|
errshow 0 "mount -o $MNT_OPTS $part $mntp" || return 1
|
||||||
else
|
else
|
||||||
mount "$part" "$mntpt" > /dev/null 2> "$ERR" || mount "$part" "$mntpt" > /dev/null 2> "$ERR"
|
mount "$part" "$mntp" > /dev/null 2> "$ERR" || mount "$part" "$mntp" > /dev/null 2> "$ERR"
|
||||||
errshow 0 "mount $part $mntpt" || return 1
|
errshow 0 "mount $part $mntp" || return 1
|
||||||
|
MNT_OPTS=''
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -q "$mntpt" /proc/mounts; then
|
msg "Mount Complete" "\nMounted $part at $mntp\n" 1
|
||||||
msg "Mount Success" "\n$part mounted at $mntpt\n" 1
|
part_countdec "$part"
|
||||||
part_countdec "$part"
|
part_cryptlv "$part"
|
||||||
part_cryptlv "$part"
|
|
||||||
else
|
|
||||||
msg "Mount Failed" "\nUnable to mount $part at $mntpt\n" 2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1103,7 +1097,6 @@ part_format()
|
|||||||
local part="$1"
|
local part="$1"
|
||||||
local fs="$2"
|
local fs="$2"
|
||||||
local delay="$3"
|
local delay="$3"
|
||||||
shift 3
|
|
||||||
|
|
||||||
if [[ $fs == 'f2fs' && -z $PF2FS ]]; then
|
if [[ $fs == 'f2fs' && -z $PF2FS ]]; then
|
||||||
modprobe f2fs
|
modprobe f2fs
|
||||||
@ -1327,16 +1320,15 @@ select_boot()
|
|||||||
|
|
||||||
select_root()
|
select_root()
|
||||||
{
|
{
|
||||||
|
local pts dev size isize ptcount=0
|
||||||
|
|
||||||
if [[ -z $ROOT ]]; then
|
if [[ -z $ROOT ]]; then
|
||||||
if [[ $AUTO_ROOT && -z $LVM && -z $LUKS ]]; then
|
if [[ $AUTO_ROOT && -z $LVM && -z $LUKS ]]; then
|
||||||
ROOT="$AUTO_ROOT"
|
ROOT="$AUTO_ROOT"
|
||||||
msg "Mount Menu" "\nUsing partitions created during automatic format.\n" 2
|
msg "Mount Menu" "\nUsing partitions created during automatic format.\n" 2
|
||||||
part_mount "$ROOT" || { ROOT=''; return 1; }
|
part_mount "$ROOT" || { AUTO_ROOT='' ROOT=''; return 1; }
|
||||||
return 0 # we're done here
|
return 0 # we're done here
|
||||||
else
|
else # walk partition list and skip ones that are < 8G
|
||||||
local pts dev size isize ptcount=0
|
|
||||||
|
|
||||||
# walk partition list and skip ones that are < 8G
|
|
||||||
while read -r dev size; do
|
while read -r dev size; do
|
||||||
s=${size%%__*}
|
s=${size%%__*}
|
||||||
size_t="${s: -1:1}"
|
size_t="${s: -1:1}"
|
||||||
@ -1361,13 +1353,14 @@ select_root()
|
|||||||
|
|
||||||
if [[ $ROOT ]]; then
|
if [[ $ROOT ]]; then
|
||||||
select_filesystem "$ROOT" || return 1
|
select_filesystem "$ROOT" || return 1
|
||||||
part_mount "$ROOT" "" $BTRFS || return 1
|
part_mount "$ROOT" || return 1
|
||||||
if (( BTRFS == 2 )); then
|
if (( BTRFS == 2 )); then
|
||||||
btrfs_subvols "$ROOT" || return 1
|
btrfs_subvols "$ROOT" || return 1
|
||||||
fi
|
fi
|
||||||
BTRFS=0
|
BTRFS=0
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# should never reach here unless an error occurred
|
# should never reach here unless an error occurred
|
||||||
ROOT=''
|
ROOT=''
|
||||||
return 1
|
return 1
|
||||||
@ -1441,7 +1434,7 @@ select_extra()
|
|||||||
dlg part menu 'Mount Extra' "$_expart" 'done' 'finish mounting step' $PARTS || break
|
dlg part menu 'Mount Extra' "$_expart" 'done' 'finish mounting step' $PARTS || break
|
||||||
if [[ $part == 'done' ]]; then
|
if [[ $part == 'done' ]]; then
|
||||||
break
|
break
|
||||||
elif select_filesystem "$part" && select_mountpoint && part_mount "$part" "$EXMNT" $BTRFS; then
|
elif select_filesystem "$part" && select_mountpoint && part_mount "$part" "$EXMNT"; then
|
||||||
if (( BTRFS == 2 )); then
|
if (( BTRFS == 2 )); then
|
||||||
btrfs_subvols "$part" "$EXMNT" || return 1
|
btrfs_subvols "$part" "$EXMNT" || return 1
|
||||||
fi
|
fi
|
||||||
@ -1458,11 +1451,12 @@ select_extra()
|
|||||||
|
|
||||||
select_mntopts()
|
select_mntopts()
|
||||||
{
|
{
|
||||||
local fs="$1"
|
local part="$1"
|
||||||
|
local fs="$2"
|
||||||
local opts=''
|
local opts=''
|
||||||
local title="${fs^} Mount Options"
|
local title="${fs^} Mount Options"
|
||||||
|
|
||||||
yesno "$title" "\nMount partition with default options?\n" && return 1
|
yesno "$title" "\nMount $part with default mount options?\n" && return 1
|
||||||
for i in ${FS_OPTS[$fs]}; do
|
for i in ${FS_OPTS[$fs]}; do
|
||||||
opts+="$i - off "
|
opts+="$i - off "
|
||||||
done
|
done
|
||||||
@ -1470,7 +1464,7 @@ select_mntopts()
|
|||||||
dlg MNT_OPTS check "$title" "$_mount" $opts
|
dlg MNT_OPTS check "$title" "$_mount" $opts
|
||||||
[[ $MNT_OPTS ]] || return 1 # no options is auto mount
|
[[ $MNT_OPTS ]] || return 1 # no options is auto mount
|
||||||
MNT_OPTS="${MNT_OPTS// /,}"
|
MNT_OPTS="${MNT_OPTS// /,}"
|
||||||
yesno "$title" "\nConfirm the following options: $MNT_OPTS\n" || MNT_OPTS=''
|
yesno "$title" "\nConfirm mount options: $MNT_OPTS\n" || MNT_OPTS=''
|
||||||
done
|
done
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1550,9 +1544,12 @@ install_main()
|
|||||||
install_login
|
install_login
|
||||||
|
|
||||||
# changing distro name?
|
# changing distro name?
|
||||||
if [[ $DIST != "ArchLabs" ]]; then
|
if grep -q 'ArchLabs' "$MNT/etc/lsb-release"; then
|
||||||
sed -i "s/ArchLabs/$DIST/g" "$MNT/etc/lsb-release"
|
sed -i "s/ArchLabs/$DIST/g" "$MNT/etc/lsb-release"
|
||||||
sed -i "s/ArchLabs/$DIST/g" "$MNT/etc/os-release"
|
sed -i "s/ArchLabs/$DIST/g" "$MNT/etc/os-release"
|
||||||
|
else
|
||||||
|
sed -i "s/Arch/$DIST/g" "$MNT/etc/lsb-release"
|
||||||
|
sed -i "s/Arch/$DIST/g" "$MNT/etc/os-release"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# allow members of the wheel group to run commands as root
|
# allow members of the wheel group to run commands as root
|
||||||
@ -2385,15 +2382,14 @@ prerun_systemd-boot()
|
|||||||
btrfs_name()
|
btrfs_name()
|
||||||
{
|
{
|
||||||
local txt="$1"
|
local txt="$1"
|
||||||
local def="$2"
|
local match="$2"
|
||||||
local match="$3"
|
|
||||||
|
|
||||||
SUBVOL=''
|
SUBVOL=''
|
||||||
until [[ $SUBVOL ]]; do
|
until [[ $SUBVOL ]]; do
|
||||||
dlg SUBVOL input "Subvolume Name" "$txt" "$def" || return 1
|
dlg SUBVOL input "Subvolume Name" "$txt" || return 1
|
||||||
if [[ -z $SUBVOL ]]; then
|
if [[ -z $SUBVOL ]]; then
|
||||||
return 1
|
return 1
|
||||||
elif [[ $SUBVOL =~ \ |\' || $match == *"$SUBVOL"* || $SUBVOL == "$MVOL" ]]; then
|
elif [[ $SUBVOL =~ \ |\' || $match == *"$SUBVOL"* ]]; then
|
||||||
msg "Subvolume Name Error" "$_btrfserrname"
|
msg "Subvolume Name Error" "$_btrfserrname"
|
||||||
SUBVOL=''
|
SUBVOL=''
|
||||||
fi
|
fi
|
||||||
@ -2401,48 +2397,47 @@ btrfs_name()
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btrfs_extsubvols()
|
||||||
|
{
|
||||||
|
local mntp="$1"
|
||||||
|
local mvol="$2"
|
||||||
|
local list=''
|
||||||
|
local n=0
|
||||||
|
|
||||||
|
SUBVOL_COUNT=0
|
||||||
|
dlg SUBVOL_COUNT menu "Subvolume Count" "\nSelect the number of subvolumes to create in: $mvol" \
|
||||||
|
0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -
|
||||||
|
while (( ++n <= SUBVOL_COUNT )); do
|
||||||
|
local txt="\nEnter a name for subvolume $n within '$mvol'."
|
||||||
|
if (( n > 1 )); then
|
||||||
|
btrfs_name "$txt\n\nCreated subvolumes: $list" "$list $mvol" || return 1
|
||||||
|
else
|
||||||
|
btrfs_name "$txt" "$mvol" || return 1
|
||||||
|
fi
|
||||||
|
btrfs subvolume create "$mntp/$SUBVOL" > /dev/null 2> "$ERR"
|
||||||
|
errshow 0 "btrfs subvolume create $mntp/$SUBVOL" || return 1
|
||||||
|
list+="$SUBVOL "
|
||||||
|
done
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
btrfs_subvols()
|
btrfs_subvols()
|
||||||
{
|
{
|
||||||
local part="$1"
|
local part="$1"
|
||||||
local mntp="$2"
|
local mntp="${MNT}$2"
|
||||||
local list='' opts='' s="${mntp//\//_}" n=1
|
local mvol=''
|
||||||
local txt="\nEnter a name for the initial subvolume.\n\nOnce mounted other subvolumes created for"
|
|
||||||
|
|
||||||
btrfs_name "$txt $MNT${mntp} will branch from it." "subvol${s:-_root}" || return 1
|
btrfs_name "\nEnter a name for the initial subvolume on $part." || return 1
|
||||||
MVOL="$SUBVOL"
|
mvol="$SUBVOL"
|
||||||
|
[[ $mntp == "$MNT" ]] && BTRFS_MNT="rootflags=subvol=$mvol"
|
||||||
mkdir -p "$MNT${mntp}" || return 1
|
btrfs subvolume create "$mntp/$mvol" > /dev/null 2> "$ERR"
|
||||||
[[ -z $mntp ]] && BTRFS_MNT="rootflags=subvol=$MVOL"
|
errshow 0 "btrfs subvolume create $mntp/$mvol" || return 1
|
||||||
|
umount_dir "$mntp" || return 1
|
||||||
# create the main subvolume
|
select_mntopts 'btrfs' && [[ $MNT_OPTS ]] && MNT_OPTS+=','
|
||||||
btrfs subvolume create "$MNT${mntp}/$MVOL" > /dev/null 2> "$ERR"
|
mount -o ${MNT_OPTS}subvol=${mvol} "$part" "$mntp" 2> "$ERR"
|
||||||
errshow 0 "btrfs subvolume create $MNT${mntp}/$MVOL" || return 1
|
errshow 0 "mount -o ${MNT_OPTS}subvol=${mvol} $part $mntp" || return 1
|
||||||
umount "$part" 2> "$ERR"
|
btrfs_extsubvols "$mntp" "$mvol" || return 1
|
||||||
errshow 0 "umount $part" || return 1
|
msg "Btrfs Setup Complete" "\nCreated subvolumes:\n\n$(ls -R "$mntp/$mvol")"
|
||||||
|
|
||||||
if select_mntopts 'btrfs' && [[ $MNT_OPTS ]]; then
|
|
||||||
opts="${MNT_OPTS},subvol=${MVOL}"
|
|
||||||
else
|
|
||||||
opts="subvol=${MVOL}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mount -o $opts "$part" "$MNT${mntp}" 2> "$ERR"
|
|
||||||
errshow 0 "mount -o $opts $part $MNT${mntp}" || return 1
|
|
||||||
grep -q "$MNT${mntp}" /proc/mounts || { msg "Mount Failed" "\nUnable to mount $part at $MNT${mntp}\n" 2; return 1; }
|
|
||||||
msg "Mount Complete" "\nSubvolume $MVOL mounted at $MNT${mntp}\n" 1
|
|
||||||
|
|
||||||
# create the subvolume(s)
|
|
||||||
until [[ $SUBVOL == '*' ]]; do
|
|
||||||
local txt="\nEnter a name for subvolume $n within '$MVOL' subvolume."
|
|
||||||
txt+="\n\nThis process will be repeated until an asterisk (*) is entered as the subvolume name."
|
|
||||||
btrfs_name "$txt\n\nCreated subvolumes: ${list:-none}\n" "subvol_$n" "$list" || return 1
|
|
||||||
btrfs subvolume create "$MNT${mntp}/$MVOL/$SUBVOL" > /dev/null 2> "$ERR"
|
|
||||||
errshow 0 "btrfs subvolume create $MNT${mntp}/$MVOL/$SUBVOL" || return 1
|
|
||||||
(( n++ ))
|
|
||||||
list+="$SUBVOL "
|
|
||||||
done
|
|
||||||
|
|
||||||
msg "Btrfs Setup Complete" "\nBtrfs subvolumes:\n\n$(ls -R "$MNT${mntp}/$MVOL")"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -2485,18 +2480,21 @@ lvm_detect()
|
|||||||
|
|
||||||
lvm_create()
|
lvm_create()
|
||||||
{
|
{
|
||||||
VGROUP='' LVM_PARTS='' VGROUP_MB=0
|
VGROUP='' LVM_PARTS='' VOL_COUNT=0 VGROUP_MB=0
|
||||||
umount_dir "$MNT"
|
umount_dir "$MNT"
|
||||||
lvm_mkgroup || return 1
|
lvm_mkgroup || return 1
|
||||||
|
|
||||||
local txt="\nThe last (or only) logical volume will automatically use all remaining space in the volume group."
|
local txt="\nThe last (or only) logical volume will automatically use all remaining space in the volume group."
|
||||||
dlg VOL_COUNT menu "$_lvmnew" "\nSelect the number of logical volumes (LVs) to create in: $VGROUP\n$txt" 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -
|
dlg VOL_COUNT menu "$_lvmnew" "\nSelect the number of logical volumes (LVs) to create in: $VGROUP\n$txt" \
|
||||||
|
1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -
|
||||||
[[ $VOL_COUNT ]] || return 1
|
[[ $VOL_COUNT ]] || return 1
|
||||||
lvm_extra_lvs || return 1
|
lvm_extra_lvs || return 1
|
||||||
lvm_volume_name "$_lvmlvname\nNOTE: This LV will use up all remaining space in the volume group (${VGROUP_MB}MB)" || return 1
|
lvm_volume_name "$_lvmlvname\nNOTE: This LV will use up all remaining space in the volume group (${VGROUP_MB}MB)" || return 1
|
||||||
msg "$_lvmnew (LV:$VOL_COUNT)" "\nCreating volume $VNAME from remaining space in $VGROUP\n" 0
|
msg "$_lvmnew (LV:$VOL_COUNT)" "\nCreating volume $VNAME from remaining space in $VGROUP\n" 0
|
||||||
lvcreate -l +100%FREE "$VGROUP" -n "$VNAME" > /dev/null 2> "$ERR"
|
lvcreate -l +100%FREE "$VGROUP" -n "$VNAME" > /dev/null 2> "$ERR"
|
||||||
errshow 0 "lvcreate -l +100%FREE '$VGROUP' -n '$VNAME' >/dev/null" || return 1
|
errshow 0 "lvcreate -l +100%FREE $VGROUP -n $VNAME" || return 1
|
||||||
LVM='logical volume'; sleep 0.5
|
LVM='logical volume'
|
||||||
|
sleep 0.5
|
||||||
txt="\nDone, volume: $VGROUP-$VNAME (${VOLUME_SIZE:-${VGROUP_MB}MB}) has been created.\n"
|
txt="\nDone, volume: $VGROUP-$VNAME (${VOLUME_SIZE:-${VGROUP_MB}MB}) has been created.\n"
|
||||||
msg "$_lvmnew (LV:$VOL_COUNT)" "$txt\n$(lsblk -o NAME,SIZE $LVM_PARTS)\n"
|
msg "$_lvmnew (LV:$VOL_COUNT)" "$txt\n$(lsblk -o NAME,SIZE $LVM_PARTS)\n"
|
||||||
return 0
|
return 0
|
||||||
@ -2508,7 +2506,7 @@ lvm_lv_size()
|
|||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
ERR_SIZE=0
|
ERR_SIZE=0
|
||||||
dlg VOLUME_SIZE input "$_lvmnew (LV:$VOL_COUNT)" "$txt" ''
|
dlg VOLUME_SIZE input "$_lvmnew (LV:$VOL_COUNT)" "$txt"
|
||||||
if [[ -z $VOLUME_SIZE ]]; then
|
if [[ -z $VOLUME_SIZE ]]; then
|
||||||
ERR_SIZE=1
|
ERR_SIZE=1
|
||||||
break # allow bailing with escape or an empty choice
|
break # allow bailing with escape or an empty choice
|
||||||
@ -2643,7 +2641,7 @@ lvm_group_name()
|
|||||||
{
|
{
|
||||||
VGROUP=''
|
VGROUP=''
|
||||||
until [[ $VGROUP ]]; do
|
until [[ $VGROUP ]]; do
|
||||||
dlg VGROUP input "$_lvmnew" "$_lvmvgname" "lvgroup"
|
dlg VGROUP input "$_lvmnew" "$_lvmvgname"
|
||||||
if [[ -z $VGROUP ]]; then
|
if [[ -z $VGROUP ]]; then
|
||||||
return 1
|
return 1
|
||||||
elif [[ ${VGROUP:0:1} == "/" || $VGROUP =~ \ |\' ]] || vgdisplay | grep -q "$VGROUP"; then
|
elif [[ ${VGROUP:0:1} == "/" || $VGROUP =~ \ |\' ]] || vgdisplay | grep -q "$VGROUP"; then
|
||||||
@ -2657,10 +2655,9 @@ lvm_group_name()
|
|||||||
lvm_volume_name()
|
lvm_volume_name()
|
||||||
{
|
{
|
||||||
VNAME=''
|
VNAME=''
|
||||||
local txt="$1" default="root"
|
local txt="$1"
|
||||||
(( VOL_COUNT > 1 )) && default="volume$VOL_COUNT"
|
|
||||||
until [[ $VNAME ]]; do
|
until [[ $VNAME ]]; do
|
||||||
dlg VNAME input "$_lvmnew (LV:$VOL_COUNT)" "\n$txt" "$default"
|
dlg VNAME input "$_lvmnew (LV:$VOL_COUNT)" "\n$txt"
|
||||||
if [[ -z $VNAME ]]; then
|
if [[ -z $VNAME ]]; then
|
||||||
return 1
|
return 1
|
||||||
elif [[ ${VNAME:0:1} == "/" || $VNAME =~ \ |\' ]] || lsblk | grep -q "$VNAME"; then
|
elif [[ ${VNAME:0:1} == "/" || $VNAME =~ \ |\' ]] || lsblk | grep -q "$VNAME"; then
|
||||||
@ -2841,20 +2838,23 @@ dlg()
|
|||||||
local l=$((LINES - 20))
|
local l=$((LINES - 20))
|
||||||
(( ($# / 2) > l )) && n=$l
|
(( ($# / 2) > l )) && n=$l
|
||||||
|
|
||||||
tput civis
|
|
||||||
case "$dlg_t" in
|
case "$dlg_t" in
|
||||||
menu)
|
menu)
|
||||||
|
tput civis
|
||||||
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " $title " \
|
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " $title " \
|
||||||
--menu "$body" 0 0 $n "$@" 2> "$ANS" || return 1
|
--menu "$body" 0 0 $n "$@" 2> "$ANS" || return 1
|
||||||
;;
|
;;
|
||||||
check)
|
check)
|
||||||
|
tput civis
|
||||||
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " $title " \
|
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " $title " \
|
||||||
--checklist "$body" 0 0 $n "$@" 2> "$ANS" || return 1
|
--checklist "$body" 0 0 $n "$@" 2> "$ANS" || return 1
|
||||||
;;
|
;;
|
||||||
input)
|
input)
|
||||||
tput cnorm
|
tput cnorm
|
||||||
local def="$1" # assign default value for input
|
if [[ $1 && $1 != 'limit' ]]; then
|
||||||
shift
|
local def="$1" # assign default value for input
|
||||||
|
shift
|
||||||
|
fi
|
||||||
if [[ $1 == 'limit' ]]; then
|
if [[ $1 == 'limit' ]]; then
|
||||||
dialog --backtitle "$DIST Installer - $SYS - v$VER" --max-input 63 \
|
dialog --backtitle "$DIST Installer - $SYS - v$VER" --max-input 63 \
|
||||||
--title " $title " --inputbox "$body" 0 0 "$def" 2> "$ANS" || return 1
|
--title " $title " --inputbox "$body" 0 0 "$def" 2> "$ANS" || return 1
|
||||||
@ -2949,30 +2949,30 @@ usage()
|
|||||||
usage: $1 [-hDn] [-r ROOT] [-b BOOT] [-l SESSION] [-d DISTRO] [-m MOUNTPOINT]
|
usage: $1 [-hDn] [-r ROOT] [-b BOOT] [-l SESSION] [-d DISTRO] [-m MOUNTPOINT]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-h print this message and exit
|
-h print this message and exit
|
||||||
-l install and setup a live session
|
-l install and setup a live session
|
||||||
-D enable xtrace and log output to $DBG
|
-D enable xtrace and log output to $DBG
|
||||||
-m set the mountpoint used for the new installation
|
-m set the mountpoint used for the new installation
|
||||||
-d set the distribution name for the installed system
|
-d set the distribution name for the installed system
|
||||||
-n no partitioning, mounting, or formatting (self mount)
|
-n no partitioning, mounting, or formatting (self mount)
|
||||||
-r root partition to use for install, required when using -n
|
-r root partition to use for install, required when using -n
|
||||||
-b boot partition to use for install, required on UEFI systems when using -n
|
-b boot partition to use for install, required on UEFI systems when using -n
|
||||||
-t install and setup drivers for nvidia or tearfree xorg configs for other vendors
|
-t install and setup drivers for nvidia or tearfree xorg configs for other vendors
|
||||||
if you experience boot issues with this option you can remove /etc/X11/xorg.conf.d/20-*.conf
|
if you experience boot issues with this option, remove /etc/X11/xorg.conf.d/20-*.conf
|
||||||
|
|
||||||
sessions:
|
sessions:
|
||||||
i3-gaps - A fork of i3wm with more features including gaps
|
i3-gaps - A fork of i3wm with more features including gaps
|
||||||
openbox - A lightweight, powerful, and highly configurable stacking wm
|
openbox - A lightweight, powerful, and highly configurable stacking wm
|
||||||
dwm - A dynamic WM for X that manages windows in tiled, floating, or monocle layouts
|
dwm - A dynamic WM for X that manages windows in tiled, floating, or monocle layouts
|
||||||
awesome - A customized Awesome WM session created by @elanapan
|
awesome - A customized Awesome WM session created by @elanapan
|
||||||
lxqt - A port of the lightweight desktop environment (LXDE) to Qt
|
lxqt - A port of the lightweight desktop environment (LXDE) to Qt
|
||||||
bspwm - A tiling wm that represents windows as the leaves of a binary tree
|
bspwm - A tiling wm that represents windows as the leaves of a binary tree
|
||||||
fluxbox - A lightweight and highly-configurable window manager
|
fluxbox - A lightweight and highly-configurable window manager
|
||||||
jwm - A lightweight window manager for Xorg written in C
|
jwm - A lightweight window manager for Xorg written in C
|
||||||
gnome - A desktop environment that aims to be simple and easy to use
|
gnome - A desktop environment that aims to be simple and easy to use
|
||||||
cinnamon - A desktop environment combining traditional desktop with modern effects
|
cinnamon - A desktop environment combining traditional desktop with modern effects
|
||||||
plasma - A kde software project currently comprising a full desktop environment
|
plasma - A kde software project currently comprising a full desktop environment
|
||||||
xfce4 - A lightweight and modular desktop environment based on gtk+2/3
|
xfce4 - A lightweight and modular desktop environment based on gtk+2/3
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 0
|
exit 0
|
||||||
@ -3071,7 +3071,7 @@ errshow()
|
|||||||
shift 1 # always shift off the fatal level arg
|
shift 1 # always shift off the fatal level arg
|
||||||
|
|
||||||
local txt
|
local txt
|
||||||
txt="\nCommand: $1\n\n\n\nError:\n$(errmsg)\n\n"
|
txt="\nCommand: $1\n\n$(errmsg)\n\n"
|
||||||
tput cnorm
|
tput cnorm
|
||||||
if (( fatal )); then
|
if (( fatal )); then
|
||||||
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " Install Error " --yes-label "Abort" --no-label "Continue" \
|
dialog --backtitle "$DIST Installer - $SYS - v$VER" --title " Install Error " --yes-label "Abort" --no-label "Continue" \
|
||||||
@ -3314,9 +3314,9 @@ fi
|
|||||||
# check for update once
|
# 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/archlabs-installer -o /tmp/new; then
|
if curl -fsSL https://bitbucket.org/archlabslinux/installer/raw/master/installer -o /tmp/new; then
|
||||||
if (( $(vercmp "$(awk -F= '/^VER=/ {print $2}' /tmp/archlabs-installer)" "$VER") > 0 )); then
|
if (( $(vercmp "$(awk -F= '/^VER=/ {print $2}' /tmp/new)" "$VER") > 0 )); then
|
||||||
cp /tmp/new /usr/bin/archlabs-installer && exec archlabs-installer "$@"
|
cp /tmp/new /usr/bin/installer && exec installer "$@"
|
||||||
die
|
die
|
||||||
fi
|
fi
|
||||||
else
|
else
|
Reference in New Issue
Block a user