From fa1d197fbf6dde03e3fa2363425c0f5f9b0bcd42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 6 Mar 2019 18:47:16 +0100 Subject: [PATCH] modular config for touch screen --- Makefile | 23 +++++++++---------- config.example | 10 ++++---- files/boot/config.txt | 5 ---- files/root/postbuild.sh | 4 ---- .../usr/share/X11/xorg.conf.d/45-evdev.conf | 7 ++++++ .../etc/{ => X11}/Xresources/xscreensaver | 0 files_xfce/etc/{ => X11}/Xsession.d/10qtstyle | 0 files_xfce/etc/{ => gimp}/2.0/controllerrc | 0 files_xfce/etc/{ => gimp}/2.0/gimprc | 0 files_xfce/etc/{ => gimp}/2.0/gtkrc | 0 files_xfce/etc/{ => gimp}/2.0/menurc | 0 files_xfce/etc/{ => gimp}/2.0/sessionrc | 0 files_xfce/etc/{ => gimp}/2.0/templaterc | 0 files_xfce/etc/{ => gimp}/2.0/toolrc | 0 files_xfce/etc/{ => gimp}/2.0/unitrc | 0 files_xfce/etc/{ => gtk-2.0}/gtkrc | 0 files_xfce/etc/{ => xdg}/marblerc | 0 files_xfce/etc/{ => xdg}/mimeapps.list | 0 .../{ => xdg}/xfce4/panel/whiskermenu-1.rc | 0 .../etc/{ => xdg}/xfce4/terminal/terminalrc | 0 .../xfconf/xfce-perchannel-xml/thunar.xml | 0 .../xfce-perchannel-xml/xfce4-desktop.xml | 0 .../xfce-perchannel-xml/xfce4-panel.xml | 0 .../xfconf/xfce-perchannel-xml/xfwm4.xml | 0 .../xfconf/xfce-perchannel-xml/xsettings.xml | 0 ws5inch.mk | 21 +++++++++++++++++ xfce.mk | 12 ++++------ 27 files changed, 49 insertions(+), 33 deletions(-) delete mode 100755 files/root/postbuild.sh create mode 100644 files_ws5inch/usr/share/X11/xorg.conf.d/45-evdev.conf rename files_xfce/etc/{ => X11}/Xresources/xscreensaver (100%) rename files_xfce/etc/{ => X11}/Xsession.d/10qtstyle (100%) rename files_xfce/etc/{ => gimp}/2.0/controllerrc (100%) rename files_xfce/etc/{ => gimp}/2.0/gimprc (100%) rename files_xfce/etc/{ => gimp}/2.0/gtkrc (100%) rename files_xfce/etc/{ => gimp}/2.0/menurc (100%) rename files_xfce/etc/{ => gimp}/2.0/sessionrc (100%) rename files_xfce/etc/{ => gimp}/2.0/templaterc (100%) rename files_xfce/etc/{ => gimp}/2.0/toolrc (100%) rename files_xfce/etc/{ => gimp}/2.0/unitrc (100%) rename files_xfce/etc/{ => gtk-2.0}/gtkrc (100%) rename files_xfce/etc/{ => xdg}/marblerc (100%) rename files_xfce/etc/{ => xdg}/mimeapps.list (100%) rename files_xfce/etc/{ => xdg}/xfce4/panel/whiskermenu-1.rc (100%) rename files_xfce/etc/{ => xdg}/xfce4/terminal/terminalrc (100%) rename files_xfce/etc/{ => xdg}/xfce4/xfconf/xfce-perchannel-xml/thunar.xml (100%) rename files_xfce/etc/{ => xdg}/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml (100%) rename files_xfce/etc/{ => xdg}/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml (100%) rename files_xfce/etc/{ => xdg}/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml (100%) rename files_xfce/etc/{ => xdg}/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml (100%) create mode 100644 ws5inch.mk diff --git a/Makefile b/Makefile index 6a35118..fe8971e 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,8 @@ BOOTSTRAP = http://raspbian.raspberrypi.org/raspbian define SOURCES = -deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi\n\ -deb http://archive.raspberrypi.org/debian stretch main\n +deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi +deb http://archive.raspberrypi.org/debian stretch main endef PACKAGES := apt bluez bluez-firmware bluez-tools btrfs-tools busybox-static bzip2 ca-certificates cron debian-archive-keyring deborphan firmware-brcm80211 firmware-linux-free firmware-misc-nonfree gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less libraspberrypi-bin libraspberrypi0 make net-tools nmap ntpdate openssh-client openssh-server pi-bluetooth raspberrypi-bootloader raspberrypi-kernel rsync ssh sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip @@ -30,15 +30,14 @@ PACKAGES := apt bluez bluez-firmware bluez-tools btrfs-tools busybox-static bzip WIFI-SSID = WIFI-PASS = +IMGFILE = raspi.img + config.mk: config.example cp -n "$<" "$@" +include config.mk .PHONY: imgfile imgmount root_copy norecommends apt_keys - -IMGFILE = raspi.img - -include config.mk -include *.mk +export SOURCES raspi_root: btrfs subvolume create "$@" || mkdir "$@" @@ -55,13 +54,13 @@ raspi_root/etc/apt/apt.conf.d/10norecommends: raspi_root printf 'APT::Install-Recommends "false";\n' >"$@" chmod 644 "$@" -apt_keys: - -chroot "$@" apt-key add - <./raspbian-archive-keyring.gpg - -chroot "$@" apt-key add - <./raspberrypi-archive-keyring.gpg - -chroot "$@" apt-key add - <./debian-archive-stretch-stable.gpg +apt_keys: raspi_root + -chroot "$<" apt-key add - <./raspbian-archive-keyring.gpg + -chroot "$<" apt-key add - <./raspberrypi-archive-keyring.gpg + -chroot "$<" apt-key add - <./debian-archive-stretch-stable.gpg raspi_root/: raspi_root norecommends apt_keys .FORCE - printf '${SOURCES}' >$@/etc/apt/sources.list + printf %s "$$SOURCES" >$@/etc/apt/sources.list -cp /etc/resolv.conf "$@etc/" -chroot "$@" sh -c 'apt-mark showmanual |xargs apt-mark auto' -chroot "$@" apt-get update diff --git a/config.example b/config.example index 8f02654..9bf5035 100644 --- a/config.example +++ b/config.example @@ -1,18 +1,20 @@ # Name this file config.mk to override options from the main Makefile # define SOURCES = -# deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi\n\ -# deb http://archive.raspberrypi.org/debian stretch main\n +# deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi +# deb http://archive.raspberrypi.org/debian stretch main # endef # BOOTSTRAP := http://raspbian.raspberrypi.org/raspbian - # PACKAGES := ${PACKAGES} foo bar ... additional packages +# include xfce.mk +# include ws5inch.mk + # WIFI-SSID = # WIFI-PASS = # PHONY: rootpass # ${IMGFILE}: rootpass # rootpass: imgmount root_copy -# -chroot "$<" usermod -p "$(openssl passwd -1 -salt aaa password)" root +# -chroot "$<" usermod -p "$$(openssl passwd -salt "x$$RANDOM" password)" root diff --git a/files/boot/config.txt b/files/boot/config.txt index 78c168d..cf2e1af 100644 --- a/files/boot/config.txt +++ b/files/boot/config.txt @@ -5,8 +5,3 @@ dtparam=audio=on # dtoverlay=w1-gpio - -hdmi_group=2 -hdmi_mode=87 -hdmi_cvt=800 480 60 6 0 0 0 -hdmi_drive=1 diff --git a/files/root/postbuild.sh b/files/root/postbuild.sh deleted file mode 100755 index faf7de6..0000000 --- a/files/root/postbuild.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -usermod -p "$(openssl passwd -1 -salt ert root)" root -useradd -m local diff --git a/files_ws5inch/usr/share/X11/xorg.conf.d/45-evdev.conf b/files_ws5inch/usr/share/X11/xorg.conf.d/45-evdev.conf new file mode 100644 index 0000000..6d18181 --- /dev/null +++ b/files_ws5inch/usr/share/X11/xorg.conf.d/45-evdev.conf @@ -0,0 +1,7 @@ +Section "InputClass" + Identifier "evdev touchscreen catchall" + MatchIsTouchscreen "on" + Option "Calibration" "200 3950 250 4000" + MatchDevicePath "/dev/input/event*" + Driver "evdev" +EndSection diff --git a/files_xfce/etc/Xresources/xscreensaver b/files_xfce/etc/X11/Xresources/xscreensaver similarity index 100% rename from files_xfce/etc/Xresources/xscreensaver rename to files_xfce/etc/X11/Xresources/xscreensaver diff --git a/files_xfce/etc/Xsession.d/10qtstyle b/files_xfce/etc/X11/Xsession.d/10qtstyle similarity index 100% rename from files_xfce/etc/Xsession.d/10qtstyle rename to files_xfce/etc/X11/Xsession.d/10qtstyle diff --git a/files_xfce/etc/2.0/controllerrc b/files_xfce/etc/gimp/2.0/controllerrc similarity index 100% rename from files_xfce/etc/2.0/controllerrc rename to files_xfce/etc/gimp/2.0/controllerrc diff --git a/files_xfce/etc/2.0/gimprc b/files_xfce/etc/gimp/2.0/gimprc similarity index 100% rename from files_xfce/etc/2.0/gimprc rename to files_xfce/etc/gimp/2.0/gimprc diff --git a/files_xfce/etc/2.0/gtkrc b/files_xfce/etc/gimp/2.0/gtkrc similarity index 100% rename from files_xfce/etc/2.0/gtkrc rename to files_xfce/etc/gimp/2.0/gtkrc diff --git a/files_xfce/etc/2.0/menurc b/files_xfce/etc/gimp/2.0/menurc similarity index 100% rename from files_xfce/etc/2.0/menurc rename to files_xfce/etc/gimp/2.0/menurc diff --git a/files_xfce/etc/2.0/sessionrc b/files_xfce/etc/gimp/2.0/sessionrc similarity index 100% rename from files_xfce/etc/2.0/sessionrc rename to files_xfce/etc/gimp/2.0/sessionrc diff --git a/files_xfce/etc/2.0/templaterc b/files_xfce/etc/gimp/2.0/templaterc similarity index 100% rename from files_xfce/etc/2.0/templaterc rename to files_xfce/etc/gimp/2.0/templaterc diff --git a/files_xfce/etc/2.0/toolrc b/files_xfce/etc/gimp/2.0/toolrc similarity index 100% rename from files_xfce/etc/2.0/toolrc rename to files_xfce/etc/gimp/2.0/toolrc diff --git a/files_xfce/etc/2.0/unitrc b/files_xfce/etc/gimp/2.0/unitrc similarity index 100% rename from files_xfce/etc/2.0/unitrc rename to files_xfce/etc/gimp/2.0/unitrc diff --git a/files_xfce/etc/gtkrc b/files_xfce/etc/gtk-2.0/gtkrc similarity index 100% rename from files_xfce/etc/gtkrc rename to files_xfce/etc/gtk-2.0/gtkrc diff --git a/files_xfce/etc/marblerc b/files_xfce/etc/xdg/marblerc similarity index 100% rename from files_xfce/etc/marblerc rename to files_xfce/etc/xdg/marblerc diff --git a/files_xfce/etc/mimeapps.list b/files_xfce/etc/xdg/mimeapps.list similarity index 100% rename from files_xfce/etc/mimeapps.list rename to files_xfce/etc/xdg/mimeapps.list diff --git a/files_xfce/etc/xfce4/panel/whiskermenu-1.rc b/files_xfce/etc/xdg/xfce4/panel/whiskermenu-1.rc similarity index 100% rename from files_xfce/etc/xfce4/panel/whiskermenu-1.rc rename to files_xfce/etc/xdg/xfce4/panel/whiskermenu-1.rc diff --git a/files_xfce/etc/xfce4/terminal/terminalrc b/files_xfce/etc/xdg/xfce4/terminal/terminalrc similarity index 100% rename from files_xfce/etc/xfce4/terminal/terminalrc rename to files_xfce/etc/xdg/xfce4/terminal/terminalrc diff --git a/files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/thunar.xml b/files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/thunar.xml similarity index 100% rename from files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/thunar.xml rename to files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/thunar.xml diff --git a/files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml b/files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml similarity index 100% rename from files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml rename to files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml diff --git a/files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml similarity index 100% rename from files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml rename to files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml diff --git a/files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml b/files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml similarity index 100% rename from files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml rename to files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml diff --git a/files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml b/files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml similarity index 100% rename from files_xfce/etc/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml rename to files_xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml diff --git a/ws5inch.mk b/ws5inch.mk new file mode 100644 index 0000000..e514622 --- /dev/null +++ b/ws5inch.mk @@ -0,0 +1,21 @@ +define ws5inch_boot = +hdmi_group=2 +hdmi_mode=87 +hdmi_cvt=800 480 60 6 0 0 0 +hdmi_drive=1 + +dtparam=i2c_arm=on +dtparam=spi=on +enable_uart=1 +dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900 +endef +export ws5inch_boot + +PACKAGES := ${PACKAGES} xserver-xorg-input-evdev xinput xinput-calibrator + +.PHONY: ws5inch +${IMGFILE}: ws5inch +ws5inch: imgmount root_copy files_ws5inch/ + cp -a files_ws5inch/. "$>"$