Change rsync command

This commit is contained in:
natemaia 2018-08-25 22:39:58 -07:00
parent 1fb3167454
commit b21247ae85

View File

@ -14,7 +14,7 @@
# immutable variables { # immutable variables {
readonly DIST="Archlabs" # Linux distributor readonly DIST="Archlabs" # Linux distributor
readonly VER="1.6.47" # Installer version readonly VER="1.6.48" # Installer version
readonly LIVE="liveuser" # Live session user readonly LIVE="liveuser" # Live session user
readonly TRN="/usr/share/archlabs-installer" # Translation path readonly TRN="/usr/share/archlabs-installer" # Translation path
readonly MNT="/mnt/install" # Install mountpoint readonly MNT="/mnt/install" # Install mountpoint
@ -1012,11 +1012,9 @@ setup_boot_device() {
BOOT_PART_NUM="${BOOT_PART: -1}" BOOT_PART_NUM="${BOOT_PART: -1}"
# setup the needed partition flags for boot on both system types # setup the needed partition flags for boot on both system types
parted -s $BOOT_DEVICE set $BOOT_PART_NUM boot on 2>$ERR parted -s $BOOT_DEVICE set $BOOT_PART_NUM boot on >/dev/null 2>&1
check_for_errors "parted -s $BOOT_DEVICE set $BOOT_PART_NUM boot on"
if [[ $SYS == 'UEFI' ]]; then if [[ $SYS == 'UEFI' ]]; then
parted -s $BOOT_DEVICE set $BOOT_PART_NUM esp on 2>$ERR parted -s $BOOT_DEVICE set $BOOT_PART_NUM esp on >/dev/null 2>&1
check_for_errors "parted -s $BOOT_DEVICE set $BOOT_PART_NUM boot on"
fi fi
return 0 return 0
@ -1735,7 +1733,7 @@ install_base() {
# unpack the main system # unpack the main system
tput cnorm tput cnorm
clear && echo -e "\nUnpacking base filesystem..\n\n" clear && echo -e "\nUnpacking base filesystem..\n\n"
rsync -avh --info=progress2 /run/archiso/sfs/airootfs/ $MNT/ rsync -ah --info=progress2 /run/archiso/sfs/airootfs/ $MNT/
# remove archiso init files # remove archiso init files
find $MNT/usr/lib/initcpio -name 'archiso*' -type f -exec rm '{}' \; find $MNT/usr/lib/initcpio -name 'archiso*' -type f -exec rm '{}' \;
@ -1884,7 +1882,8 @@ setup_lightdm() {
# #
# autologin-user=$USER # autologin-user=$USER
chroot_cmd 'systemctl enable lightdm.service && systemctl set-default graphical.target' >/dev/null 2>&1 echo -e "\nSetting up lightdm..\n"
chroot_cmd 'systemctl enable lightdm.service && systemctl set-default graphical.target'
local cfg="$MNT/etc/lightdm/lightdm-gtk-greeter.conf" local cfg="$MNT/etc/lightdm/lightdm-gtk-greeter.conf"
sed -i '/#background=/ c background=/usr/share/backgrounds/archlabs/archlabs.jpg' $cfg sed -i '/#background=/ c background=/usr/share/backgrounds/archlabs/archlabs.jpg' $cfg
@ -1895,10 +1894,11 @@ setup_lightdm() {
sed -i '/\[greeter]/ a default-user-image=/usr/share/icons/ArchLabs-Dark/64x64/places/distributor-logo-archlabs.png' $cfg sed -i '/\[greeter]/ a default-user-image=/usr/share/icons/ArchLabs-Dark/64x64/places/distributor-logo-archlabs.png' $cfg
sed -i '/\[greeter]/ a active-monitor=0' $cfg sed -i '/\[greeter]/ a active-monitor=0' $cfg
rm -rf $MNT/etc/systemd/system/getty@tty1.service.d >/dev/null 2>&1 rm -rf $MNT/etc/systemd/system/getty@tty1.service.d
if [[ $AUTOLOGIN == true ]]; then if [[ $AUTOLOGIN == true ]]; then
chroot_cmd 'groupadd -r nopasswdlogin' >/dev/null 2>&1 echo -e "\nSetting up autologin..\n"
chroot_cmd 'groupadd -r nopasswdlogin'
sed -i '/#%PAM-1.0/ a auth sufficient pam_succeed_if.so user ingroup nopasswdlogin' $MNT/etc/pam.d/lightdm sed -i '/#%PAM-1.0/ a auth sufficient pam_succeed_if.so user ingroup nopasswdlogin' $MNT/etc/pam.d/lightdm
sed -i "/#autologin-session=/ c autologin-session=${LOGIN_WM}" $MNT/etc/lightdm/lightdm.conf sed -i "/#autologin-session=/ c autologin-session=${LOGIN_WM}" $MNT/etc/lightdm/lightdm.conf
sed -i "/#autologin-user=/ c autologin-user=${NEWUSER}" $MNT/etc/lightdm/lightdm.conf sed -i "/#autologin-user=/ c autologin-user=${NEWUSER}" $MNT/etc/lightdm/lightdm.conf
@ -1906,16 +1906,13 @@ setup_lightdm() {
} }
create_user() { create_user() {
infobox "$_ConfRoot" "\nSetting root password\n" 1 echo -e "\nSetting root password\n"
chroot_cmd "echo 'root:$ROOT_PASS' | chpasswd" 2>$ERR chroot_cmd "echo 'root:$ROOT_PASS' | chpasswd"
check_for_errors "chpasswd root"
infobox "$_ConfUser" "$_UserSetBody" 1 echo -e "$_UserSetBody"
swap_livuser swap_livuser
chroot_cmd "echo '$NEWUSER:$USER_PASS' | chpasswd" 2>$ERR chroot_cmd "echo '$NEWUSER:$USER_PASS' | chpasswd"
check_for_errors "chpasswd $NEWUSER" chroot_cmd "chown -Rf $NEWUSER:users /home/$NEWUSER"
chroot_cmd "chown -Rf $NEWUSER:users /home/$NEWUSER" 2>$ERR
check_for_errors "chown -Rf $NEWUSER:users /home/$NEWUSER"
setup_user_home setup_user_home
return 0 return 0
@ -1937,9 +1934,7 @@ swap_livuser() {
fi fi
chroot_cmd "mv -f /home/$LIVE /home/$NEWUSER" 2>$ERR chroot_cmd "mv -f /home/$LIVE /home/$NEWUSER" 2>$ERR
check_for_errors "mv -f /home/$LIVE /home/$NEWUSER"
chroot_cmd "usermod -aG $groups $NEWUSER" 2>$ERR chroot_cmd "usermod -aG $groups $NEWUSER" 2>$ERR
check_for_errors "usermod -aG $groups $NEWUSER"
return 0 return 0
} }
@ -1972,13 +1967,14 @@ setup_user_home() {
elif ! [[ $INSTALL_WMS =~ i3-gaps ]]; then elif ! [[ $INSTALL_WMS =~ i3-gaps ]]; then
rm -rf $user_home/.config/i3 rm -rf $user_home/.config/i3
fi fi
return 0 return 0
} }
update_mirrorlist() { update_mirrorlist() {
echo -e "\nSorting the mirrorlist..\n\n" echo -e "\nSorting the mirrorlist..\n"
$MIRROR_CMD --verbose --save $MNT/etc/pacman.d/mirrorlist && return 0 $MIRROR_CMD --verbose --save $MNT/etc/pacman.d/mirrorlist && return 0
infobox "$_ErrTitle" "\nAn error occurred while updating the mirrorlist.\n\nFalling back to automatic sorting...\n" echo -e "\nAn error occurred while updating the mirrorlist.\n\nFalling back to automatic sorting...\n"
reflector --score 100 -l 50 -f 10 --sort rate --verbose --save $MNT/etc/pacman.d/mirrorlist reflector --score 100 -l 50 -f 10 --sort rate --verbose --save $MNT/etc/pacman.d/mirrorlist
return 0 return 0
} }
@ -2075,7 +2071,6 @@ When = PostTransaction
Exec = /usr/bin/bootctl --path=${BOOT_MNTS[UEFI-systemd-boot]} update Exec = /usr/bin/bootctl --path=${BOOT_MNTS[UEFI-systemd-boot]} update
EOF EOF
fi fi
return 0 return 0
} }
@ -2136,22 +2131,17 @@ install_bootloader() {
prep_for_bootloader prep_for_bootloader
# needed for os-prober module to work properly in the chroot
mkdir -p $MNT/run/udev && mount --rbind /run/udev $MNT/run/udev >/dev/null 2>&1
# BOOT_CMDS[grub]="mount --rbind /run/udev /run/udev ; ${BOOT_CMDS[grub]}"
# create the bootloader config(s) # create the bootloader config(s)
bootloader_config bootloader_config
# run the bootloader command # run the bootloader command
chroot_cmd "${BOOT_CMDS[$BOOTLOADER]}" 2>$ERR >/dev/null 2>&1 chroot_cmd "${BOOT_CMDS[$BOOTLOADER]}" 2>$ERR
check_for_errors "${BOOT_CMDS[$BOOTLOADER]}" check_for_errors "${BOOT_CMDS[$BOOTLOADER]}"
# copy bootloader efi stub to generic catch all # copy bootloader efi stub to generic catch all
local boot_dir local boot_dir
[[ $BOOTLOADER == 'syslinux' ]] && boot_dir="syslinux" || boot_dir="$DIST" [[ $BOOTLOADER == 'syslinux' ]] && boot_dir="syslinux" || boot_dir="$DIST"
[[ $SYS == 'UEFI' && $BOOTLOADER =~ (grub|syslinux) ]] && uefi_bootloader_fallback "$boot_dir" [[ $SYS == 'UEFI' && $BOOTLOADER =~ (grub|syslinux) ]] && uefi_bootloader_fallback "$boot_dir"
return 0 return 0
} }