Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-superbox committed Nov 18, 2022
1 parent eaec571 commit e78019d
Show file tree
Hide file tree
Showing 26 changed files with 284 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Device config for:
~/buildroot$ git checkout 2022.02.6

~/buildroot$ make BR2_EXTERNAL=../unipi-buildroot/buildroot list-defconfigs
~/buildroot$ make unipi_neuron_rpi3b_defconfig
~/buildroot$ make unipi_neuron_rpi3_defconfig

# You can change the hostname with the BR2_TARGET_GENERIC_HOSTNAME variable
~/buildroot$ make BR2_TARGET_GENERIC_HOSTNAME=unipi clean all
Expand Down
1 change: 0 additions & 1 deletion buildroot/board/.gitignore

This file was deleted.

6 changes: 6 additions & 0 deletions buildroot/board/common/boot.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mmc dev 0
fatload mmc 0:1 ${kernel_addr_r} Image
fatload mmc 0:1 ${fdt_addr_r} bcm2710-rpi-3-b-plus.dtb
setenv bootargs root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA0,115200 loglevel=3 zram.enabled=1
printenv
booti ${kernel_addr_r} - ${fdt_addr_r}
16 changes: 4 additions & 12 deletions buildroot/board/common/config.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
disable_splash=1

start_file=start.elf
fixup_file=fixup.dat

kernel=u-boot.bin
kernel=Image

disable_overscan=1

gpu_mem=64
gpu_mem=100

dtoverlay=miniuart-bt
dtoverlay=krnbt=on

# Neuron
dtparam=i2c_arm=on
dtoverlay=i2c-rtc,mcp7941x
dtoverlay=neuron-spi-new

# enable 64bits support
arm_64bit=1

[pi4]
arm_boost=1
9 changes: 0 additions & 9 deletions buildroot/board/common/post-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ ln -fs ../resize-root.service ${TARGET_DIR}/etc/systemd/system/multi-user.target
# Enable monit systemd service
ln -fs ../resize-root.service ${TARGET_DIR}/etc/systemd/system/multi-user.target.wants/monit.service

# Disable owftpd
ln -fs /dev/null ${TARGET_DIR}/etc/systemd/system/owftpd.service

# Update boot arguments
grep -qE ' loglevel=3' ${BINARIES_DIR}/rpi-firmware/cmdline.txt || sed -i '$ s/$/ loglevel=3/' ${BINARIES_DIR}/rpi-firmware/cmdline.txt
grep -qE ' zram.enabled=1' ${BINARIES_DIR}/rpi-firmware/cmdline.txt || sed -i '$ s/$/ zram.enabled=1/' ${BINARIES_DIR}/rpi-firmware/cmdline.txt
Expand All @@ -26,9 +23,3 @@ sed -i 's/#Storage=auto/Storage=volatile/g' ${TARGET_DIR}/etc/systemd/journald.c

# Set ZSH for root user
sed -i '/^root:/s,:/bin/dash$,:/bin/zsh,' ${TARGET_DIR}/etc/passwd

# Update mosquitto listener
sed -i 's/#listener/listener 1883 0.0.0.0/g' ${TARGET_DIR}/etc/mosquitto/mosquitto.conf

# Update mosquitto authentication
sed -i 's/#allow_anonymous false/allow_anonymous true/g' ${TARGET_DIR}/etc/mosquitto/mosquitto.conf
2 changes: 1 addition & 1 deletion buildroot/board/common/rootfs_overlay/etc/monitrc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ set log syslog
set httpd port 2812 and
use address 0.0.0.0 # only accept connection from localhost (drop if you use M/Monit)
allow localhost # allow localhost to connect to the server and
allow unipi:unipi # require user 'admin' with password 'monit'
#allow admin:monit # require user 'admin' with password 'monit'
#with ssl { # enable SSL/TLS and set path to server certificate
# pemfile: /etc/ssl/certs/monit.pem
#}
Expand Down
2 changes: 1 addition & 1 deletion buildroot/board/common/users_table.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
unipi -1 unipi -1 =unipi /home/unipi /bin/zsh wheel
pi -1 pi -1 =pi /home/pi /bin/zsh wheel
19 changes: 19 additions & 0 deletions buildroot/board/neuron-rpi3/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
start_file=start.elf
fixup_file=fixup.dat

kernel=Image

disable_overscan=1

gpu_mem=100

dtoverlay=miniuart-bt
dtoverlay=krnbt=on

# Neuron
dtparam=i2c_arm=on
dtoverlay=i2c-rtc,mcp7941x
dtoverlay=neuron-spi-new

# enable 64bits support
arm_64bit=1
2 changes: 2 additions & 0 deletions buildroot/board/neuron-rpi3/device_table.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
/etc/monitrc f 700 0 0 - - - - -
33 changes: 33 additions & 0 deletions buildroot/board/neuron-rpi3/genimage.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
image boot.vfat {
vfat {
files = {
"bcm2710-rpi-3-b.dtb",
"bcm2710-rpi-3-b-plus.dtb",
"bcm2837-rpi-3-b.dtb",
"rpi-firmware/bootcode.bin",
"rpi-firmware/cmdline.txt",
"rpi-firmware/config.txt",
"rpi-firmware/fixup.dat",
"rpi-firmware/start.elf",
"rpi-firmware/overlays",
"Image"
}
}
size = 32M
}

image sdcard.img {
hdimage {
}

partition boot {
partition-type = 0xC
bootable = "true"
image = "boot.vfat"
}

partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
}
}
13 changes: 13 additions & 0 deletions buildroot/board/neuron-rpi3/post-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -u
set -e

