Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/buildroot 2024.05 #205

Merged
merged 6 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
/work/setup_build.sh
cd /work/buildroot
make BR2_EXTERNAL=../tp2bmc tp2bmc_defconfig
make
FORCE_UNSAFE_CONFIGURE=1 make

- name: stamp images
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f2cd287bc49fee60b1c8f2c537b2e5c71ca7c348 Mon Sep 17 00:00:00 2001
From: Sven Rademakers <[email protected]>
Date: Wed, 13 Mar 2024 15:55:30 +0000
Subject: [PATCH] bump rust to 1.75
Subject: [PATCH] bump rust to 1.79

---
buildroot/package/rust-bin/rust-bin.hash | 111 ---------------------------------
Expand Down Expand Up @@ -138,7 +138,7 @@ index ca35d27d1c..6cee57ece9 100644
# When updating this version, check whether support/download/cargo-post-process
# still generates the same archives.
-RUST_BIN_VERSION = 1.74.1
+RUST_BIN_VERSION = 1.75.0
+RUST_BIN_VERSION = 1.79.0
RUST_BIN_SITE = https://static.rust-lang.org/dist
RUST_BIN_LICENSE = Apache-2.0 or MIT
RUST_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
Expand All @@ -163,7 +163,7 @@ index c544582c99..23e46fca2c 100644
# When updating this version, check whether support/download/cargo-post-process
# still generates the same archives.
-RUST_VERSION = 1.74.1
+RUST_VERSION = 1.75.0
+RUST_VERSION = 1.79.0
RUST_SOURCE = rustc-$(RUST_VERSION)-src.tar.xz
RUST_SITE = https://static.rust-lang.org/dist
RUST_LICENSE = Apache-2.0 or MIT
Expand Down
3 changes: 2 additions & 1 deletion setup_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
#

set -x
BUILDROOT_VER="2024.05"

download_dir=$(mktemp -d)
install_dir="$1"
buildroot_url='https://buildroot.org/downloads/buildroot-2024.02.tar.gz'
buildroot_url="https://buildroot.org/downloads/buildroot-${BUILDROOT_VER}.tar.gz"
buildroot=$(basename "$buildroot_url")
buildroot_folder="${buildroot%.tar.gz}"
project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand Down
2 changes: 1 addition & 1 deletion tp2bmc/board/tp2bmc/factory_overlay/upper/etc/inittab
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ si9::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr 2>/dev/null
si10::sysinit:/bin/hostname -F /etc/hostname
rcS:12345:wait:/etc/init.d/rcS

S0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL
S0::respawn:/bin/login -f root

# Stuff to do for the 3-finger salute
#ca::ctrlaltdel:/sbin/reboot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ verify_msd_connection() {
exit $res
fi

if [ ! -f "$mount_point/$file1" ] && \
[ ! -f "$mount_point/$file2" ] && \
[ ! -f "$mount_point/$file3" ]; then
echo "$(ls -l $mount_point)"
echo "Error: cannot find $file1 or $file2 on mount $partition"
exit 1
fi
# if [ ! -f "$mount_point/$file1" ] && \
# [ ! -f "$mount_point/$file2" ] && \
# [ ! -f "$mount_point/$file3" ]; then
# echo "$(ls -l $mount_point)"
# echo "Error: cannot find $file1 or $file2 on mount $partition"
# exit 1
# fi

umount "$mount_point"
rmdir "$mount_point"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
source node_helpers.sh

# node 3 has a NVMe + 2 sata devices
assert_pci_devices "3" "3"
assert_pci_devices "3" "1"
assert_sata_devices "3" "2"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ source node_helpers.sh

tpi advanced msd --node 2 >/dev/null
tpi usb device --node 2 > /dev/null
confirm "plug the USB cable from 'BMC_USB_OTG' to the 'USB_DEV' port"
devices=$(get_usb_devices "1")
if echo "$devices" | grep -q "ID ${RK1_USB}"; then
echo -e "\tUSB_DEV => OK"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ get_usb_devices() {
echo "$result" | grep -v 'Device 001' | grep -v '2109:3431'
}

