[PATCH] tests: hwsim: make /etc/alternatives work in VM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Berg <johannes.berg@xxxxxxxxx>

In recent Debian versions, ebtables is an alias managed by
the alternatives(8) mechanism. This means /usr/sbin/ebtables
is a symlink to /etc/alternatives/ebtables, which in turn
links to the real binary.

As we mount a tmpfs over /etc, we cannot access this.

Fix this by bind-mounting the real /etc to /tmp/etc and
adding a symlink from /etc/alternatives to this.

Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
 tests/hwsim/vm/inside.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/hwsim/vm/inside.sh b/tests/hwsim/vm/inside.sh
index c97a284e8db6..ac01d411c3b2 100755
--- a/tests/hwsim/vm/inside.sh
+++ b/tests/hwsim/vm/inside.sh
@@ -1,10 +1,13 @@
 #!/bin/sh
 
+# keep old /etc
+mount tmpfs -t tmpfs /tmp
+mkdir /tmp/etc
+mount --bind /etc /tmp/etc
 # mount all kinds of things
 mount tmpfs -t tmpfs /etc
 # we need our own /dev/rfkill, and don't want device access
 mount tmpfs -t tmpfs /dev
-mount tmpfs -t tmpfs /tmp
 # some sockets go into /var/run, and / is read-only
 mount tmpfs -t tmpfs /var/run
 mount proc -t proc /proc
@@ -71,6 +74,9 @@ udp     17      UDP
 ipv6-icmp 58	IPv6-ICMP
 EOF
 
+# we may need /etc/alternatives, at least on Debian-based systems
+ln -s /tmp/etc/alternatives /etc/
+
 # local network is needed for some tests
 ip link set lo up
 
-- 
2.17.2


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux