Skip to content

Instantly share code, notes, and snippets.

@jadonk
Last active May 23, 2023 16:20
Show Gist options
  • Save jadonk/39d0fcfc323347d88e995cdfee02bdad to your computer and use it in GitHub Desktop.
Save jadonk/39d0fcfc323347d88e995cdfee02bdad to your computer and use it in GitHub Desktop.
Add X11 to a BeagleBone IoT image

As 'root' perform the following:

git clone https://gist.github.com/jadonk/39d0fcfc323347d88e995cdfee02bdad
apt-get install -y --no-install-recommends xinput xinput-calibrator xorg xserver-xorg-video-fbdev \
    xserver-xorg-video-modesetting lightdm xserver-xorg-core xserver-xorg-input-joystick \
    dbus-x11 openbox cmst compton-conf libfm-tools libgl1-mesa-dri lximage-qt	\
    lxqt-about lxqt-admin lxqt-common lxqt-config lxqt-globalkeys lxqt-notificationd	\
    lxqt-panel lxqt-policykit lxqt-runner lxqt-session lxqt-sudo	\
    obconf pcmanfm-qt qterminal \
    xserver-xorg-video-omap read-edid
systemctl set-default graphical.target
39d0fcfc323347d88e995cdfee02bdad/setup_desktop.sh
3c3
< image_type="iot"
---
> image_type="lxqt-2gb"
17,18d16
< alsa-utils \
< apache2 \
31a30
> dbus-x11 \
36,39d34
< firmware-atheros \
< firmware-ralink \
< firmware-realtek \
< firmware-zd1211 \
43d37
< hdparm \
45d38
< hostapd \
50d42
< iperf \
55d46
< libdbus-1-dev \
56a48
> lightdm \
63a56
> openbox \
66c59
< ppp \
---
> read-edid \
74d66
< u-boot-tools \
78d69
< v4l-utils \
83c74,78
< wvdial \
---
> xinput \
> xinput-calibrator \
> xorg \
> xserver-xorg-video-fbdev \
> xserver-xorg-video-modesetting \
101,102d95
< pylint \
< python-dbus \
104d96
< python-flask \
116,117c108,109
< rfs_default_desktop=""
< rfs_desktop_background=""
---
> rfs_default_desktop="lxqt"
> rfs_desktop_background="/opt/scripts/images/beaglebg.jpg"
131d122
< bb-node-red-installer \
133d123
< bone101 \
134a125
> bone101 \
135a127,128
> cmst \
> compton-conf \
138,143c131,132
< doc-beaglebonegreen-getting-started \
< doc-seeed-bbgw-getting-started \
< haveged \
< libsoc-dev \
< libsoc2 \
< linux-headers-4.4.19-ti-r41 \
---
> libfm-tools \
> libgl1-mesa-dri \
144a134,148
> lximage-qt \
> lxqt-about \
> lxqt-admin \
> lxqt-common \
> lxqt-config \
> lxqt-globalkeys \
> lxqt-notificationd \
> lxqt-panel \
> lxqt-policykit \
> lxqt-runner \
> lxqt-session \
> lxqt-sudo \
> obconf \
> pcmanfm-qt \
> qterminal \
147,148d150
< ti-pru-cgt-installer \
< ti-wlconf \
150c152
< upm \
---
> xserver-xorg-video-omap \
#!/bin/bash
# Per https://github.com/beagleboard/image-builder/blob/master/configs/bb.org-debian-jessie-lxqt-4gb-v4.4.conf
# and https://github.com/beagleboard/image-builder/blob/master/target/chroot/beagleboard.org-jessie.sh
rfs_username="debian"
rfs_default_desktop="lxqt"
rfs_desktop_background="/opt/scripts/images/beaglebg.jpg"
setup_desktop () {
if [ -d /etc/X11/ ] ; then
wfile="/etc/X11/xorg.conf"
echo "Patching: ${wfile}"
echo "Section \"Monitor\"" > ${wfile}
echo " Identifier \"Builtin Default Monitor\"" >> ${wfile}
echo "EndSection" >> ${wfile}
echo "" >> ${wfile}
echo "Section \"Device\"" >> ${wfile}
echo " Identifier \"Builtin Default fbdev Device 0\"" >> ${wfile}
# echo " Driver \"modesetting\"" >> ${wfile}
# echo " Option \"AccelMethod\" \"none\"" >> ${wfile}
echo " Driver \"fbdev\"" >> ${wfile}
echo "#HWcursor_false Option \"HWcursor\" \"false\"" >> ${wfile}
echo "EndSection" >> ${wfile}
echo "" >> ${wfile}
echo "Section \"Screen\"" >> ${wfile}
echo " Identifier \"Builtin Default fbdev Screen 0\"" >> ${wfile}
echo " Device \"Builtin Default fbdev Device 0\"" >> ${wfile}
echo " Monitor \"Builtin Default Monitor\"" >> ${wfile}
echo " DefaultDepth 16" >> ${wfile}
echo "EndSection" >> ${wfile}
echo "" >> ${wfile}
echo "Section \"ServerLayout\"" >> ${wfile}
echo " Identifier \"Builtin Default Layout\"" >> ${wfile}
echo " Screen \"Builtin Default fbdev Screen 0\"" >> ${wfile}
echo "EndSection" >> ${wfile}
fi
wfile="/etc/lightdm/lightdm.conf"
if [ -f ${wfile} ] ; then
echo "Patching: ${wfile}"
sed -i -e 's:#autologin-user=:autologin-user='$rfs_username':g' ${wfile}
sed -i -e 's:#autologin-session=UNIMPLEMENTED:autologin-session='$rfs_default_desktop':g' ${wfile}
if [ -f /opt/scripts/3rdparty/xinput_calibrator_pointercal.sh ] ; then
sed -i -e 's:#display-setup-script=:display-setup-script=/opt/scripts/3rdparty/xinput_calibrator_pointercal.sh:g' ${wfile}
fi
fi
if [ ! "x${rfs_desktop_background}" = "x" ] ; then
mkdir -p /home/${rfs_username}/.config/ || true
if [ -d /opt/scripts/desktop-defaults/jessie/lxqt/ ] ; then
cp -rv /opt/scripts/desktop-defaults/jessie/lxqt/* /home/${rfs_username}/.config
fi
chown -R ${rfs_username}:${rfs_username} /home/${rfs_username}/.config/
fi
#Disable dpms mode and screen blanking
#Better fix for missing cursor
wfile="/home/${rfs_username}/.xsessionrc"
echo "#!/bin/sh" > ${wfile}
echo "" >> ${wfile}
echo "xset -dpms" >> ${wfile}
echo "xset s off" >> ${wfile}
echo "xsetroot -cursor_name left_ptr" >> ${wfile}
chown -R ${rfs_username}:${rfs_username} ${wfile}
# #Disable LXDE's screensaver on autostart
# if [ -f /etc/xdg/lxsession/LXDE/autostart ] ; then
# sed -i '/xscreensaver/s/^/#/' /etc/xdg/lxsession/LXDE/autostart
# fi
#echo "CAPE=cape-bone-proto" >> /etc/default/capemgr
# #root password is blank, so remove useless application as it requires a password.
# if [ -f /usr/share/applications/gksu.desktop ] ; then
# rm -f /usr/share/applications/gksu.desktop || true
# fi
# #lxterminal doesnt reference .profile by default, so call via loginshell and start bash
# if [ -f /usr/bin/lxterminal ] ; then
# if [ -f /usr/share/applications/lxterminal.desktop ] ; then
# sed -i -e 's:Exec=lxterminal:Exec=lxterminal -l -e bash:g' /usr/share/applications/lxterminal.desktop
# sed -i -e 's:TryExec=lxterminal -l -e bash:TryExec=lxterminal:g' /usr/share/applications/lxterminal.desktop
# fi
# fi
}
setup_desktop
@el-mimoso
Copy link

Thanks a lot! You rock!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment