SRC_URI += "file://dcs_first_boot.sh"

SRC_URI += "file://dcs_first_boot.service"

SRC_URI += "file://usb_hub_control.sh"

SRC_URI += "file://usb_hub_control.service"

SRC_URI += "file://usb3_control.sh"

SRC_URI += "file://usb3_control.service"


inherit systemd


DEPENDS += "bash"


SYSTEMD_AUTO_ENABLE:${PN} = "enable"

SYSTEMD_SERVICE:${PN} = "dcs_first_boot.service"

SYSTEMD_SERVICE:${PN} = "usb_hub_control.service"

SYSTEMD_SERVICE:${PN} = "usb3_control.service"


do_install() {

install -d ${D}/${systemd_unitdir}/system

install -m 0644 \

${WORKDIR}/dcs_first_boot.service \

${WORKDIR}/usb_hub_control.service \

${WORKDIR}/usb3_control.service \

${D}/${systemd_unitdir}/system


install -d ${D}/${systemd_unitdir}/system/multi-user.target.wants

ln -s -r ${D}/${systemd_unitdir}/system/dcs_first_boot.service ${D}/${systemd_unitdir}/system/multi-user.target.wants/dcs_first_boot.service


install -d ${D}/etc/first_boot


install -d ${D}/usr/local/bin

install -m 0770 \

${WORKDIR}/dcs_first_boot.sh \

${WORKDIR}/usb_hub_control.sh \

${WORKDIR}/usb3_control.sh \

${D}/usr/local/bin

}


FILES:${PN} += "${systemd_unitdir}/system/dcs_first_boot.service"

FILES:${PN} += "${systemd_unitdir}/system/usb_hub_control.service"

FILES:${PN} += "${systemd_unitdir}/system/usb3_control.service"


FILES:${PN} += "/usr/local/bin/dcs_first_boot.sh"

FILES:${PN} += "/usr/local/bin/usb_hub_control.sh"

FILES:${PN} += "/usr/local/bin/usb3_control.sh"


FILES:${PN} += "/lib/systemd/system/multi-user.target.wants"

FILES:${PN} += "/lib/systemd/system/multi-user.target.wants/dcs_first_boot.service"