simplify launching setup or update-installer.sh, add bashrc which launches zsh by default, switch root to /bin/bash shell

This commit is contained in:
Tobias Powalowski 2022-04-26 15:05:16 +02:00
parent 973f57bf2e
commit d2841519aa
12 changed files with 60 additions and 75 deletions

View file

@ -11,7 +11,7 @@ FILES=()
#
# Please change the hooks only if you know what you are doing.
HOOKS=(udev keyboard archboot_base_common archboot_base_latest archboot_installer_common \
archboot_installer_latest archboot_net_common archboot_kexec archboot_licenses)
archboot_net_common archboot_kexec archboot_licenses)
# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression

View file

@ -11,8 +11,7 @@ FILES=()
#
# Please change the hooks only if you know what you are doing.
HOOKS=(udev keyboard archboot_base_common archboot_base_latest \
archboot_installer_common archboot_installer_latest archboot_kexec \
archboot_licenses archboot_cache)
archboot_installer_common archboot_kexec archboot_licenses archboot_cache)
# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression

View file

@ -11,8 +11,7 @@ FILES=()
#
# Please change the hooks only if you know what you are doing.
HOOKS=(udev keyboard archboot_base_common archboot_base_latest \
archboot_installer_common archboot_installer_latest archboot_net_common archboot_kexec \
archboot_licenses)
archboot_installer_common archboot_net_common archboot_kexec archboot_licenses)
# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression

View file

@ -11,8 +11,7 @@ FILES=()
#
# Please change the hooks only if you know what you are doing.
HOOKS=(udev keyboard archboot_base_common archboot_base_latest \
archboot_installer_common archboot_installer_latest archboot_kexec \
archboot_licenses archboot_cache)
archboot_installer_common archboot_kexec archboot_licenses archboot_cache)
# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression

View file

@ -27,7 +27,7 @@ build ()
### adding needed files from running system
add_symlink "/etc/mtab" "/proc/self/mounts"
map add_full_dir "/etc/profile.d" "/usr/share/terminfo"
systemfiles="bash.bashrc bash.bash_logout crypttab fstab host.conf hosts inputrc mke2fs.conf \
systemfiles="bash.bash_logout crypttab fstab host.conf hosts inputrc mke2fs.conf \
nanorc nsswitch.conf protocols request-key.conf resolv.conf securetty \
services wgetrc"
for i in $systemfiles; do
@ -36,7 +36,7 @@ build ()
### adding config files of installation system
map add_file "/etc/profile" "/etc/group" "/etc/gshadow"
basic_config="hostname modprobe.d/modprobe.conf profile.d/launch-setup.sh shadow shells"
basic_config="bash.bashrc hostname modprobe.d/modprobe.conf profile.d/launch-setup.sh shadow shells"
for i in $basic_config; do
add_file "/usr/share/archboot/base/etc/$i" "/etc/$i"
done

View file

