diff options
Diffstat (limited to 'recipes-misc/de10-nano-x11vnc-init')
3 files changed, 74 insertions, 0 deletions
diff --git a/recipes-misc/de10-nano-x11vnc-init/de10-nano-x11vnc-init.bb b/recipes-misc/de10-nano-x11vnc-init/de10-nano-x11vnc-init.bb new file mode 100644 index 0000000..47aea10 --- /dev/null +++ b/recipes-misc/de10-nano-x11vnc-init/de10-nano-x11vnc-init.bb @@ -0,0 +1,36 @@ +SUMMARY = "De Nano X11VNC startus" +DESCRIPTION = "De Nano scripts to start x11vnc" +AUTHOR = "Dalon Westergreen <dwesterg@gmail.com>" +SECTION = "DE10-Nano" + +PV = "1.0" +PR = "r0" + +inherit systemd + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +SRC_URI = "file://de10-nano-x11vnc-init.service \ + file://de10-nano-x11vnc-init.sh \ + " + +do_install() { + install -d ${D}${base_libdir}/systemd/system + install -m 0644 ${WORKDIR}/*.service ${D}${base_libdir}/systemd/system + + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/*.sh ${D}${bindir} + +} + +FILES_${PN} = "${base_libdir}/systemd/system/de10-nano-x11vnc-init.service \ + ${sysconfdir}/systemd/ \ + ${bindir}/de10-nano-x11vnc-init.sh \ + " + +NATIVE_SYSTEMD_SUPPORT = "1" +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "de10-nano-x11vnc-init.service" diff --git a/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.service b/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.service new file mode 100644 index 0000000..a240722 --- /dev/null +++ b/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.service @@ -0,0 +1,9 @@ +[Unit] +Description=DE10-Nano X11VNC server +Documentation=man:x11vnc + +[Service] +ExecStart=/usr/bin/de10-nano-x11vnc-init.sh + +[Install] +WantedBy=multi-user.target diff --git a/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh b/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh new file mode 100644 index 0000000..94de046 --- /dev/null +++ b/recipes-misc/de10-nano-x11vnc-init/files/de10-nano-x11vnc-init.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +X11VNC__SH_ENV="/home/root/.x11vnc_env" +X11VNC_HOME="/home/root" + +# create this environment setup file for the shell in the x11vnc session +[ -f "${X11VNC__SH_ENV}" ] || { +cat <<EOF > "${X11VNC__SH_ENV}" + +# this file is created by the script ‘/usr/bin/de10-nano-x11vnc-init.sh’. +# + +# this file is assigned to the ENV environment variable which is evaluated +# when /bin/sh is executed. We use this to setup environment variables for +# that shell. + +export PS1='\u@\h:\w$ ' +EOF +} + +# then execute this command to start the x11vnc session +FD_PROG=/usr/bin/xfce4-session \ +/usr/bin/x11vnc \ +-loop \ +-repeat \ +-env ENV="${X11VNC__SH_ENV}" \ +-env HOME="${X11VNC_HOME}" \ +-display WAIT:cmd=FINDCREATEDISPLAY-Xvfb + |