public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH v2] test: make passt.mbuto script more robust
@ 2023-12-14 21:12 Jon Maloy
  2023-12-15  0:38 ` David Gibson
  2023-12-27 20:25 ` Stefano Brivio
  0 siblings, 2 replies; 3+ messages in thread
From: Jon Maloy @ 2023-12-14 21:12 UTC (permalink / raw)
  To: passt-dev, sbrivio, lvivier, dgibson, jmaloy

From: Jon Paul Maloy <jmaloy@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@redhat.com>

---
v2: Move the contents of /sbin to /usr/sbin before creating the link.

Signed-off-by: Jon Maloy <jmaloy@redhat.com>
---
 test/passt.mbuto | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/passt.mbuto b/test/passt.mbuto
index 90816d2..75d1260 100755
--- a/test/passt.mbuto
+++ b/test/passt.mbuto
@@ -26,6 +26,9 @@ 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}"'
+	mv /sbin/* /usr/sbin || :
+	rm -rf /sbin
+	ln -s /usr/sbin /sbin
 	cat > /sbin/dhclient-script << EOF
 #!/bin/sh
 LOG=/var/log/dhclient-script.log
@@ -47,7 +50,6 @@ set >> \$LOG
 exit 0
 EOF
 	chmod 755 /sbin/dhclient-script
-	ln -s /sbin /usr/sbin
 	ln -s /bin /usr/bin
 	ln -s /run /var/run
 	:> /etc/fstab
-- 
@@ -26,6 +26,9 @@ 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}"'
+	mv /sbin/* /usr/sbin || :
+	rm -rf /sbin
+	ln -s /usr/sbin /sbin
 	cat > /sbin/dhclient-script << EOF
 #!/bin/sh
 LOG=/var/log/dhclient-script.log
@@ -47,7 +50,6 @@ set >> \$LOG
 exit 0
 EOF
 	chmod 755 /sbin/dhclient-script
-	ln -s /sbin /usr/sbin
 	ln -s /bin /usr/bin
 	ln -s /run /var/run
 	:> /etc/fstab
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] test: make passt.mbuto script more robust
  2023-12-14 21:12 [PATCH v2] test: make passt.mbuto script more robust Jon Maloy
@ 2023-12-15  0:38 ` David Gibson
  2023-12-27 20:25 ` Stefano Brivio
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2023-12-15  0:38 UTC (permalink / raw)
  To: Jon Maloy; +Cc: passt-dev, sbrivio, lvivier, dgibson

[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]

On Thu, Dec 14, 2023 at 04:12:19PM -0500, Jon Maloy wrote:
> From: Jon Paul Maloy <jmaloy@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@redhat.com>
> 
> ---
> v2: Move the contents of /sbin to /usr/sbin before creating the link.
> 
> Signed-off-by: Jon Maloy <jmaloy@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  test/passt.mbuto | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/test/passt.mbuto b/test/passt.mbuto
> index 90816d2..75d1260 100755
> --- a/test/passt.mbuto
> +++ b/test/passt.mbuto
> @@ -26,6 +26,9 @@ 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}"'
> +	mv /sbin/* /usr/sbin || :
> +	rm -rf /sbin
> +	ln -s /usr/sbin /sbin
>  	cat > /sbin/dhclient-script << EOF
>  #!/bin/sh
>  LOG=/var/log/dhclient-script.log
> @@ -47,7 +50,6 @@ set >> \$LOG
>  exit 0
>  EOF
>  	chmod 755 /sbin/dhclient-script
> -	ln -s /sbin /usr/sbin
>  	ln -s /bin /usr/bin
>  	ln -s /run /var/run
>  	:> /etc/fstab

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] test: make passt.mbuto script more robust
  2023-12-14 21:12 [PATCH v2] test: make passt.mbuto script more robust Jon Maloy
  2023-12-15  0:38 ` David Gibson
@ 2023-12-27 20:25 ` Stefano Brivio
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Brivio @ 2023-12-27 20:25 UTC (permalink / raw)
  To: Jon Maloy; +Cc: passt-dev, lvivier, dgibson

On Thu, 14 Dec 2023 16:12:19 -0500
Jon Maloy <jmaloy@redhat.com> wrote:

> From: Jon Paul Maloy <jmaloy@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@redhat.com>

Applied.

By the way, proposal announced last week:

  https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin#Benefit_to_Fedora

-- 
Stefano


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-27 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-14 21:12 [PATCH v2] test: make passt.mbuto script more robust Jon Maloy
2023-12-15  0:38 ` David Gibson
2023-12-27 20:25 ` Stefano Brivio

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).