Name each CAN bus using udev
The names were consistent before purely because the probe order appeared
consistent... Instead, use udev to name them can[abc] and have the
order be static based on the port.
Change-Id: I13ad066699bb2a5af60abceb3c59451ecec0bc1f
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/orin/build_rootfs.py b/frc971/orin/build_rootfs.py
index ec8d955..c378226 100755
--- a/frc971/orin/build_rootfs.py
+++ b/frc971/orin/build_rootfs.py
@@ -765,7 +765,7 @@
resolved_deps.sort()
rule_name = obj[1:].replace('/', '_')
rule_deps = ''.join([
- ' ":%s",\n'.format(d[1:].replace('/', '_'))
+ ' ":{}",\n'.format(d[1:].replace('/', '_'))
for d in resolved_deps if d not in skip_set
])
rules.append(
@@ -843,6 +843,8 @@
with open("../../compilers/orin_debian_rootfs.BUILD", "w") as file:
file.write(template.render(substitutions))
+ subprocess.run(['buildifier', "../../compilers/orin_debian_rootfs.BUILD"])
+
def do_package(partition):
tarball = datetime.date.today().strftime(
@@ -1112,8 +1114,11 @@
target_mkdir("root:root", "755", "etc/systemd/network")
copyfile("root:root", "644", "etc/systemd/network/eth0.network")
- copyfile("root:root", "644", "etc/systemd/network/80-can.network")
+ copyfile("root:root", "644", "etc/systemd/network/80-cana.network")
+ copyfile("root:root", "644", "etc/systemd/network/80-canb.network")
+ copyfile("root:root", "644", "etc/systemd/network/80-canc.network")
copyfile("root:root", "644", "etc/udev/rules.d/nvidia.rules")
+ copyfile("root:root", "644", "etc/udev/rules.d/can.rules")
target(["/root/bin/change_hostname.sh", "pi-971-1"])
target(["systemctl", "enable", "systemd-networkd"])