diff --git a/userpatches/overlay/etc/systemd/system/usbc_port_cat.service b/userpatches/overlay/etc/systemd/system/usbc_port_cat.service index cbf1035..da77f6d 100644 --- a/userpatches/overlay/etc/systemd/system/usbc_port_cat.service +++ b/userpatches/overlay/etc/systemd/system/usbc_port_cat.service @@ -2,6 +2,7 @@ Description=USB-C Port RAW CAT control Requires=x6100_socat_cat.service Requires=x6100_cat_mux.service +Requires=x6100_app.service [Service] User=root diff --git a/userpatches/overlay/etc/systemd/system/x6100_socat_cat.service b/userpatches/overlay/etc/systemd/system/x6100_socat_cat.service index df5fe8e..e8810d0 100644 --- a/userpatches/overlay/etc/systemd/system/x6100_socat_cat.service +++ b/userpatches/overlay/etc/systemd/system/x6100_socat_cat.service @@ -4,6 +4,7 @@ Requires=x6100_chroot.service [Service] User=root +Type=notify ExecStart=/root/run_x6100_socat_app.sh start ExecStop=/root/run_x6100_socat_app.sh stop Restart=on-failure diff --git a/userpatches/overlay/root/run_x6100_socat_app.sh b/userpatches/overlay/root/run_x6100_socat_app.sh index 3ea058f..22ef175 100755 --- a/userpatches/overlay/root/run_x6100_socat_app.sh +++ b/userpatches/overlay/root/run_x6100_socat_app.sh @@ -18,6 +18,9 @@ if [ "$ACTION" == "start" ] ; then if [ -e "${CAT_DEV_NEW}" ] ; then rm ${CAT_DEV_NEW} fi + if [ -e "${CAT_DEV_ORG}" ] ; then + rm ${CAT_DEV_ORG} + fi if [ ! -e "${CAT_DEV_ORG}" ] ; then # create orginal @@ -25,6 +28,7 @@ if [ "$ACTION" == "start" ] ; then chown root:dialout ${CAT_DEV_ORG} fi + systemd-notify --ready --status="starting socat" exec socat pty,link=${CAT_DEV_NEW},raw,user=root,group=dialout,echo=0 tcp-listen:9990,bind=127.0.0.1,fork else if [ -e "${CAT_DEV_ORG}" ] ; then @@ -43,5 +47,4 @@ else # restore orginal mknod -m 660 ${CAT_DEV} c 4 66 chown root:dialout ${CAT_DEV} - fi