mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 12:00:37 +02:00
add new function for package cleaning
This commit is contained in:
parent
8bd2bd8e3c
commit
5cdeee7b51
2 changed files with 13 additions and 7 deletions
|
@ -65,13 +65,17 @@ _clean_container() {
|
||||||
rm -r "${1}"/usr/share/{aclocal,applications,audit,awk,common-lisp,emacs,et,fish,gdb,gettext,gettext-[0-9]*,glib-[0-9]*,gnupg,gtk-doc,iana-etc,icons,icu,keyutils,libalpm,libgpg-error,makepkg-template,misc,mkinitcpio,pixmaps,pkgconfig,readline,screen,smartmontools,ss,tabset,vala,xml,zoneinfo-leaps,man,doc,info,i18n/locales,locale,xtables}
|
rm -r "${1}"/usr/share/{aclocal,applications,audit,awk,common-lisp,emacs,et,fish,gdb,gettext,gettext-[0-9]*,glib-[0-9]*,gnupg,gtk-doc,iana-etc,icons,icu,keyutils,libalpm,libgpg-error,makepkg-template,misc,mkinitcpio,pixmaps,pkgconfig,readline,screen,smartmontools,ss,tabset,vala,xml,zoneinfo-leaps,man,doc,info,i18n/locales,locale,xtables}
|
||||||
rm -r "${1}"/usr/lib/{audit,awk,binfmt.d,cmake,dracut,e2fsprogs,engines-[0-9]*,environment.d,gawk,getconf,gettext,girepository-[0-9]*,glib-[0-9]*,gnupg,gssproxy,guile,icu,krb5,ldscripts,libnl,pkgconfig,python[0-9]*,rsync,sasl2,siconv,tar,xfsprogs,xtables}
|
rm -r "${1}"/usr/lib/{audit,awk,binfmt.d,cmake,dracut,e2fsprogs,engines-[0-9]*,environment.d,gawk,getconf,gettext,girepository-[0-9]*,glib-[0-9]*,gnupg,gssproxy,guile,icu,krb5,ldscripts,libnl,pkgconfig,python[0-9]*,rsync,sasl2,siconv,tar,xfsprogs,xtables}
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_clean_packages() {
|
||||||
|
if [[ "${_CLEANUP_CONTAINER}" == "1" ]]; then
|
||||||
# remove packages from pacman db that are not included in initramfs
|
# remove packages from pacman db that are not included in initramfs
|
||||||
_RM_PACMAN_DB="grub libxml2 icu gettext refind amd-ucode intel-ucode edk2-shell cdrtools \
|
_RM_PACKAGES="grub libxml2 icu gettext refind amd-ucode intel-ucode edk2-shell cdrtools \
|
||||||
libisoburn libburn libisofs mkinitcpio memtest linux-api-headers jansson libwbclient \
|
libisoburn libburn libisofs mkinitcpio memtest linux-api-headers jansson libwbclient \
|
||||||
libbsd libmd libpcap libnftnl libnfnetlink libnetfilter_conntrack libsasl libldap"
|
libbsd libmd libpcap libnftnl libnfnetlink libnetfilter_conntrack libsasl libldap"
|
||||||
for i in ${_RM_PACMAN_DB}; do
|
echo "Uninstalling ${_RM_PACKAGES}..."
|
||||||
rm -rf ${1}/var/lib/pacman/local/${i}* &>/dev/null
|
${_PACMAN} -RDD ${_RM_PACKAGES} ${_PACMAN_DEFAULTS} &>/dev/null || exit 1
|
||||||
done
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# removing mkinitcpio hooks to speed up process, removing not needed initramdisks
|
# removing mkinitcpio hooks to speed up process, removing not needed initramdisks
|
||||||
|
|
|
@ -19,6 +19,7 @@ if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
|
||||||
_clean_cache "${1}"
|
_clean_cache "${1}"
|
||||||
_install_archboot "${1}" || exit 1
|
_install_archboot "${1}" || exit 1
|
||||||
_clean_cache "${1}"
|
_clean_cache "${1}"
|
||||||
|
_clean_packages "${1}" || exit 1
|
||||||
_umount_special "${1}" || exit 1
|
_umount_special "${1}" || exit 1
|
||||||
_clean_container "${1}"
|
_clean_container "${1}"
|
||||||
_generate_keyring "${1}" || exit 1
|
_generate_keyring "${1}" || exit 1
|
||||||
|
@ -48,6 +49,7 @@ else
|
||||||
_install_archboot "${1}" "use_binfmt" || exit 1
|
_install_archboot "${1}" "use_binfmt" || exit 1
|
||||||
_clean_mkinitcpio "${1}"
|
_clean_mkinitcpio "${1}"
|
||||||
_clean_container "${1}" 2>/dev/null
|
_clean_container "${1}" 2>/dev/null
|
||||||
|
_clean_packages "${1}" || exit 1
|
||||||
else
|
else
|
||||||
echo "Error: binfmt usage is only supported on x86_64!"
|
echo "Error: binfmt usage is only supported on x86_64!"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue