Fix: live() being passed $@ without first shifting
This commit is contained in:
parent
9cd8276366
commit
ea9d419c6b
@ -14,7 +14,7 @@
|
|||||||
# will result in "My Distro Linux" used where needed
|
# will result in "My Distro Linux" used where needed
|
||||||
: ${DIST="ArchLabs"}
|
: ${DIST="ArchLabs"}
|
||||||
|
|
||||||
VER="2.0.69" # installer version
|
VER="2.0.70" # installer version
|
||||||
MNT="/mnt" # install mountpoint
|
MNT="/mnt" # install mountpoint
|
||||||
ANS="/tmp/ans" # dialog answer file
|
ANS="/tmp/ans" # dialog answer file
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ USER_PASS='' # new user's password
|
|||||||
ROOT_PASS='' # root password
|
ROOT_PASS='' # root password
|
||||||
|
|
||||||
KERNEL='' # linux kernel, can be: linux, linux-lts, linux-zen, or linux-hardened
|
KERNEL='' # linux kernel, can be: linux, linux-lts, linux-zen, or linux-hardened
|
||||||
MYSHELL='' # full path for the shell, eg. /usr/bin/zsh
|
MYSHELL='' # shell to use for the system, eg. zsh
|
||||||
UCODE='' # cpu microcode (if any), can be: amd-ucode, intel-ucode
|
UCODE='' # cpu microcode (if any), can be: amd-ucode, intel-ucode
|
||||||
|
|
||||||
LUKS='' # empty when not using encryption
|
LUKS='' # empty when not using encryption
|
||||||
@ -447,9 +447,9 @@ select_config()
|
|||||||
until [[ $CONFIG_DONE ]]; do
|
until [[ $CONFIG_DONE ]]; do
|
||||||
case $i in
|
case $i in
|
||||||
0) dlg MYSHELL menu "Shell" "\nChoose which shell to use." \
|
0) dlg MYSHELL menu "Shell" "\nChoose which shell to use." \
|
||||||
/usr/bin/zsh 'A very advanced and programmable command interpreter (shell) for UNIX' \
|
zsh 'A very advanced and programmable command interpreter (shell) for UNIX' \
|
||||||
/bin/bash 'The GNU Bourne Again shell, standard in many GNU/Linux distributions' \
|
bash 'The GNU Bourne Again shell, standard in many GNU/Linux distributions' \
|
||||||
/usr/bin/mksh 'The MirBSD Korn Shell - an enhanced version of the public domain ksh' || return 1
|
mksh 'The MirBSD Korn Shell - an enhanced version of the public domain ksh' || return 1
|
||||||
;;
|
;;
|
||||||
1) dlg MYHOST input "Hostname" "$_hostname" "${DIST,,}" limit || { i=0; continue; } ;;
|
1) dlg MYHOST input "Hostname" "$_hostname" "${DIST,,}" limit || { i=0; continue; } ;;
|
||||||
2) dlg MYLOCALE menu "Locale" "$_locale" $LOCALES || { i=1; continue; } ;;
|
2) dlg MYLOCALE menu "Locale" "$_locale" $LOCALES || { i=1; continue; } ;;
|
||||||
@ -470,7 +470,7 @@ select_config()
|
|||||||
(( i++ )) # progress through to the next choice
|
(( i++ )) # progress through to the next choice
|
||||||
done
|
done
|
||||||
|
|
||||||
case $MYSHELL in *bash) LOGINRC='.bash_profile' ;; *zsh) LOGINRC='.zprofile' ;; *mksh) LOGINRC='.profile' ;; esac
|
case $MYSHELL in bash) LOGINRC='.bash_profile' ;; zsh) LOGINRC='.zprofile' ;; mksh) LOGINRC='.profile' ;; esac
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1485,18 +1485,18 @@ install_user()
|
|||||||
|
|
||||||
chrun "chpasswd <<< 'root:$ROOT_PASS'" 2>$ERR
|
chrun "chpasswd <<< 'root:$ROOT_PASS'" 2>$ERR
|
||||||
errshow 1 "set root password"
|
errshow 1 "set root password"
|
||||||
if [[ $MYSHELL != "/usr/bin/zsh" ]]; then # root uses zsh by default, change it if something else was chosen
|
if [[ $MYSHELL != 'zsh' ]]; then # root uses zsh by default, change it if something else was chosen
|
||||||
chrun "usermod -s $MYSHELL root" 2>$ERR
|
chrun "usermod -s /bin/$MYSHELL root" 2>$ERR
|
||||||
errshow 1 "usermod -s $MYSHELL root"
|
errshow 1 "usermod -s /bin/$MYSHELL root"
|
||||||
# copy the default mkshrc to /root if mksh was picked
|
# copy the default mkshrc to /root if mksh was picked
|
||||||
[[ $MYSHELL == '/usr/bin/mksh' ]] && cp -fv $MNT/etc/skel/.mkshrc $MNT/root/.mkshrc
|
[[ $MYSHELL == 'mksh' ]] && cp -fv $MNT/etc/skel/.mkshrc $MNT/root/.mkshrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating new user $NEWUSER and setting password"
|
echo "Creating new user $NEWUSER and setting password"
|
||||||
local groups='audio,floppy,log,network,rfkill,scanner,storage,optical,power,wheel'
|
local groups='audio,floppy,log,network,rfkill,scanner,storage,optical,power,wheel'
|
||||||
|
|
||||||
chrun "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER" 2>$ERR
|
chrun "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER" 2>$ERR
|
||||||
errshow 1 "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER"
|
errshow 1 "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER"
|
||||||
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" 2>$ERR
|
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" 2>$ERR
|
||||||
errshow 1 "set $NEWUSER password"
|
errshow 1 "set $NEWUSER password"
|
||||||
|
|
||||||
@ -1572,11 +1572,7 @@ install_packages()
|
|||||||
local rmpkg="archlabs-installer "
|
local rmpkg="archlabs-installer "
|
||||||
local inpkg="$BASE_PKGS ${LOGIN_PKGS[$LOGIN_TYPE]} $PACKAGES $USER_PKGS "
|
local inpkg="$BASE_PKGS ${LOGIN_PKGS[$LOGIN_TYPE]} $PACKAGES $USER_PKGS "
|
||||||
|
|
||||||
case $MYSHELL in
|
case $MYSHELL in zsh) inpkg+="zsh-completions " ;; mksh) inpkg+="mksh " rmpkg+="zsh " ;; bash) inpkg+="bash-completion " rmpkg+="zsh " ;; esac
|
||||||
*zsh) inpkg+="zsh-completions " ;;
|
|
||||||
*mksh) inpkg+="mksh " rmpkg+="zsh " ;;
|
|
||||||
*bash) inpkg+="bash-completion " rmpkg+="zsh " ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# using a different kernel, remove the stock one
|
# using a different kernel, remove the stock one
|
||||||
[[ $KERNEL != 'linux' ]] && inpkg+="$KERNEL " rmpkg+="linux "
|
[[ $KERNEL != 'linux' ]] && inpkg+="$KERNEL " rmpkg+="linux "
|
||||||
@ -2281,16 +2277,27 @@ live()
|
|||||||
trap - INT
|
trap - INT
|
||||||
pacman -Syyu --noconfirm || die 1
|
pacman -Syyu --noconfirm || die 1
|
||||||
pacman -S $AL_BASE_PKGS $WM_BASE_PKGS xorg-xinit xorg-server --needed --noconfirm || die 1
|
pacman -S $AL_BASE_PKGS $WM_BASE_PKGS xorg-xinit xorg-server --needed --noconfirm || die 1
|
||||||
case "$1" in
|
for ses; do
|
||||||
dwm) pacman -S git --needed --noconfirm || die 1
|
case "$ses" in
|
||||||
mkdir -pv /root/suckless
|
dwm)
|
||||||
for i in dwm dmenu st; do
|
pacman -S git --needed --noconfirm || die 1
|
||||||
git clone https://git.suckless.org/$i /root/suckless/$i && cd /root/suckless/$i && make PREFIX=/usr install
|
mkdir -pv /root/suckless
|
||||||
done ;;
|
for i in dwm dmenu st; do
|
||||||
i3-gaps|oepnbox|fluxbox|bspwm|xfce4|gnome|plasma|cinnamon|awesome) pacman -S "$1" ${WM_EXT[$1]} xterm --needed --noconfirm ;;
|
git clone https://git.suckless.org/$i /root/suckless/$i &&
|
||||||
*) echo "error: invalid session for -l, --live, see -h, --help"; die 1 ;;
|
cd /root/suckless/$i &&
|
||||||
esac
|
make PREFIX=/usr install
|
||||||
pacman -Scc --noconfirm # these get back some space
|
done
|
||||||
|
;;
|
||||||
|
i3-gaps|oepnbox|fluxbox|bspwm|xfce4|gnome|plasma|cinnamon|awesome)
|
||||||
|
pacman -S "$1" ${WM_EXT[$1]} xterm --needed --noconfirm || die 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "error: invalid session for -l, --live, see -h, --help"
|
||||||
|
die 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
pacman -Scc --noconfirm
|
||||||
rm -rf /var/cache/pacman/pkg/*
|
rm -rf /var/cache/pacman/pkg/*
|
||||||
cp -rfT /etc/skel /root || die 1
|
cp -rfT /etc/skel /root || die 1
|
||||||
sed -i "/exec/ c exec ${WM_SESSIONS[$1]}" /root/.xinitrc
|
sed -i "/exec/ c exec ${WM_SESSIONS[$1]}" /root/.xinitrc
|
||||||
@ -2526,6 +2533,7 @@ elif [[ $1 =~ (-h|--help) ]]; then
|
|||||||
elif [[ $1 =~ (-d|--debug) ]]; then
|
elif [[ $1 =~ (-d|--debug) ]]; then
|
||||||
debug
|
debug
|
||||||
elif [[ $1 =~ (-l|--live) ]]; then
|
elif [[ $1 =~ (-l|--live) ]]; then
|
||||||
|
shift
|
||||||
live "$@"
|
live "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user