diff options
-rw-r--r-- | packaging/system-plugin.spec | 10 | ||||
-rw-r--r-- | rules/99-usb-ethernet.rules | 6 | ||||
-rw-r--r-- | scripts/usb_net_init.sh | 9 |
3 files changed, 21 insertions, 4 deletions
diff --git a/packaging/system-plugin.spec b/packaging/system-plugin.spec index 1bfacec..3622003 100644 --- a/packaging/system-plugin.spec +++ b/packaging/system-plugin.spec @@ -131,7 +131,6 @@ mkdir -p %{buildroot}/csa mkdir -p %{buildroot}/initrd install -m 644 units/resize2fs@.service %{buildroot}%{_unitdir} install -m 644 units/tizen-system-env.service %{buildroot}%{_unitdir} -install -m 644 units/ivi-network.service %{buildroot}%{_unitdir} # csa mount install -m 644 units/csa.mount %{buildroot}%{_unitdir} @@ -149,11 +148,11 @@ ln -s ../resize2fs@.service %{buildroot}%{_unitdir}/basic.target.wants/resize2fs ln -s ../resize2fs@.service %{buildroot}%{_unitdir}/basic.target.wants/resize2fs@dev-disk-by\\x2dpartlabel-rootfs.service ln -s ../tizen-system-env.service %{buildroot}%{_unitdir}/basic.target.wants/tizen-system-env.service -%install_service multi-user.target.wants ivi-network.service mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d/ install -m 644 rules/51-system-plugin-exynos.rules %{buildroot}%{_prefix}/lib/udev/rules.d/ install -m 644 rules/51-system-plugin-spreadtrum.rules %{buildroot}%{_prefix}/lib/udev/rules.d/ +install -m 644 rules/99-usb-ethernet.rules %{buildroot}%{_prefix}/lib/udev/rules.d/ # fstab mkdir -p %{buildroot}%{_sysconfdir} @@ -185,6 +184,9 @@ install -m 644 units/offline-update.service %{buildroot}%{_unitdir} ln -s ../offline-update.service %{buildroot}%{_unitdir}/system-update.target.wants/offline-update.service ln -s %{_datadir}/upgrade %{buildroot}/system-update +# ivi +install -m 755 scripts/usb_net_init.sh %{buildroot}%{_bindir} + # fixed-multi-user install -m 775 -D scripts/fixed-multi-user.sh %{buildroot}%{_datadir}/fixed_multiuser/fixed-multi-user.sh @@ -314,5 +316,5 @@ cp -a /usr/lib/systemd/system/user\@.service /usr/lib/systemd/system/__user@.ser echo 'RemainAfterExit=yes' >> /usr/lib/systemd/system/user\@.service %files profile_ivi -%{_unitdir}/ivi-network.service -%{_unitdir}/multi-user.target.wants/ivi-network.service +%{_prefix}/lib/udev/rules.d/99-usb-ethernet.rules +%{_bindir}/usb_net_init.sh diff --git a/rules/99-usb-ethernet.rules b/rules/99-usb-ethernet.rules new file mode 100644 index 0000000..6c0307d --- /dev/null +++ b/rules/99-usb-ethernet.rules @@ -0,0 +1,6 @@ +# USB ETHERNET +SUBSYSTEM!="net", GOTO="usb_ethernet_end" + +ACTION=="add", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="8152", RUN+="/usr/bin/usb_net_init.sh %k" + +LABEL="usb_ethernet_end" diff --git a/scripts/usb_net_init.sh b/scripts/usb_net_init.sh new file mode 100644 index 0000000..ab245b1 --- /dev/null +++ b/scripts/usb_net_init.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +interface=$1 + +/sbin/ifconfig ${interface} down +/sbin/ifconfig ${interface} 192.20.16.11 +/sbin/ifconfig ${interface} up + |