File: fix_usr_merge.patch

package info (click to toggle)
clonezilla 5.12.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,580 kB
  • sloc: sh: 41,014; perl: 193; python: 59; makefile: 26
file content (52 lines) | stat: -rw-r--r-- 2,764 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- clonezilla-5.8.7.orig/setup/files/ocs/live-hook/ocs-live-hook-functions
+++ clonezilla-5.8.7/setup/files/ocs/live-hook/ocs-live-hook-functions
@@ -275,12 +275,12 @@
   # By doing apt-get --purge remove cdebootstrap-helper-diverts, it will
   # Removing `diversion of /sbin/start-stop-daemon to /sbin/start-stop-daemon.REAL by cdebootstrap-helper-diverts'
   # Removing `diversion of /usr/sbin/invoke-rc.d to /usr/sbin/invoke-rc.d.REAL by cdebootstrap-helper-diverts'
-  if [ -e /sbin/start-stop-daemon.REAL ]; then
+  if [ -e /usr/sbin/start-stop-daemon.REAL ]; then
     apt-get -y --purge remove cdebootstrap-helper-diverts
   fi
   # For live-build v2.x, the file name is /sbin/start-stop-daemon.orig, and no more cdebootstrap-helper-diverts in lb_chroot_dpkg. We just restore it. Otherwise the file start-stop-daemon copied to /tftpboot/node_root/sbin/ will be the temp fake one.
-  if [ -e /sbin/start-stop-daemon.orig ]; then
-    mv -v /sbin/start-stop-daemon.orig /sbin/start-stop-daemon
+  if [ -e /usr/sbin/start-stop-daemon.orig ]; then
+    mv -v /usr/sbin/start-stop-daemon.orig /sbin/start-stop-daemon
   fi
   # For live-build v3.x, the file name is renamed as start-stop-daemon.distrib by
   # dpkg-divert in /usr/lib/live/build/chroot_dpkg:
@@ -312,6 +312,15 @@
 set_start_stop_daemon_diverts(){
   # For live-build v3.x, after drblpush, we have to revert the status to fake, temp one, so the rest of chroot_dpkg command won't remove the real /sbin/start-stop-daemon.
   # Ref: /usr/lib/live/build/chroot_dpkg
+  # begin-remove-after: released:trixie
+  if [ "$lb_3_start_stop_daemon_revert_aliased_flag" = "true" ]; then
+    if dpkg -D /sbin/start-stop-daemon >/dev/null 2>&1; then
+      dpkg-divert --rename --add --divert /sbin/start-stop-daemon.distrib.usr-is-merged /sbin/start-stop-daemon
+    else
+      dpkg-divert --no-rename --add --divert /sbin/start-stop-daemon.distrib.usr-is-merged /sbin/start-stop-daemon
+    fi
+  fi
+  # end-remove-after
   if [ "$lb_3_start_stop_daemon_revert_flag" = "true" ]; then
     dpkg-divert --rename --add /usr/sbin/start-stop-daemon
     cat > /usr/sbin/start-stop-daemon << EOF
@@ -322,8 +331,7 @@
     chmod 755 /usr/sbin/start-stop-daemon
   fi
   # begin-remove-after: released:trixie
-  if [ "$lb_3_start_stop_daemon_revert_aliased_flag" = "true" ]; then
-    dpkg-divert --rename --add --divert /sbin/start-stop-daemon.distrib.usr-is-merged /sbin/start-stop-daemon
+  if [ "$lb_3_start_stop_daemon_revert_aliased_flag" = "true" ] && [ "$lb_3_start_stop_daemon_revert_flag" != "true" ]; then
     cat > /sbin/start-stop-daemon << EOF
 #!/bin/sh
 
@@ -405,6 +413,7 @@
 UDEV_END
     update_initramfs_flag="yes"
   fi
+  # end-remove-after
 }
 #
 append_framebuffer_modules_if_necessary() {