Sophie

Sophie

distrib > Mageia > 9 > armv7hl > media > core-release-src > by-pkgid > 71a1ba4a20ff0a01d79300b8413dde5d > files > 11

dracut-057-4.mga9.src.rpm

From e5a7e4d67ecb1fbf5c275c949a44b77e648b0f79 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Thu, 12 Jul 2012 20:47:09 +0100
Subject: [PATCH 508/514] mageia: Add a convertfs hacks for packaging quirks

---
 modules.d/30convertfs/convertfs.sh | 43 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/modules.d/30convertfs/convertfs.sh b/modules.d/30convertfs/convertfs.sh
index 66bb4a64..4806ce3b 100755
--- a/modules.d/30convertfs/convertfs.sh
+++ b/modules.d/30convertfs/convertfs.sh
@@ -23,12 +23,18 @@ if [ ! -L "$ROOT"/var/run -a -e "$ROOT"/var/run ]; then
     echo "Converting /var/run to symlink"
     mv -f "$ROOT"/var/run "$ROOT"/var/run.runmove~
     ln -sfn ../run "$ROOT"/var/run
+    # Prevent the clean script from running. It's not needed now but if it's still
+    # active on boot, it will remove the symlinks we've just created above!
+    rm -f "$ROOT/lib/systemd/system/sysinit.target.wants/mandriva-clean-var-run-lock.service"
 fi
 
 if [ ! -L "$ROOT"/var/lock -a -e "$ROOT"/var/lock ]; then
     echo "Converting /var/lock to symlink"
     mv -f "$ROOT"/var/lock "$ROOT"/var/lock.lockmove~
     ln -sfn ../run/lock "$ROOT"/var/lock
+    # Prevent the clean script from running. It's not needed now but if it's still
+    # active on boot, it will remove the symlinks we've just created above!
+    rm -f "$ROOT/lib/systemd/system/sysinit.target.wants/mandriva-clean-var-run-lock.service"
 fi
 
 needconvert() {
@@ -129,6 +135,20 @@ for dir in bin sbin lib lib64; do
     echo "Make a copy of \`$ROOT/usr/$dir'."
     [[ -d "$ROOT/usr/$dir" ]] \
         && cp -ax -l "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmove-new"
+
+    # (cg) Mageia packaging quirks....
+    if [[ "$dir" = "bin" ]]; then
+        # shadow-utils on mga2 packaged this binary in /usr/bin when it shouldn't...
+        [[ -f "$ROOT/usr/${dir}.usrmove-new/login" ]] \
+            && [[ -f "$ROOT/${dir}/login" ]] \
+            && mv "$ROOT/usr/${dir}.usrmove-new/login" "$ROOT/usr/${dir}.usrmove-new/login.usrmove~"
+    elif [[ "$dir" = "lib" ]]; then
+        # libgcc1 on x86_64 installs had duplicate symlinks that ultimately point at the same file
+        [[ -L "$ROOT/${dir}/libgcc_s.so.1" ]] \
+            && [[ -L "$ROOT/usr/${dir}.usrmove-new/libgcc_s.so.1" ]] \
+            && rm -f "$ROOT/usr/${dir}.usrmove-new/libgcc_s.so.1"
+    fi
+
     echo "Merge the copy with \`$ROOT/$dir'."
     [[ -d "$ROOT/usr/${dir}.usrmove-new" ]] \
         || mkdir -p "$ROOT/usr/${dir}.usrmove-new"
@@ -207,5 +227,26 @@ if [ -n "$(command -v setfiles)" ] && [ "$SELINUX" != "disabled" ] && [ -f /etc/
     setfiles -r "$ROOT" -p /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts "$ROOT"/sbin "$ROOT"/bin "$ROOT"/lib "$ROOT"/lib64 "$ROOT"/usr/lib "$ROOT"/usr/lib64 "$ROOT"/etc/ld.so.cache "$ROOT"/var/cache/ldconfig || :
 fi
 
+# (cg) iptables package has an unpackaged symlink that conflicts with a script name
+if [[ -f "$ROOT/usr/lib64/iptables.usrmove~" ]]; then
+  mv "$ROOT/usr/lib64/iptables.usrmove~" "$ROOT/usr/lib64/iptables.init"
+  [[ -f "$ROOT/usr/lib/systemd/system/iptables.service" ]] \
+    && sed -i 's,lib64/iptables ,lib64/iptables.init ,' "$ROOT/usr/lib/systemd/system/iptables.service"
+  if [[ -f "$ROOT/usr/lib64/ip6tables" ]]; then
+    mv "$ROOT/usr/lib64/ip6tables" "$ROOT/usr/lib64/ip6tables.init"
+    [[ -f "$ROOT/usr/lib/systemd/system/ip6tables.service" ]] \
+      && sed -i 's,lib64/ip6tables ,lib64/ip6tables.init ,' "$ROOT/usr/lib/systemd/system/ip6tables.service"
+  fi
+elif [[ -f "$ROOT/usr/lib/iptables.usrmove~" ]]; then
+  mv "$ROOT/usr/lib/iptables.usrmove~" "$ROOT/usr/lib/iptables.init"
+  [[ -f "$ROOT/usr/lib/systemd/system/iptables.service" ]] \
+    && sed -i 's,lib/iptables ,lib/iptables.init ,' "$ROOT/usr/lib/systemd/system/iptables.service"
+  if [[ -f "$ROOT/usr/lib/ip6tables" ]]; then
+    mv "$ROOT/usr/lib/ip6tables" "$ROOT/usr/lib/ip6tables.init"
+    [[ -f "$ROOT/usr/lib/systemd/system/ip6tables.service" ]] \
+      && sed -i 's,lib/ip6tables ,lib/ip6tables.init ,' "$ROOT/usr/lib/systemd/system/ip6tables.service"
+  fi
+fi
+
 echo "Done."
 exit 0
-- 
2.13.5