:: Re: [DNG] running with separate / a…
Página Principal
Delete this message
Reply to this message
Autor: Rainer Weikusat
Data:  
Para: dng
Assunto: Re: [DNG] running with separate / and /usr
Ralph Ronnquist <rrq@???> writes:
> On Mon, Jan 16, 2023 at 04:26:13PM +0000, Rainer Weikusat via Dng wrote:
>> ...
>>
>> The issue is specifically that libselinux is linked with most basic
>> utilities and requires libpcre2 which is below /usr and that the module
>> utilities are linked with libcrypto (from OpenSSL) which is also below
>> /usr. The effect is that it's not possible to boot a system in the
>> traditional way, ie, have the kernel mount / and then run init to start
>> everything up as init cannot be executed before /usr has been mounted.
>
> Yes; the violated "The Rule" is that /bin binaries (as well as /sbin
> binaries) should have all their required libraries in /lib.


[...]

> Boot trouble is avoided for me by virtue of mkinitramfs pulling all
> dependencies of all used programs into the initrd, and therefore all
> is available at boot.
>
> Possibly one could do the same on a system without initrd; i.e., a
> utility that copies or moves all ldd dependencies from /bin and /sbin
> to /lib somewhere. Such a thing would at least detach this from the
> merged-usr discussion.


I never intended to start that (nor the "We should really use busybox
because of the BLOAT!!1" discussion).

Proof-of-concept patch moving the pcre2 libraries (I do plan to
'maintain' that for myself).

diff --git a/debian/changelog b/debian/changelog
index e16eb32..3c5c189 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+pcre2 (10.36-2+rw001+deb11u2) unstable; urgency=medium
+
+ * moved libraries to /lib
+
+ -- Rainer Weikusat <rweikusat@???> Tue, 17 Jan 2023 16:27:51 +0000
+
pcre2 (10.36-2+deb11u1) bullseye; urgency=medium

   * Backport upstream fixes for CVE-2022-1586 CVE-2022-1587
diff --git a/debian/control b/debian/control
index 25ebb50..b57bd40 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,7 @@
 Source: pcre2
 Section: libs
 Priority: optional
-Maintainer:  Matthew Vernon <matthew@???>
+Maintainer:  Rainer Weikusat <rweikusat@???>
 Standards-Version: 4.5.1
 Build-Depends: debhelper (>=9), dpkg-dev (>= 1.16.1~)
 Vcs-Git: https://salsa.debian.org/debian/pcre2.git
diff --git a/debian/libpcre2-16-0.install b/debian/libpcre2-16-0.install
index 8582b10..839808a 100644
--- a/debian/libpcre2-16-0.install
+++ b/debian/libpcre2-16-0.install
@@ -1 +1 @@
-debian/tmp/usr/lib/*/libpcre2-16.so.*
+debian/tmp/lib/*/libpcre2-16.so.*
diff --git a/debian/libpcre2-32-0.install b/debian/libpcre2-32-0.install
index f3dea05..3acefe8 100644
--- a/debian/libpcre2-32-0.install
+++ b/debian/libpcre2-32-0.install
@@ -1 +1 @@
-debian/tmp/usr/lib/*/libpcre2-32.so.*
+debian/tmp/lib/*/libpcre2-32.so.*
diff --git a/debian/libpcre2-8-0-udeb.install b/debian/libpcre2-8-0-udeb.install
index 1a38dd6..6b69ab3 100644
--- a/debian/libpcre2-8-0-udeb.install
+++ b/debian/libpcre2-8-0-udeb.install
@@ -1 +1 @@
-debian/tmp/usr/lib/*/libpcre2-8.so.*
+debian/tmp/lib/*/libpcre2-8.so.*
diff --git a/debian/libpcre2-8-0.install b/debian/libpcre2-8-0.install
index 1a38dd6..6b69ab3 100644
--- a/debian/libpcre2-8-0.install
+++ b/debian/libpcre2-8-0.install
@@ -1 +1 @@
-debian/tmp/usr/lib/*/libpcre2-8.so.*
+debian/tmp/lib/*/libpcre2-8.so.*
diff --git a/debian/libpcre2-dev.install b/debian/libpcre2-dev.install
index 52ce644..8419349 100644
--- a/debian/libpcre2-dev.install
+++ b/debian/libpcre2-dev.install
@@ -1,6 +1,6 @@
 debian/tmp/usr/include/*
-debian/tmp/usr/lib/*/lib*.a
-debian/tmp/usr/lib/*/lib*.so
-debian/tmp/usr/lib/*/pkgconfig/*
+debian/tmp/lib/*/lib*.a
+debian/tmp/lib/*/lib*.so
+debian/tmp/lib/*/pkgconfig/*
 debian/tmp/usr/bin/*-config
 debian/tmp/usr/share/man/man3/*
diff --git a/debian/libpcre2-posix2.install b/debian/libpcre2-posix2.install
index 2669a04..ae76e05 100644
--- a/debian/libpcre2-posix2.install
+++ b/debian/libpcre2-posix2.install
@@ -1 +1 @@
-debian/tmp/usr/lib/*/libpcre2-posix.so.*
+debian/tmp/lib/*/libpcre2-posix.so.*
diff --git a/debian/rules b/debian/rules
index 9572b1e..85408cf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,7 +23,7 @@ endif
     dh $@ --parallel


 override_dh_auto_configure:
-    dh_auto_configure -- --libdir=/lib/x86_64-linux-gnu $(deb_maint_conf_args)
+    dh_auto_configure -- --libdir=/lib/$(DEB_TARGET_MULTIARCH) $(deb_maint_conf_args)


 override_dh_makeshlibs:
     dh_makeshlibs -V --add-udeb=libpcre2-8-0-udeb