summary refs log tree commit diff
path: root/mklive.sh.in
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2014-12-17 18:54:43 +0100
committerJuan RP <xtraeme@gmail.com>2014-12-17 18:54:43 +0100
commit7f49ee579c84b4ef2fa4bf7e704e686fe1e3d9be (patch)
tree564c03bbfba1da1b2c0eb15ecd3a63107a1e970f /mklive.sh.in
parent4ab914cdf7cc7a42b9880d72b16417020839c280 (diff)
downloadhrmpf-7f49ee579c84b4ef2fa4bf7e704e686fe1e3d9be.tar.gz
hrmpf-7f49ee579c84b4ef2fa4bf7e704e686fe1e3d9be.tar.xz
hrmpf-7f49ee579c84b4ef2fa4bf7e704e686fe1e3d9be.zip
mklive: only remove unnecessary pkgs if don't have revdeps.
... otherwise switch them to automatic installation mode.
Diffstat (limited to 'mklive.sh.in')
-rw-r--r--mklive.sh.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/mklive.sh.in b/mklive.sh.in
index 14d7c68..09c6f6b 100644
--- a/mklive.sh.in
+++ b/mklive.sh.in
@@ -139,7 +139,12 @@ generate_initramfs() {
 
 cleanup_rootfs() {
     for f in ${INITRAMFS_PKGS}; do
-        xbps-remove -r $ROOTFS -Ry ${f} || die "Failed to remove $f from rootfs"
+        revdeps=$(xbps-query -r $ROOTFS -X $f)
+        if [ -n "$revdeps" ]; then
+            xbps-pkgdb -r $ROOTFS -m auto $f
+        else
+            xbps-remove -r $ROOTFS -Ry ${f} >/dev/null 2>&1
+        fi
     done
     rm -r $ROOTFS/usr/lib/dracut/modules.d/01vmklive
 }