Skip to content
Permalink
Browse files

[IMP] point_of_sale: Add support of RPI 4

With this PR we can use the IoT Box with the new Raspberry Pi 4 B
using raspbian 'Buster'

With buster we remove the kiosk mode of firefox and
replace this mode with a fullscreen view of firefox.
To do that we adapt DisplayDriver to expend window with a 'call_xdotool(F11)'

We remove postgresql and patch 'odoo/odoo/http.py' for he does not return a DB.

Task id: 2089286
  • Loading branch information...
qle-odoo committed Oct 17, 2019
1 parent 583054f commit 170af60b9b0d5e7e80f3811d402923bd69a74343
Showing with 27 additions and 303 deletions.
  1. +2 −1 addons/hw_drivers/drivers/DisplayDriver.py
  2. +1 −1 addons/point_of_sale/tools/posbox/overwrite_after_init/etc/ld.so.preload
  3. +5 −0 addons/point_of_sale/tools/posbox/overwrite_after_init/etc/resolv.conf
  4. +11 −0 addons/point_of_sale/tools/posbox/overwrite_after_init/home/pi/odoo/odoo/http.py.iotpatch
  5. +0 −32 ...sr/lib/firefox-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/META-INF/manifest.mf
  6. BIN ...sr/lib/firefox-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/META-INF/mozilla.rsa
  7. +0 −4 ...usr/lib/firefox-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/META-INF/mozilla.sf
  8. +0 −3 ...e_after_init/usr/lib/firefox-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/README
  9. +0 −4 ...nit/usr/lib/firefox-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/chrome.manifest
  10. +0 −34 ...ib/firefox-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/content/rkioskbrowser.js
  11. +0 −175 ...b/firefox-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/content/rkioskbrowser.xul
  12. +0 −9 ...sr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/content/rkioskunknownContentType.xul
  13. +0 −9 ...-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/content/rkioskxpinstallConfirm.xul
  14. +0 −19 ...er_init/usr/lib/firefox-esr/browser/extensions/{4D498D0A-05AD-4fdb-97B5-8A0AABC1FC5B}/install.rdf
  15. 0 .../posbox/overwrite_after_init/usr/local/lib/{python3.5 → python3.7}/dist-packages/v4l2.py.iotpatch
  16. +1 −0 ...ools/posbox/overwrite_after_init/usr/share/firefox-esr/browser/defaults/preferences/all-posbox.js
  17. +1 −1 addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init.d/odoo
  18. +3 −8 addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh
  19. +1 −1 addons/point_of_sale/tools/posbox/overwrite_before_init/etc/ld.so.preload
  20. +1 −1 addons/point_of_sale/tools/posbox/posbox_create_image.sh
  21. +1 −1 addons/point_of_sale/tools/posbox/posbox_download_images.sh
@@ -36,6 +36,7 @@ def __init__(self, device):
self.owner = False
self.rendered_html = ''
self.load_url()
self.call_xdotools('F11')

@property
def device_identifier(self):
@@ -103,7 +104,7 @@ def call_xdotools(self, keystroke):
os.environ['DISPLAY'] = ":0.0"
os.environ['XAUTHORITY'] = "/run/lightdm/pi/xauthority"
try:
subprocess.call(['xdotool', 'key', keystroke])
subprocess.call(['xdotool', 'search', '--sync', '--onlyvisible', '--class', 'Firefox', 'windowactivate', 'key', keystroke])
return "xdotool succeeded in stroking " + keystroke
except:
return "xdotool threw an error, maybe it is not installed on the IoTBox"
@@ -1 +1 @@
/usr/lib/arm-linux-gnueabihf/libarmmem.so
/usr/lib/arm-linux-gnueabihf/libarmmem-v8l.so
@@ -0,0 +1,5 @@
# Edited by Odoo
domain localdomain
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1
@@ -0,0 +1,11 @@
--- http_old.py 2019-11-07 15:01:37.190918774 +0100
+++ http_new.py 2019-11-07 15:02:16.406711394 +0100
@@ -1496,7 +1496,7 @@
"""
httprequest = httprequest or request.httprequest

- dbs = db_list(True, httprequest)
+ dbs = []

# try the db already in the session
db_session = httprequest.session.db

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -8,3 +8,4 @@ pref("browser.shell.checkDefaultBrowser", false);
// Open all links in the same tab
// Needed to change URL without having multiple tabs running
pref("browser.link.open_newwindow", 1);
pref("browser.shell.checkDefaultBrowser",false);
@@ -1,7 +1,7 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: odoo.py
# Required-Start: $remote_fs $syslog postgresql
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@@ -12,7 +12,7 @@ __base="$(basename ${__file} .sh)"
# leading to mismatch between kernel image and modules.
mount /dev/sda1 /boot

# Recommends: antiword, graphviz, ghostscript, postgresql, python-gevent, poppler-utils
# Recommends: antiword, graphviz, ghostscript, python-gevent, poppler-utils
export DEBIAN_FRONTEND=noninteractive
echo "nameserver 8.8.8.8" >> /etc/resolv.conf

@@ -46,14 +46,14 @@ PKGS_TO_INSTALL="
lightdm \
xserver-xorg-video-fbdev \
xserver-xorg-input-evdev \
iceweasel \
firefox-esr \
xdotool \
unclutter \
x11-utils \
openbox \
rpi-update \
adduser \
postgresql \
libpq-dev \
python-cups \
python3 \
python3-pyscard \
@@ -96,11 +96,6 @@ echo "Acquire::Retries "16";" > /etc/apt/apt.conf.d/99acquire-retries
# KEEP OWN CONFIG FILES DURING PACKAGE CONFIGURATION
# http://serverfault.com/questions/259226/automatically-keep-current-version-of-config-files-when-apt-get-install
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install ${PKGS_TO_INSTALL}
pg_lsclusters
systemctl start postgresql@9.6-main
systemctl status postgresql@9.6-main

sudo -u postgres createuser -s pi

apt-get clean
localepurge
@@ -1 +1 @@
#/usr/lib/arm-linux-gnueabihf/libarmmem.so
#/usr/lib/arm-linux-gnueabihf/libarmmem-v8l.so

0 comments on commit 170af60

Please sign in to comment.
You can’t perform that action at this time.