mirror of
https://codeberg.org/privacy1st/arch
synced 2024-12-23 01:16:04 +01:00
installer: refactor! xfce4: remove firefox and add pulseaudio
This commit is contained in:
parent
7fa7035990
commit
894473c306
@ -2,7 +2,7 @@
|
|||||||
_pkgname=installer
|
_pkgname=installer
|
||||||
_reponame=arch
|
_reponame=arch
|
||||||
pkgname="de-p1st-$_pkgname"
|
pkgname="de-p1st-$_pkgname"
|
||||||
pkgver=0.1.16
|
pkgver=0.1.17
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Bash script to install Arch Linux"
|
pkgdesc="Bash script to install Arch Linux"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
|
@ -15,7 +15,8 @@ function main() {
|
|||||||
# installation finished
|
# installation finished
|
||||||
|
|
||||||
check_network || return $?
|
check_network || return $?
|
||||||
# out: BIOS_TYPE, FS, HOSTNAME, USERNAME, USER_PWD, LUKS_PWD
|
# in: BOOT_FIRMWARE, FS, HOSTNAME, USERNAME, USER_PWD, LUKS_PWD (all optional)
|
||||||
|
# out: BOOT_FIRMWARE, FS, HOSTNAME, USERNAME, USER_PWD, LUKS_PWD
|
||||||
get_user_input || return $?
|
get_user_input || return $?
|
||||||
# in: CPU_VENDOR (optional)
|
# in: CPU_VENDOR (optional)
|
||||||
# out: CPU_VENDOR
|
# out: CPU_VENDOR
|
||||||
@ -25,29 +26,32 @@ function main() {
|
|||||||
# out: FS_DEFAULT_MOUNT_OPTIONS
|
# out: FS_DEFAULT_MOUNT_OPTIONS
|
||||||
get_default_mount_options || return $?
|
get_default_mount_options || return $?
|
||||||
# in: FS
|
# in: FS
|
||||||
# out: FS_CHOSEN_MOUNT_OPTIONS
|
# out: FS_ADDITIONAL_MOUNT_OPTIONS
|
||||||
choose_mount_options || return $?
|
get_additional_mount_options || return $?
|
||||||
|
|
||||||
# in: TARGET_BLOCK_DEVICE, BIOS_TYPE
|
# in: TARGET_BLOCK_DEVICE, BOOT_FIRMWARE
|
||||||
# out: BOOT_PART, LUKS_PART
|
# out: BOOT_PART, LUKS_PART
|
||||||
partition || return $?
|
partition || return $?
|
||||||
# in: BIOS_TYPE, BOOT_PART, LUKS_PART, LUKS_PWD, FS
|
# in: BOOT_FIRMWARE, BOOT_PART, LUKS_PART, LUKS_PWD, FS
|
||||||
# out: LUKS_PART_UUID, DATA_PART
|
# out: LUKS_PART_UUID, DATA_PART
|
||||||
format || return $?
|
format || return $?
|
||||||
|
|
||||||
# Combine default and chosen mount options
|
# Combine default and additional mount options
|
||||||
TMP1=("${FS_DEFAULT_MOUNT_OPTIONS[@]}" "${FS_CHOSEN_MOUNT_OPTIONS[@]}") || return $?
|
# out: FS_MOUNT_OPTIONS
|
||||||
# Join array elements by ","
|
{
|
||||||
join_by "," TMP1 FS_MOUNT_OPTIONS || return $?
|
TMP1=("${FS_DEFAULT_MOUNT_OPTIONS[@]}" "${FS_ADDITIONAL_MOUNT_OPTIONS[@]}") || return $?
|
||||||
|
# Join array elements by ","
|
||||||
|
join_by ',' TMP1 FS_MOUNT_OPTIONS || return $?
|
||||||
|
}
|
||||||
|
|
||||||
echo "Mounting data partition with options: ${FS_MOUNT_OPTIONS}"
|
echo 'Mounting data partition with options: '"${FS_MOUNT_OPTIONS}"
|
||||||
sudo mount -o "${FS_MOUNT_OPTIONS}" "$DATA_PART" /mnt || return $?
|
sudo mount -o "${FS_MOUNT_OPTIONS}" "${DATA_PART}" /mnt || return $?
|
||||||
|
|
||||||
echo "Mounting boot partition ..."
|
echo 'Mounting boot partition ...'
|
||||||
mkdir /mnt/boot || return $?
|
mkdir /mnt/boot || return $?
|
||||||
sudo mount "$BOOT_PART" /mnt/boot || return $?
|
sudo mount "${BOOT_PART}" /mnt/boot || return $?
|
||||||
|
|
||||||
# in: BIOS_TYPE
|
# in: BOOT_FIRMWARE
|
||||||
run_pacstrap || return $?
|
run_pacstrap || return $?
|
||||||
# in: FS
|
# in: FS
|
||||||
run_genfstab || return $?
|
run_genfstab || return $?
|
||||||
@ -61,19 +65,19 @@ function main() {
|
|||||||
# in: TARGET_BLOCK_DEVICE, LUKS_PART_UUID
|
# in: TARGET_BLOCK_DEVICE, LUKS_PART_UUID
|
||||||
bootloader || return $?
|
bootloader || return $?
|
||||||
|
|
||||||
if [ "${LEAVE_MOUNTED}" -eq "1" ]; then
|
if [ "${LEAVE_MOUNTED}" -eq '1' ]; then
|
||||||
echo "Leaving partitions below /mnt mounted and ${DATA_PART} opened."
|
echo 'Leaving partitions below /mnt mounted and '"${DATA_PART}"' opened.'
|
||||||
else
|
else
|
||||||
sudo umount -R /mnt || return $?
|
sudo umount -R /mnt || return $?
|
||||||
sudo cryptsetup luksClose "$(basename "${DATA_PART}")" || return $?
|
sudo cryptsetup luksClose "$(basename "${DATA_PART}")" || return $?
|
||||||
fi
|
fi
|
||||||
echo "Finished installation without errors!"
|
echo 'Finished installation without errors!'
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_network() {
|
function check_network() {
|
||||||
echo "Sending ping to wikipedia.de ..."
|
echo 'Sending ping to wikipedia.de ...'
|
||||||
ping -c 1 wikipedia.de >/dev/null || {
|
ping -c 1 wikipedia.de >/dev/null || {
|
||||||
echo "Pleas set up network access."
|
echo 'Pleas set up network access.'
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,64 +88,65 @@ function increase_cow_space() {
|
|||||||
|
|
||||||
# make sure that we are on a live medium:
|
# make sure that we are on a live medium:
|
||||||
findmnt /run/archiso/cowspace >/dev/null || {
|
findmnt /run/archiso/cowspace >/dev/null || {
|
||||||
echo "Not on live medium, did not increase cowspace!"
|
echo 'Not on live medium, did not increase cowspace!'
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Increasing cowspace partition of live medium ..."
|
echo 'Increasing cowspace partition of live medium ...'
|
||||||
sudo mount -o remount,size=2G /run/archiso/cowspace || return $?
|
sudo mount -o remount,size=2G /run/archiso/cowspace || return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_user_input() {
|
function get_user_input() {
|
||||||
# @post
|
# @post
|
||||||
# BIOS_TYPE (uefi or bios)
|
# BOOT_FIRMWARE (uefi or bios)
|
||||||
# FS (BTRFS, EXT4, F2FS)
|
# FS (BTRFS, EXT4, F2FS)
|
||||||
# HOSTNAME
|
# HOSTNAME
|
||||||
# USERNAME, USER_PWD
|
# USERNAME, USER_PWD
|
||||||
# LUKS_PWD
|
# LUKS_PWD
|
||||||
|
|
||||||
get_block_devices_with_size || return $?
|
get_block_devices_with_size || return $?
|
||||||
get_single_choice TARGET_BLOCK_DEVICE "Select target device for installation" BLOCK_DEVICE_SIZES || return $?
|
get_single_choice TARGET_BLOCK_DEVICE 'Select target device for installation' BLOCK_DEVICE_SIZES || return $?
|
||||||
|
|
||||||
if [ "${BIOS_TYPE}" = "autodetect" ]; then
|
ask_user_if_empty BOOT_FIRMWARE 'Enter desired boot firmware. Valid options are "bios", "uefi" or "autodetect":' || return $?
|
||||||
|
if [ "${BOOT_FIRMWARE}" = 'autodetect' ]; then
|
||||||
# Detect BIOS type: https://askubuntu.com/a/162573
|
# Detect BIOS type: https://askubuntu.com/a/162573
|
||||||
|
|
||||||
# Check exit code; if 0 EFI, else BIOS.
|
# Check exit code; if 0 EFI, else BIOS.
|
||||||
# "-q": tell grep to output nothing
|
# "-q": tell grep to output nothing
|
||||||
if dmesg | grep -q "EFI v"; then
|
if dmesg | grep -q 'EFI v'; then
|
||||||
echo "Detected EFI boot."
|
echo 'Detected EFI boot.'
|
||||||
BIOS_TYPE="uefi"
|
BOOT_FIRMWARE='uefi'
|
||||||
else
|
else
|
||||||
echo "Detected BIOS boot"
|
echo 'Detected BIOS boot'
|
||||||
BIOS_TYPE="bios"
|
BOOT_FIRMWARE='bios'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
# Let user select BIOS type
|
# Let user select BIOS type
|
||||||
|
|
||||||
TMP1=('uefi' 'Newer mainboards' 'bios' 'Legacy BIOS on older mainboards')
|
TMP1=('uefi' 'Newer mainboards' 'bios' 'Legacy BIOS on older mainboards')
|
||||||
get_single_choice BIOS_TYPE "Select your bios type" TMP1 || return $?
|
get_single_choice BOOT_FIRMWARE 'Select your bios type' TMP1 || return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TMP1=('BTRFS' 'Allows snapshots and dynamic extension of the FS' 'EXT4' 'Default FS of many distributions' 'F2FS' 'Flash-Friendly-FS for SSD or NVMe')
|
TMP1=('BTRFS' 'Allows snapshots and dynamic extension of the FS' 'EXT4' 'Default FS of many distributions' 'F2FS' 'Flash-Friendly-FS for SSD or NVMe')
|
||||||
get_single_choice FS "Select filesystem to use" TMP1 || return $?
|
get_single_choice FS 'Select filesystem to use' TMP1 || return $?
|
||||||
|
|
||||||
get_text_input HOSTNAME "Enter hostname:" || return $?
|
ask_user_if_empty HOSTNAME 'Enter hostname:' || return $?
|
||||||
get_text_input USERNAME "Enter username:" || return $?
|
ask_user_if_empty USERNAME 'Enter username:' || return $?
|
||||||
|
|
||||||
if [ -z "${USER_PWD}" ]; then
|
if [ -z "${USER_PWD}" ]; then
|
||||||
get_text_input USER_PWD "Enter a user password:" || return $?
|
ask_user_if_empty USER_PWD 'Enter a user password:' || return $?
|
||||||
get_text_input USER_PWD2 "Please enter the password again:" || return $?
|
ask_user_if_empty USER_PWD2 'Please enter the password again:' || return $?
|
||||||
[[ "${USER_PWD}" == "${USER_PWD2}" ]] || {
|
[[ "${USER_PWD}" == "${USER_PWD2}" ]] || {
|
||||||
echo "Passwords did not match";
|
echo 'Passwords did not match';
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
if [ -z "${LUKS_PWD}" ]; then
|
if [ -z "${LUKS_PWD}" ]; then
|
||||||
get_text_input LUKS_PWD "Enter a disk encryption password:" || return $?
|
ask_user_if_empty LUKS_PWD 'Enter a disk encryption password:' || return $?
|
||||||
get_text_input LUKS_PWD2 "Please enter the password again:" || return $?
|
ask_user_if_empty LUKS_PWD2 'Please enter the password again:' || return $?
|
||||||
[[ "${LUKS_PWD}" == "${LUKS_PWD2}" ]] || {
|
[[ "${LUKS_PWD}" == "${LUKS_PWD2}" ]] || {
|
||||||
echo "Passwords did not match";
|
echo 'Passwords did not match';
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
@ -176,17 +181,17 @@ function get_default_mount_options() {
|
|||||||
FS_DEFAULT_MOUNT_OPTIONS+=('compress_algorithm=lz4')
|
FS_DEFAULT_MOUNT_OPTIONS+=('compress_algorithm=lz4')
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Filesystem $FS not yet supported!"
|
echo 'Filesystem '"$FS"' not yet supported!'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function choose_mount_options() {
|
function get_additional_mount_options() {
|
||||||
# @pre
|
# @pre
|
||||||
# FS
|
# FS
|
||||||
# @post
|
# @post
|
||||||
# FS_CHOSEN_MOUNT_OPTIONS (array)
|
# FS_ADDITIONAL_MOUNT_OPTIONS (array)
|
||||||
|
|
||||||
case "${FS}" in
|
case "${FS}" in
|
||||||
BTRFS)
|
BTRFS)
|
||||||
@ -196,40 +201,41 @@ function choose_mount_options() {
|
|||||||
# - The noatime option fully disables writing file access times to the drive every time you read a file.
|
# - The noatime option fully disables writing file access times to the drive every time you read a file.
|
||||||
# This works well for almost all applications, except for those that need to know if a file has been
|
# This works well for almost all applications, except for those that need to know if a file has been
|
||||||
# read since the last time it was modified.
|
# read since the last time it was modified.
|
||||||
TMP1=('noatime' "Don't write file/folder access times" 'on' 'ssd' 'Enable if using SSD/NVMe' 'off')
|
TMP1=('noatime' 'Don'\''t write file/folder access times' 'on' 'ssd' 'Enable if using SSD/NVMe' 'off')
|
||||||
;;
|
;;
|
||||||
EXT4)
|
EXT4)
|
||||||
TMP1=('noatime'" Don't write file/folder access times" 'on')
|
TMP1=('noatime' 'Don'\''t write file/folder access times' 'on')
|
||||||
;;
|
;;
|
||||||
F2FS)
|
F2FS)
|
||||||
TMP1=('noatime' "Don't write file/folder access times" 'on')
|
# shellcheck disable=SC2034
|
||||||
|
TMP1=('noatime' 'Don'\''t write file/folder access times' 'on')
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Filesystem $FS not yet supported!"
|
echo 'Filesystem '"$FS"' not yet supported!'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
get_multi_choice FS_CHOSEN_MOUNT_OPTIONS "Select mount options" TMP1 || return $?
|
get_multi_choice FS_ADDITIONAL_MOUNT_OPTIONS 'Select mount options' TMP1 || return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_pacstrap() {
|
function run_pacstrap() {
|
||||||
# @pre
|
# @pre
|
||||||
# BIOS_TYPE
|
# BOOT_FIRMWARE
|
||||||
|
|
||||||
echo "Running pacstrap ..."
|
echo 'Running pacstrap ...'
|
||||||
PKGS=("${ADDITIONAL_PKGS[@]}")
|
PKGS=("${ADDITIONAL_PKGS[@]}")
|
||||||
|
|
||||||
case "${BIOS_TYPE}" in
|
case "${BOOT_FIRMWARE}" in
|
||||||
uefi)
|
uefi)
|
||||||
PKGS+=('de-p1st-base')
|
PKGS+=('de-p1st-base')
|
||||||
;;
|
;;
|
||||||
bios)
|
bios)
|
||||||
echo "Not yet implemented"
|
echo 'Not yet implemented'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Not yet implemented!"
|
echo 'Not yet implemented!'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -247,14 +253,14 @@ function run_pacstrap() {
|
|||||||
PKGS+=('de-p1st-ucode-placeholder')
|
PKGS+=('de-p1st-ucode-placeholder')
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid option '${CPU_VENDOR}'!"
|
echo 'Invalid option: '"${CPU_VENDOR}"
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local args=()
|
local args=()
|
||||||
if [ "${PACSTRAP_INTERACTIVE}" = "1" ]; then
|
if [ "${PACSTRAP_INTERACTIVE}" = '1' ]; then
|
||||||
args+=('-i') # run interactively
|
args+=('-i') # run interactively
|
||||||
fi
|
fi
|
||||||
args+=('/mnt')
|
args+=('/mnt')
|
||||||
@ -266,17 +272,17 @@ function run_genfstab() {
|
|||||||
# @pre
|
# @pre
|
||||||
# FS
|
# FS
|
||||||
|
|
||||||
echo "Generating fstab ..."
|
echo 'Generating fstab ...'
|
||||||
local fstab
|
local fstab
|
||||||
fstab="$(genfstab -U /mnt)"
|
fstab="$(genfstab -U /mnt)"
|
||||||
|
|
||||||
case "${FS}" in
|
case "${FS}" in
|
||||||
BTRFS)
|
BTRFS)
|
||||||
# Remove "subvolid=..." mount option but leave "subvol=..." mount option
|
# Remove "subvolid=..." mount option but leave "subvol=..." mount option
|
||||||
fstab=$(printf "%s" "${fstab}" | sed 's/,subvolid=[^,\s]\+//') || return $?
|
fstab=$(printf '%s' "${fstab}" | sed 's/,subvolid=[^,\s]\+//') || return $?
|
||||||
# Check if fstab does still contain subvolid mount option
|
# Check if fstab does still contain subvolid mount option
|
||||||
if printf "%s" "${fstab}" | grep -q 'subvolid='; then
|
if printf '%s' "${fstab}" | grep -q 'subvolid='; then
|
||||||
echo "This should not happen!"
|
echo 'This should not happen!'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@ -287,12 +293,12 @@ function run_genfstab() {
|
|||||||
true
|
true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Filesystem $FS not yet supported!"
|
echo 'Filesystem '"$FS"' not yet supported!'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf "%s" "${fstab}" | sudo tee /mnt/etc/fstab >/dev/null || return $?
|
printf '%s' "${fstab}" | sudo tee /mnt/etc/fstab >/dev/null || return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
function config_hostname_and_hosts() {
|
function config_hostname_and_hosts() {
|
||||||
@ -302,10 +308,10 @@ function config_hostname_and_hosts() {
|
|||||||
# STATIC_IP (optional, e.g. 93.133.433.133)
|
# STATIC_IP (optional, e.g. 93.133.433.133)
|
||||||
# IPV6_CAPABLE (optional, e.g. 1)
|
# IPV6_CAPABLE (optional, e.g. 1)
|
||||||
|
|
||||||
echo "Set hostname ..."
|
echo 'Set hostname ...'
|
||||||
echo "${HOSTNAME}" | sudo tee /mnt/etc/hostname >/dev/null || return $?
|
echo "${HOSTNAME}" | sudo tee /mnt/etc/hostname >/dev/null || return $?
|
||||||
|
|
||||||
echo "Create hosts file ..."
|
echo 'Create hosts file ...'
|
||||||
# If the system has a permanent IP address, it should be used instead of 127.0.1.1.
|
# If the system has a permanent IP address, it should be used instead of 127.0.1.1.
|
||||||
# * https://wiki.archlinux.org/index.php/Installation_guide#Network_configuration
|
# * https://wiki.archlinux.org/index.php/Installation_guide#Network_configuration
|
||||||
|
|
||||||
@ -317,17 +323,17 @@ function config_hostname_and_hosts() {
|
|||||||
# If STATIC_IP not given, use 127.0.1.1 instead
|
# If STATIC_IP not given, use 127.0.1.1 instead
|
||||||
STATIC_IP="${STATIC_IP:='127.0.1.1'}"
|
STATIC_IP="${STATIC_IP:='127.0.1.1'}"
|
||||||
|
|
||||||
echo "# The following lines are desirable for IPv4 capable hosts
|
echo '# The following lines are desirable for IPv4 capable hosts
|
||||||
127.0.0.1 localhost
|
127.0.0.1 localhost
|
||||||
# 127.0.1.1 is often used for the FQDN of the machine
|
# 127.0.1.1 is often used for the FQDN of the machine
|
||||||
${STATIC_IP} ${FQDN} ${HOSTNAME}" | sudo tee /mnt/etc/hosts >/dev/null || return $?
|
'"${STATIC_IP} ${FQDN} ${HOSTNAME}" | sudo tee /mnt/etc/hosts >/dev/null || return $?
|
||||||
|
|
||||||
if [ "${IPV6_CAPABLE}" = "1" ]; then
|
if [ "${IPV6_CAPABLE}" = '1' ]; then
|
||||||
echo "
|
echo '
|
||||||
# The following lines are desirable for IPv6 capable hosts
|
# The following lines are desirable for IPv6 capable hosts
|
||||||
::1 localhost ip6-localhost ip6-loopback
|
::1 localhost ip6-localhost ip6-loopback
|
||||||
ff02::1 ip6-allnodes
|
ff02::1 ip6-allnodes
|
||||||
ff02::2 ip6-allrouters" | sudo tee -a /mnt/etc/hosts >/dev/null || return $?
|
ff02::2 ip6-allrouters' | sudo tee -a /mnt/etc/hosts >/dev/null || return $?
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,7 +343,7 @@ function user_and_pwd() {
|
|||||||
# USER_PWD
|
# USER_PWD
|
||||||
# ROOT_PWD (optional)
|
# ROOT_PWD (optional)
|
||||||
|
|
||||||
echo "Adding user and changing shell to /bin/zsh ..."
|
echo 'Adding user and changing shell to /bin/zsh ...'
|
||||||
# -m: create home
|
# -m: create home
|
||||||
# -U: Create a group with the same name as the user, and add the user to this group.
|
# -U: Create a group with the same name as the user, and add the user to this group.
|
||||||
sudo arch-chroot /mnt useradd -m -s /usr/bin/zsh -g wheel "${USERNAME}" || return $?
|
sudo arch-chroot /mnt useradd -m -s /usr/bin/zsh -g wheel "${USERNAME}" || return $?
|
||||||
@ -346,8 +352,8 @@ function user_and_pwd() {
|
|||||||
# If ROOT_PWD is not given, the use USER_PWD for root user
|
# If ROOT_PWD is not given, the use USER_PWD for root user
|
||||||
ROOT_PWD="${ROOT_PWD:="${USER_PWD}"}"
|
ROOT_PWD="${ROOT_PWD:="${USER_PWD}"}"
|
||||||
|
|
||||||
printf "%s:%s" "${USERNAME}" "${USER_PWD}" | sudo chpasswd --root /mnt || return $?
|
printf '%s:%s' "${USERNAME}" "${USER_PWD}" | sudo chpasswd --root /mnt || return $?
|
||||||
printf "%s:%s" "root" "${ROOT_PWD}" | sudo chpasswd --root /mnt || return $?
|
printf '%s:%s' "root" "${ROOT_PWD}" | sudo chpasswd --root /mnt || return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
function bootloader() {
|
function bootloader() {
|
||||||
@ -355,8 +361,8 @@ function bootloader() {
|
|||||||
# TARGET_BLOCK_DEVICE
|
# TARGET_BLOCK_DEVICE
|
||||||
# LUKS_PART_UUID
|
# LUKS_PART_UUID
|
||||||
|
|
||||||
echo "Installing grub ..."
|
echo 'Installing grub ...'
|
||||||
case "${BIOS_TYPE}" in
|
case "${BOOT_FIRMWARE}" in
|
||||||
uefi)
|
uefi)
|
||||||
# portable fallback efi name for grub:
|
# portable fallback efi name for grub:
|
||||||
# * https://www.rodsbooks.com/efi-bootloaders/installation.html#alternative-naming
|
# * https://www.rodsbooks.com/efi-bootloaders/installation.html#alternative-naming
|
||||||
@ -367,12 +373,12 @@ function bootloader() {
|
|||||||
sudo arch-chroot /mnt grub-install --target=i386-pc "${TARGET_BLOCK_DEVICE}" || return $?
|
sudo arch-chroot /mnt grub-install --target=i386-pc "${TARGET_BLOCK_DEVICE}" || return $?
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Not yet implemented!"
|
echo 'Not yet implemented!'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "Generating /boot/grub/grub.cfg ..."
|
echo 'Generating /boot/grub/grub.cfg ...'
|
||||||
{
|
{
|
||||||
# /etc/default/grub is managed by Holo. Therefore we should not manually modify it.
|
# /etc/default/grub is managed by Holo. Therefore we should not manually modify it.
|
||||||
# Instead, we create a holosript which writes $LUKS_PART_UUID into GRUB_CMDLINE_LINUX of /etc/default/grub
|
# Instead, we create a holosript which writes $LUKS_PART_UUID into GRUB_CMDLINE_LINUX of /etc/default/grub
|
||||||
|
@ -9,10 +9,10 @@ USERNAME=yoda
|
|||||||
TARGET_BLOCK_DEVICE=/dev/sda
|
TARGET_BLOCK_DEVICE=/dev/sda
|
||||||
BOOT_PART_SIZE=500 # MiB
|
BOOT_PART_SIZE=500 # MiB
|
||||||
FS=BTRFS
|
FS=BTRFS
|
||||||
FS_CHOSEN_MOUNT_OPTIONS=('noatime')
|
FS_ADDITIONAL_MOUNT_OPTIONS=('noatime')
|
||||||
|
|
||||||
CPU_VENDOR=none
|
CPU_VENDOR=none
|
||||||
BIOS_TYPE=uefi
|
BOOT_FIRMWARE=uefi
|
||||||
|
|
||||||
# If set to "1", then the data, boot and luks partitions
|
# If set to "1", then the data, boot and luks partitions
|
||||||
# will be left mounted/opened after installation
|
# will be left mounted/opened after installation
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Example config for testing in VirtualBox
|
# Example config for testing in VirtualBox
|
||||||
|
|
||||||
# FQDN=domain.name.of.this.host.de
|
# FQDN=domain.name.of.this.host.de
|
||||||
# STATIC_IP=123.456.789.012
|
# STATIC_IP=123.123.123.123
|
||||||
# IPV6_CAPABLE=1
|
# IPV6_CAPABLE=1
|
||||||
HOSTNAME=yodaTest
|
HOSTNAME=yodaTest
|
||||||
USERNAME=yoda
|
USERNAME=yoda
|
||||||
@ -16,13 +16,13 @@ LUKS_PWD=test
|
|||||||
TARGET_BLOCK_DEVICE=/dev/sda
|
TARGET_BLOCK_DEVICE=/dev/sda
|
||||||
BOOT_PART_SIZE=500 # MiB
|
BOOT_PART_SIZE=500 # MiB
|
||||||
FS=BTRFS
|
FS=BTRFS
|
||||||
FS_CHOSEN_MOUNT_OPTIONS=('noatime')
|
FS_ADDITIONAL_MOUNT_OPTIONS=('noatime')
|
||||||
|
|
||||||
# If not booted into the target system, these values should be set:
|
# If not booted into the target system, these values should be set:
|
||||||
# CPU_VENDOR: "autodetect", "amd", "intel" or "none"
|
# CPU_VENDOR: "autodetect", "amd", "intel" or "none"
|
||||||
CPU_VENDOR=autodetect
|
CPU_VENDOR=autodetect
|
||||||
# BIOS_TYPE: "autodetect", "uefi" or "bios"
|
# BOOT_FIRMWARE: "autodetect", "uefi" or "bios"
|
||||||
BIOS_TYPE=uefi
|
BOOT_FIRMWARE=uefi
|
||||||
|
|
||||||
# If set to "1", then the data, boot and luks partitions
|
# If set to "1", then the data, boot and luks partitions
|
||||||
# will be left mounted/opened for manual inspection
|
# will be left mounted/opened for manual inspection
|
||||||
@ -41,14 +41,6 @@ ADDITIONAL_PKGS+=('virtualbox-guest-utils')
|
|||||||
# XFCE4 desktop with HiDPI
|
# XFCE4 desktop with HiDPI
|
||||||
ADDITIONAL_PKGS+=('de-p1st-gpu-generic' 'de-p1st-xfce4-hidpi' 'de-p1st-sddm-tablet')
|
ADDITIONAL_PKGS+=('de-p1st-gpu-generic' 'de-p1st-xfce4-hidpi' 'de-p1st-sddm-tablet')
|
||||||
|
|
||||||
# Audio
|
|
||||||
## pulseaudio - base
|
|
||||||
ADDITIONAL_PKGS+=('pulseaudio' 'pulseaudio-alsa' 'pavucontrol')
|
|
||||||
## pulseaudio - xfce4
|
|
||||||
ADDITIONAL_PKGS+=('xfce4-pulseaudio-plugin')
|
|
||||||
## sound theme
|
|
||||||
ADDITIONAL_PKGS+=('libcanberra' 'libcanberra-pulse')
|
|
||||||
|
|
||||||
# If your network is unsafe, e.g. if you live in Germany, then include a VPN client
|
# If your network is unsafe, e.g. if you live in Germany, then include a VPN client
|
||||||
ADDITIONAL_PKGS+=('riseup-vpn')
|
ADDITIONAL_PKGS+=('riseup-vpn')
|
||||||
# Smartcard (e.g. Nitrokey or Yubikey)
|
# Smartcard (e.g. Nitrokey or Yubikey)
|
||||||
@ -56,7 +48,7 @@ ADDITIONAL_PKGS+=('de-p1st-smartcard')
|
|||||||
|
|
||||||
|
|
||||||
# Other programs
|
# Other programs
|
||||||
ADDITIONAL_PKGS+=('signal-desktop' 'nextcloud-client' 'keepassxc' 'xournalpp' 'zotero')
|
ADDITIONAL_PKGS+=('firefox' 'signal-desktop' 'nextcloud-client' 'keepassxc' 'xournalpp' 'zotero')
|
||||||
# Development
|
# Development
|
||||||
ADDITIONAL_PKGS+=('intellij-idea-ultimate-edition' 'intellij-idea-ultimate-edition-jre')
|
ADDITIONAL_PKGS+=('intellij-idea-ultimate-edition' 'intellij-idea-ultimate-edition-jre')
|
||||||
# Document viewer
|
# Document viewer
|
||||||
|
@ -32,7 +32,7 @@ function get_block_devices() {
|
|||||||
# BLOCK_DEVICES (array with one entry for each block device)
|
# BLOCK_DEVICES (array with one entry for each block device)
|
||||||
|
|
||||||
# Get list of devices, one per line
|
# Get list of devices, one per line
|
||||||
BLOCK_DEVICES="$(lsblk -dplnx size -o name | grep -Ev "boot|rpmb|loop" | tac)" || return $?
|
BLOCK_DEVICES="$(lsblk -dplnx size -o name | grep -Ev 'boot|rpmb|loop' | tac)" || return $?
|
||||||
|
|
||||||
newline_separated_to_array BLOCK_DEVICES BLOCK_DEVICES || return $?
|
newline_separated_to_array BLOCK_DEVICES BLOCK_DEVICES || return $?
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ function get_block_devices_with_size() {
|
|||||||
|
|
||||||
# Get list of devices and their sizes, one pair per line
|
# Get list of devices and their sizes, one pair per line
|
||||||
# Use sed to remove multiple white spaces: sed 's|\s\s*| |'
|
# Use sed to remove multiple white spaces: sed 's|\s\s*| |'
|
||||||
BLOCK_DEVICE_SIZES="$(lsblk -dplnx size -o name,size | grep -Ev "boot|rpmb|loop" | sed 's|\s\s*| |' | tac)" || return $?
|
BLOCK_DEVICE_SIZES="$(lsblk -dplnx size -o name,size | grep -Ev 'boot|rpmb|loop' | sed 's|\s\s*| |' | tac)" || return $?
|
||||||
|
|
||||||
newline_to_space BLOCK_DEVICE_SIZES || return $?
|
newline_to_space BLOCK_DEVICE_SIZES || return $?
|
||||||
space_separated_to_array BLOCK_DEVICE_SIZES BLOCK_DEVICE_SIZES || return $?
|
space_separated_to_array BLOCK_DEVICE_SIZES BLOCK_DEVICE_SIZES || return $?
|
||||||
@ -53,7 +53,7 @@ function get_block_devices_with_size() {
|
|||||||
function partition() {
|
function partition() {
|
||||||
# @pre
|
# @pre
|
||||||
# TARGET_BLOCK_DEVICE
|
# TARGET_BLOCK_DEVICE
|
||||||
# BIOS_TYPE
|
# BOOT_FIRMWARE
|
||||||
# @post
|
# @post
|
||||||
# BOOT_PART
|
# BOOT_PART
|
||||||
# LUKS_PART
|
# LUKS_PART
|
||||||
@ -61,14 +61,14 @@ function partition() {
|
|||||||
# if BOOT_PART_SIZE not given, set to default value
|
# if BOOT_PART_SIZE not given, set to default value
|
||||||
BOOT_PART_SIZE="${BOOT_PART_SIZE:='261'}"
|
BOOT_PART_SIZE="${BOOT_PART_SIZE:='261'}"
|
||||||
# if too small, print warning and exit
|
# if too small, print warning and exit
|
||||||
if [ "${BOOT_PART_SIZE}" -lt "261" ]; then
|
if [ "${BOOT_PART_SIZE}" -lt '261' ]; then
|
||||||
echo "BOOT_PART_SIZE should be larger than 260!";
|
echo 'BOOT_PART_SIZE should be larger than 260!';
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# As our data partition is encrypted,
|
# As our data partition is encrypted,
|
||||||
# we need a separate boot partition!
|
# we need a separate boot partition!
|
||||||
case "${BIOS_TYPE}" in
|
case "${BOOT_FIRMWARE}" in
|
||||||
uefi)
|
uefi)
|
||||||
# EFI boot partition
|
# EFI boot partition
|
||||||
#
|
#
|
||||||
@ -101,18 +101,18 @@ function partition() {
|
|||||||
LUKS_PART="${PARTITIONS[3]}"
|
LUKS_PART="${PARTITIONS[3]}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Expected uefi or bios but got ${BIOS_TYPE} instead!"
|
echo 'Expected uefi or bios but got '"${BOOT_FIRMWARE}"' instead!'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "boot partition: ${BOOT_PART}"
|
echo 'boot partition: '"${BOOT_PART}"
|
||||||
echo "luks partition: ${LUKS_PART}"
|
echo 'luks partition: '"${LUKS_PART}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function format() {
|
function format() {
|
||||||
# @pre
|
# @pre
|
||||||
# BIOS_TYPE
|
# BOOT_FIRMWARE
|
||||||
# BOOT_PART
|
# BOOT_PART
|
||||||
# LUKS_PART
|
# LUKS_PART
|
||||||
# LUKS_PWD
|
# LUKS_PWD
|
||||||
@ -123,18 +123,18 @@ function format() {
|
|||||||
# boot partition formatted
|
# boot partition formatted
|
||||||
# luks partition formatted and opened at DATA_PART
|
# luks partition formatted and opened at DATA_PART
|
||||||
|
|
||||||
echo "Wiping old signatures from partitions ..."
|
echo 'Wiping old signatures from partitions ...'
|
||||||
sudo wipefs "${BOOT_PART}" || return $?
|
sudo wipefs "${BOOT_PART}" || return $?
|
||||||
sudo wipefs "${LUKS_PART}" || return $?
|
sudo wipefs "${LUKS_PART}" || return $?
|
||||||
|
|
||||||
echo "Formatting boot partition ${BOOT_PART} ..."
|
echo 'Formatting boot partition '"${BOOT_PART}"' ...'
|
||||||
sudo mkfs.fat -F32 "${BOOT_PART}" || return $?
|
sudo mkfs.fat -F32 "${BOOT_PART}" || return $?
|
||||||
|
|
||||||
# Note:
|
# Note:
|
||||||
# FDE: GRUB does support LUKS2 since this commit: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=365e0cc3e7e44151c14dd29514c2f870b49f9755
|
# FDE: GRUB does support LUKS2 since this commit: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=365e0cc3e7e44151c14dd29514c2f870b49f9755
|
||||||
# -> Using "--type luks1" is no longer required.
|
# -> Using "--type luks1" is no longer required.
|
||||||
echo "Creating encrypted luks partition ${LUKS_PART} ..."
|
echo 'Creating encrypted luks partition '"${LUKS_PART}"' ...'
|
||||||
printf "%s" "${LUKS_PWD}" | sudo cryptsetup luksFormat \
|
printf '%s' "${LUKS_PWD}" | sudo cryptsetup luksFormat \
|
||||||
--cipher aes-xts-plain64 --key-size 512 --hash sha512 \
|
--cipher aes-xts-plain64 --key-size 512 --hash sha512 \
|
||||||
--iter-time 10000 --use-random "${LUKS_PART}" || return $?
|
--iter-time 10000 --use-random "${LUKS_PART}" || return $?
|
||||||
|
|
||||||
@ -145,9 +145,9 @@ function format() {
|
|||||||
DATA_PART="/dev/mapper/${luks_name}"
|
DATA_PART="/dev/mapper/${luks_name}"
|
||||||
|
|
||||||
# open luks partition
|
# open luks partition
|
||||||
printf "%s" "${LUKS_PWD}" | sudo cryptsetup luksOpen "${LUKS_PART}" "${luks_name}" || return $?
|
printf '%s' "${LUKS_PWD}" | sudo cryptsetup luksOpen "${LUKS_PART}" "${luks_name}" || return $?
|
||||||
|
|
||||||
echo "Formatting the data partition ${DATA_PART} ..."
|
echo 'Formatting the data partition '"${DATA_PART}"' ...'
|
||||||
case "${FS}" in
|
case "${FS}" in
|
||||||
BTRFS)
|
BTRFS)
|
||||||
sudo mkfs.btrfs "${DATA_PART}" || return $?
|
sudo mkfs.btrfs "${DATA_PART}" || return $?
|
||||||
@ -163,7 +163,7 @@ function format() {
|
|||||||
sudo mkfs.f2fs -O extra_attr,inode_checksum,sb_checksum,compression "${DATA_PART}" || return $?
|
sudo mkfs.f2fs -O extra_attr,inode_checksum,sb_checksum,compression "${DATA_PART}" || return $?
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Filesystem ${FS} is not yet supported!"
|
echo 'Filesystem '"${FS}"' is not yet supported!'
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function get_text_input {
|
function ask_user_if_empty {
|
||||||
# If variable with name $1 is zero, then ask user for input.
|
# If variable with name $1 is zero, then ask user for input.
|
||||||
# Only one line user input is allowed.
|
# Only one line user input is allowed.
|
||||||
# User input must not be empty.
|
# User input must not be empty.
|
||||||
@ -6,26 +6,26 @@ function get_text_input {
|
|||||||
# arg $1: name of variable to store user input
|
# arg $1: name of variable to store user input
|
||||||
# arg $2: text to display (e.g. "Enter hostname:")
|
# arg $2: text to display (e.g. "Enter hostname:")
|
||||||
if [ "$#" -ne 2 ]; then
|
if [ "$#" -ne 2 ]; then
|
||||||
echo "get_text_input requires two args!";
|
echo 'ask_user_if_empty requires two args!';
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
if [ -z "$i" ]; then
|
if [ -z "${i}" ]; then
|
||||||
echo "get_text_input: all given args must not be empty";
|
echo 'ask_user_if_empty: all given args must not be empty';
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
local -n ptr=$1 || return $?
|
local -n ptr=$1 || return $?
|
||||||
if [ -z "$ptr" ]; then
|
if [ -z "${ptr}" ]; then
|
||||||
# if ptr has no value yet, ask user for input!
|
# if ptr has no value yet, ask user for input!
|
||||||
echo "$2"
|
echo "${2}"
|
||||||
read -r ptr || return $?
|
read -r ptr || return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check string length to be greater than zero!
|
# check string length to be greater than zero!
|
||||||
if [ "${#ptr}" -lt 1 ]; then
|
if [ "${#ptr}" -lt 1 ]; then
|
||||||
echo "get_text_input must not be empty!";
|
echo 'The input must not be empty!';
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -37,24 +37,24 @@ function get_single_choice {
|
|||||||
# arg $2: text to display
|
# arg $2: text to display
|
||||||
# arg $3: name of variable with array of options to display (for each option there must be two entries in the array: Item and description)
|
# arg $3: name of variable with array of options to display (for each option there must be two entries in the array: Item and description)
|
||||||
if [ "$#" -ne 3 ]; then
|
if [ "$#" -ne 3 ]; then
|
||||||
echo "get_single_choice requires three args!";
|
echo 'get_single_choice requires three args!';
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
if [ -z "$i" ]; then
|
if [ -z "${i}" ]; then
|
||||||
echo "get_single_choice: all given args must not be empty";
|
echo 'get_single_choice: all given args must not be empty';
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
local -n ptr=$1 || return $?
|
local -n ptr=$1 || return $?
|
||||||
if [ -z "$ptr" ]; then
|
if [ -z "${ptr}" ]; then
|
||||||
# if ptr has no value yet, ask user for input!
|
# if ptr has no value yet, ask user for input!
|
||||||
|
|
||||||
local -n MENU_OPTIONS=$3 || return $?
|
local -n MENU_OPTIONS=$3 || return $?
|
||||||
ptr=$(dialog --stdout --menu "$2" 0 0 0 "${MENU_OPTIONS[@]}") || {
|
ptr=$(dialog --stdout --menu "${2}" 0 0 0 "${MENU_OPTIONS[@]}") || {
|
||||||
echo "Error during menu selection!"
|
echo 'Error during menu selection!'
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
clear
|
clear
|
||||||
@ -68,24 +68,24 @@ function get_multi_choice {
|
|||||||
# arg $2: text to display
|
# arg $2: text to display
|
||||||
# arg $3: name of variable with array of options to display (for each option there must be three entries in the array: Item, description, on/off)
|
# arg $3: name of variable with array of options to display (for each option there must be three entries in the array: Item, description, on/off)
|
||||||
if [ "$#" -ne 3 ]; then
|
if [ "$#" -ne 3 ]; then
|
||||||
echo "get_multi_choice requires three args!";
|
echo 'get_multi_choice requires three args!';
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
if [ -z "$i" ]; then
|
if [ -z "${i}" ]; then
|
||||||
echo "get_multi_choice: all given args must not be empty";
|
echo 'get_multi_choice: all given args must not be empty';
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
local -n ptr=$1 || return $?
|
local -n ptr=$1 || return $?
|
||||||
if [ -z "$ptr" ]; then
|
if [ -z "${ptr}" ]; then
|
||||||
# if ptr has no value yet, ask user for input!
|
# if ptr has no value yet, ask user for input!
|
||||||
|
|
||||||
local -n MENU_OPTIONS=$3 || return $?
|
local -n MENU_OPTIONS=$3 || return $?
|
||||||
TMP1=$(dialog --stdout --checklist "$2" 0 0 0 "${MENU_OPTIONS[@]}") || {
|
TMP1=$(dialog --stdout --checklist "${2}" 0 0 0 "${MENU_OPTIONS[@]}") || {
|
||||||
echo "Error during menu selection!"
|
echo 'Error during menu selection!'
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
clear
|
clear
|
||||||
|
@ -7,7 +7,7 @@ function join_by() {
|
|||||||
|
|
||||||
local -n ptr=$2 || return $?
|
local -n ptr=$2 || return $?
|
||||||
local -n ptr2=$3 || return $?
|
local -n ptr2=$3 || return $?
|
||||||
ptr2=$(printf ",%s" "${ptr[@]}")
|
ptr2=$(printf ',%s' "${ptr[@]}")
|
||||||
ptr2=${ptr2:1}
|
ptr2=${ptr2:1}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ function newline_separated_to_array() {
|
|||||||
local -n ptr2=$2 || return $?
|
local -n ptr2=$2 || return $?
|
||||||
# ptr newline separated list.
|
# ptr newline separated list.
|
||||||
# Store this as array ptr2.
|
# Store this as array ptr2.
|
||||||
readarray -t ptr2 <<<"$ptr"
|
readarray -t ptr2 <<<"${ptr}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function space_separated_to_array() {
|
function space_separated_to_array() {
|
||||||
@ -49,7 +49,7 @@ function space_separated_to_array() {
|
|||||||
# ptr space separated list.
|
# ptr space separated list.
|
||||||
# Store this as array ptr2.
|
# Store this as array ptr2.
|
||||||
# Without newline at last array element: https://unix.stackexchange.com/a/519917/315162
|
# Without newline at last array element: https://unix.stackexchange.com/a/519917/315162
|
||||||
readarray -d " " -t ptr2 < <(printf '%s' "$ptr")
|
readarray -d ' ' -t ptr2 < <(printf '%s' "${ptr}")
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_cpu_vendor() {
|
function get_cpu_vendor() {
|
||||||
@ -58,23 +58,23 @@ function get_cpu_vendor() {
|
|||||||
# @post
|
# @post
|
||||||
# CPU_VENDOR ("amd", "intel", "none", "")
|
# CPU_VENDOR ("amd", "intel", "none", "")
|
||||||
|
|
||||||
if [[ -z "${CPU_VENDOR}" ]] || [[ "${CPU_VENDOR}" == "autodetect" ]]; then
|
if [[ -z "${CPU_VENDOR}" ]] || [[ "${CPU_VENDOR}" == 'autodetect' ]]; then
|
||||||
|
|
||||||
# If run virtual environment (e.g. VirtualBox) then no CPU microcode is required
|
# If run virtual environment (e.g. VirtualBox) then no CPU microcode is required
|
||||||
if cat /proc/cpuinfo | grep '^flags.*hypervisor' >/dev/null; then
|
if cat /proc/cpuinfo | grep '^flags.*hypervisor' >/dev/null; then
|
||||||
echo "Detected virtual environment."
|
echo 'Detected virtual environment.'
|
||||||
CPU_VENDOR="none"
|
CPU_VENDOR='none'
|
||||||
|
|
||||||
else
|
else
|
||||||
local vendor_id
|
local vendor_id
|
||||||
vendor_id=$(cat /proc/cpuinfo | grep vendor_id | head -1 | sed 's|vendor_id\s*:\s*||')
|
vendor_id=$(cat /proc/cpuinfo | grep vendor_id | head -1 | sed 's|vendor_id\s*:\s*||')
|
||||||
|
|
||||||
if [ "$vendor_id" = "AuthenticAMD" ]; then
|
if [ "${vendor_id}" = 'AuthenticAMD' ]; then
|
||||||
CPU_VENDOR="amd"
|
CPU_VENDOR='amd'
|
||||||
elif [ "$vendor_id" = "GenuineIntel" ]; then
|
elif [ "${vendor_id}" = 'GenuineIntel' ]; then
|
||||||
CPU_VENDOR="intel"
|
CPU_VENDOR='intel'
|
||||||
else
|
else
|
||||||
echo "Unknown CPU vendor"
|
echo 'Unknown CPU vendor'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -13,27 +13,27 @@ function text_input {
|
|||||||
#
|
#
|
||||||
# $1: variable name to store input to
|
# $1: variable name to store input to
|
||||||
# $2: text to display (e.g. "Enter hostname:")
|
# $2: text to display (e.g. "Enter hostname:")
|
||||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
if [ -z "${1}" ] || [ -z "${2}" ]; then
|
||||||
echo "text_input requires two args!";
|
echo 'text_input requires two args!';
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local -n ptr=$1 || return $?
|
local -n ptr=$1 || return $?
|
||||||
if [ -z "$ptr" ]; then
|
if [ -z "${ptr}" ]; then
|
||||||
echo "$2"
|
echo "${2}"
|
||||||
read -r ptr || return $?
|
read -r ptr || return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check string length to be greater than zero!
|
# check string length to be greater than zero!
|
||||||
if [ "${#ptr}" -lt 1 ]; then
|
if [ "${#ptr}" -lt 1 ]; then
|
||||||
echo "text_input must not be empty!";
|
echo 'text_input must not be empty!';
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
text_input foo "Enter something funny:"
|
text_input foo 'Enter something funny:'
|
||||||
echo "Input: $foo"
|
echo "Input: ${foo}"
|
||||||
|
|
||||||
bar=""
|
bar=''
|
||||||
text_input bar "Enter something even funnier:"
|
text_input bar 'Enter something even funnier:'
|
||||||
echo "Input: $bar"
|
echo "Input: ${bar}"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
_pkgname=xfce4
|
_pkgname=xfce4
|
||||||
_reponame=arch
|
_reponame=arch
|
||||||
pkgname="de-p1st-$_pkgname"
|
pkgname="de-p1st-$_pkgname"
|
||||||
pkgver=0.0.20
|
pkgver=0.0.21
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="XFCE4 with configuration"
|
pkgdesc="XFCE4 with configuration"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
@ -52,6 +52,14 @@ depends+=(de-p1st-redshift)
|
|||||||
# sddm themeing
|
# sddm themeing
|
||||||
depends+=(de-p1st-sddm-theme)
|
depends+=(de-p1st-sddm-theme)
|
||||||
|
|
||||||
|
# ============== audio ==============
|
||||||
|
# pulseaudio - base
|
||||||
|
ADDITIONAL_PKGS+=('pulseaudio' 'pulseaudio-alsa' 'pavucontrol')
|
||||||
|
# pulseaudio - xfce4
|
||||||
|
ADDITIONAL_PKGS+=('xfce4-pulseaudio-plugin')
|
||||||
|
# sound theme
|
||||||
|
ADDITIONAL_PKGS+=('libcanberra' 'libcanberra-pulse')
|
||||||
|
|
||||||
# ============== network, theme, keyboard ==============
|
# ============== network, theme, keyboard ==============
|
||||||
#
|
#
|
||||||
# NetworkManager and NetworkManager applet
|
# NetworkManager and NetworkManager applet
|
||||||
@ -65,8 +73,6 @@ depends+=(de-p1st-keyboard-x11)
|
|||||||
|
|
||||||
# ============== wallpaper ==============
|
# ============== wallpaper ==============
|
||||||
depends+=(de-p1st-wallpaper)
|
depends+=(de-p1st-wallpaper)
|
||||||
# ============== browser ==============
|
|
||||||
depends+=(firefox)
|
|
||||||
|
|
||||||
|
|
||||||
# https://wiki.archlinux.org/title/GNOME/Keyring#Manage_using_GUI
|
# https://wiki.archlinux.org/title/GNOME/Keyring#Manage_using_GUI
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
Whisker Menu:
|
Whisker Menu:
|
||||||
-> .face shown as user icon
|
-> .face shown as user icon
|
||||||
-> Firefox as favourite top right
|
|
||||||
|
|
||||||
desktop-icons on primary display is set to "true"
|
desktop-icons on primary display is set to "true"
|
||||||
custom destkop background
|
custom destkop background
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
favorites=firefox.desktop,xfce4-mail-reader.desktop,xfce4-file-manager.desktop,xfce4-terminal-emulator.desktop
|
|
||||||
recent=firefox.desktop,xfce4-terminal-emulator.desktop
|
|
||||||
button-icon=xfce4-whiskermenu
|
|
||||||
button-single-row=false
|
|
||||||
show-button-title=false
|
|
||||||
show-button-icon=true
|
|
||||||
launcher-show-name=true
|
|
||||||
launcher-show-description=true
|
|
||||||
launcher-show-tooltip=true
|
|
||||||
item-icon-size=3
|
|
||||||
hover-switch-category=false
|
|
||||||
category-show-name=true
|
|
||||||
category-icon-size=1
|
|
||||||
load-hierarchy=false
|
|
||||||
view-as-icons=true
|
|
||||||
default-category=0
|
|
||||||
recent-items-max=10
|
|
||||||
favorites-in-recent=true
|
|
||||||
position-search-alternate=true
|
|
||||||
position-commands-alternate=false
|
|
||||||
position-categories-alternate=true
|
|
||||||
stay-on-focus-out=false
|
|
||||||
confirm-session-command=true
|
|
||||||
menu-width=450
|
|
||||||
menu-height=500
|
|
||||||
menu-opacity=100
|
|
||||||
command-settings=xfce4-settings-manager
|
|
||||||
show-command-settings=true
|
|
||||||
command-lockscreen=xflock4
|
|
||||||
show-command-lockscreen=true
|
|
||||||
command-switchuser=gdmflexiserver
|
|
||||||
show-command-switchuser=false
|
|
||||||
command-logoutuser=xfce4-session-logout --logout --fast
|
|
||||||
show-command-logoutuser=false
|
|
||||||
command-restart=xfce4-session-logout --reboot --fast
|
|
||||||
show-command-restart=false
|
|
||||||
command-shutdown=xfce4-session-logout --halt --fast
|
|
||||||
show-command-shutdown=false
|
|
||||||
command-suspend=xfce4-session-logout --suspend
|
|
||||||
show-command-suspend=false
|
|
||||||
command-hibernate=xfce4-session-logout --hibernate
|
|
||||||
show-command-hibernate=false
|
|
||||||
command-logout=xfce4-session-logout
|
|
||||||
show-command-logout=true
|
|
||||||
command-menueditor=menulibre
|
|
||||||
show-command-menueditor=true
|
|
||||||
command-profile=mugshot
|
|
||||||
show-command-profile=true
|
|
||||||
search-actions=5
|
|
||||||
|
|
||||||
[action0]
|
|
||||||
name=Man Pages
|
|
||||||
pattern=#
|
|
||||||
command=exo-open --launch TerminalEmulator man %s
|
|
||||||
regex=false
|
|
||||||
|
|
||||||
[action1]
|
|
||||||
name=Web Search
|
|
||||||
pattern=?
|
|
||||||
command=exo-open --launch WebBrowser https://duckduckgo.com/?q=%u
|
|
||||||
regex=false
|
|
||||||
|
|
||||||
[action2]
|
|
||||||
name=Wikipedia
|
|
||||||
pattern=!w
|
|
||||||
command=exo-open --launch WebBrowser https://en.wikipedia.org/wiki/%u
|
|
||||||
regex=false
|
|
||||||
|
|
||||||
[action3]
|
|
||||||
name=Run in Terminal
|
|
||||||
pattern=!
|
|
||||||
command=exo-open --launch TerminalEmulator %s
|
|
||||||
regex=false
|
|
||||||
|
|
||||||
[action4]
|
|
||||||
name=Open URI
|
|
||||||
pattern=^(file|http|https):\\/\\/(.*)$
|
|
||||||
command=exo-open \\0
|
|
||||||
regex=true
|
|
@ -1 +1 @@
|
|||||||
Subproject commit f2d89b673b79cd9d5dbdee519a136ef23a359668
|
Subproject commit 4ce9106446a3046d400a9e0c80c68af5df3ca54a
|
@ -1 +1 @@
|
|||||||
Subproject commit dfd3b1f887690d4d7c287a6b1d4bce0b9bfa2fa3
|
Subproject commit 8ba41d7f37c4eaf756da834ef8560b07f36020f9
|
@ -1 +1 @@
|
|||||||
Subproject commit 5460f3800e8a13d01e5fe2d39205e277d3c767f8
|
Subproject commit 4d6600b719ff69ca4715445853f37cd5a2a9d859
|
Loading…
Reference in New Issue
Block a user