get_sata_devices() {
local node="$1"
send_command $node "lsblk -d -o name,tran | grep sata | awk '{print \$1}'"
}

get_pci_devices() {
local n="$1"
send_command "$n" "lspci | grep -v RK3588 | grep -v 'PCI bridge: Broadcom Inc'"
Expand Down Expand Up @@ -44,7 +49,6 @@ assert_usb_devices() {
local usb_count="$2"
local usb_devices=$(get_usb_devices "$node")


if [ -z "$usb_devices" ]; then
line_count=0
else
Expand All @@ -58,6 +62,24 @@ assert_usb_devices() {
fi
}

assert_sata_devices() {
local node="$1"
local count="$2"
local devices=$(get_sata_devices "$node")

if [ -z "$devices" ]; then
line_count=0
else
line_count=$(echo "$devices" | wc -l)
print_sata_drives "$devices"
fi

if [[ "$line_count" -lt "$count" ]]; then
echo "Error: the test requires ${count} SATA devices connected to ${node}, found ${line_count}" >&2
exit 1
fi
}

print_usb_names() {
local usb_devices="$1"
local counter=1
Expand All @@ -81,6 +103,16 @@ print_pci_names() {
done
}

print_sata_drives() {
local sata_devices="$1"
local counter=1
echo -e "\tSATA:"
echo "$sata_devices" | while IFS= read -r line; do
echo -e "\t\t${counter}. ${line}"
((counter++))
done
}

#usb_dev_test() {
# tpi advanced msd --node 2 >/dev/null
# tpi usb device --node 2 > /dev/null
Expand Down
87 changes: 33 additions & 54 deletions tp2bmc/board/tp2bmc/factory_overlay/upper/factory/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,46 @@ NC='\033[0m' # No Color
# Define the directory to search
TEST_DIR="/factory"
NON_EXECUTABLE_FILES=()
FAILED_TESTS=()
EXIT_CODE=0

echo "TURING PI FACTORY TESTING STARTED"

try_run_test() {
local file="$1"
local retries="$2"

FILENAME=$(basename "$file")
local test_id="${FILENAME:0:3}"
local test_name="${FILENAME:4}"
test_name="${test_name%%.*}"
test_name="${test_name//_/ }"

echo -e "\n* [${test_id}] Running ${test_name}.."
"$FILE"
EXIT_CODE=$?

if [[ $EXIT_CODE -ne 0 ]]; then
echo -e " [${test_id}] ${RED}FAILED${NC}"
if [[ "$retries" -ne 0 ]]; then
((retries--))
confirm "try again?"
try_run_test "$1" "$retries"
else
echo "Exiting program. the tests can be started again with running './run_all_tests.sh'"
exit 1
fi
else
echo -e " [${test_id}] ${GREEN}PASSED${NC}"
fi
}

nr_of_executed_tests=0
# Iterate over files in the test directory that are prefixed with 3 numbers
# followed by a dash. e.g. "999-"
for FILE in "$TEST_DIR"/[0-9][0-9][0-9]-*; do
# Check if the file exists and is executable
if [[ -x "$FILE" ]]; then
FILENAME=$(basename "$FILE")
test_id="${FILENAME:0:3}"
test_name="${FILENAME:4}"
test_name="${test_name%%.*}"
test_name="${test_name//_/ }"

echo -e "\n* [${test_id}] Running ${test_name}.."
"$FILE"
EXIT_CODE=$?


echo -ne " [${test_id}] "
if [[ $EXIT_CODE -ne 0 ]]; then
echo -e "${RED}FAILED${NC} exited with code $EXIT_CODE"
FAILED_TESTS+=("$FILE")
else
echo -e "${GREEN}PASSED${NC}"
fi
# Increment the counter
try_run_test "$FILE" "2"
((nr_of_executed_tests++))
else
NON_EXECUTABLE_FILES+=("$FILE")
Expand All @@ -57,39 +67,8 @@ fi
echo "running post test script.."
./post_test.sh &

if [[ ${#FAILED_TESTS[@]} -eq 0 ]]; then
echo -ne "${GREEN}"
else
echo -ne "${RED}"
fi

failed_count=$(printf '%s\n' "${FAILED_TESTS[@]}" | wc -w)
passed=$((nr_of_executed_tests - failed_count))
echo -e "FINISHED TESTS:\t(${passed}/${nr_of_executed_tests}) tests passed"

if [[ ${#FAILED_TESTS[@]} -ne 0 ]]; then
echo "Failed tests:"
for FAILED_TEST in "${FAILED_TESTS[@]}"; do
FILENAME=$(basename "$FAILED_TEST")
test_name="${FILENAME:4}"
test_name="${test_name%%.*}"
test_name="${test_name//_/ }"
echo -e "\t$test_name"
done
echo -en "${NC}"

confirm "You have failed tests, Do you still want to flash firmware to the board?"
if [[ $? -ne 0 ]]; then
exit 1
fi
else
echo "You are about to install the official firmware.."
confirm
if [[ $? -ne 0 ]]; then
exit 1
fi
fi

source install_official_firmware.sh
echo "THIS IS THE END, press the power button on the front panel to test power down"
wait

echo -e "${GREEN}ALL TESTS PASSED (${nr_of_executed_tests})${NC}"
echo "eject the SD card, restart the system"
12 changes: 6 additions & 6 deletions tp2bmc/board/tp2bmc/turing-pi2.its
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#address-cells = <1>;

images {
kernel6_6 {
description = "turingpi 6.6.18";
kernel6_8 {
description = "turingpi 6.8.12";
data = /incbin/("./zImage");
type = "kernel";
arch = "arm";
Expand Down Expand Up @@ -78,28 +78,28 @@

config-v2.4.0 {
description = "turing-pi v2.4 configuration";
kernel = "kernel6_6";
kernel = "kernel6_8";
fdt = "fdt-v2.4.0";
compatible = "turing,pi2", "allwinner,sun8i-t113s";
};

config-v2.5.0 {
description = "turing-pi v2.5 configuration";
kernel = "kernel6_6";
kernel = "kernel6_8";
fdt = "fdt-v2.5.0";
compatible = "turing,pi2", "allwinner,sun8i-t113s";
};

config-v2.5.1 {
description = "turing-pi v2.5.1 configuration";
kernel = "kernel6_6";
kernel = "kernel6_8";
fdt = "fdt-v2.5.1";
compatible = "turing,pi2", "allwinner,sun8i-t113s";
};

config-v2.5.2 {
description = "turing-pi v2.5.2 configuration";
kernel = "kernel6_6";
kernel = "kernel6_8";
fdt = "fdt-v2.5.1";
compatible = "turing,pi2", "allwinner,sun8i-t113s";
};
Expand Down
2 changes: 1 addition & 1 deletion tp2bmc/package/bmc-ui/bmc-ui.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# bmc-ui
###########################################################

BMC_UI_VERSION = v3.1.3
BMC_UI_VERSION = v3.2.0
BMC_UI_SITE = https://github.com/turing-machines/BMC-UI/releases/download/$(BMC_UI_VERSION)
BMC_UI_LICENSE = GPL-2.0
BMC_UI_LICENSE_FILES = LICENSE
Expand Down
2 changes: 1 addition & 1 deletion tp2bmc/package/bmcd/bmcd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# bmcd
###########################################################

BMCD_VERSION = a525f331627535fd7173f93554dba85fe641c42b
BMCD_VERSION = 4d6e25069c9ee428ea826b8c1e29a99d6f6a74e5
BMCD_SITE = $(call github,turing-machines,bmcd,$(BMCD_VERSION))
BMCD_LICENSE = Apache-2.0
BMCD_LICENSE_FILES = LICENSE
Expand Down
Loading