master
Dmitry Razumov 1 year ago
parent 8a8a57c7ec
commit dc6412a6ee
Signed by: asmeron
GPG Key ID: 50BC1DB583B79706

@ -0,0 +1,26 @@
#!/usr/bin/env bash
ENABLED=yes
[[ ${ENABLED} == "yes" ]] || exit 0
DEBUGMODE=no
[[ -d /usr/lib/ublinux ]] && { ROOTFS= ; CMD_CHROOT= ; } || { [[ -d /sysroot ]] && ROOTFS="/sysroot" || ROOTFS="."; CMD_CHROOT="chroot ${ROOTFS}"; }
SOURCE=${ROOTFS}/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=${ROOTFS}/usr/lib/ublinux/default; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
debug_mode "$0" "$@"
SYSCONF="${ROOTFS}${SYSCONF}"
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
exec_install_pkg_tar(){
find /memory/layer-base/*/install -maxdepth 1 -type f -name "*.pkg.tar.*" -exec pacman -U --noprogressbar --noconfirm {} + 2>/dev/null
}
################
##### MAIN #####
################
# Если файл подключен как ресурс с функциями, то выйти
return 0 2>/dev/null && return 0
exec_install_pkg_tar $@

@ -13,17 +13,17 @@ SYSCONF="${ROOTFS}${SYSCONF}"
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
exec_install_pkg_tar(){
[[ -n $(find /memory/layer-base/*/install/preinit -type f -name "*.pkg.tar.*" -print 2>/dev/null) ]] || return 0
if [[ -n ${ROOTFS} ]]; then
LIST_PKG=$(find /memory/layer-base/*/install/preinit -type f -name "*.pkg.tar.*" -print 2>/dev/null)
if [[ -n ${ROOTFS} && -n ${LIST_PKG} ]]; then
mount -t proc /proc /${ROOTFS}/proc
mount -t sysfs /sys /${ROOTFS}/sys
mount --bind /dev/ /${ROOTFS}/dev
LC_ALL=C LD_LIBRARY_PATH="${ROOTFS}/usr/lib" find /memory/layer-base/*/install/preinit -type f -name "*.pkg.tar.*" -exec ${ROOTFS}/usr/bin/pacman --quiet --sysroot ${ROOTFS} -U --noprogressbar --noconfirm {} +
LC_ALL=C LD_LIBRARY_PATH="${ROOTFS}/usr/lib" ${ROOTFS}/usr/bin/pacman --sysroot ${ROOTFS} -U --noprogressbar --noconfirm ${LIST_PKG}
umount /${ROOTFS}/dev
umount /${ROOTFS}/sys
umount /${ROOTFS}/proc
else
find /memory/layer-base/*/install/preinit -type f -name "*.pkg.tar.*" -exec pacman --quiet -U --noprogressbar --noconfirm {} +
elif [[ -n ${LIST_PKG} ]]; then
pacman -U --noprogressbar --noconfirm ${LIST_PKG}
fi
}

Loading…
Cancel
Save