mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-05-06 04:42:16 +00:00
arm-autonomy/xen-tools: vif-nat script fixes
This patch introduces two fixes for the vif-nat script: 1- Setting the hostname is failing because the "$XENBUS_PATH/domain" doesn't exist anymore. To fix this we set it to dom$domid. 2- Copy temp files used to add/remove dhcpd configurations to avoid replacing potential symlinks. Change-Id: I5f2ed917c15bbe1c6ff9ec3cc9ad2fc4e1c0fb60 Issue-Id: SCM-1019 Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com> Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
Upstream-Status: Pending
|
||||||
|
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||||
|
|
||||||
|
Setting the hostname is failing because the "$XENBUS_PATH/domain"
|
||||||
|
doesn't exist anymore. To fix this we set it to dom$domid
|
||||||
|
|
||||||
|
Index: git/tools/hotplug/Linux/vif-nat
|
||||||
|
===================================================================
|
||||||
|
--- git.orig/tools/hotplug/Linux/vif-nat
|
||||||
|
+++ git/tools/hotplug/Linux/vif-nat
|
||||||
|
@@ -86,6 +86,7 @@ router_ip=$(routing_ip "$ip")
|
||||||
|
vif_ip=`echo ${ip} | awk -F/ '{print $1}'`
|
||||||
|
|
||||||
|
hostname=$(xenstore_read "$XENBUS_PATH/domain" | tr -- '_.:/+' '-----')
|
||||||
|
+[ -z "${hostname}" ] && hostname=dom$domid
|
||||||
|
if [ "$vifid" != "1" ]
|
||||||
|
then
|
||||||
|
hostname="$hostname-$vifid"
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
Upstream-Status: Pending
|
||||||
|
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
||||||
|
|
||||||
|
Copy temp files used to add/remove dhcpd configurations to avoid
|
||||||
|
replacing potential symlinks.
|
||||||
|
|
||||||
|
Index: git/tools/hotplug/Linux/vif-nat
|
||||||
|
===================================================================
|
||||||
|
--- git.orig/tools/hotplug/Linux/vif-nat
|
||||||
|
+++ git/tools/hotplug/Linux/vif-nat
|
||||||
|
@@ -99,7 +100,8 @@ dhcparg_remove_entry()
|
||||||
|
then
|
||||||
|
rm "$tmpfile"
|
||||||
|
else
|
||||||
|
- mv "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ cp "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ rm "$tmpfile"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -109,11 +111,11 @@ dhcparg_add_entry()
|
||||||
|
local tmpfile=$(mktemp)
|
||||||
|
# handle Red Hat, SUSE, and Debian styles, with or without quotes
|
||||||
|
sed -e 's/^DHCPDARGS="*\([^"]*\)"*/DHCPDARGS="\1'"${dev} "'"/' \
|
||||||
|
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
sed -e 's/^DHCPD_INTERFACE="*\([^"]*\)"*/DHCPD_INTERFACE="\1'"${dev} "'"/' \
|
||||||
|
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
sed -e 's/^INTERFACES="*\([^"]*\)"*/INTERFACES="\1'"${dev} "'"/' \
|
||||||
|
- "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
+ "$dhcpd_arg_file" >"$tmpfile" && cp "$tmpfile" "$dhcpd_arg_file"
|
||||||
|
rm -f "$tmpfile"
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -125,7 +127,8 @@ dhcp_remove_entry()
|
||||||
|
then
|
||||||
|
rm "$tmpfile"
|
||||||
|
else
|
||||||
|
- mv "$tmpfile" "$dhcpd_conf_file"
|
||||||
|
+ cp "$tmpfile" "$dhcpd_conf_file"
|
||||||
|
+ rm "$tmpfile"
|
||||||
|
fi
|
||||||
|
dhcparg_remove_entry
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
|
SRC_URI += "file://0001-vif-nat-fix-hostname.patch \
|
||||||
|
file://0002-vif-nat-fix-symlink-removal.patch \
|
||||||
|
"
|
||||||
Reference in New Issue
Block a user