# Disable owftpd
ln -fs /dev/null ${TARGET_DIR}/etc/systemd/system/owftpd.service

# Update mosquitto listener
sed -i 's/#listener/listener 1883 0.0.0.0/g' ${TARGET_DIR}/etc/mosquitto/mosquitto.conf

# Update mosquitto authentication
sed -i 's/#allow_anonymous false/allow_anonymous true/g' ${TARGET_DIR}/etc/mosquitto/mosquitto.conf
3 changes: 3 additions & 0 deletions buildroot/board/neuron-rpi3/post-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

support/scripts/genimage.sh -c $(dirname $0)/genimage.cfg
1 change: 1 addition & 0 deletions buildroot/board/neuron-rpi3/users_table.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unipi -1 unipi -1 =unipi /home/unipi /bin/zsh wheel
33 changes: 33 additions & 0 deletions buildroot/board/rpi3/genimage.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
image boot.vfat {
vfat {
files = {
"bcm2710-rpi-3-b.dtb",
"bcm2710-rpi-3-b-plus.dtb",
"bcm2837-rpi-3-b.dtb",
"rpi-firmware/bootcode.bin",
"rpi-firmware/cmdline.txt",
"rpi-firmware/config.txt",
"rpi-firmware/fixup.dat",
"rpi-firmware/start.elf",
"rpi-firmware/overlays",
"Image"
}
}
size = 32M
}

image sdcard.img {
hdimage {
}

partition boot {
partition-type = 0xC
bootable = "true"
image = "boot.vfat"
}

partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
}
}
3 changes: 3 additions & 0 deletions buildroot/board/rpi3/post-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

support/scripts/genimage.sh -c $(dirname $0)/genimage.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ BR2_aarch64=y
BR2_ARM_FPU_VFPV4=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
BR2_PACKAGE_GLIBC_UTILS=y
BR2_BINUTILS_VERSION_2_37_X=y
BR2_GCC_VERSION_11_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="unipi"
BR2_TARGET_GENERIC_ISSUE="Welcome to Unipi"
BR2_TARGET_GENERIC_HOSTNAME="raspberry"
BR2_TARGET_GENERIC_PASSWD_SHA512=y
BR2_INIT_SYSTEMD=y
BR2_ROOTFS_DEVICE_TABLE="$(BR2_EXTERNAL_UNIPI_PATH)/board/common/device_table.txt system/device_table.txt"
BR2_TARGET_GENERIC_ROOT_PASSWD="unipi"
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt"
BR2_TARGET_GENERIC_ROOT_PASSWD="raspberry"
BR2_SYSTEM_BIN_SH_DASH=y
BR2_TARGET_GENERIC_GETTY_PORT="tty1"
BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
Expand All @@ -21,7 +17,7 @@ BR2_TARGET_LOCALTIME="Europe/Vienna"
BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_UNIPI_PATH)/board/common/users_table.txt"
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_UNIPI_PATH)/board/common/rootfs_overlay"
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_UNIPI_PATH)/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_UNIPI_PATH)/board/common/post-image.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_UNIPI_PATH)/board/rpi3/post-image.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
Expand Down Expand Up @@ -59,15 +55,13 @@ BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI_WIFI=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_CD=y
BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="$(BR2_EXTERNAL_UNIPI_PATH)/board/common/config.txt"
BR2_PACKAGE_I2C_TOOLS=y
BR2_PACKAGE_PARTED=y
BR2_PACKAGE_RASPI_GPIO=y
BR2_PACKAGE_RS485CONF=y
BR2_PACKAGE_RTC_TOOLS=y
BR2_PACKAGE_USBUTILS=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_PY_PYC=y
BR2_PACKAGE_PYTHON3_BZIP2=y
BR2_PACKAGE_PYTHON3_DECIMAL=y
Expand All @@ -83,7 +77,6 @@ BR2_PACKAGE_LIBFUSE=y
BR2_PACKAGE_LIBFTDI1=y
BR2_PACKAGE_OWFS=y
BR2_PACKAGE_LIBXSLT=y
BR2_PACKAGE_LIBYAML=y
BR2_PACKAGE_LIBCURL=y
BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_CMOCKA=y
Expand Down Expand Up @@ -120,6 +113,12 @@ BR2_PACKAGE_SUDO=y
BR2_PACKAGE_WHICH=y
BR2_PACKAGE_ATOP=y
BR2_PACKAGE_COREUTILS=y
BR2_PACKAGE_DOCKER_CLI=y
BR2_PACKAGE_DOCKER_COMPOSE=y
BR2_PACKAGE_DOCKER_ENGINE=y
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS=y
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER=y
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS=y
BR2_PACKAGE_FTOP=y
BR2_PACKAGE_HTOP=y
BR2_PACKAGE_IOTOP=y
Expand All @@ -130,7 +129,6 @@ BR2_PACKAGE_PWGEN=y
BR2_PACKAGE_SYSTEMD_FIRSTBOOT=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_TAR=y
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
BR2_PACKAGE_UTIL_LINUX_HWCLOCK=y
BR2_PACKAGE_UTIL_LINUX_KILL=y
BR2_PACKAGE_UTIL_LINUX_LAST=y
Expand All @@ -155,10 +153,3 @@ BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_UNIPI_PATH)/board/common/
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_PKGCONF=y
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="$(BR2_EXTERNAL_UNIPI_PATH)/board/common/boot.scr"
BR2_PACKAGE_UNIPI_TOOLS=y
BR2_PACKAGE_ZSH_AUTOSUGGESTIONS=y
BR2_PACKAGE_ZSH_HISTORY_SUBSTRING_SEARCH=y

0 comments on commit e78019d

Please sign in to comment.