Skip to content

Commit

Permalink
use pitrezor firmware for 1.10.5
Browse files Browse the repository at this point in the history
added support for pi0-2w board
use yocto honister
  • Loading branch information
heneault committed Feb 2, 2022
1 parent 3c5a453 commit d9298fc
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:buster

RUN apt-get update && \
apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping locales
apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping locales liblz4-tool zstd

RUN useradd -ms /bin/bash -p build build --uid 30000

Expand Down
2 changes: 1 addition & 1 deletion build-pitrezor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

TAG=${1:-master}
MACHINE=${2:-raspberrypi0-wifi} # raspberrypi0-wifi (default) or raspberrypi4
MACHINE=${2:-raspberrypi0-wifi} # raspberrypi0-wifi (default), raspberrypi4 or raspberrypi0-2w-64
IMAGE=pitrezor-build
IMGFILE=imgs/pitrezor-$MACHINE-$TAG.img
DOCKER_UID=30000
Expand Down
14 changes: 7 additions & 7 deletions build/conf/local.conf
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
MACHINE ??= "raspberrypi0-wifi"
#MACHINE ??= "raspberrypi4"
#MACHINE ??= "raspberrypi4-64"
#MACHINE ??= "raspberrypi0-2w-64"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES += "read-only-rootfs"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
USER_CLASSES ?= "buildstats image-prelink"
PATCHRESOLVE = "noop"
DISTRO_FEATURES_remove = " acl alsa argp bluetooth irda largefile pcmcia usbgadget usbhost xattr nfs zeroconf pci 3g nfc x11 wayland pulseaudio "
DISTRO_FEATURES:remove = " acl alsa argp bluetooth irda largefile pcmcia usbgadget usbhost xattr nfs zeroconf pci 3g nfc x11 wayland pulseaudio "
IMAGE_FSTYPES = "rpi-sdimg"
VIRTUAL-RUNTIME_init_manager = "sysvinit"
VIRTUAL-RUNTIME_dev_manager = ""
BOOTDD_VOLUME_ID = "boot"
SERIAL_CONSOLES = ""
SERIAL_CONSOLES_CHECK_forcevariable = ""
SYSVINIT_ENABLED_GETTYS = ""
ENABLE_DWC2_PERIPHERAL = "1"
GPU_MEM = "64"
VC4DTBO = "vc4-fkms-v3d"
CMDLINE = "dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait consoleblank=0 ro quiet "
KERNEL_MODULE_AUTOLOAD += " gadgetfs dwc2 vc4 v3d "
EXTRA_IMAGECMD_ext3 = "-i 4096 -L fs"
EXTRA_IMAGECMD:ext3 = "-i 4096 -L fs"
FATPAYLOAD += " ${datadir}/pitrezor/pitrezor.config"
TOOLCHAIN_TARGET_TASK += " bcm2835-staticdev "
TOOLCHAIN_HOST_TASK_append += " nativesdk-protobuf-compiler nativesdk-python3-protobuf nativesdk-python3-setuptools nativesdk-python3 nativesdk-python3-click nativesdk-python3-trezor nativesdk-python3-mako nativesdk-python3-munch "
TOOLCHAIN_HOST_TASK:append += " nativesdk-protobuf-compiler nativesdk-python3-protobuf nativesdk-python3-setuptools nativesdk-python3 nativesdk-python3-click nativesdk-python3-trezor nativesdk-python3-mako nativesdk-python3-munch "
RPI_EXTRA_CONFIG = "hdmi_safe=1"

BB_DISKMON_DIRS = "\
Expand All @@ -34,5 +34,5 @@ BB_DISKMON_DIRS = "\
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"

CONF_VERSION = "1"
CONF_VERSION = "2"

2 changes: 1 addition & 1 deletion meta-openembedded
Submodule meta-openembedded updated from f2d02c to a12eff
2 changes: 1 addition & 1 deletion meta-pitrezor/conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "meta-pitrezor"
BBFILE_PATTERN_meta-pitrezor = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-pitrezor = "10"

LAYERSERIES_COMPAT_meta-pitrezor = "dunfell"
LAYERSERIES_COMPAT_meta-pitrezor = "honister"
7 changes: 3 additions & 4 deletions meta-pitrezor/recipes-core/images/pitrezor-image-debug.bb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include pitrezor-image.bb
inherit extrausers
EXTRA_USERS_PARAMS = "usermod -P raspberry root;"
IMAGE_FEATURES += " debug-tweaks "

