From 5d3271dc3ac8bc6b483f5e7f6386b42b47e27f8e Mon Sep 17 00:00:00 2001 From: Vyacheslav <64684523+adeepn@users.noreply.github.com> Date: Fri, 25 Feb 2022 21:27:57 +0300 Subject: [PATCH] JetHub H1: dirty userland fix for net interface does not up at boot (#3507) --- config/sources/families/jethub.conf | 8 ++++++++ packages/bsp/jethub/jethubj80/jethub-ethreset | 3 +++ .../bsp/jethub/jethubj80/jethub-ethreset.service | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100755 packages/bsp/jethub/jethubj80/jethub-ethreset create mode 100644 packages/bsp/jethub/jethubj80/jethub-ethreset.service diff --git a/config/sources/families/jethub.conf b/config/sources/families/jethub.conf index e4c1dfd2fc..923815c770 100644 --- a/config/sources/families/jethub.conf +++ b/config/sources/families/jethub.conf @@ -153,6 +153,9 @@ family_tweaks() { # Hardware init chroot "${SDCARD}" /bin/bash -c "systemctl --no-reload enable jethub-initer.service >/dev/null 2>&1" + # AR-1098 userland fix for net interface does not up at boot + chroot "${SDCARD}" /bin/bash -c "systemctl --no-reload enable jethub-ethreset.service >/dev/null 2>&1" + # pip3 packages chroot "${SDCARD}" /bin/bash -c "pip3 install pyserial intelhex python-magic" >>"${DEST}"/debug/install.log 2>&1 @@ -184,7 +187,12 @@ family_tweaks_bsp() { cp "$SRC/packages/bsp/jethub/jethub-initer.service" "$destination/lib/systemd/system/" || exit_with_error "Unable to copy jethub-initer.service" cp "$SRC/packages/bsp/jethub/${BOARD}/jethub-init" "$destination/usr/lib/armbian/" || exit_with_error "Unable to copy jethub-init" + if [[ "$BOARD" == jethubj80 ]]; then + # AR-1098 userland fix for net interface does not up at boot + cp "$SRC/packages/bsp/jethub/jethubj80/jethub-ethreset.service" "$destination/lib/systemd/system/" || exit_with_error "Unable to copy jethub-ethreset.service" + cp "$SRC/packages/bsp/jethub/jethubj80/jethub-ethreset" "$destination/usr/lib/armbian/" || exit_with_error "Unable to copy jethub-ethreset" + # Ethernet LED setup cp "$SRC/packages/bsp/jethub/$BOARD/05-jethub_set_eth_leds.rules" "$destination/etc/udev/rules.d/" fi diff --git a/packages/bsp/jethub/jethubj80/jethub-ethreset b/packages/bsp/jethub/jethubj80/jethub-ethreset new file mode 100755 index 0000000000..89f85bea72 --- /dev/null +++ b/packages/bsp/jethub/jethubj80/jethub-ethreset @@ -0,0 +1,3 @@ +#!/bin/bash +/usr/sbin/ethtool -r eth0 +exit 0 diff --git a/packages/bsp/jethub/jethubj80/jethub-ethreset.service b/packages/bsp/jethub/jethubj80/jethub-ethreset.service new file mode 100644 index 0000000000..5566424403 --- /dev/null +++ b/packages/bsp/jethub/jethubj80/jethub-ethreset.service @@ -0,0 +1,12 @@ +[Unit] +Description=test service +Wants=network.target +After=network.target + +[Service] +Type=oneshot +ExecStartPre=/usr/bin/sleep 20 +ExecStart=/usr/lib/armbian/jethub-ethreset + +[Install] +WantedBy=multi-user.target \ No newline at end of file