replace 0m with m

This commit is contained in:
Tobias Powalowski 2023-02-07 20:19:31 +01:00
parent d1dce3d1b8
commit 0c83fdb109
15 changed files with 187 additions and 187 deletions

View file

@ -8,14 +8,14 @@
_APPNAME=$(basename "${0}") _APPNAME=$(basename "${0}")
_usage() _usage()
{ {
echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[0m\e[1m - COPY MOUNTPOINT:\e[0m" echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m\e[1m - COPY MOUNTPOINT:\e[m"
echo -e "\e[1m--------------------------------------\e[0m" echo -e "\e[1m--------------------------------------\e[m"
echo "- Copy mountpoint recursivly from one mountpoint to an other one," echo "- Copy mountpoint recursivly from one mountpoint to an other one,"
echo " using tar utility." echo " using tar utility."
echo -e "- For system copying start with mounted \e[1m/\e[0m and then invoke this script" echo -e "- For system copying start with mounted \e[1m/\e[m and then invoke this script"
echo -e " for each additional mountpoint eg. \e[1m/boot\e[0m or \e[1m/home\e[0m." echo -e " for each additional mountpoint eg. \e[1m/boot\e[m or \e[1m/home\e[m."
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} <oldmountpoint> <newmountpoint>\e[0m" echo -e "usage: \e[1m${_APPNAME} <oldmountpoint> <newmountpoint>\e[m"
exit "$1" exit "$1"
} }
################################################## ##################################################

View file

@ -8,13 +8,13 @@
_APPNAME=$(basename "${0}") _APPNAME=$(basename "${0}")
_usage() _usage()
{ {
echo -e "\e[1mWelcome to \e[34marchboot's\e[0m \e[1mHWSIM:\e[0m" echo -e "\e[1mWelcome to \e[34marchboot's\e[m \e[1mHWSIM:\e[m"
echo -e "\e[1m---------------------------------------\e[0m" echo -e "\e[1m---------------------------------------\e[m"
echo "Create a simulated wireless SSID for testing purposes" echo "Create a simulated wireless SSID for testing purposes"
echo "with mac80211_hwsim module." echo "with mac80211_hwsim module."
echo "- wlan0 will be setup as the AP. Don't use for scanning!" echo "- wlan0 will be setup as the AP. Don't use for scanning!"
echo "- wlan1 will be setup for STATION mode. Use this for scanning for your AP." echo "- wlan1 will be setup for STATION mode. Use this for scanning for your AP."
echo -e "usage: \e[1m${_APPNAME} <SSID>\e[0m" echo -e "usage: \e[1m${_APPNAME} <SSID>\e[m"
exit 0 exit 0
} }
[[ -z "${1}" ]] && _usage [[ -z "${1}" ]] && _usage
@ -26,4 +26,4 @@ systemctl restart iwd
sleep 2 sleep 2
iwctl device wlan0 set-property Mode ap iwctl device wlan0 set-property Mode ap
iwctl device wlan0 set-property Powered on iwctl device wlan0 set-property Powered on
iwctl ap wlan0 start "${1}" "12345678" && echo -e "\e[1mSSID:'${1}' with password '12345678' is online now.\e[0m" iwctl ap wlan0 start "${1}" "12345678" && echo -e "\e[1mSSID:'${1}' with password '12345678' is online now.\e[m"

View file

@ -5,25 +5,25 @@ _DESTDIR="${1}"
. /usr/lib/archboot/installer/common.sh . /usr/lib/archboot/installer/common.sh
_usage() { _usage() {
echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[0m \e[1m- QUICKINST INSTALLER:\e[0m" echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m \e[1m- QUICKINST INSTALLER:\e[m"
echo -e "\e[1m-------------------------------------------\e[0m" echo -e "\e[1m-------------------------------------------\e[m"
echo -e "Usage:" echo -e "Usage:"
echo -e "\e[1mquickinst <destdir>\e[0m" echo -e "\e[1mquickinst <destdir>\e[m"
echo "" echo ""
echo "This script is for users who would rather partition/mkfs/mount their target" echo "This script is for users who would rather partition/mkfs/mount their target"
echo "media manually than go through the routines in the setup script." echo "media manually than go through the routines in the setup script."
echo echo
if ! [[ -e "${_LOCAL_DB}" ]]; then if ! [[ -e "${_LOCAL_DB}" ]]; then
echo -e "First configure \e[1m/etc/pacman.conf\e[0m which repositories to use" echo -e "First configure \e[1m/etc/pacman.conf\e[m which repositories to use"
echo -e "and set a mirror in \e[1m/etc/pacman.d/mirrorlist\e[0m" echo -e "and set a mirror in \e[1m/etc/pacman.d/mirrorlist\e[m"
fi fi
echo echo
echo -e "Make sure you have all your filesystems mounted under \e[1m<destdir>\e[0m." echo -e "Make sure you have all your filesystems mounted under \e[1m<destdir>\e[m."
echo -e "Then run this script to install all packages listed in \e[1m/etc/archboot/defaults\e[0m" echo -e "Then run this script to install all packages listed in \e[1m/etc/archboot/defaults\e[m"
echo -e "to \e[1m<destdir>\e[0m." echo -e "to \e[1m<destdir>\e[m."
echo echo
echo "Example:" echo "Example:"
echo -e " \e[1mquickinst /mnt\e[0m" echo -e " \e[1mquickinst /mnt\e[m"
echo "" echo ""
exit 0 exit 0
} }
@ -80,12 +80,12 @@ else
fi fi
if ! _prepare_pacman; then if ! _prepare_pacman; then
echo -e "Pacman preparation \e[91mFAILED\e[0m." echo -e "Pacman preparation \e[91mFAILED\e[m."
exit 1 exit 1
fi fi
_chroot_mount _chroot_mount
if ! _install_packages; then if ! _install_packages; then
echo -e "Package installation \e[91mFAILED\e[0m." echo -e "Package installation \e[91mFAILED\e[m."
_chroot_umount _chroot_umount
exit 1 exit 1
fi fi
@ -93,21 +93,21 @@ _locale_gen
_chroot_umount _chroot_umount
echo echo
echo -e "\e[1mPackage installation complete.\e[0m" echo -e "\e[1mPackage installation complete.\e[m"
echo echo
echo -e "Please install a \e[1mbootloader\e[0m. Edit the appropriate config file for" echo -e "Please install a \e[1mbootloader\e[m. Edit the appropriate config file for"
echo -e "your loader. Please use \e[1m${_VMLINUZ}\e[0m as kernel image." echo -e "your loader. Please use \e[1m${_VMLINUZ}\e[m as kernel image."
echo -e "Chroot into your system to install it:" echo -e "Chroot into your system to install it:"
echo -e " \e[1m# mount -o bind /dev ${_DESTDIR}/dev\e[0m" echo -e " \e[1m# mount -o bind /dev ${_DESTDIR}/dev\e[m"
echo -e " \e[1m# mount -t proc none ${_DESTDIR}/proc\e[0m" echo -e " \e[1m# mount -t proc none ${_DESTDIR}/proc\e[m"
echo -e " \e[1m# mount -t sysfs none ${_DESTDIR}/sys\e[0m" echo -e " \e[1m# mount -t sysfs none ${_DESTDIR}/sys\e[m"
echo -e " \e[1m# chroot ${_DESTDIR} /bin/bash\e[0m" echo -e " \e[1m# chroot ${_DESTDIR} /bin/bash\e[m"
echo echo
echo "Next step, initramfs setup:" echo "Next step, initramfs setup:"
echo -e "Edit your \e[1m/etc/mkinitcpio.conf\e[0m to fit your needs. After that run:" echo -e "Edit your \e[1m/etc/mkinitcpio.conf\e[m to fit your needs. After that run:"
echo -e " \e[1m# mkinitcpio -p ${_KERNELPKG}\e[0m" echo -e " \e[1m# mkinitcpio -p ${_KERNELPKG}\e[m"
echo echo
echo -e "Then \e[1mexit\e[0m your chroot shell, edit \e[1m${_DESTDIR}/etc/fstab\e[0m and \e[1mreboot\e[0m! " echo -e "Then \e[1mexit\e[m your chroot shell, edit \e[1m${_DESTDIR}/etc/fstab\e[m and \e[1mreboot\e[m! "
exit 0 exit 0
# vim: set ts=4 sw=4 et: # vim: set ts=4 sw=4 et:

View file

@ -8,12 +8,12 @@
_APPNAME=$(basename "${0}") _APPNAME=$(basename "${0}")
_usage() _usage()
{ {
echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[0m \e[1m- RESTORE USB STICK:\e[0m" echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m \e[1m- RESTORE USB STICK:\e[m"
echo -e "\e[1m----------------------------------------\e[0m" echo -e "\e[1m----------------------------------------\e[m"
echo -e "This script restores an USB device to a \e[1mFAT32\e[0m device." echo -e "This script restores an USB device to a \e[1mFAT32\e[m device."
echo -e "\e[91mWARNING: ALL DATA WILL BE LOST ON THE DEVICE! \e[0m" echo -e "\e[91mWARNING: ALL DATA WILL BE LOST ON THE DEVICE! \e[m"
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} <device>\e[0m" echo -e "usage: \e[1m${_APPNAME} <device>\e[m"
exit "1" exit "1"
} }
################################################## ##################################################
@ -23,15 +23,15 @@ if ! [[ ${UID} -eq 0 ]]; then
echo "ERROR: Please run as root user!" echo "ERROR: Please run as root user!"
exit 1 exit 1
fi fi
echo -e "\e[91mWARNING: 10 seconds for hitting CTRL+C to stop the process on ${1} now! \e[0m" echo -e "\e[91mWARNING: 10 seconds for hitting CTRL+C to stop the process on ${1} now! \e[m"
sleep 10 sleep 10
# clean partitiontable # clean partitiontable
echo -e "\e[1mRestoring USB STICK...\e[0m" echo -e "\e[1mRestoring USB STICK...\e[m"
echo -e "\e[1mSTEP 1/3:\e[0m Cleaning partition table..." echo -e "\e[1mSTEP 1/3:\e[m Cleaning partition table..."
dd if=/dev/zero of="${1}" bs=512 count=2048 dd if=/dev/zero of="${1}" bs=512 count=2048
wipefs -a "${1}" wipefs -a "${1}"
# create new MBR and partition on <DEVICE> # create new MBR and partition on <DEVICE>
echo -e "\e[1mSTEP 2/3:\e[0m Create new MBR and partitiontable..." echo -e "\e[1mSTEP 2/3:\e[m Create new MBR and partitiontable..."
fdisk "${1}" <<EOF fdisk "${1}" <<EOF
n n
p p
@ -45,6 +45,6 @@ EOF
# wait for partitiontable to be resynced # wait for partitiontable to be resynced
sleep 5 sleep 5
# create FAT32 filesystem on <device-partition> # create FAT32 filesystem on <device-partition>
echo -e "\e[1mSTEP 3/3:\e[0m Create FAT32 filesystem..." echo -e "\e[1mSTEP 3/3:\e[m Create FAT32 filesystem..."
mkfs.vfat -F32 "${1}"1 mkfs.vfat -F32 "${1}"1
echo -e "\e[1mFinished.\e[0m" echo -e "\e[1mFinished.\e[m"

View file

@ -7,15 +7,15 @@
_APPNAME=$(basename "${0}") _APPNAME=$(basename "${0}")
_usage() _usage()
{ {
echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[0m\e[1m - RSYNC BACKUP:\e[0m" echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m\e[1m - RSYNC BACKUP:\e[m"
echo -e "\e[1m-----------------------------------\e[0m" echo -e "\e[1m-----------------------------------\e[m"
echo -e "- Copy \e[1mbackupdir\e[0m to \e[1mbackupdestination\e[0m using rsync." echo -e "- Copy \e[1mbackupdir\e[m to \e[1mbackupdestination\e[m using rsync."
echo -e "- For system backup, start with \e[1mfull\e[0m mounted system and then invoke this script" echo -e "- For system backup, start with \e[1mfull\e[m mounted system and then invoke this script"
echo -e " with system's root directory as \e[1mbackupdir\e[0m." echo -e " with system's root directory as \e[1mbackupdir\e[m."
echo -e "- \e[1mexcluded\e[0m directories are \e[1m/dev /tmp /proc /sys /run /mnt /media /lost+found\e[0m" echo -e "- \e[1mexcluded\e[m directories are \e[1m/dev /tmp /proc /sys /run /mnt /media /lost+found\e[m"
echo -e "- \e[1m--numeric-ids\e[0m option is invoked to \e[1mpreserve\e[0m users" echo -e "- \e[1m--numeric-ids\e[m option is invoked to \e[1mpreserve\e[m users"
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} <backupdir> <backupdestination>\e[0m" echo -e "usage: \e[1m${_APPNAME} <backupdir> <backupdestination>\e[m"
exit "$1" exit "$1"
} }
################################################## ##################################################

View file

@ -2,16 +2,16 @@
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh . /usr/lib/archboot/common.sh
usage () { usage () {
echo -e "\e[1mGenerate Secure Boot keys,MOK files and backup existing keys:\e[0m" echo -e "\e[1mGenerate Secure Boot keys,MOK files and backup existing keys:\e[m"
echo -e "\e[1m-------------------------------------------------------------\e[0m" echo -e "\e[1m-------------------------------------------------------------\e[m"
echo "This script generates all needed keys for a Secure Boot setup." echo "This script generates all needed keys for a Secure Boot setup."
echo -e "It will include the \e[1m2\e[0m needed Microsoft certificates, in order" echo -e "It will include the \e[1m2\e[m needed Microsoft certificates, in order"
echo "to avoid soft bricking of devices." echo "to avoid soft bricking of devices."
echo -e "Backup of your existing keys are put to \e[1mBACKUP\e[0m directory." echo -e "Backup of your existing keys are put to \e[1mBACKUP\e[m directory."
echo "" echo ""
echo -e "\e[1m-Usage: -name= <directory>\e[0m" echo -e "\e[1m-Usage: -name= <directory>\e[m"
echo "" echo ""
echo -e "\e[1m-PARAMETERS:\e[0m" echo -e "\e[1m-PARAMETERS:\e[m"
echo " -name= your name to embed in the keys" echo " -name= your name to embed in the keys"
echo " -h This message." echo " -h This message."
exit 0 exit 0

View file

@ -33,7 +33,7 @@ while [ $# -gt 0 ]; do
done done
_archboot_check _archboot_check
_download_latest _download_latest
echo -e "\e[1mInformation:\e[0m Logging is done on \e[1m/dev/tty7\e[0m..." echo -e "\e[1mInformation:\e[m Logging is done on \e[1m/dev/tty7\e[m..."
_zram_initialize _zram_initialize
# Generate new environment and launch it with kexec # Generate new environment and launch it with kexec
if [[ -n "${_L_COMPLETE}" || -n "${_L_INSTALL_COMPLETE}" ]]; then if [[ -n "${_L_COMPLETE}" || -n "${_L_INSTALL_COMPLETE}" ]]; then

View file

@ -4,18 +4,18 @@
# don't run ttyS0 as first device # don't run ttyS0 as first device
_welcome () { _welcome () {
[[ "$(uname -m)" == "x86_64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[0m\e[1m - Arch Linux\e[0m" [[ "$(uname -m)" == "x86_64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux\e[m"
[[ "$(uname -m)" == "aarch64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[0m\e[1m - Arch Linux ARM\e[0m" [[ "$(uname -m)" == "aarch64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux ARM\e[m"
[[ "$(uname -m)" == "riscv64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[0m\e[1m - Arch Linux RISC-V 64\e[0m" [[ "$(uname -m)" == "riscv64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux RISC-V 64\e[m"
echo -e "\e[1m--------------------------------------------------------------------\e[0m" echo -e "\e[1m--------------------------------------------------------------------\e[m"
_local_mode _local_mode
} }
_local_mode () { _local_mode () {
if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
echo -e "You are running in \e[92m\e[1mLocal mode\e[0m, with \e[1mlocal package repository\e[0m enabled.\e[0m" echo -e "You are running in \e[92m\e[1mLocal mode\e[m, with \e[1mlocal package repository\e[m enabled.\e[m"
if [[ -e /usr/bin/setup ]] ; then if [[ -e /usr/bin/setup ]] ; then
echo -e "To \e[1mswitch\e[0m to \e[1mOnline mode\e[0m:\e[1m\e[91m# rm /var/cache/pacman/pkg/archboot.db\e[0m\e[1m" echo -e "To \e[1mswitch\e[m to \e[1mOnline mode\e[m:\e[1m\e[91m# rm /var/cache/pacman/pkg/archboot.db\e[m\e[1m"
echo "" echo ""
fi fi
fi fi
@ -25,21 +25,21 @@ _enter_shell() {
# dbus sources profiles again # dbus sources profiles again
if ! pgrep -x dbus-run-sessio &>/dev/null; then if ! pgrep -x dbus-run-sessio &>/dev/null; then
cd / cd /
echo -e "Hit \e[1m\e[92mENTER\e[0m for \e[1mshell\e[0m login." echo -e "Hit \e[1m\e[92mENTER\e[m for \e[1mshell\e[m login."
read -r read -r
clear clear
fi fi
} }
_run_latest() { _run_latest() {
echo -e "\e[1mStarting\e[0m assembling of archboot environment \e[1mwithout\e[0m package cache..." echo -e "\e[1mStarting\e[m assembling of archboot environment \e[1mwithout\e[m package cache..."
echo -e "\e[1mRunning now: \e[92mupdate-installer -latest\e[0m" echo -e "\e[1mRunning now: \e[92mupdate-installer -latest\e[m"
update-installer -latest | tee -a /dev/ttyS0 /dev/ttyAMA0 /dev/ttyUSB0 /dev/pts/0 2>/dev/null update-installer -latest | tee -a /dev/ttyS0 /dev/ttyAMA0 /dev/ttyUSB0 /dev/pts/0 2>/dev/null
} }
_run_latest_install() { _run_latest_install() {
echo -e "\e[1mStarting\e[0m assembling of archboot environment \e[1mwith\e[0m package cache..." echo -e "\e[1mStarting\e[m assembling of archboot environment \e[1mwith\e[m package cache..."
echo -e "\e[1mRunning now: \e[92mupdate-installer -latest-install\e[0m" echo -e "\e[1mRunning now: \e[92mupdate-installer -latest-install\e[m"
update-installer -latest-install | tee -a /dev/ttyS0 /dev/ttyAMA0 /dev/ttyUSB0 /dev/pts/0 2>/dev/null update-installer -latest-install | tee -a /dev/ttyS0 /dev/ttyAMA0 /dev/ttyUSB0 /dev/pts/0 2>/dev/null
} }
@ -47,12 +47,12 @@ _run_update_installer() {
[[ -z $TTY ]] && TTY=$(tty) [[ -z $TTY ]] && TTY=$(tty)
TTY=${TTY#/dev/} TTY=${TTY#/dev/}
cd / cd /
echo -e "\e[1m\e[92mMemory checks run successfully:\e[0m" echo -e "\e[1m\e[92mMemory checks run successfully:\e[m"
echo -e "\e[93mGo and get a cup of coffee. Depending on your system setup,\e[0m" echo -e "\e[93mGo and get a cup of coffee. Depending on your system setup,\e[m"
echo -e "\e[93myou can \e[1mstart\e[0m\e[93m with your tasks in about \e[1m5\e[0m\e[93m minutes...\e[0m" echo -e "\e[93myou can \e[1mstart\e[m\e[93m with your tasks in about \e[1m5\e[m\e[93m minutes...\e[m"
echo "" echo ""
if [[ "${TTY}" == "tty1" ]]; then if [[ "${TTY}" == "tty1" ]]; then
echo -e "\e[1m\e[91m10 seconds\e[0;25m time to hit \e[1m\e[92mCTRL-C\e[0m to \e[1m\e[91mstop\e[0m the process \e[1m\e[1mnow...\e[0m" echo -e "\e[1m\e[91m10 seconds\e[0;25m time to hit \e[1m\e[92mCTRL-C\e[m to \e[1m\e[91mstop\e[m the process \e[1m\e[1mnow...\e[m"
sleep 10 sleep 10
echo "" echo ""
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 2571000 ]]; then if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 2571000 ]]; then
@ -62,11 +62,11 @@ _run_update_installer() {
fi fi
elif [[ "${TTY}" == "ttyS0" || "${TTY}" == "ttyAMA0" || "${TTY}" == "ttyUSB0" || "${TTY}" == "pts/0" ]]; then elif [[ "${TTY}" == "ttyS0" || "${TTY}" == "ttyAMA0" || "${TTY}" == "ttyUSB0" || "${TTY}" == "pts/0" ]]; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2571000 ]]; then if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2571000 ]]; then
echo -e "Running \e[1m\e[92mupdate-installer -latest-install\e[0m on \e[1mtty1\e[0m, please wait...\e[0m" echo -e "Running \e[1m\e[92mupdate-installer -latest-install\e[m on \e[1mtty1\e[m, please wait...\e[m"
else else
echo -e "\e[1mRunning now: \e[92mupdate-installer -latest\e[0m" echo -e "\e[1mRunning now: \e[92mupdate-installer -latest\e[m"
fi fi
echo -e "\e[1mProgress is shown here...\e[0m" echo -e "\e[1mProgress is shown here...\e[m"
fi fi
} }
@ -102,19 +102,19 @@ if [[ -e /usr/bin/setup ]]; then
# latest image, fail if less than 2GB RAM available # latest image, fail if less than 2GB RAM available
elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 1970000 ]]; then elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 1970000 ]]; then
_welcome _welcome
echo -e "\e[1m\e[91mMemory check failed:\e[0m" echo -e "\e[1m\e[91mMemory check failed:\e[m"
echo -e "\e[91m- Not engough memory detected! \e[0m" echo -e "\e[91m- Not engough memory detected! \e[m"
echo -e "\e[93m- Please add \e[1mmore\e[0m\e[93m than \e[1m2.0GB\e[0m\e[93m RAM.\e[0m" echo -e "\e[93m- Please add \e[1mmore\e[m\e[93m than \e[1m2.0GB\e[m\e[93m RAM.\e[m"
echo -e "\e[91mAborting...\e[0m" echo -e "\e[91mAborting...\e[m"
_enter_shell _enter_shell
# local image, fail if less than 2.6GB RAM available # local image, fail if less than 2.6GB RAM available
elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 2571000 &&\ elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 2571000 &&\
-e "/var/cache/pacman/pkg/archboot.db" ]]; then -e "/var/cache/pacman/pkg/archboot.db" ]]; then
_welcome _welcome
echo -e "\e[1m\e[91mMemory check failed:\e[0m" echo -e "\e[1m\e[91mMemory check failed:\e[m"
echo -e "\e[91m- Not engough memory detected! \e[0m" echo -e "\e[91m- Not engough memory detected! \e[m"
echo -e "\e[93m- Please add \e[1mmore\e[0m\e[93m than \e[1m2.6GB\e[0m\e[93m RAM.\e[0m" echo -e "\e[93m- Please add \e[1mmore\e[m\e[93m than \e[1m2.6GB\e[m\e[93m RAM.\e[m"
echo -e "\e[91mAborting...\e[0m" echo -e "\e[91mAborting...\e[m"
_enter_shell _enter_shell
else else
_welcome _welcome

View file

@ -7,8 +7,8 @@ _install_gnome_wayland() {
} }
_start_gnome_wayland() { _start_gnome_wayland() {
echo -e "Launching \e[1mGNOME Wayland\e[0m now, logging is done on \e[1m/dev/tty7\e[0m..." echo -e "Launching \e[1mGNOME Wayland\e[m now, logging is done on \e[1m/dev/tty7\e[m..."
echo -e "To relaunch \e[1mGNOME Wayland\e[0m use: \e[92mgnome-wayland\e[0m" echo -e "To relaunch \e[1mGNOME Wayland\e[m use: \e[92mgnome-wayland\e[m"
echo "LANG=C.UTF-8 MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session >/dev/tty7 2>&1" > /usr/bin/gnome-wayland echo "LANG=C.UTF-8 MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session >/dev/tty7 2>&1" > /usr/bin/gnome-wayland
chmod 755 /usr/bin/gnome-wayland chmod 755 /usr/bin/gnome-wayland

View file

@ -7,13 +7,13 @@ _install_gnome() {
} }
_start_gnome() { _start_gnome() {
echo -e "Launching \e[1mGNOME\e[0m now, logging is done on \e[1m/dev/tty8\e[0m..." echo -e "Launching \e[1mGNOME\e[m now, logging is done on \e[1m/dev/tty8\e[m..."
echo "export XDG_SESSION_TYPE=x11" > /root/.xinitrc echo "export XDG_SESSION_TYPE=x11" > /root/.xinitrc
#shellcheck disable=SC2129 #shellcheck disable=SC2129
echo "export GDK_BACKEND=x11" >> /root/.xinitrc echo "export GDK_BACKEND=x11" >> /root/.xinitrc
echo "export LANG=C.UTF-8" >> /root/.xinitrc echo "export LANG=C.UTF-8" >> /root/.xinitrc
echo "exec dbus-launch gnome-session" >> /root/.xinitrc echo "exec dbus-launch gnome-session" >> /root/.xinitrc
startx >/dev/tty8 2>&1 startx >/dev/tty8 2>&1
echo -e "To relaunch \e[1mGNOME\e[0m desktop use: \e[92mstartx\e[0m" echo -e "To relaunch \e[1mGNOME\e[m desktop use: \e[92mstartx\e[m"
} }
# vim: set ft=sh ts=4 sw=4 et: # vim: set ft=sh ts=4 sw=4 et:

View file

@ -7,8 +7,8 @@ _install_plasma_wayland() {
} }
_start_plasma_wayland() { _start_plasma_wayland() {
echo -e "Launching \e[1mKDE/Plasma Wayland\e[0m now, logging is done on \e[1m/dev/tty7\e[0m..." echo -e "Launching \e[1mKDE/Plasma Wayland\e[m now, logging is done on \e[1m/dev/tty7\e[m..."
echo -e "To relaunch \e[1mKDE/Plasma Wayland\e[0m use: \e[92mplasma-wayland\e[0m" echo -e "To relaunch \e[1mKDE/Plasma Wayland\e[m use: \e[92mplasma-wayland\e[m"
echo "exec dbus-run-session startplasma-wayland >/dev/tty7 2>&1" > /usr/bin/plasma-wayland echo "exec dbus-run-session startplasma-wayland >/dev/tty7 2>&1" > /usr/bin/plasma-wayland
chmod 755 /usr/bin/plasma-wayland chmod 755 /usr/bin/plasma-wayland
plasma-wayland plasma-wayland

View file

@ -7,10 +7,10 @@ _install_plasma() {
} }
_start_plasma() { _start_plasma() {
echo -e "Launching \e[1mKDE/Plasma\e[0m now, logging is done on \e[1m/dev/tty8\e[0m..." echo -e "Launching \e[1mKDE/Plasma\e[m now, logging is done on \e[1m/dev/tty8\e[m..."
echo "export DESKTOP_SESSION=plasma" > /root/.xinitrc echo "export DESKTOP_SESSION=plasma" > /root/.xinitrc
echo "exec startplasma-x11" >> /root/.xinitrc echo "exec startplasma-x11" >> /root/.xinitrc
startx >/dev/tty8 2>&1 startx >/dev/tty8 2>&1
echo -e "To relaunch \e[1mKDE/Plasma\e[0m desktop use: \e[92mstartx\e[0m" echo -e "To relaunch \e[1mKDE/Plasma\e[m desktop use: \e[92mstartx\e[m"
} }
# vim: set ft=sh ts=4 sw=4 et: # vim: set ft=sh ts=4 sw=4 et:

View file

@ -21,26 +21,26 @@ _ZRAM_SIZE=${_ZRAM_SIZE:-"3G"}
_graphic_options() { _graphic_options() {
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
echo -e " \e[1m-gnome\e[0m Launch Gnome desktop with VNC sharing enabled." echo -e " \e[1m-gnome\e[m Launch Gnome desktop with VNC sharing enabled."
echo -e " \e[1m-gnome-wayland\e[0m Launch Gnome desktop with Wayland backend." echo -e " \e[1m-gnome-wayland\e[m Launch Gnome desktop with Wayland backend."
echo -e " \e[1m-plasma\e[0m Launch KDE Plasma desktop with VNC sharing enabled." echo -e " \e[1m-plasma\e[m Launch KDE Plasma desktop with VNC sharing enabled."
echo -e " \e[1m-plasma-wayland\e[0m Launch KDE Plasma desktop with Wayland backend." echo -e " \e[1m-plasma-wayland\e[m Launch KDE Plasma desktop with Wayland backend."
fi fi
} }
usage () { usage () {
echo -e "\e[1mManage \e[36mArchboot\e[0m\e[1m - Arch Linux Environment:\e[0m" echo -e "\e[1mManage \e[36mArchboot\e[m\e[1m - Arch Linux Environment:\e[m"
echo -e "\e[1m-----------------------------------------\e[0m" echo -e "\e[1m-----------------------------------------\e[m"
echo -e " \e[1m-help\e[0m This message." echo -e " \e[1m-help\e[m This message."
if [[ ! -e "/var/cache/pacman/pkg/archboot.db" || -e "/usr/bin/setup" ]]; then if [[ ! -e "/var/cache/pacman/pkg/archboot.db" || -e "/usr/bin/setup" ]]; then
echo -e " \e[1m-update\e[0m Update scripts: setup, quickinst, tz, km and helpers." echo -e " \e[1m-update\e[m Update scripts: setup, quickinst, tz, km and helpers."
fi fi
# latest image # latest image
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2500000 && ! -e "/.full_system" && ! -e "/var/cache/pacman/pkg/archboot.db" ]]; then if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2500000 && ! -e "/.full_system" && ! -e "/var/cache/pacman/pkg/archboot.db" ]]; then
echo -e " \e[1m-full-system\e[0m Switch to full Arch Linux system." echo -e " \e[1m-full-system\e[m Switch to full Arch Linux system."
# local image # local image
elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2571000 && ! -e "/.full_system" && -e "/var/cache/pacman/pkg/archboot.db" && -e "/usr/bin/setup" ]]; then elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2571000 && ! -e "/.full_system" && -e "/var/cache/pacman/pkg/archboot.db" && -e "/usr/bin/setup" ]]; then
echo -e " \e[1m-full-system\e[0m Switch to full Arch Linux system." echo -e " \e[1m-full-system\e[m Switch to full Arch Linux system."
fi fi
echo -e "" echo -e ""
if [[ -e "/usr/bin/setup" ]]; then if [[ -e "/usr/bin/setup" ]]; then
@ -50,9 +50,9 @@ usage () {
_graphic_options _graphic_options
fi fi
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2500000 ]]; then if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2500000 ]]; then
echo -e " \e[1m-xfce\e[0m Launch XFCE desktop with VNC sharing enabled." echo -e " \e[1m-xfce\e[m Launch XFCE desktop with VNC sharing enabled."
echo -e " \e[1m-custom-xorg\e[0m Install custom X environment." echo -e " \e[1m-custom-xorg\e[m Install custom X environment."
[[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3400000 ]] && echo -e " \e[1m-custom-wayland\e[0m Install custom Wayland environment." [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3400000 ]] && echo -e " \e[1m-custom-wayland\e[m Install custom Wayland environment."
echo "" echo ""
fi fi
fi fi
@ -60,19 +60,19 @@ usage () {
if ! [[ -e "/var/cache/pacman/pkg/archboot.db" ]] || [[ -e "/var/cache/pacman/pkg/archboot.db" && ! -e "/usr/bin/setup" ]]; then if ! [[ -e "/var/cache/pacman/pkg/archboot.db" ]] || [[ -e "/var/cache/pacman/pkg/archboot.db" && ! -e "/usr/bin/setup" ]]; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 1970000 ]]; then if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 1970000 ]]; then
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
echo -e " \e[1m-latest\e[0m Launch latest archboot environment (using kexec)." echo -e " \e[1m-latest\e[m Launch latest archboot environment (using kexec)."
fi fi
fi fi
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2571000 ]]; then if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2571000 ]]; then
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
echo -e " \e[1m-latest-install\e[0m Launch latest archboot environment with" echo -e " \e[1m-latest-install\e[m Launch latest archboot environment with"
echo -e " package cache (using kexec)." echo -e " package cache (using kexec)."
fi fi
fi fi
fi fi
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 4616000 &&\ if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 4616000 &&\
-e /usr/bin/archboot-"${_RUNNING_ARCH}"-release.sh ]]; then -e /usr/bin/archboot-"${_RUNNING_ARCH}"-release.sh ]]; then
echo -e " \e[1m-latest-image\e[0m Generate latest image files in /archboot directory." echo -e " \e[1m-latest-image\e[m Generate latest image files in /archboot directory."
fi fi
exit 0 exit 0
} }
@ -92,13 +92,13 @@ _download_latest() {
# Download latest setup and quickinst script from git repository # Download latest setup and quickinst script from git repository
if [[ -n "${_D_SCRIPTS}" ]]; then if [[ -n "${_D_SCRIPTS}" ]]; then
_network_check _network_check
echo -e "\e[1mStart:\e[0m Downloading latest km, tz, quickinst, setup and helpers..." echo -e "\e[1mStart:\e[m Downloading latest km, tz, quickinst, setup and helpers..."
[[ -d "${_INST}" ]] || mkdir "${_INST}" [[ -d "${_INST}" ]] || mkdir "${_INST}"
# config # config
echo -e "\e[1mStep 1/4:\e[0m Downloading latest config..." echo -e "\e[1mStep 1/4:\e[m Downloading latest config..."
wget -q "${_SOURCE}${_ETC}/defaults?inline=false" -O "${_ETC}/defaults" wget -q "${_SOURCE}${_ETC}/defaults?inline=false" -O "${_ETC}/defaults"
# helper binaries # helper binaries
echo -e "\e[1mStep 2/4:\e[0m Downloading latest scripts..." echo -e "\e[1mStep 2/4:\e[m Downloading latest scripts..."
# main binaries # main binaries
BINS="quickinst setup km tz update-installer copy-mountpoint rsync-backup restore-usbstick" BINS="quickinst setup km tz update-installer copy-mountpoint rsync-backup restore-usbstick"
for i in ${BINS}; do for i in ${BINS}; do
@ -114,7 +114,7 @@ _download_latest() {
wget -q "${_SOURCE}${_HELP}/${i}?inline=false" -O "${_HELP}/${i}" wget -q "${_SOURCE}${_HELP}/${i}?inline=false" -O "${_HELP}/${i}"
done done
# main libs # main libs
echo -e "\e[1mStep 3/4:\e[0m Downloading latest script libs..." echo -e "\e[1mStep 3/4:\e[m Downloading latest script libs..."
LIBS="common.sh container.sh release.sh iso.sh login.sh" LIBS="common.sh container.sh release.sh iso.sh login.sh"
for i in ${LIBS}; do for i in ${LIBS}; do
wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}" wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}"
@ -130,20 +130,20 @@ _download_latest() {
wget -q "${_SOURCE}${_RUN}/${i}?inline=false" -O "${_RUN}/${i}" wget -q "${_SOURCE}${_RUN}/${i}?inline=false" -O "${_RUN}/${i}"
done done
# setup libs # setup libs
echo -e "\e[1mStep 4/4:\e[0m Downloading latest setup libs..." echo -e "\e[1mStep 4/4:\e[m Downloading latest setup libs..."
LIBS="autoconfiguration.sh autoprepare.sh base.sh blockdevices.sh bootloader.sh btrfs.sh common.sh \ LIBS="autoconfiguration.sh autoprepare.sh base.sh blockdevices.sh bootloader.sh btrfs.sh common.sh \
configuration.sh mountpoints.sh network.sh pacman.sh partition.sh storage.sh" configuration.sh mountpoints.sh network.sh pacman.sh partition.sh storage.sh"
for i in ${LIBS}; do for i in ${LIBS}; do
wget -q "${_SOURCE}${_INST}/${i}?inline=false" -O "${_INST}/${i}" wget -q "${_SOURCE}${_INST}/${i}?inline=false" -O "${_INST}/${i}"
done done
echo -e "\e[1mFinished:\e[0m Downloading scripts done." echo -e "\e[1mFinished:\e[m Downloading scripts done."
exit 0 exit 0
fi fi
} }
_network_check() { _network_check() {
if ! getent hosts www.google.com &>/dev/null; then if ! getent hosts www.google.com &>/dev/null; then
echo -e "\e[91mAborting:\e[0m" echo -e "\e[91mAborting:\e[m"
echo -e "Network not yet ready." echo -e "Network not yet ready."
echo -e "Please configure your network first." echo -e "Please configure your network first."
exit 1 exit 1
@ -152,7 +152,7 @@ _network_check() {
_update_installer_check() { _update_installer_check() {
if [[ -f /.update-installer ]]; then if [[ -f /.update-installer ]]; then
echo -e "\e[91mAborting:\e[0m" echo -e "\e[91mAborting:\e[m"
echo "update-installer is already running on other tty..." echo "update-installer is already running on other tty..."
echo "If you are absolutly sure it's not running, you need to remove /.update-installer" echo "If you are absolutly sure it's not running, you need to remove /.update-installer"
exit 1 exit 1
@ -207,14 +207,14 @@ _zram_w_dir() {
} }
_initialize_zram_usr() { _initialize_zram_usr() {
echo -e "\e[1mInitializing /usr.zram...\e[0m" echo -e "\e[1mInitializing /usr.zram...\e[m"
echo -e "\e[1mStep 1/2:\e[0m Waiting for gpg pacman keyring import to finish..." echo -e "\e[1mStep 1/2:\e[m Waiting for gpg pacman keyring import to finish..."
_gpg_check _gpg_check
if ! [[ -d /usr.zram ]]; then if ! [[ -d /usr.zram ]]; then
echo -e "\e[1mStep 2/2:\e[0m Moving /usr to /usr.zram..." echo -e "\e[1mStep 2/2:\e[m Moving /usr to /usr.zram..."
_zram_usr "${_ZRAM_SIZE}" _zram_usr "${_ZRAM_SIZE}"
else else
echo -e "\e[1mStep 2/2:\e[0m Moving /usr to /usr.zram already done..." echo -e "\e[1mStep 2/2:\e[m Moving /usr to /usr.zram already done..."
fi fi
} }
@ -316,10 +316,10 @@ _create_initramfs() {
_kexec() { _kexec() {
# you need approx. 3.39x size for KEXEC_FILE_LOAD # you need approx. 3.39x size for KEXEC_FILE_LOAD
if [[ "$(($(stat -c %s /initrd.img)*339/100000))" -lt "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" ]]; then if [[ "$(($(stat -c %s /initrd.img)*339/100000))" -lt "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" ]]; then
echo -e "Running \e[1m\e[92mkexec\e[0m with \e[1mnew\e[0m KEXEC_FILE_LOAD..." echo -e "Running \e[1m\e[92mkexec\e[m with \e[1mnew\e[m KEXEC_FILE_LOAD..."
kexec -s -f /"${VMLINUZ}" --initrd="/initrd.img" --reuse-cmdline & kexec -s -f /"${VMLINUZ}" --initrd="/initrd.img" --reuse-cmdline &
else else
echo -e "Running \e[1m\e[92mkexec\e[0m with \e[1mold\e[0m KEXEC_LOAD..." echo -e "Running \e[1m\e[92mkexec\e[m with \e[1mold\e[m KEXEC_LOAD..."
kexec -c -f --mem-max=0xA0000000 /"${VMLINUZ}" --initrd="/initrd.img" --reuse-cmdline & kexec -c -f --mem-max=0xA0000000 /"${VMLINUZ}" --initrd="/initrd.img" --reuse-cmdline &
fi fi
sleep 2 sleep 2
@ -418,41 +418,41 @@ _new_environment() {
touch /.update-installer touch /.update-installer
_umount_w_dir _umount_w_dir
_zram_w_dir "${_ZRAM_SIZE}" _zram_w_dir "${_ZRAM_SIZE}"
echo -e "\e[1mStep 1/9:\e[0m Waiting for gpg pacman keyring import to finish..." echo -e "\e[1mStep 1/9:\e[m Waiting for gpg pacman keyring import to finish..."
_gpg_check _gpg_check
echo -e "\e[1mStep 2/9:\e[0m Removing not necessary files from /..." echo -e "\e[1mStep 2/9:\e[m Removing not necessary files from /..."
_clean_archboot _clean_archboot
_zram_usr "300M" _zram_usr "300M"
_clean_kernel_cache _clean_kernel_cache
echo -e "\e[1mStep 3/9:\e[0m Generating archboot container in ${_W_DIR}..." echo -e "\e[1mStep 3/9:\e[m Generating archboot container in ${_W_DIR}..."
echo " This will need some time..." echo " This will need some time..."
_create_container || exit 1 _create_container || exit 1
# 10 seconds for getting free RAM # 10 seconds for getting free RAM
_clean_kernel_cache _clean_kernel_cache
sleep 10 sleep 10
echo -e "\e[1mStep 4/9:\e[0m Copying kernel ${VMLINUZ} to /${VMLINUZ}..." echo -e "\e[1mStep 4/9:\e[m Copying kernel ${VMLINUZ} to /${VMLINUZ}..."
cp "${_W_DIR}/boot/${VMLINUZ}" / || exit 1 cp "${_W_DIR}/boot/${VMLINUZ}" / || exit 1
[[ ${_RUNNING_ARCH} == "x86_64" ]] && _kver_x86 [[ ${_RUNNING_ARCH} == "x86_64" ]] && _kver_x86
[[ ${_RUNNING_ARCH} == "aarch64" || ${_RUNNING_ARCH} == "riscv64" ]] && _kver_generic [[ ${_RUNNING_ARCH} == "aarch64" || ${_RUNNING_ARCH} == "riscv64" ]] && _kver_generic
echo -e "\e[1mStep 5/9:\e[0m Collecting initramfs files in ${_W_DIR}..." echo -e "\e[1mStep 5/9:\e[m Collecting initramfs files in ${_W_DIR}..."
echo " This will need some time..." echo " This will need some time..."
# write initramfs to "${_W_DIR}"/tmp # write initramfs to "${_W_DIR}"/tmp
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount tmp;mkinitcpio -k ${_HWKVER} -c ${_CONFIG} -d /tmp" >/dev/tty7 2>&1 || exit 1 ${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount tmp;mkinitcpio -k ${_HWKVER} -c ${_CONFIG} -d /tmp" >/dev/tty7 2>&1 || exit 1
echo -e "\e[1mStep 6/9:\e[0m Cleanup ${_W_DIR}..." echo -e "\e[1mStep 6/9:\e[m Cleanup ${_W_DIR}..."
find "${_W_DIR}"/. -mindepth 1 -maxdepth 1 ! -name 'tmp' ! -name "${VMLINUZ}" -exec rm -rf {} \; find "${_W_DIR}"/. -mindepth 1 -maxdepth 1 ! -name 'tmp' ! -name "${VMLINUZ}" -exec rm -rf {} \;
# 10 seconds for getting free RAM # 10 seconds for getting free RAM
_clean_kernel_cache _clean_kernel_cache
sleep 10 sleep 10
echo -e "\e[1mStep 7/9:\e[0m Creating initramfs /initrd.img..." echo -e "\e[1mStep 7/9:\e[m Creating initramfs /initrd.img..."
echo " This will need some time..." echo " This will need some time..."
_create_initramfs _create_initramfs
echo -e "\e[1mStep 8/9:\e[0m Cleanup ${_W_DIR}..." echo -e "\e[1mStep 8/9:\e[m Cleanup ${_W_DIR}..."
cd / cd /
_umount_w_dir _umount_w_dir
_clean_kernel_cache _clean_kernel_cache
# unload virtio-net to avoid none functional network device on aarch64 # unload virtio-net to avoid none functional network device on aarch64
grep -qw virtio_net /proc/modules && rmmod virtio_net grep -qw virtio_net /proc/modules && rmmod virtio_net
echo -e "\e[1mStep 9/9:\e[0m Loading files through kexec into kernel now..." echo -e "\e[1mStep 9/9:\e[m Loading files through kexec into kernel now..."
echo " This will need some time..." echo " This will need some time..."
_kexec _kexec
} }
@ -462,16 +462,16 @@ _kernel_check() {
_INSTALLED_KERNEL="$(${_PATH}/pacman -Qi linux | ${_PATH}/grep Version | ${_PATH}/cut -d ':' -f 2 | ${_PATH}/sed -e 's# ##g' -e 's#\.arch#-arch#g')" _INSTALLED_KERNEL="$(${_PATH}/pacman -Qi linux | ${_PATH}/grep Version | ${_PATH}/cut -d ':' -f 2 | ${_PATH}/sed -e 's# ##g' -e 's#\.arch#-arch#g')"
_RUNNING_KERNEL="$(${_PATH}/uname -r)" _RUNNING_KERNEL="$(${_PATH}/uname -r)"
if ! [[ "${_INSTALLED_KERNEL}" == "${_RUNNING_KERNEL}" ]]; then if ! [[ "${_INSTALLED_KERNEL}" == "${_RUNNING_KERNEL}" ]]; then
echo -e "\e[93mWarning:\e[0m" echo -e "\e[93mWarning:\e[m"
echo -e "Installed kernel does \e[1mnot\e[0m match running kernel!" echo -e "Installed kernel does \e[1mnot\e[m match running kernel!"
echo -e "Kernel module loading will \e[1mnot\e[0m work." echo -e "Kernel module loading will \e[1mnot\e[m work."
echo -e "Use \e[1m--latest\e[0m options to get a matching kernel first." echo -e "Use \e[1m--latest\e[m options to get a matching kernel first."
fi fi
} }
_full_system() { _full_system() {
if [[ -e "/.full_system" ]]; then if [[ -e "/.full_system" ]]; then
echo -e "\e[1m\e[1mFull Arch Linux system already setup.\e[0m" echo -e "\e[1m\e[1mFull Arch Linux system already setup.\e[m"
exit 0 exit 0
fi fi
# higher _ZRAM_SIZE is needed for plasma environment 200MB safety buffer # higher _ZRAM_SIZE is needed for plasma environment 200MB safety buffer
@ -481,44 +481,44 @@ _full_system() {
_ZRAM_SIZE="4000M" _ZRAM_SIZE="4000M"
fi fi
_initialize_zram_usr _initialize_zram_usr
echo -e "\e[1mInitializing full Arch Linux system...\e[0m" echo -e "\e[1mInitializing full Arch Linux system...\e[m"
echo -e "\e[1mStep 1/3:\e[0m Reinstalling packages and adding info/man-pages..." echo -e "\e[1mStep 1/3:\e[m Reinstalling packages and adding info/man-pages..."
echo " This will need some time..." echo " This will need some time..."
pacman -Sy >/dev/tty7 2>&1 || exit 1 pacman -Sy >/dev/tty7 2>&1 || exit 1
pacman -Qqn | pacman -S --noconfirm man-db man-pages texinfo - >/dev/tty7 2>&1 || exit 1 pacman -Qqn | pacman -S --noconfirm man-db man-pages texinfo - >/dev/tty7 2>&1 || exit 1
echo -e "\e[1mStep 2/3:\e[0m Checking /home and /root are tmpfs..." echo -e "\e[1mStep 2/3:\e[m Checking /home and /root are tmpfs..."
_home_root_mount _home_root_mount
echo -e "\e[1mStep 3/3:\e[0m Checking kernel version..." echo -e "\e[1mStep 3/3:\e[m Checking kernel version..."
_kernel_check _kernel_check
echo -e "\e[1mFull Arch Linux system is ready now.\e[0m" echo -e "\e[1mFull Arch Linux system is ready now.\e[m"
touch /.full_system touch /.full_system
} }
_new_image() { _new_image() {
_zram_w_dir "4000M" _zram_w_dir "4000M"
echo -e "\e[1mStep 1/2:\e[0m Removing not necessary files from /..." echo -e "\e[1mStep 1/2:\e[m Removing not necessary files from /..."
_clean_archboot _clean_archboot
rm /var/cache/pacman/pkg/* rm /var/cache/pacman/pkg/*
_zram_usr "300M" _zram_usr "300M"
echo -e "\e[1mStep 2/2:\e[0m Generating new iso files in ${_W_DIR} now..." echo -e "\e[1mStep 2/2:\e[m Generating new iso files in ${_W_DIR} now..."
echo " This will need some time..." echo " This will need some time..."
"archboot-${_RUNNING_ARCH}-release.sh" "${_W_DIR}" >/dev/tty7 2>&1 || exit 1 "archboot-${_RUNNING_ARCH}-release.sh" "${_W_DIR}" >/dev/tty7 2>&1 || exit 1
echo -e "\e[1mFinished:\e[0m New isofiles are located in ${_W_DIR}" echo -e "\e[1mFinished:\e[m New isofiles are located in ${_W_DIR}"
} }
_install_graphic () { _install_graphic () {
_initialize_zram_usr _initialize_zram_usr
[[ -e /var/cache/pacman/pkg/archboot.db ]] && touch /.graphic_installed [[ -e /var/cache/pacman/pkg/archboot.db ]] && touch /.graphic_installed
echo -e "\e[1mInitializing desktop environment...\e[0m" echo -e "\e[1mInitializing desktop environment...\e[m"
[[ -n "${_L_XFCE}" ]] && _install_xfce [[ -n "${_L_XFCE}" ]] && _install_xfce
[[ -n "${_L_GNOME}" ]] && _install_gnome [[ -n "${_L_GNOME}" ]] && _install_gnome
[[ -n "${_L_GNOME_WAYLAND}" ]] && _install_gnome_wayland [[ -n "${_L_GNOME_WAYLAND}" ]] && _install_gnome_wayland
[[ -n "${_L_PLASMA}" ]] && _install_plasma [[ -n "${_L_PLASMA}" ]] && _install_plasma
[[ -n "${_L_PLASMA_WAYLAND}" ]] && _install_plasma_wayland [[ -n "${_L_PLASMA_WAYLAND}" ]] && _install_plasma_wayland
echo -e "\e[1mStep 3/4:\e[0m Starting avahi..." echo -e "\e[1mStep 3/4:\e[m Starting avahi..."
systemctl restart avahi-daemon systemctl restart avahi-daemon
# only start vnc on xorg environment # only start vnc on xorg environment
echo -e "\e[1mStep 4/4:\e[0m Setting up VNC and browser...\e[0m" echo -e "\e[1mStep 4/4:\e[m Setting up VNC and browser...\e[m"
[[ -n "${_L_XFCE}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}" ]] && _autostart_vnc [[ -n "${_L_XFCE}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}" ]] && _autostart_vnc
command -v firefox &>/dev/null && _firefox_flags command -v firefox &>/dev/null && _firefox_flags
command -v chromium &>/dev/null && _chromium_flags command -v chromium &>/dev/null && _chromium_flags
@ -530,34 +530,34 @@ _install_graphic () {
} }
_hint_graphic_installed () { _hint_graphic_installed () {
echo -e "\e[1m\e[91mError: Graphical environment already installed...\e[0m" echo -e "\e[1m\e[91mError: Graphical environment already installed...\e[m"
echo -e "You are running in \e[1mLocal mode\e[0m with less than \e[1m4500 MB RAM\e[0m, which only can launch \e[1mone\e[0m environment." echo -e "You are running in \e[1mLocal mode\e[m with less than \e[1m4500 MB RAM\e[m, which only can launch \e[1mone\e[m environment."
echo -e "Please relaunch your already used graphical environment from commandline." echo -e "Please relaunch your already used graphical environment from commandline."
} }
_prepare_gnome() { _prepare_gnome() {
if ! [[ -e /usr/bin/gnome-session ]]; then if ! [[ -e /usr/bin/gnome-session ]]; then
echo -e "\e[1mStep 1/4:\e[0m Installing GNOME desktop now..." echo -e "\e[1mStep 1/4:\e[m Installing GNOME desktop now..."
echo " This will need some time..." echo " This will need some time..."
_prepare_graphic "${_PACKAGES}" >/dev/tty7 2>&1 _prepare_graphic "${_PACKAGES}" >/dev/tty7 2>&1
echo -e "\e[1mStep 2/4:\e[0m Configuring GNOME desktop..." echo -e "\e[1mStep 2/4:\e[m Configuring GNOME desktop..."
_configure_gnome >/dev/tty7 2>&1 _configure_gnome >/dev/tty7 2>&1
else else
echo -e "\e[1mStep 1/4:\e[0m Installing GNOME desktop already done..." echo -e "\e[1mStep 1/4:\e[m Installing GNOME desktop already done..."
echo -e "\e[1mStep 2/4:\e[0m Configuring GNOME desktop already done..." echo -e "\e[1mStep 2/4:\e[m Configuring GNOME desktop already done..."
fi fi
} }
_prepare_plasma() { _prepare_plasma() {
if ! [[ -e /usr/bin/startplasma-x11 ]]; then if ! [[ -e /usr/bin/startplasma-x11 ]]; then
echo -e "\e[1mStep 1/4:\e[0m Installing KDE/Plasma desktop now..." echo -e "\e[1mStep 1/4:\e[m Installing KDE/Plasma desktop now..."
echo " This will need some time..." echo " This will need some time..."
_prepare_graphic "${_PACKAGES}" >/dev/tty7 2>&1 _prepare_graphic "${_PACKAGES}" >/dev/tty7 2>&1
echo -e "\e[1mStep 2/4:\e[0m Configuring KDE desktop..." echo -e "\e[1mStep 2/4:\e[m Configuring KDE desktop..."
_configure_plasma >/dev/tty7 2>&1 _configure_plasma >/dev/tty7 2>&1
else else
echo -e "\e[1mStep 1/4:\e[0m Installing KDE/Plasma desktop already done..." echo -e "\e[1mStep 1/4:\e[m Installing KDE/Plasma desktop already done..."
echo -e "\e[1mStep 2/4:\e[0m Configuring KDE desktop already done..." echo -e "\e[1mStep 2/4:\e[m Configuring KDE desktop already done..."
fi fi
} }
@ -646,18 +646,18 @@ EOF
_custom_wayland_xorg() { _custom_wayland_xorg() {
_initialize_zram_usr _initialize_zram_usr
if [[ -n "${_CUSTOM_WAYLAND}" ]]; then if [[ -n "${_CUSTOM_WAYLAND}" ]]; then
echo -e "\e[1mStep 1/3:\e[0m Installing custom wayland..." echo -e "\e[1mStep 1/3:\e[m Installing custom wayland..."
echo " This will need some time..." echo " This will need some time..."
_prepare_graphic "${_WAYLAND_PACKAGE} ${_CUSTOM_WAYLAND}" > /dev/tty7 2>&1 _prepare_graphic "${_WAYLAND_PACKAGE} ${_CUSTOM_WAYLAND}" > /dev/tty7 2>&1
fi fi
if [[ -n "${_CUSTOM_X}" ]]; then if [[ -n "${_CUSTOM_X}" ]]; then
echo -e "\e[1mStep 1/3:\e[0m Installing custom xorg..." echo -e "\e[1mStep 1/3:\e[m Installing custom xorg..."
echo " This will need some time..." echo " This will need some time..."
_prepare_graphic "${_XORG_PACKAGE} ${_CUSTOM_XORG}" > /dev/tty7 2>&1 _prepare_graphic "${_XORG_PACKAGE} ${_CUSTOM_XORG}" > /dev/tty7 2>&1
fi fi
echo -e "\e[1mStep 2/3:\e[0m Starting avahi-daemon..." echo -e "\e[1mStep 2/3:\e[m Starting avahi-daemon..."
systemctl start avahi-daemon.service systemctl start avahi-daemon.service
echo -e "\e[1mStep 3/3:\e[0m Setting up browser...\e[0m" echo -e "\e[1mStep 3/3:\e[m Setting up browser...\e[m"
which firefox &>/dev/null && _firefox_flags which firefox &>/dev/null && _firefox_flags
which chromium &>/dev/null && _chromium_flags which chromium &>/dev/null && _chromium_flags
} }

View file

@ -3,14 +3,14 @@
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
_install_xfce() { _install_xfce() {
if ! [[ -e /usr/bin/startxfce4 ]]; then if ! [[ -e /usr/bin/startxfce4 ]]; then
echo -e "\e[1mStep 1/4:\e[0m Installing XFCE desktop now..." echo -e "\e[1mStep 1/4:\e[m Installing XFCE desktop now..."
echo " This will need some time..." echo " This will need some time..."
_prepare_graphic "${_XORG_PACKAGE} ${_VNC_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_XFCE_PACKAGES}" >/dev/tty7 2>&1 _prepare_graphic "${_XORG_PACKAGE} ${_VNC_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_XFCE_PACKAGES}" >/dev/tty7 2>&1
echo -e "\e[1mStep 2/4:\e[0m Configuring XFCE desktop..." echo -e "\e[1mStep 2/4:\e[m Configuring XFCE desktop..."
_configure_xfce >/dev/tty7 2>&1 _configure_xfce >/dev/tty7 2>&1
else else
echo -e "\e[1mStep 1/4:\e[0m Installing XFCE desktop already done..." echo -e "\e[1mStep 1/4:\e[m Installing XFCE desktop already done..."
echo -e "\e[1mStep 2/4:\e[0m Configuring XFCE desktop already done..." echo -e "\e[1mStep 2/4:\e[m Configuring XFCE desktop already done..."
fi fi
} }
@ -251,8 +251,8 @@ EOF
} }
_start_xfce() { _start_xfce() {
echo -e "Launching \e[1mXFCE\e[0m now, logging is done on \e[1m/dev/tty8\e[0m..." echo -e "Launching \e[1mXFCE\e[m now, logging is done on \e[1m/dev/tty8\e[m..."
startxfce4 >/dev/tty8 2>&1 startxfce4 >/dev/tty8 2>&1
echo -e "To relaunch \e[1mXFCE\e[0m desktop use: \e[92mstartxfce4\e[0m" echo -e "To relaunch \e[1mXFCE\e[m desktop use: \e[92mstartxfce4\e[m"
} }
# vim: set ft=sh ts=4 sw=4 et: # vim: set ft=sh ts=4 sw=4 et:

View file

@ -6,38 +6,38 @@ build ()
{ {
### generate motd ### generate motd
MOTD=$(mktemp /var/tmp/motd.XXXX) MOTD=$(mktemp /var/tmp/motd.XXXX)
[[ "$(uname -m)" == "x86_64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[0m\e[1m - Arch Linux X86_64\e[0m" >> "${MOTD}" [[ "$(uname -m)" == "x86_64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux X86_64\e[m" >> "${MOTD}"
[[ "$(uname -m)" == "aarch64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[0m\e[1m - Arch Linux AARCH64\e[0m" >> "${MOTD}" [[ "$(uname -m)" == "aarch64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux AARCH64\e[m" >> "${MOTD}"
[[ "$(uname -m)" == "riscv64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[0m\e[1m - Arch Linux RISCV64\e[0m" >> "${MOTD}" [[ "$(uname -m)" == "riscv64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux RISCV64\e[m" >> "${MOTD}"
#shellcheck disable=SC2129 #shellcheck disable=SC2129
echo -e "\e[1m----------------------------------------\e[0m" >> "${MOTD}" echo -e "\e[1m----------------------------------------\e[m" >> "${MOTD}"
echo -e "\e[1mConsoles:\e[0m" >> "${MOTD}" echo -e "\e[1mConsoles:\e[m" >> "${MOTD}"
echo -e " - Virtual consoles \e[1m1-6\e[0m are active." >> "${MOTD}" echo -e " - Virtual consoles \e[1m1-6\e[m are active." >> "${MOTD}"
echo -e " - To change virtual console use \e[1m\e[92mALT + F(1-6)\e[0m" >> "${MOTD}" echo -e " - To change virtual console use \e[1m\e[92mALT + F(1-6)\e[m" >> "${MOTD}"
if echo "${HOOKS[@]}" | grep -qw archboot_keymap ; then if echo "${HOOKS[@]}" | grep -qw archboot_keymap ; then
echo -e "\e[1mChange keymap and console font:\e[0m" >> "${MOTD}" echo -e "\e[1mChange keymap and console font:\e[m" >> "${MOTD}"
echo -e " - To change to a non-US keymap, type \e[1m\e[92m'km'\e[0m at the console." >> "${MOTD}" echo -e " - To change to a non-US keymap, type \e[1m\e[92m'km'\e[m at the console." >> "${MOTD}"
fi fi
if echo "${HOOKS[@]}" | grep -qw archboot_tz; then if echo "${HOOKS[@]}" | grep -qw archboot_tz; then
echo -e "\e[1mChange time and date:\e[0m" >> "${MOTD}" echo -e "\e[1mChange time and date:\e[m" >> "${MOTD}"
echo -e " - To change your time and date, type \e[1m\e[92m'tz'\e[0m at the console." >> "${MOTD}" echo -e " - To change your time and date, type \e[1m\e[92m'tz'\e[m at the console." >> "${MOTD}"
fi fi
if echo "${HOOKS[@]}" | grep -qw archboot_net; then if echo "${HOOKS[@]}" | grep -qw archboot_net; then
#shellcheck disable=SC2129 #shellcheck disable=SC2129
echo -e "\e[1mFor wifi authentification to internet access or further online help:\e[0m" >> "${MOTD}" echo -e "\e[1mFor wifi authentification to internet access or further online help:\e[m" >> "${MOTD}"
echo -e " - Use the \e[1m\e[92m'elinks'\e[0m text mode browser." >> "${MOTD}" echo -e " - Use the \e[1m\e[92m'elinks'\e[m text mode browser." >> "${MOTD}"
echo -e "\e[1mFor getting support on IRC channels:\e[0m" >> "${MOTD}" echo -e "\e[1mFor getting support on IRC channels:\e[m" >> "${MOTD}"
echo -e " - Use the \e[1m\e[92m'weechat'\e[0m IRC client." >> "${MOTD}" echo -e " - Use the \e[1m\e[92m'weechat'\e[m IRC client." >> "${MOTD}"
fi fi
if echo "${HOOKS[@]}" | grep -qw archboot_installer; then if echo "${HOOKS[@]}" | grep -qw archboot_installer; then
echo -e "\e[1mManage Archboot Environment:\e[0m" >> "${MOTD}" echo -e "\e[1mManage Archboot Environment:\e[m" >> "${MOTD}"
echo -e " - Run \e[1m\e[92m'update-installer'\e[0m to manage the Archboot Environment." >> "${MOTD}" echo -e " - Run \e[1m\e[92m'update-installer'\e[m to manage the Archboot Environment." >> "${MOTD}"
#shellcheck disable=SC2129 #shellcheck disable=SC2129
echo -e "\e[1mInstallation:\e[0m" >> "${MOTD}" echo -e "\e[1mInstallation:\e[m" >> "${MOTD}"
echo -e " - On first login \e[92m'setup'\e[0m is launched automatically." >> "${MOTD}" echo -e " - On first login \e[92m'setup'\e[m is launched automatically." >> "${MOTD}"
echo -e " - Rerun \e[1m\e[92m'setup'\e[0m to continue installation." >> "${MOTD}" echo -e " - Rerun \e[1m\e[92m'setup'\e[m to continue installation." >> "${MOTD}"
echo -e "\e[1mFor Experts:\e[0m" >> "${MOTD}" echo -e "\e[1mFor Experts:\e[m" >> "${MOTD}"
echo -e " - Use \e[1m\e[92m'quickinst'\e[0m to install and bypass the setup routine." >> "${MOTD}" echo -e " - Use \e[1m\e[92m'quickinst'\e[m to install and bypass the setup routine." >> "${MOTD}"
fi fi
chmod 644 "${MOTD}" chmod 644 "${MOTD}"
add_file "${MOTD}" "/etc/motd" add_file "${MOTD}" "/etc/motd"