customize_image_debug() {
sed -i '/^DROPBEAR_EXTRA_ARGS=/ s/-w//' ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear
Expand All @@ -9,7 +8,7 @@ customize_image_debug() {
ln -s ../init.d/networking ${IMAGE_ROOTFS}${sysconfdir}/rc5.d/S05network
}

ROOTFS_POSTPROCESS_COMMAND_append = " customize_image_debug; "
ROOTFS_POSTPROCESS_COMMAND:append = " customize_image_debug; "

IMAGE_INSTALL += " iw wireless-regdb-static wpa-supplicant linux-firmware-rpidistro-bcm43430 linux-firmware-rpidistro-bcm43455 kernel-module-brcmfmac dropbear gdbserver strace "
IMAGE_INSTALL += " iw wireless-regdb-static wpa-supplicant linux-firmware-rpidistro-bcm43430 linux-firmware-rpidistro-bcm43455 kernel-module-brcmfmac dropbear gdbserver strace linux-firmware-rpidistro-bcm43436 linux-firmware-rpidistro-bcm43436s"

7 changes: 3 additions & 4 deletions meta-pitrezor/recipes-core/images/pitrezor-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ include recipes-core/images/core-image-minimal.bb
IMAGE_INSTALL += " \
kernel-module-gadgetfs \
kernel-module-dwc2 \
kernel-module-vc4 \
"
"

IMAGE_INSTALL_append_raspberrypi4 = " kernel-module-v3d libudev "
IMAGE_INSTALL:append:raspberrypi4 = " kernel-module-v3d libudev "

IMAGE_INSTALL += " pitrezor "

Expand Down Expand Up @@ -37,4 +36,4 @@ customize_image() {
chmod a+x ${IMAGE_ROOTFS}/etc/rcS.d/S10mountgadget
}

ROOTFS_POSTPROCESS_COMMAND_append = " customize_image; "
ROOTFS_POSTPROCESS_COMMAND:append = " customize_image; "
7 changes: 4 additions & 3 deletions meta-pitrezor/recipes-core/pitrezor/pitrezor_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://legacy/COPYING;md5=e6a600fd5e1d9cbde2d983680233ad02"

DEPENDS = "libsdl2 libsdl2-image bcm2835 protobuf-native python3-protobuf-native python3-six-native python3-click-native python3-trezor-native dos2unix-native python3-mako-native python3-munch-native libconfig"
RDEPENDS_${PN} = "rng-tools dos2unix libegl-mesa libgles2-mesa mesa-megadriver libgbm libdrm"
RDEPENDS:${PN} = "rng-tools dos2unix libegl-mesa libgles2-mesa mesa-megadriver libgbm libdrm"

inherit pkgconfig python3native
inherit pkgconfig python3native siteinfo

SRC_URI = "git://github.com/heneault/trezor-firmware.git;branch=pitrezor \
file://start_pitrezor \
file://pitrezor.config \
"

SRCREV = "45f78578dfc8463c4968b7e85714a7bdeae9726e"
SRCREV = "1e62209d024b7e84a7368be8175735372b8080c9"

S = "${WORKDIR}/git"

Expand All @@ -25,6 +25,7 @@ do_compile() {
export PIZERO=1
export CPUFLAGS=""
export RANDOM_DEV_FILE="/dev/random"
export ARCH_BITS=${SITEINFO_BITS}
cd legacy
make vendor
make -C emulator/pizero
Expand Down
4 changes: 1 addition & 3 deletions meta-pitrezor/recipes-devtools/bcm2835/bcm2835_1.68.bb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ SRC_URI[sha256sum] = "b7eda59fd7bc3cb97fdac14e8455e86ddad75006d69270358ac8d00108

inherit autotools

RDEPENDS_${PN}-dev = ""

FILES_${PN} = ""
ALLOW_EMPTY:${PN} = "1"
6 changes: 4 additions & 2 deletions meta-pitrezor/recipes-devtools/python/python3-munch_2.5.0.bb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
SUMMARY = "A dot-accessible dictionary (a la JavaScript objects)."
DEPENDS = "python3-pbr"
DEPENDS = "${PYTHON_PN}-pbr-native"
HOMEPAGE = "https://github.com/Infinidat/munch"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f0291cd32b2d6a91d9b19970c94d0a46"

SRC_URI[sha256sum] = "2d735f6f24d4dba3417fa448cae40c6e896ec1fdab6cdb5e6510999758a4dbd2"

BBCLASSEXTEND = "native nativesdk"
PYPI_PACKAGE = "munch"

inherit pypi setuptools3
RDEPENDS:${PN} += "${PYTHON_PN}-pip"
BBCLASSEXTEND = "native nativesdk"

2 changes: 1 addition & 1 deletion meta-pitrezor/recipes-devtools/qemu/qemu_%.bbappend
Original file line number Diff line number Diff line change
@@ -1 +1 @@
PACKAGECONFIG_remove = "sdl"
PACKAGECONFIG:remove = "sdl"
1 change: 0 additions & 1 deletion meta-pitrezor/recipes-graphics/libsdl2/libsdl2_%.bbappend
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PACKAGECONFIG = "kmsdrm gles2"
EXTRA_OECONF_append = " --disable-video-rpi "
DEPENDS += "udev"
BBCLASSEXTEND=""

3 changes: 3 additions & 0 deletions meta-pitrezor/recipes-kernel/linux/linux-raspberrypi/usb.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_USB_DWC2=m
CONFIG_USB_DWC2_DUAL_ROLE=y
CONFIG_USB_GADGETFS=m
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://usb_inode.patch"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += " \
file://usb.cfg \
file://usb_inode.patch \
"
2 changes: 1 addition & 1 deletion meta-raspberrypi
Submodule meta-raspberrypi updated from 987993 to 1584bd
2 changes: 1 addition & 1 deletion poky
Submodule poky updated from 424296 to 4ce984

0 comments on commit d9298fc

Please sign in to comment.