On Mon, 11 Dec 2023 13:50:14 -0500
Jon Maloy <jmaloy(a)redhat.com> wrote:
From: Jon Paul Maloy <jmaloy(a)redhat.com>
Creation of a symbolic link from /sbin to /usr/sbin fails if /sbin
exists and is non-empty. This is the case on Ubuntu-23.04.
We fix this by removing /sbin before creating the link.
Signed-off-by: Jon Maloy <jmaloy(a)redhat.com>
---
test/passt.mbuto | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/passt.mbuto b/test/passt.mbuto
index 90816d2..12d7f50 100755
--- a/test/passt.mbuto
+++ b/test/passt.mbuto
@@ -26,6 +26,8 @@ DIRS="${DIRS} /tmp /sbin /usr/share /var/log /var/lib /etc/ssh
/run/sshd /root/.
COPIES="${COPIES} small.bin,/root/small.bin medium.bin,/root/medium.bin
big.bin,/root/big.bin"
FIXUP="${FIXUP}"'
+ rm -rf /sbin
This works on Ubuntu, but to be safer with other distributions:
shouldn't we first move anything we need that happens to be in /sbin to
/usr/sbin?
On (your version of) Ubuntu /sbin is created because of $DIRS above,
but let's say that another version or another distribution has ip(8)
at /sbin/ip, we'll get rid of it.
That is, if you add /usr/sbin explicitly to DIRS above (to make sure it
exists), and then, here, do:
mv /sbin/* /sbin || :
Gah, sorry, I meant:
mv /sbin/* /usr/sbin/ || :
--
Stefano