From d2841519aa66aa2e83f71ffdddf35cae80a863f8 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Tue, 26 Apr 2022 15:05:16 +0200 Subject: [PATCH] simplify launching setup or update-installer.sh, add bashrc which launches zsh by default, switch root to /bin/bash shell --- etc/archboot/aarch64-latest.conf | 2 +- etc/archboot/aarch64-local.conf | 3 +- etc/archboot/x86_64-latest.conf | 3 +- etc/archboot/x86_64-local.conf | 3 +- usr/lib/initcpio/install/archboot_base_common | 4 +-- usr/lib/initcpio/install/archboot_base_latest | 2 -- .../install/archboot_installer_latest | 14 -------- usr/share/archboot/base/etc/bash.bashrc | 24 +++++++++++++ usr/share/archboot/base/etc/passwd | 2 +- .../base/etc/profile.d/launch-setup.sh | 35 +++++++++++++++---- .../archboot/installer_latest/etc/passwd | 23 ------------ .../etc/profile.d/latest-installer.sh | 20 ----------- 12 files changed, 60 insertions(+), 75 deletions(-) delete mode 100644 usr/lib/initcpio/install/archboot_installer_latest create mode 100644 usr/share/archboot/base/etc/bash.bashrc delete mode 100644 usr/share/archboot/installer_latest/etc/passwd delete mode 100644 usr/share/archboot/installer_latest/etc/profile.d/latest-installer.sh diff --git a/etc/archboot/aarch64-latest.conf b/etc/archboot/aarch64-latest.conf index 3be5d8f3d..ebeeea914 100644 --- a/etc/archboot/aarch64-latest.conf +++ b/etc/archboot/aarch64-latest.conf @@ -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 diff --git a/etc/archboot/aarch64-local.conf b/etc/archboot/aarch64-local.conf index 3c53bd94f..f198255b1 100644 --- a/etc/archboot/aarch64-local.conf +++ b/etc/archboot/aarch64-local.conf @@ -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 diff --git a/etc/archboot/x86_64-latest.conf b/etc/archboot/x86_64-latest.conf index 57b12c728..90ca3fa14 100644 --- a/etc/archboot/x86_64-latest.conf +++ b/etc/archboot/x86_64-latest.conf @@ -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 diff --git a/etc/archboot/x86_64-local.conf b/etc/archboot/x86_64-local.conf index 3c53bd94f..f198255b1 100644 --- a/etc/archboot/x86_64-local.conf +++ b/etc/archboot/x86_64-local.conf @@ -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 diff --git a/usr/lib/initcpio/install/archboot_base_common b/usr/lib/initcpio/install/archboot_base_common index f7b52dc44..b573b0bd7 100644 --- a/usr/lib/initcpio/install/archboot_base_common +++ b/usr/lib/initcpio/install/archboot_base_common @@ -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 diff --git a/usr/lib/initcpio/install/archboot_base_latest b/usr/lib/initcpio/install/archboot_base_latest index 008ab07a1..553cc766a 100644 --- a/usr/lib/initcpio/install/archboot_base_latest +++ b/usr/lib/initcpio/install/archboot_base_latest @@ -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" diff --git a/usr/lib/initcpio/install/archboot_installer_latest b/usr/lib/initcpio/install/archboot_installer_latest deleted file mode 100644 index 9eb7938be..000000000 --- a/usr/lib/initcpio/install/archboot_installer_latest +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# Created by Tobias Powalowski - -build () -{ - add_file "/usr/share/archboot/installer_latest/etc/profile.d/latest-installer.sh" "/etc/profile.d/latest-installer.sh" -} - -help () -{ -cat</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 diff --git a/usr/share/archboot/installer_latest/etc/passwd b/usr/share/archboot/installer_latest/etc/passwd deleted file mode 100644 index bf99b6f8b..000000000 --- a/usr/share/archboot/installer_latest/etc/passwd +++ /dev/null @@ -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 diff --git a/usr/share/archboot/installer_latest/etc/profile.d/latest-installer.sh b/usr/share/archboot/installer_latest/etc/profile.d/latest-installer.sh deleted file mode 100644 index 11f2e52c9..000000000 --- a/usr/share/archboot/installer_latest/etc/profile.d/latest-installer.sh +++ /dev/null @@ -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