ACK/Cmnt: [SRU][M:meta-laptop][PATCH] UBUNTU: Set persistent wifi MAC address

Manuel Diewald manuel.diewald at canonical.com
Wed Nov 22 12:55:33 UTC 2023


On Fri, Oct 27, 2023 at 08:27:29PM +0200, Juerg Haefliger wrote:
> BugLink: https://bugs.launchpad.net/2039144
> 

I cannot access the BugLink ('Error: Page not found'). Should it be
public?

> The X13s comes up with a random wifi MAC address, because it's hidden
> probably in secret storage that the kernel can't get to (yet). This can
> be problematic for some environments and MAC address randomization should
> really be handled by NetworkManager. So set a unique and persistent
> MAC based on /etc/machine-id.
> 
> Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
> ---
>  rules.d/60-laptop-persistent-wifi-mac.rules |  2 ++
>  share/set-wifi-mac-addr                     | 16 ++++++++++++++++
>  2 files changed, 18 insertions(+)
>  create mode 100644 rules.d/60-laptop-persistent-wifi-mac.rules
>  create mode 100755 share/set-wifi-mac-addr
> 
> diff --git a/rules.d/60-laptop-persistent-wifi-mac.rules b/rules.d/60-laptop-persistent-wifi-mac.rules
> new file mode 100644
> index 000000000000..e667f9d13f3a
> --- /dev/null
> +++ b/rules.d/60-laptop-persistent-wifi-mac.rules
> @@ -0,0 +1,2 @@
> +# Set wifi MAC on X13s
> +SUBSYSTEM=="net", ACTION=="add", ATTRS{vendor}=="0x17cb", ATTRS{device}=="0x1103", PROGRAM="/usr/share/linux-laptop/set-wifi-mac-addr %k"
> diff --git a/share/set-wifi-mac-addr b/share/set-wifi-mac-addr
> new file mode 100755
> index 000000000000..1b56e22e5638
> --- /dev/null
> +++ b/share/set-wifi-mac-addr
> @@ -0,0 +1,16 @@
> +#!/bin/sh
> +#
> +# Set X13s wifi MAC address
> +#
> +
> +intf=${1}
> +
> +# Bytes 2-4 from /etc/machine-id
> +nic=$(sed 's/\(..\)/\1:/g' /etc/machine-id | cut -c 4-11)
> +
> +# Qualcomm OUI
> +oui="8c:fd:f0"
> +
> +mac="${oui}:${nic}"
> +echo "Set MAC addr of ${intf} to ${mac}"
> +/bin/ip link set "${intf}" address "${mac}"
> -- 
> 2.39.2
> 
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Acked-by: Manuel Diewald <manuel.diewald at canonical.com>

-- 
 Manuel



More information about the kernel-team mailing list