@ -3,8 +3,6 @@
build ()
{
### adding passwd file for correct shell
add_file "/usr/share/archboot/installer_latest/etc/passwd" "/etc/passwd"
### adding default font and keymap
add_file "/usr/share/kbd/consolefonts/lat9w-16.psfu.gz"
add_file "/usr/share/kbd/keymaps/i386/qwerty/us.map.gz"

View file

@ -1,14 +0,0 @@
#!/usr/bin/env bash
# Created by Tobias Powalowski <tpowa@archlinux.org>
build ()
{
add_file "/usr/share/archboot/installer_latest/etc/profile.d/latest-installer.sh" "/etc/profile.d/latest-installer.sh"
}
help ()
{
cat<<HELPEOF
This hook reboots the latest archboot installer with package cache on an archboot image.
HELPEOF
}

View file

@ -0,0 +1,24 @@
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
[[ $DISPLAY ]] && shopt -s checkwinsize
PS1='[\u@\h \W]\$ '
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
screen*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
esac
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
# always try to run zsh
[ -x "$(command -v zsh)" ] && exec zsh "$@"

View file

@ -1,4 +1,4 @@
root:x:0:0:root:/root:/bin/zsh
root:x:0:0:root:/root:/bin/bash
bin:x:1:1::/:/usr/bin/nologin
daemon:x:2:2::/:/usr/bin/nologin
mail:x:8:12::/var/spool/mail:/usr/bin/nologin

View file

@ -1,7 +1,30 @@
cd /
echo "Hit ENTER to enter the zsh shell ..."
read
clear
if ! [ -e /tmp/.setup ]; then
[ -e /usr/bin/setup ] && setup
# don't run ttyS0 as first device
if [[ -e /usr/bin/setup ]]; then
cd /
echo "Hit ENTER to enter the zsh shell ..."
read
clear
if ! [ -e /tmp/.setup ]; then
setup
fi
else
[[ -z $TTY ]] && TTY=$(tty)
TTY=${TTY#/dev/}
cd /
echo -e "\033[1mWelcome to \033[36mArch Linux \033[34m(archboot environment)\033[0m"
echo -e "\033[1m--------------------------------------------------------------------\033[0m"
echo -e "\033[93mGo and get a cup of coffee. Depending on your system setup,\033[0m"
echo -e "\033[93myou can start with your tasks in about 5 minutes ...\033[0m"
echo ""
if [[ "${TTY}" == "tty1" ]]; then
echo -e "\033[91m10 seconds\033[0;25m time to hit \033[92mCTRL-C\033[0m to \033[91mstop\033[0m the process \033[1mnow ...\033[0m"
sleep 10
echo -e "\033[1mStarting\033[0m assembling of archboot environment with package cache ..."
echo ""
echo -e "\033[1mRunning now:\033[0m \033[92mupdate-installer.sh -latest-install\033[0m"
update-installer.sh -latest-install | tee -a /dev/ttyS0 2>/dev/null
elif [[ "${TTY}" == "ttyS0" ]]; then
echo -e "\033[1mRunning\033[0m \033[92mupdate-installer.sh -latest-install\033[0m on \033[1mtty1\033[0m, please wait ...\033[0m"
echo -e "\033[1mProgress is shown here ...\033[0m"
fi
fi

View file

@ -1,23 +0,0 @@
root:x:0:0:root:/root:/bin/bash
bin:x:1:1::/:/usr/bin/nologin
daemon:x:2:2::/:/usr/bin/nologin
mail:x:8:12::/var/spool/mail:/usr/bin/nologin
ftp:x:14:11::/srv/ftp:/usr/bin/nologin
http:x:33:33::/srv/http:/usr/bin/nologin
nobody:x:65534:65534:Nobody:/:/usr/bin/nologin
dbus:x:81:81:System Message Bus:/:/usr/bin/nologin
systemd-journal-remote:x:981:981:systemd Journal Remote:/:/usr/bin/nologin
systemd-network:x:980:980:systemd Network Management:/:/usr/bin/nologin
systemd-oom:x:979:979:systemd Userspace OOM Killer:/:/usr/bin/nologin
systemd-resolve:x:978:978:systemd Resolver:/:/usr/bin/nologin
systemd-timesync:x:977:977:systemd Time Synchronization:/:/usr/bin/nologin
systemd-coredump:x:976:976:systemd Core Dumper:/:/usr/bin/nologin
uuidd:x:68:68::/:/usr/bin/nologin
avahi:x:975:975:Avahi mDNS/DNS-SD daemon:/:/usr/bin/nologin
named:x:40:40:BIND DNS Server:/:/usr/bin/nologin
dhcpcd:x:974:974:dhcpcd privilege separation:/:/usr/bin/nologin
dnsmasq:x:973:973:dnsmasq daemon:/:/usr/bin/nologin
git:x:972:972:git daemon user:/:/usr/bin/git-shell
ntp:x:87:87:Network Time Protocol:/var/lib/ntp:/bin/false
openvpn:x:971:971:OpenVPN:/:/usr/bin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/usr/bin/nologin

View file

@ -1,20 +0,0 @@
# don't run ttyS0 as first device
[[ -z $TTY ]] && TTY=$(tty)
TTY=${TTY#/dev/}
cd /
echo -e "\033[1mWelcome to \033[36mArch Linux \033[34m(archboot environment)\033[0m"
echo -e "\033[1m--------------------------------------------------------------------\033[0m"
echo -e "\033[93mGo and get a cup of coffee. Depending on your system setup,\033[0m"
echo -e "\033[93myou can start with your tasks in about 5 minutes ...\033[0m"
echo ""
if [[ "${TTY}" == "tty1" ]]; then
echo -e "\033[91m10 seconds\033[0;25m time to hit \033[92mCTRL-C\033[0m to \033[91mstop\033[0m the process \033[1mnow ...\033[0m"
sleep 10
echo -e "\033[1mStarting\033[0m assembling of archboot environment with package cache ..."
echo ""
echo -e "\033[1mRunning now:\033[0m \033[92mupdate-installer.sh -latest-install\033[0m"
update-installer.sh -latest-install | tee -a /dev/ttyS0 2>/dev/null
elif [[ "${TTY}" == "ttyS0" ]]; then
echo -e "\033[1mRunning\033[0m \033[92mupdate-installer.sh -latest-install\033[0m on \033[1mtty1\033[0m, please wait ...\033[0m"
echo -e "\033[1mProgress is shown here ...\033[0m"
fi