1divert(-1)
2define(`HOST_MAC_ARG', `ifelse($1, `invalid', `',
3            ifelse($1, `', `',
4                ` --host-mac "$1"'))')
5
6define(`DEV_MAC_ARG', `ifelse($1, `invalid', `',
7            ifelse($1, `', `',
8                ` --dev-mac "$1"'))')
9
10divert(0)dnl
11dnl
12[Unit]
13Description=USB Gadget
14
15[Service]
16Type=oneshot
17RemainAfterExit=yes
18ExecStart=M_SCRIPT_INSTALL_DIR/usb_network.sh \
19    --product-id "M_BMC_USB_PRODUCT_ID" \
20    --product-name "M_BMC_USB_PRODUCT_NAME" \
21    --dev-type "M_BMC_USB_TYPE" \
22    HOST_MAC_ARG(M_BMC_USB_HOST_MAC) \
23    DEV_MAC_ARG(M_BMC_USB_DEV_MAC) \
24    --iface-name "M_BMC_USB_IFACE" \
25    --bind-device "M_BMC_USB_BIND_DEV"
26ExecStop=M_SCRIPT_INSTALL_DIR/usb_network.sh stop \
27    --dev-type "M_BMC_USB_TYPE" \
28    --iface-name "M_BMC_USB_IFACE"
29
30[Install]
31WantedBy=multi-user.target
32