From d9298fc7f373662ccdd3e7e24ec4e462ae448952 Mon Sep 17 00:00:00 2001 From: Yannick Heneault Date: Wed, 2 Feb 2022 12:36:43 +0000 Subject: [PATCH] use pitrezor firmware for 1.10.5 added support for pi0-2w board use yocto honister --- Dockerfile | 2 +- build-pitrezor.sh | 2 +- build/conf/local.conf | 14 +++++++------- meta-openembedded | 2 +- meta-pitrezor/conf/layer.conf | 2 +- .../recipes-core/images/pitrezor-image-debug.bb | 7 +++---- .../recipes-core/images/pitrezor-image.bb | 7 +++---- .../recipes-core/pitrezor/pitrezor_git.bb | 7 ++++--- .../recipes-devtools/bcm2835/bcm2835_1.68.bb | 4 +--- .../recipes-devtools/python/python3-munch_2.5.0.bb | 6 ++++-- .../recipes-devtools/qemu/qemu_%.bbappend | 2 +- .../recipes-graphics/libsdl2/libsdl2_%.bbappend | 1 - .../recipes-kernel/linux/linux-raspberrypi/usb.cfg | 3 +++ .../linux/linux-raspberrypi_%.bbappend | 7 +++++-- meta-raspberrypi | 2 +- poky | 2 +- 16 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 meta-pitrezor/recipes-kernel/linux/linux-raspberrypi/usb.cfg diff --git a/Dockerfile b/Dockerfile index 0a8db6f..663d6d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/build-pitrezor.sh b/build-pitrezor.sh index 2545298..b989124 100755 --- a/build-pitrezor.sh +++ b/build-pitrezor.sh @@ -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 diff --git a/build/conf/local.conf b/build/conf/local.conf index 231137a..11804e3 100644 --- a/build/conf/local.conf +++ b/build/conf/local.conf @@ -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 = "\ @@ -34,5 +34,5 @@ BB_DISKMON_DIRS = "\ ABORT,${SSTATE_DIR},100M,1K \ ABORT,/tmp,10M,1K" -CONF_VERSION = "1" +CONF_VERSION = "2" diff --git a/meta-openembedded b/meta-openembedded index f2d02cb..a12eff7 160000 --- a/meta-openembedded +++ b/meta-openembedded @@ -1 +1 @@ -Subproject commit f2d02cb71eaff8eb285a1997b30be52486c160ae +Subproject commit a12eff7e3f6aa1d4150b0724d4b7939622aa598f diff --git a/meta-pitrezor/conf/layer.conf b/meta-pitrezor/conf/layer.conf index 39e9ac2..cd11867 100644 --- a/meta-pitrezor/conf/layer.conf +++ b/meta-pitrezor/conf/layer.conf @@ -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" diff --git a/meta-pitrezor/recipes-core/images/pitrezor-image-debug.bb b/meta-pitrezor/recipes-core/images/pitrezor-image-debug.bb index c103e54..8f62831 100644 --- a/meta-pitrezor/recipes-core/images/pitrezor-image-debug.bb +++ b/meta-pitrezor/recipes-core/images/pitrezor-image-debug.bb @@ -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 @@ -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" diff --git a/meta-pitrezor/recipes-core/images/pitrezor-image.bb b/meta-pitrezor/recipes-core/images/pitrezor-image.bb index 8b54a8f..da0f155 100644 --- a/meta-pitrezor/recipes-core/images/pitrezor-image.bb +++ b/meta-pitrezor/recipes-core/images/pitrezor-image.bb @@ -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 " @@ -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; " diff --git a/meta-pitrezor/recipes-core/pitrezor/pitrezor_git.bb b/meta-pitrezor/recipes-core/pitrezor/pitrezor_git.bb index a8cb511..988d97e 100644 --- a/meta-pitrezor/recipes-core/pitrezor/pitrezor_git.bb +++ b/meta-pitrezor/recipes-core/pitrezor/pitrezor_git.bb @@ -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" @@ -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 diff --git a/meta-pitrezor/recipes-devtools/bcm2835/bcm2835_1.68.bb b/meta-pitrezor/recipes-devtools/bcm2835/bcm2835_1.68.bb index 4f69028..72a1f2f 100644 --- a/meta-pitrezor/recipes-devtools/bcm2835/bcm2835_1.68.bb +++ b/meta-pitrezor/recipes-devtools/bcm2835/bcm2835_1.68.bb @@ -19,6 +19,4 @@ SRC_URI[sha256sum] = "b7eda59fd7bc3cb97fdac14e8455e86ddad75006d69270358ac8d00108 inherit autotools -RDEPENDS_${PN}-dev = "" - -FILES_${PN} = "" +ALLOW_EMPTY:${PN} = "1" diff --git a/meta-pitrezor/recipes-devtools/python/python3-munch_2.5.0.bb b/meta-pitrezor/recipes-devtools/python/python3-munch_2.5.0.bb index 9fc8032..3e8eed3 100644 --- a/meta-pitrezor/recipes-devtools/python/python3-munch_2.5.0.bb +++ b/meta-pitrezor/recipes-devtools/python/python3-munch_2.5.0.bb @@ -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" diff --git a/meta-pitrezor/recipes-devtools/qemu/qemu_%.bbappend b/meta-pitrezor/recipes-devtools/qemu/qemu_%.bbappend index f58517e..7dc1621 100644 --- a/meta-pitrezor/recipes-devtools/qemu/qemu_%.bbappend +++ b/meta-pitrezor/recipes-devtools/qemu/qemu_%.bbappend @@ -1 +1 @@ -PACKAGECONFIG_remove = "sdl" +PACKAGECONFIG:remove = "sdl" diff --git a/meta-pitrezor/recipes-graphics/libsdl2/libsdl2_%.bbappend b/meta-pitrezor/recipes-graphics/libsdl2/libsdl2_%.bbappend index 2ef06ea..dd20442 100644 --- a/meta-pitrezor/recipes-graphics/libsdl2/libsdl2_%.bbappend +++ b/meta-pitrezor/recipes-graphics/libsdl2/libsdl2_%.bbappend @@ -1,5 +1,4 @@ PACKAGECONFIG = "kmsdrm gles2" -EXTRA_OECONF_append = " --disable-video-rpi " DEPENDS += "udev" BBCLASSEXTEND="" diff --git a/meta-pitrezor/recipes-kernel/linux/linux-raspberrypi/usb.cfg b/meta-pitrezor/recipes-kernel/linux/linux-raspberrypi/usb.cfg new file mode 100644 index 0000000..dae6dee --- /dev/null +++ b/meta-pitrezor/recipes-kernel/linux/linux-raspberrypi/usb.cfg @@ -0,0 +1,3 @@ +CONFIG_USB_DWC2=m +CONFIG_USB_DWC2_DUAL_ROLE=y +CONFIG_USB_GADGETFS=m diff --git a/meta-pitrezor/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-pitrezor/recipes-kernel/linux/linux-raspberrypi_%.bbappend index 1e83748..2c5b207 100644 --- a/meta-pitrezor/recipes-kernel/linux/linux-raspberrypi_%.bbappend +++ b/meta-pitrezor/recipes-kernel/linux/linux-raspberrypi_%.bbappend @@ -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 \ + " diff --git a/meta-raspberrypi b/meta-raspberrypi index 9879932..1584bdd 160000 --- a/meta-raspberrypi +++ b/meta-raspberrypi @@ -1 +1 @@ -Subproject commit 987993209716302eb8f314f69a2a3340555f94d8 +Subproject commit 1584bddcf31f4bf3acc2304aa8dae927e8bec970 diff --git a/poky b/poky index 424296b..4ce9843 160000 --- a/poky +++ b/poky @@ -1 +1 @@ -Subproject commit 424296bf9bb4bae27febf91bce0118df09ce5fa1 +Subproject commit 4ce984316d038eaed2f48533b31d0a1898942f0a