Commit 5ee4326d authored by Guido Gunther's avatar Guido Gunther
Browse files

Merge tag 'v0.0.14' into pureos/byzantium

librem5-devkit-tools v0.0.14
parents ed98d0ad 70c4e06f
......@@ -32,10 +32,16 @@ test:download:deb:
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install $FLASHDEPS
- rm -rf output
script:
- scripts/librem5-devkit-flash-image --board librem5 --variant plain --dist amber-phone --skip-flash --skip-cleanup --dir=download/
- ls -l download/librem5.img download/flash_librem5.lst download/u-boot-librem5.imx
- scripts/librem5-flash-image --board librem5r3 --variant plain --dist amber-phone --skip-flash --skip-cleanup --dir=download/
- ls -l download/librem5*.img download/flash_librem5*.lst download/u-boot-librem5*.imx
- mkdir -p output/
- cp download/flash_*.lst output/
- rm -rf download
artifacts:
paths:
- output/
test:download:pip:
<<: *tags
......@@ -48,7 +54,7 @@ test:download:pip:
- virtualenv --python=python3 test-download
- source test-download/bin/activate
- pip install -r requirements.txt
- python3 scripts/librem5-devkit-flash-image --board librem5 --variant plain --dist amber-phone --skip-flash --skip-cleanup --dir=download/
- ls -l download/librem5.img download/flash_librem5.lst download/u-boot-librem5.imx
- python3 scripts/librem5-flash-image --board librem5r3 --variant plain --dist amber-phone --skip-flash --skip-cleanup --dir=download/
- ls -l download/librem5*.img download/flash_librem5*.lst download/u-boot-librem5*.imx
- rm -rf download
librem5-devkit-tools (0.0.14) amber-phone; urgency=medium
[ Martin Kepplinger ]
* pytests: test_cameras: update to runtime pm sysfs interface
-- Martin Kepplinger <martin.kepplinger@puri.sm> Mon, 30 Nov 2020 19:50:59 +0100
librem5-devkit-tools (0.0.13) amber-phone; urgency=high
[ Guido Günther ]
* librem5-flash-image: Fix help
* librem5-flash-image: Use amber-phone as default
* librem5-flash-image: Use revision for uuu_mods too
No need to pass both
* librem5-flash-image: Use dogwood by default
* flash-image: Drop unused global
* flash-image: Print defaults
This makes it simpler for people who found --help
* debian: Add librem5-flash-image manpage based on help output
* debian: Add flash-image deps as build-deps
This ensure help2man can work
* librem5-flash-image: Support r4
[ Martin Kepplinger ]
* pytests: add basic test for the torch
* pytests: add basic test for gnss
* pytests: add basic test for the status led
* pytests: add basic test for usb0 network device
* pytests: test_audio: check existence of both modem and codec cards
* pytests: add basic test for the m41t80 rtc
* pytests: add touchscreen firmware version check
[ Angus Ainslie ]
* uuu_scripts/burn_fuses_dogwood.lst: move the version number
* uuu_scripts/burn_fuses_evergreen.lst: add a script to burn the evergreen fuses
* debian/librem5-check.install: copy the switch test
* test_scripts/keys_test.py: add a cli based key test
* debian/librem5-check.install: install the key test
[ Dorota Czaplejewicz ]
* pytests: Test i2c communication with cameras
-- Martin Kepplinger <martin.kepplinger@puri.sm> Fri, 13 Nov 2020 11:55:44 +0100
librem5-devkit-tools (0.0.12) amber-phone; urgency=medium
[ Sebastian Krzyszkowiak ]
* Remove /etc/network/interfaces.d/usb0 file
[ Angus Ainslie (Purism) ]
* compare_flash.sh: add a script to check the flash contents
[ Martin Kepplinger ]
* pytests: support new Board names for hardware revisions
* pytests/test_modem.py: add support for the bm818 alsa device name
[ Guido Günther ]
* librem5-devkit-flash-image: Report proper error when job wasn't found
* librem5-devkit-flash: Strip board revision from uboot board name
* librem5-devkit-flash-image: Use images with revision
* gitlab-ci: Use librem5r3 for the download test (Closes: #24)
* gitlab-ci: Keep uuu script around
* gitlab-ci: Be less picky about image names
* Drop devkit from flash script name
* Drop devkit from host package
* Drop devkit from udev rule name
* Drop devkit from check package
* Drop udev rule that gives the dialog group access to the gnss subsytem
(Closes: #26)
[ Angus Ainslie ]
* 99-gnss.rules: Add a udev rule
* scripts: flash-image: add a script to flash local images
* uuu_scripts: drop deprecated scripts
-- Martin Kepplinger <martin.kepplinger@puri.sm> Mon, 21 Sep 2020 11:03:08 +0200
librem5-devkit-tools (0.0.11.0pureos0.1) byzantium; urgency=medium
* Upload to byzantium
......
debian/librem5-flash-image.1
......@@ -5,6 +5,12 @@ Maintainer: Guido Günther <agx@sigxcpu.org>
Build-Depends:
debhelper (>= 11),
flake8,
help2man,
python3-coloredlogs,
python3-jenkins,
python3-requests,
python3-tqdm,
python3-yaml,
shellcheck,
Standards-Version: 4.1.3
Homepage: https://source.puri.sm/Librem5/librem5-devkit-tools/
......@@ -29,8 +35,10 @@ Description: Basic configuration for the librem5-devkit
This package contains initial configuration for the
librem5 devkits.
Package: librem5-devkit-check
Package: librem5-check
Architecture: all
Conflicts: librem5-devkit-check (<< 0.0.12)
Replaces: librem5-devkit-check (<< 0.0.12)
Depends:
${misc:Depends},
${shlibs:Depends},
......@@ -47,13 +55,15 @@ Depends:
python3-yaml,
usb-modeswitch,
usbutils,
Description: Check script for the librem5 devkit
librem5-devkit-check performs various check on
the a librem5 devkit to make sure the hardware
Description: Check script for the Librem5 and the Devkit
librem5-check performs various checks on
a Librem5 or a Librem 5 devkit to make sure the hardware
got detected correctly.
Package: librem5-devkit-host
Package: librem5-host
Architecture: all
Conflicts: librem5-devkit-host (<< 0.0.12)
Replaces: librem5-devkit-host (<< 0.0.12)
Depends:
${misc:Depends},
${shlibs:Depends},
......@@ -65,9 +75,10 @@ Depends:
python3-yaml,
usbutils,
uuu,
Description: Tools for the librem5 devkit (host side)
Scripts useful to for working with the librem-t5 devkit.
Description: Tools for the librem5 and the Devkit (host side)
Scripts useful to for working with the Librem 5 and the
Librem 5 Devkit.
.
These tools are useful on the host side (e.g. the machine
you use to flash the image from). They are not useful on
the devkit itself.
the Librem 5 or the Devkit itself.
......@@ -7,3 +7,5 @@ test_scripts/fb-color.py usr/share/librem5-devkit/tools/
test_scripts/vibra_test.py usr/share/librem5-devkit/tools/
test_scripts/power_key.py usr/share/librem5-devkit/tools/
test_scripts/gps_config.py usr/share/librem5-devkit/tools/
test_scripts/switch_test.py usr/share/librem5-devkit/tools/
test_scripts/keys_test.py usr/share/librem5-devkit/tools/
rm_conffile /etc/network/interfaces.d/usb0 0.0.8 librem5-devkit-base
rm_conffile /etc/network/interfaces.d/usb0 0.0.12 librem5-devkit-base
rm_conffile /etc/profile.d/etnaviv.sh 0.0.11 librem5-devkit-base
rm_conffile /etc/udev/rules.d/99-gnss.rules 0.0.12 librem5-devkit-base
scripts/librem5-devkit-flash-image /usr/bin/
scripts/librem5-*flash-image /usr/bin/
scripts/librem5-usbnet /usr/bin/
librem5-flash-image.1
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
%:
dh $@
override_dh_installudev:
dh_installudev --name=librem5_devkit
dh_installudev --name=librem5
override_dh_installsystemd:
dh_installsystemd --no-start --name=resize_rootfs
......@@ -16,3 +18,9 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
else
@echo "Checks disabled via DEB_BUILD_OPTIONS"
endif
override_dh_installman:
help2man -N --version-string=$(DEB_VERSION_UPSTREAM) \
--version-string=0.0.12 scripts/librem5-flash-image \
> debian/tmp/librem5-flash-image.1
dh_installman
......@@ -7,8 +7,12 @@ def _get_board_type():
return f.readline().strip().strip('\00')
def is_birch():
return _get_board_type() == 'Purism Librem 5r2'
def is_librem5():
return _get_board_type() == r'Purism Librem 5'
return r'Purism Librem 5r' in _get_board_type()
def is_devkit():
......
......@@ -26,6 +26,11 @@ def test_wm8962():
assert b"[wm8962]" in out
def test_codec_and_modem_cards_exist():
assert(os.path.exists('/sys/class/sound/card0'))
assert(os.path.exists('/sys/class/sound/card1'))
def test_headphone_detection():
"Check if we registered the headphone detection IRQ"
f = open("/proc/interrupts")
......
from contextlib import contextmanager
import subprocess
import pytest
from . import boardtype
def set_power(on):
value = 'on' if on else 'auto'
address = '10' if boardtype.is_birch() else '2d'
with open('/sys/bus/i2c/devices/2-0020/power/control', 'w') as f:
f.write(value)
with open('/sys/bus/i2c/devices/3-00' + address + '/power/control', 'w') as f:
f.write(value)
@contextmanager
def power_up():
set_power(True)
try:
yield
finally:
set_power(False)
@pytest.mark.skipif(
boardtype.is_birch(),
reason="Birch is missing the connection to the shutdown line.")
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_selfie_camera_i2c():
with power_up():
# TODO: bringup depends on the kernel
readout = subprocess.check_output([
'i2ctransfer',
'-f', # don't let the loaded driver prevent the test
'-y', '2',
'w2@0x20', '0x0f', '0x16', 'r2'])
assert(readout == b'0x46 0x08\n')
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_big_camera_i2c():
with power_up():
address = '0x10' if boardtype.is_birch() else '0x2d'
readout = subprocess.check_output([
'i2ctransfer',
'-f', # don't let the loaded driver prevent the test
'-y', '3',
'w2@' + address, '0x00', '0x00', 'r2'])
assert(readout == b'0x30 0xc6\n')
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_big_camera_focus_driver():
"""Tests the focus driver based on observed behaviour."""
def regsetread(byte1, byte2):
# The driver should be at 0x18 according to the datasheet,
# so leaving this for easy change.
address = '0x0c'
return subprocess.check_output([
'i2ctransfer',
'-f', # don't let any loaded driver prevent the test
'-y', '3',
'w2@' + address, byte1, byte2, 'r2'])
with power_up():
# Set config bits.
readout = regsetread('0x00', '0x0f')
assert(readout == b'0x00 0x0f\n')
# Switch to "Ringing setting" mode,
# which probably means "Change settings".
readout = regsetread('0xec', '0xa3')
assert(readout == b'0x00 0x00\n')
# Switch back to drive mode.
readout = regsetread('0xdc', '0x51')
assert(readout == b'0x00 0x0f\n')
from . import boardtype
import os
import pytest
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_gnss_exists():
assert(os.path.exists('/dev/gnss0'))
......@@ -25,7 +25,7 @@ def test_modem_alsa():
out = subprocess.run(["aplay", "-l"], capture_output=True)
assert(out.returncode == 0)
if boardtype.is_librem5():
assert(b"gtm601" in out.stdout)
assert((b"gtm601" in out.stdout) or (b"bm818" in out.stdout))
else:
assert(b": SIM7100 [SIMCom SIM7100]" in out.stdout)
......
def test_rtc0_exists():
with open('/sys/class/rtc/rtc0/name') as f:
assert('rtc-m41t80' in f.readline().strip())
from . import boardtype
import os
import pytest
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_status_led_exists():
assert(os.path.exists('/sys/class/leds/red:status/brightness'))
assert(os.path.exists('/sys/class/leds/green:status/brightness'))
assert(os.path.exists('/sys/class/leds/blue:status/brightness'))
from . import boardtype
import os
import pytest
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_torch_exists():
assert(os.path.exists('/sys/class/leds/white:torch/brightness'))
from . import boardtype
import pytest
def read_firmware_version():
with open('/sys/kernel/debug/edt_ft5x06/fw_version') as f:
return int(f.read())
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
@pytest.mark.skipif(abs(read_firmware_version()) > 100,
reason="Firmware version only readable while screen on.")
def test_firmware_version():
assert(read_firmware_version() == 3)
def test_touch_controller():
if boardtype.is_librem5():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment