Fix: broken redirection
This commit is contained in:
parent
f51ab5171a
commit
aa00f0e206
@ -8,7 +8,7 @@
|
||||
# check for syntax errors
|
||||
# set -n
|
||||
|
||||
VER=2.0.93
|
||||
VER=2.0.94
|
||||
|
||||
# default values {
|
||||
|
||||
@ -1149,7 +1149,7 @@ install_main()
|
||||
errshow 1 "genfstab -U $MNT > $MNT/etc/fstab"
|
||||
[[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" "$MNT/etc/fstab"
|
||||
install_packages
|
||||
# video driver tearfree configs, MUST be done after package install to support nvidia
|
||||
# tear free configs, MUST be done after package install for nvidia
|
||||
install_tearfree_conf "$MNT/etc/X11/xorg.conf.d"
|
||||
install_mkinitcpio
|
||||
install_boot
|
||||
@ -1158,7 +1158,7 @@ install_main()
|
||||
install_login
|
||||
chrun "chown -Rf $NEWUSER:users /home/$NEWUSER"
|
||||
if [[ "$USER_CMD" ]]; then
|
||||
chrun "$USER_CMD" > "$ERR" 2>&1
|
||||
chrun "$USER_CMD" 2> "$ERR" 2>&1
|
||||
errshow 0 "$USER_CMD"
|
||||
fi
|
||||
|
||||
@ -1222,7 +1222,7 @@ install_base()
|
||||
[[ $DIST != "ArchLabs" ]] || sed -i "s/ArchLabs/$DIST/g" "$MNT/etc/"{lsb-release,os-release}
|
||||
|
||||
# vmlinuz, if this isn't copied the standard kernel may fail mkinitcpio
|
||||
cp -vf "$RUN/x86_64/vmlinuz" "$MNT/boot/vmlinuz-linux" > "$ERR" 2>&1
|
||||
cp -vf "$RUN/x86_64/vmlinuz" "$MNT/boot/vmlinuz-linux" 2> "$ERR" 2>&1
|
||||
errshow 1 "cp -vf $RUN/x86_64/vmlinuz $MNT/boot/vmlinuz-linux"
|
||||
|
||||
# copy network settings
|
||||
@ -1286,7 +1286,7 @@ install_boot()
|
||||
fi
|
||||
|
||||
prerun_$BOOTLDR
|
||||
chrun "${BCMDS[$BOOTLDR]}" > "$ERR" 2>&1
|
||||
chrun "${BCMDS[$BOOTLDR]}" 2> "$ERR" 2>&1
|
||||
errshow 1 "${BCMDS[$BOOTLDR]}"
|
||||
|
||||
if [[ -d $MNT/hostrun ]]; then
|
||||
@ -1317,19 +1317,19 @@ install_user()
|
||||
|
||||
rm -f "$MNT/root/.zlogin" # remove welcome message
|
||||
|
||||
chrun "chpasswd <<< 'root:$ROOT_PASS'" > "$ERR" 2>&1
|
||||
chrun "chpasswd <<< 'root:$ROOT_PASS'" 2> "$ERR" 2>&1
|
||||
errshow 1 "set root password"
|
||||
if [[ $MYSHELL != 'zsh' ]]; then # root uses zsh by default
|
||||
chrun "usermod -s /bin/$MYSHELL root" > "$ERR" 2>&1
|
||||
chrun "usermod -s /bin/$MYSHELL root" 2> "$ERR" 2>&1
|
||||
errshow 1 "usermod -s /bin/$MYSHELL root"
|
||||
# copy the default mkshrc to /root if it was selected
|
||||
[[ $MYSHELL == 'mksh' ]] && cp -fv "$MNT/etc/skel/.mkshrc" "$MNT/root/.mkshrc"
|
||||
fi
|
||||
|
||||
echo "Creating new user $NEWUSER and setting password"
|
||||
chrun "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER" > "$ERR" 2>&1
|
||||
chrun "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER" 2> "$ERR" 2>&1
|
||||
errshow 1 "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER"
|
||||
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" > "$ERR" 2>&1
|
||||
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" 2> "$ERR" 2>&1
|
||||
errshow 1 "set $NEWUSER password"
|
||||
|
||||
if [[ $INSTALL_WMS == *dwm* ]];then
|
||||
@ -1370,7 +1370,7 @@ install_login()
|
||||
EOF
|
||||
fi
|
||||
rm -rf "$serv" "$MNT/home/$NEWUSER/.xinitrc"
|
||||
chrun "systemctl enable $LOGIN_TYPE.service" > "$ERR" 2>&1
|
||||
chrun "systemctl enable $LOGIN_TYPE.service" 2> "$ERR" 2>&1
|
||||
errshow 1 "systemctl enable $LOGIN_TYPE.service"
|
||||
${LOGIN_TYPE}_config
|
||||
;;
|
||||
@ -1416,7 +1416,7 @@ install_packages()
|
||||
fi
|
||||
|
||||
# update and install crucial packages first to avoid issues
|
||||
chrun "pacman -Syyu $KERNEL $BASE_PKGS base-devel ${LOGIN_PKGS[$LOGIN_TYPE]} $MYSHELL --noconfirm --needed" > "$ERR" 2>&1
|
||||
chrun "pacman -Syyu $KERNEL $BASE_PKGS base-devel ${LOGIN_PKGS[$LOGIN_TYPE]} $MYSHELL --noconfirm --needed" 2> "$ERR" 2>&1
|
||||
errshow 1 "pacman -Syyu $KERNEL $BASE_PKGS base-devel ${LOGIN_PKGS[$LOGIN_TYPE]} $MYSHELL --noconfirm --needed"
|
||||
|
||||
# remove the packages we don't want on the installed system
|
||||
@ -1426,19 +1426,19 @@ install_packages()
|
||||
chrun "pacman -S iputils $UCODE --noconfirm"
|
||||
|
||||
# install the packages chosen throughout the install
|
||||
chrun "pacman -S $inpkg --needed --noconfirm" > "$ERR" 2>&1
|
||||
chrun "pacman -S $inpkg --needed --noconfirm" 2> "$ERR" 2>&1
|
||||
errshow 1 "pacman -S $inpkg --needed --noconfirm"
|
||||
|
||||
# bootloader packages
|
||||
if [[ $BOOTLDR == 'grub' ]]; then
|
||||
[[ $SYS == 'UEFI' ]] && local efib="efibootmgr"
|
||||
chrun "pacman -S os-prober grub $efib --needed --noconfirm" > "$ERR" 2>&1
|
||||
chrun "pacman -S os-prober grub $efib --needed --noconfirm" 2> "$ERR" 2>&1
|
||||
errshow 1 "pacman -S os-prober grub $efib --needed --noconfirm"
|
||||
elif [[ $BOOTLDR == 'refind-efi' ]]; then
|
||||
chrun "pacman -S refind-efi efibootmgr --needed --noconfirm" > "$ERR" 2>&1
|
||||
chrun "pacman -S refind-efi efibootmgr --needed --noconfirm" 2> "$ERR" 2>&1
|
||||
errshow 1 "pacman -S refind-efi efibootmgr --needed --noconfirm"
|
||||
elif [[ $SYS == 'UEFI' ]]; then
|
||||
chrun "pacman -S efibootmgr --needed --noconfirm" > "$ERR" 2>&1
|
||||
chrun "pacman -S efibootmgr --needed --noconfirm" 2> "$ERR" 2>&1
|
||||
errshow 1 "pacman -S efibootmgr --needed --noconfirm"
|
||||
fi
|
||||
|
||||
@ -1486,7 +1486,7 @@ install_mkinitcpio()
|
||||
[[ $LUKS ]] && add="encrypt"
|
||||
[[ $LVM ]] && { [[ $add ]] && add+=" lvm2" || add+="lvm2"; }
|
||||
sed -i "s/block filesystems/block ${add} filesystems ${HOOKS}/g" "$MNT/etc/mkinitcpio.conf"
|
||||
chrun "mkinitcpio -p $KERNEL" > "$ERR" 2>&1
|
||||
chrun "mkinitcpio -p $KERNEL" 2> "$ERR" 2>&1
|
||||
errshow 1 "mkinitcpio -p $KERNEL"
|
||||
}
|
||||
|
||||
@ -1539,6 +1539,7 @@ install_tearfree_conf()
|
||||
Option "TearFree" "true"
|
||||
EndSection
|
||||
EOF
|
||||
cat "$xpath/20-intel.conf"
|
||||
elif lspci | grep ' VGA ' | grep -q 'AMD/ATI.*RX\|AMD/ATI.*R[579]'; then # newer RX, R5, R7, and R9 cards can use the amdgpu driver
|
||||
echo "Creating AMD Tear Free config /etc/X11/xorg.conf.d/20-amdgpu.conf"
|
||||
cat > "$xpath/20-amdgpu.conf" <<- EOF
|
||||
@ -1548,6 +1549,7 @@ install_tearfree_conf()
|
||||
Option "TearFree" "true"
|
||||
EndSection
|
||||
EOF
|
||||
cat "$xpath/20-amdgpu.conf"
|
||||
elif lspci | grep ' VGA ' | grep -q 'AMD/ATI.*HD [2-6][0-9]*'; then # older HD 2xxx-6xxx cards must use the radeon driver
|
||||
echo "Creating Radeon Tear Free config /etc/X11/xorg.conf.d/20-radeon.conf"
|
||||
cat > "$xpath/20-radeon.conf" <<- EOF
|
||||
@ -1557,6 +1559,7 @@ install_tearfree_conf()
|
||||
Option "TearFree" "on"
|
||||
EndSection
|
||||
EOF
|
||||
cat "$xpath/20-radeon.conf"
|
||||
elif lspci | grep ' VGA ' | grep -q 'NVIDIA'; then # nvidia cards require a bit of checking for notebook gpus
|
||||
echo "Trying nvidia driver install"
|
||||
if lspci | grep ' VGA ' | grep -q 'Intel\|AMD' && lspci | grep ' VGA ' | grep -q 'NVIDIA.*[6-9][1-8][05]M[X]\?\|NVIDIA.*Quadro.*[KMP][1-6][0-2][0]*M'; then # optimus
|
||||
@ -1573,6 +1576,8 @@ install_tearfree_conf()
|
||||
fi
|
||||
fi
|
||||
if [[ -e $xpath/20-nvidia.conf ]]; then
|
||||
cat "$xpath/20-radeon.conf"
|
||||
echo
|
||||
echo "NVIDIA driver installed"
|
||||
if [[ $xpath == *"$MNT"* ]]; then
|
||||
echo "Trying to load the driver for live session"
|
||||
@ -1667,12 +1672,12 @@ prerun_grub()
|
||||
sed -i "s/GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"${DIST}\"/g; s/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"\"/g" "$MNT/etc/default/grub"
|
||||
|
||||
if [[ $LUKS_DEV ]]; then
|
||||
sed -i "s~#GRUB_ENABLE_CRYPTODISK~GRUB_ENABLE_CRYPTODISK~g; s~GRUB_CMDLINE_LINUX=.*~GRUB_CMDLINE_LINUX=\"${LUKS_DEV}\"~g" "$MNT/etc/default/grub" > "$ERR" 2>&1
|
||||
sed -i "s~#GRUB_ENABLE_CRYPTODISK~GRUB_ENABLE_CRYPTODISK~g; s~GRUB_CMDLINE_LINUX=.*~GRUB_CMDLINE_LINUX=\"${LUKS_DEV}\"~g" "$MNT/etc/default/grub" 2> "$ERR" 2>&1
|
||||
errshow 1 "sed -i 's~#GRUB_ENABLE_CRYPTODISK~GRUB_ENABLE_CRYPTODISK~g; s~GRUB_CMDLINE_LINUX=.*~GRUB_CMDLINE_LINUX=\"${LUKS_DEV}\"~g' $MNT/etc/default/grub"
|
||||
fi
|
||||
|
||||
if [[ $SYS == 'BIOS' && $LVM && -z $SEP_BOOT ]]; then
|
||||
sed -i "s/GRUB_PRELOAD_MODULES=.*/GRUB_PRELOAD_MODULES=\"lvm\"/g" "$MNT/etc/default/grub" > "$ERR" 2>&1
|
||||
sed -i "s/GRUB_PRELOAD_MODULES=.*/GRUB_PRELOAD_MODULES=\"lvm\"/g" "$MNT/etc/default/grub" 2> "$ERR" 2>&1
|
||||
errshow 1 "sed -i 's/GRUB_PRELOAD_MODULES=.*/GRUB_PRELOAD_MODULES=\"lvm\"/g' $MNT/etc/default/grub"
|
||||
fi
|
||||
|
||||
@ -1717,11 +1722,11 @@ prerun_syslinux()
|
||||
s="/usr/lib/syslinux/efi64"
|
||||
d='';
|
||||
fi
|
||||
mkdir -pv "$c" > "$ERR" 2>&1
|
||||
mkdir -pv "$c" 2> "$ERR" 2>&1
|
||||
errshow 1 "mkdir -pv $c"
|
||||
cp -rfv "$s/"* "$c/" > "$ERR" 2>&1
|
||||
cp -rfv "$s/"* "$c/" 2> "$ERR" 2>&1
|
||||
errshow 1 "cp -rfv $s/* $c/"
|
||||
cp -fv "$RUN/syslinux/splash.png" "$c/" > "$ERR" 2>&1
|
||||
cp -fv "$RUN/syslinux/splash.png" "$c/" 2> "$ERR" 2>&1
|
||||
errshow 0 "cp -fv $RUN/syslinux/splash.png $c/"
|
||||
cat > "$c/syslinux.cfg" <<- EOF
|
||||
UI vesamenu.c32
|
||||
|
Reference in New Issue
Block a user