diff --git a/usr/lib/archboot/cpio/hooks/base_common_cleanup b/usr/lib/archboot/cpio/hooks/base_common_cleanup index 5c73646f7..70d390164 100644 --- a/usr/lib/archboot/cpio/hooks/base_common_cleanup +++ b/usr/lib/archboot/cpio/hooks/base_common_cleanup @@ -4,7 +4,7 @@ _run () { - ! grep -qw 'archboot' /etc/hostname && return + ! rg -qw 'archboot' /etc/hostname && return _install_files rm /usr/bin/{3cpio,blkid,gzip,journalctl,less,lsmod,mkfs.btrfs,\ mountpoint,setfont,sulogin,systemctl} diff --git a/usr/lib/archboot/cpio/hooks/base_common_system b/usr/lib/archboot/cpio/hooks/base_common_system index 9fc9b9858..12713cea3 100644 --- a/usr/lib/archboot/cpio/hooks/base_common_system +++ b/usr/lib/archboot/cpio/hooks/base_common_system @@ -15,7 +15,7 @@ usr/lib/{coreutils,cryptsetup,gconv,modules-load.d,p11-kit,pam.d,pkcs11,polkit-1 usr/share/{bash-completion,dbus-1,factory,hwdata,i18n/locales,makepkg,nano,pacman/keyrings,polkit-1,readline,systemd,terminfo} \ | tar -C "${_ROOTFS}" -xpf - # only run on archboot container - if grep -qw 'archboot' /etc/hostname; then + if rg -qw 'archboot' /etc/hostname; then _map _binary locale{-gen,def} _map _file /etc/locale.gen /usr/share/locale/locale.alias # only support UTF-8 diff --git a/usr/lib/archboot/cpio/hooks/base_common_system_cleanup b/usr/lib/archboot/cpio/hooks/base_common_system_cleanup index d0874c96c..240e16399 100644 --- a/usr/lib/archboot/cpio/hooks/base_common_system_cleanup +++ b/usr/lib/archboot/cpio/hooks/base_common_system_cleanup @@ -4,7 +4,7 @@ _run () { - ! grep -qw 'archboot' /etc/hostname && return + ! rg -qw 'archboot' /etc/hostname && return # remove pacman-init.service rm -f /tmp/etc/systemd/system/multi-user.target.wants/pacman-init.service rm -f /tmp/etc/systemd/system/pacman-init.service diff --git a/usr/lib/archboot/cpio/hooks/base_init b/usr/lib/archboot/cpio/hooks/base_init index b6fdba639..4b3947e82 100644 --- a/usr/lib/archboot/cpio/hooks/base_init +++ b/usr/lib/archboot/cpio/hooks/base_init @@ -16,7 +16,7 @@ _run () # only take services from systemd package pacman -Sy &>"${_NO_LOG}" #shellcheck disable=SC2046 - _map _file $(pacman -Ql systemd | grep '/usr/lib/systemd/system/.' | choose 1) + _map _file $(pacman -Ql systemd | rg '/usr/lib/systemd/system/.' | choose 1) _map _file /usr/lib/sysusers.d/{arch,basic}.conf # disable systemd services: for i in lvm2-{lvmpolld,monitor} systemd-{boot,random-seed,sysusers\ diff --git a/usr/lib/archboot/cpio/hooks/base_system_cleanup b/usr/lib/archboot/cpio/hooks/base_system_cleanup index 4d8929853..a0bbd215b 100644 --- a/usr/lib/archboot/cpio/hooks/base_system_cleanup +++ b/usr/lib/archboot/cpio/hooks/base_system_cleanup @@ -4,7 +4,7 @@ _run () { - ! grep -qw 'archboot' /etc/hostname && return + ! rg -qw 'archboot' /etc/hostname && return _install_files rm /usr/bin/{\[,addpart,attr,b2sum,base{32,64},basenc,blk{discard,pr,zone},blockdev,bunzip2,\ bz{cat,diff,grep,ip2,ip2recover,more},cal,capsh,ch{acl,con,cpu,grp,mem,oom,own,root,rt},\ diff --git a/usr/lib/archboot/cpio/hooks/cache_cleanup b/usr/lib/archboot/cpio/hooks/cache_cleanup index 8f311daea..df1d18ff4 100644 --- a/usr/lib/archboot/cpio/hooks/cache_cleanup +++ b/usr/lib/archboot/cpio/hooks/cache_cleanup @@ -4,7 +4,7 @@ _run () { - ! grep -qw 'archboot' /etc/hostname && return + ! rg -qw 'archboot' /etc/hostname && return [[ -d /var/cache/pacman/pkg ]] && rm -r /var/cache/pacman/pkg } diff --git a/usr/lib/archboot/cpio/hooks/filesystems_cleanup b/usr/lib/archboot/cpio/hooks/filesystems_cleanup index b775d863d..fbd03cbe6 100644 --- a/usr/lib/archboot/cpio/hooks/filesystems_cleanup +++ b/usr/lib/archboot/cpio/hooks/filesystems_cleanup @@ -4,7 +4,7 @@ _run () { - ! grep -qw 'archboot' /etc/hostname && return + ! rg -qw 'archboot' /etc/hostname && return _install_files rm /usr/bin/{badblocks,blkmapd,btrfs-{find-root,image,map-logical,select-super},btrfs{,ck,tune},\ chattr,cifscreds,cifs.{idmap,upcall},compile_et,debugfs,\ diff --git a/usr/lib/archboot/cpio/hooks/firmware_cleanup b/usr/lib/archboot/cpio/hooks/firmware_cleanup index 9e3340101..d4d47d58f 100644 --- a/usr/lib/archboot/cpio/hooks/firmware_cleanup +++ b/usr/lib/archboot/cpio/hooks/firmware_cleanup @@ -4,7 +4,7 @@ _run () { - ! grep -qw 'archboot' /etc/hostname && return + ! rg -qw 'archboot' /etc/hostname && return rm -r /lib/firmware } diff --git a/usr/lib/archboot/cpio/hooks/mods_cleanup b/usr/lib/archboot/cpio/hooks/mods_cleanup index e58dd1b6f..4e66f3a5c 100644 --- a/usr/lib/archboot/cpio/hooks/mods_cleanup +++ b/usr/lib/archboot/cpio/hooks/mods_cleanup @@ -4,7 +4,7 @@ _run () { - ! grep -qw 'archboot' /etc/hostname && return + ! rg -qw 'archboot' /etc/hostname && return _install_mods rm -r /lib/modules _MODS="" _MOD_DEPS="" diff --git a/usr/lib/archboot/cpio/hooks/motd b/usr/lib/archboot/cpio/hooks/motd index a5984faf4..d64551c3b 100644 --- a/usr/lib/archboot/cpio/hooks/motd +++ b/usr/lib/archboot/cpio/hooks/motd @@ -18,12 +18,12 @@ _run () echo -e "|-----------|---------|--------|----------|---------|" >> "${_MOTD}" echo -e "| \e[1;92mALT+F1-F4\e[m | \e[1;92mALT+F5\e[m | \e[1;92mALT+F6\e[m | \e[1;92mALT+F11\e[m | \e[1;92mALT+F12\e[m |" >> "${_MOTD}" echo -e "-----------------------------------------------------" >> "${_MOTD}" -if echo "${_HOOKS[@]}" | grep -qw net; then +if echo "${_HOOKS[@]}" | rg -qw net; then #shellcheck disable=SC2129 echo -e "\e[1mFor Additional Wi-Fi Authentification Or Online Help:\e[m" >> "${_MOTD}" echo -e " - Use the \e[1;92m'elinks'\e[m text mode browser." >> "${_MOTD}" fi -if echo "${_HOOKS[@]}" | grep -qw installer; then +if echo "${_HOOKS[@]}" | rg -qw installer; then #shellcheck disable=SC2129 echo -e "\e[1mManage Archboot Environment:\e[m" >> "${_MOTD}" echo -e " - Use the \e[1;92m'launcher'\e[m or the expert \e[1;92m'update'\e[m script." >> "${_MOTD}" diff --git a/usr/lib/archboot/cpio/hooks/net_cleanup b/usr/lib/archboot/cpio/hooks/net_cleanup index be53e7bef..a89ac37a8 100644 --- a/usr/lib/archboot/cpio/hooks/net_cleanup +++ b/usr/lib/archboot/cpio/hooks/net_cleanup @@ -4,7 +4,7 @@ _run () { - ! grep -qw 'archboot' /etc/hostname && return + ! rg -qw 'archboot' /etc/hostname && return _install_files rm /usr/bin/{arpd,arping,bridge,clockdiff,ctstat,dcb,devlink,\ elinks,ethtool,genl,ifstat,lnstat,nstat,ssh,tracepath,rdma,rtacct,\