diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2018-06-08 18:10:58 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-06-14 08:45:24 +0000 |
commit | 79d26c7a83fd2b14cc9a787e7820824931336d85 (patch) | |
tree | ce9a6d941787f4f52e8b4110a4b077e357938a32 /util/docker | |
parent | 31e0d42a1de4605b5c5e89310643a5e8bbee4be5 (diff) |
util/docker/coreboot.org-status: collect report generators
Move generators for the board status report and the kconfig options
report into a common directory and wrap them in a docker container.
Also rework to emit HTML not wiki syntax.
Change-Id: If42e1dd312c5fa4e32f519865e3b551bc471bc72
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/26977
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'util/docker')
9 files changed, 801 insertions, 0 deletions
diff --git a/util/docker/coreboot.org-status/Dockerfile b/util/docker/coreboot.org-status/Dockerfile new file mode 100644 index 0000000000..910f8e75cc --- /dev/null +++ b/util/docker/coreboot.org-status/Dockerfile @@ -0,0 +1,7 @@ +FROM debian:sid + +RUN apt-get update && apt-get install -y python git bc && apt-get clean + +ADD board-status.html kconfig2html run.sh /opt/tools/ + +ENTRYPOINT /opt/tools/run.sh diff --git a/util/docker/coreboot.org-status/README.md b/util/docker/coreboot.org-status/README.md new file mode 100644 index 0000000000..f35cf55223 --- /dev/null +++ b/util/docker/coreboot.org-status/README.md @@ -0,0 +1,4 @@ +# Docker container to create coreboot status reports + +This container expects input in `/data-in/{coreboot,board-status}.git` and +emits two files `/data-out/{board-status.html,kconfig-options.html}`. diff --git a/util/docker/coreboot.org-status/board-status.html/README b/util/docker/coreboot.org-status/board-status.html/README new file mode 100644 index 0000000000..0a0d591c87 --- /dev/null +++ b/util/docker/coreboot.org-status/board-status.html/README @@ -0,0 +1,39 @@ +Scripts to publish board-status data to the wiki +================================================ + +These scripts parse the board-status repository (and the coreboot repository as companion) +to build a meaningful representation of the test coverage stored in board-status. + +The server runs these nightly (CET/CEST), so no user interaction with the wiki page is needed. + +How to use +---------- +When modifying the scripts, or when publishing the results elsewhere, you might want to run them +yourself. You'll need the board-status and the coreboot repository checked out side by side, named +"board-status" and "coreboot" respectively (in particular without .git suffix). + +To emit wiki-text, in the board-status repository's top-level directory, run + + $ ../util/board_status/to-wiki/status-to-wiki.sh + +The output ends up on stdout, so you'll have to store it yourself, if you need it later. + +`push-to-wiki.sh FILENAME TITLE` can be used to push a file into the wiki. +User credentials are looked up in ~/.wikiaccount, which should look like + + USERNAME=user + USERPASS=password + +How it works +------------ +status-to-wiki collects the reports and sorts them in buckets by report date. These can have +weekly, monthly and quarterly granularity. +It then passes these into the towiki script, which reads the data in more details and prints +them in the output format. + +Contributions +------------- +These scripts are rather bare, and you're welcome to extend them to extract more useful data +from both repositories, and to present the data in a nicer way. +A rewrite into another (reasonable) language is fine, too - shell quickly finds its limits +for this kind of text processing. diff --git a/util/docker/coreboot.org-status/board-status.html/bucketize.sh b/util/docker/coreboot.org-status/board-status.html/bucketize.sh new file mode 100755 index 0000000000..cb643e73bc --- /dev/null +++ b/util/docker/coreboot.org-status/board-status.html/bucketize.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# usage: $0 [weekly|monthly|quarterly] < filenames +# sorts files of the form VENDOR/BOARD/COMMIT/DATE/revision.txt +# into buckets of the given granularity + +weekly() { + date --date="$1" +%GW%V 2>/dev/null + return $? +} + +monthly() { + date --date="$1" +%Y-%m 2>/dev/null + return $? +} + +quarterly() { + date --date="$1" "+%Y %m" 2>/dev/null | awk '{ q=int(($2-1)/3+1); print $1 "Q" q}' + return $? +} + +# Restrict $1 to allowed values +if [ "$1" != "weekly" ] && [ "$1" != "monthly" ] && [ "$1" != "quarterly" ]; then + exit 1 +fi + +curr="" +sort -r -k4 -t/ | while read file; do + # Exclude 'oem' directories + if echo "$file" | grep -q '/oem/'; then continue; fi + timestamp=$(printf "%s" "$file" | cut -d/ -f4 | tr _ :) + + # If the directory is not a date, skip it. + new=$($1 "$timestamp");retval=$? + if [ "$retval" != "0" ]; then continue; fi + + if [ "$new" != "$curr" ]; then + if [ "$curr" != "" ]; then + printf "\n" + fi + printf "%s:" "$new" + curr=$new + fi + printf "%s " "$file" +done +printf "\n" diff --git a/util/docker/coreboot.org-status/board-status.html/foreword.html b/util/docker/coreboot.org-status/board-status.html/foreword.html new file mode 100644 index 0000000000..4d77c3f66e --- /dev/null +++ b/util/docker/coreboot.org-status/board-status.html/foreword.html @@ -0,0 +1,37 @@ +<h1>Mainboards supported by coreboot</h1> + +<p>This page shows two representations of the same data:</p> + +<p>First a list of all mainboards supported by coreboot (current within +one hour) ordered by category. For each mainboard the table shows the +latest user-contributed report of a successful boot on the device.</p> + +<p>After that, the page provides a time-ordered list of these contributed +reports, with the newest report first.</p> + +<p>Boards without such reports may boot or there may be some maintenance +required. The reports contain the coreboot configuration and precise commit +id, so it is possible to reproduce the build.</p> + +<p>We encourage developers and users to contribute reports so we know which +devices are well-tested. We have +<a href='https://review.coreboot.org/cgit/coreboot.git/tree/util/board_status'>a tool in the coreboot repository</a> +to make contributing easy. The data resides in the +<a href='https://review.coreboot.org/gitweb/cgit/board-status.git'>board status repository</a>. +Contributing requires an account on review.coreboot.org</p> + +<p>Sometimes the same board is sold under different names, we've tried to +list all known names but some names might be missing.</p> + +<p>If the board is not found in the coreboot's source code, there might +be some form of support that is not ready yet for inclusion in coreboot, +usually people willing to send their patches to coreboot goes through +<a href='https://review.coreboot.org'>gerrit</a>, so looking there could find some +code for boards that are not yet merged.</p> + +<h1>Vendor trees</h1> +<p>Some vendors have their own coreboot trees/fork, for instance: +<ul> + <li><a href='http://git.chromium.org/gitweb/?p=chromiumos/third_party/coreboot.git;a=summary'>chrome/chromium's tree</a> +</ul> +</p> diff --git a/util/docker/coreboot.org-status/board-status.html/status-to-html.sh b/util/docker/coreboot.org-status/board-status.html/status-to-html.sh new file mode 100755 index 0000000000..6630b30c1f --- /dev/null +++ b/util/docker/coreboot.org-status/board-status.html/status-to-html.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ls -d */*/*/*/ | `dirname $0`/bucketize.sh weekly | `dirname $0`/tohtml.sh diff --git a/util/docker/coreboot.org-status/board-status.html/tohtml.sh b/util/docker/coreboot.org-status/board-status.html/tohtml.sh new file mode 100755 index 0000000000..b1a7ccdc9a --- /dev/null +++ b/util/docker/coreboot.org-status/board-status.html/tohtml.sh @@ -0,0 +1,521 @@ +#!/bin/sh +export COREBOOT_DIR="../coreboot.git" +export GIT_DIR="$COREBOOT_DIR/.git" +CODE_GITWEB="https://review.coreboot.org/gitweb/cgit/coreboot.git/commit/?id=" +STATUS_GITWEB="https://review.coreboot.org/gitweb/cgit/board-status.git/tree/" +if [ -f `dirname $0`/foreword.html ]; then + cat `dirname $0`/foreword.html +fi +detailed= +nl=" +" +have= +while read line; do + timeframe=`echo $line | cut -d: -f1` + rest=`echo $line | cut -d: -f2-` + detailed="$detailed<h1>$timeframe</h1>$nl" + for i in $rest; do + vendor_board=`echo $i | cut -d/ -f1-2` + commit=`echo $i | cut -d/ -f3` + datetime_path=`echo $i | cut -d/ -f4` + datetime=`echo $datetime_path | tr _ :` + datetime_human=`LC_ALL=C TZ=UTC0 date --date="$datetime"` + upstream=`grep "^Upstream revision:" $vendor_board/$commit/$datetime_path/revision.txt |cut -d: -f2-` + upstream=`git log -1 --format=%H $upstream` + if ! echo "$have"| grep "^$vendor_board:" > /dev/null; then + detailed="$detailed<span id=\"$vendor_board\"></span>$nl" + have="$have$vendor_board:$datetime$nl" + fi + + detailed="$detailed<a href='https://www.coreboot.org/Board:$vendor_board'>$vendor_board</a> at $datetime_human$nl" + detailed="$detailed<a href='$CODE_GITWEB$upstream'>upstream tree</a> ($nl" + for file in "$vendor_board/$commit/$datetime_path/"*; do + if [ "$file" = "$vendor_board/$commit/$datetime_path/revision.txt" ]; then + continue + fi + detailed="$detailed<a href='$STATUS_GITWEB$file'>`basename $file`</a> $nl" + done + detailed="$detailed)<br />" + done +done + +cat <<EOF +<h1>Motherboards supported in coreboot</h1> + +<table border="0" style="font-size: smaller"> +<tr bgcolor="#6699ff"> +<td>Vendor</td> +<td>Mainboard</td> +<td>Latest known good</td> +<td>Northbridge</td> +<td>Southbridge</td> +<td>Super I/O</td> +<td>CPU</td> +<td>Socket</td> +<td><span title="ROM chip package">ROM <sup>1</sup></span></td> +<td><span title="ROM chip protocol">P <sup>2</sup></span></td> +<td><span title="ROM chip socketed?">S <sup>3</sup></span></td> +<td><span title="Board supported by flashrom?">F <sup>4</sup></span></td> +<td><span title="Vendor Cooperation Score">VCS<sup>5</sup></span></td> +</tr> +EOF + +for category in laptop server desktop half mini settop "eval" sbc emulation misc unclass; do + last_vendor= + color=eeeeee + case "$category" in + desktop) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Desktops / Workstations</h4></td> +</tr> + +EOF + ;; + server) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Servers</h4></td> +</tr> + +EOF + ;; + laptop) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Laptops</h4></td> +</tr> + +EOF + ;; + half) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Embedded / PC/104 / Half-size boards</h4></td> +</tr> + +EOF + ;; + mini) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Mini-ITX / Micro-ITX / Nano-ITX</h4></td> +</tr> + +EOF + ;; + settop) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Set-top-boxes / Thin clients</h4></td> +</tr> + +EOF + ;; + "eval") + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Devel/Eval Boards</h4></td> +</tr> + +EOF + ;; + sbc) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Single-Board computer</h4></td> +</tr> + +EOF + ;; + emulation) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Emulation</h4></td> +</tr> + +EOF + ;; + misc) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Miscellaneous</h4></td> +</tr> + +EOF + ;; + unclass) + cat <<EOF +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Unclassified</h4></td> +</tr> + +EOF + ;; + esac + + for vendor_board_dir in "$COREBOOT_DIR"/src/mainboard/*/* ; do + board="$(basename "$vendor_board_dir")" + vendor="$(basename "$(dirname "$vendor_board_dir")")" + if [ "$board" = Kconfig ] || [ "$board" = Kconfig.name ]; then + continue + fi + + if [ -f "$vendor_board_dir/board_info.txt" ]; then + cur_category="$(sed -n "/^[[:space:]]*Category:/ s,^[[:space:]]*Category:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + else + cur_category= + fi + + case "$cur_category" in + desktop|server|laptop|half|mini|settop|"eval"|emulation|sbc|misc) + ;; + *) + cur_category=unclass + ;; + esac + if [ "$cur_category" != "$category" ]; then + continue + fi + + if [ -f "$vendor_board_dir/board_info.txt" ]; then + vendor_2nd="$(sed -n "/^[[:space:]]*Vendor name:/ s,^[[:space:]]*Vendor name:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + board_nice="$(sed -n "/^[[:space:]]*Board name:/ s,^[[:space:]]*Board name:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + rom_package="$(sed -n "/^[[:space:]]*ROM package:/ s,^[[:space:]]*ROM package:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + rom_protocol="$(sed -n "/^[[:space:]]*ROM protocol:/ s,^[[:space:]]*ROM protocol:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + rom_socketed="$(sed -n "/^[[:space:]]*ROM socketed:/ s,^[[:space:]]*ROM socketed:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + flashrom_support="$(sed -n "/^[[:space:]]*Flashrom support:/ s,^[[:space:]]*Flashrom support:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + vendor_cooperation_score="$(sed -n "/^[[:space:]]*Vendor cooperation score:/ s,^[[:space:]]*Vendor cooperation score:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + vendor_cooperation_page="$(sed -n "/^[[:space:]]*Vendor cooperation page:/ s,^[[:space:]]*Vendor cooperation page:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + board_url="$(sed -n "/^[[:space:]]*Board URL:/ s,^[[:space:]]*Board URL:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + clone_of="$(sed -n "/^[[:space:]]*Clone of:/ s,^[[:space:]]*Clone of:[[:space:]]*,,p" "$vendor_board_dir/board_info.txt")" + else + vendor_2nd= + board_nice= + rom_package= + rom_protocol= + rom_socketed= + flashrom_support= + vendor_cooperation_score= + vendor_cooperation_page= + board_url= + clone_of= + fi + if [ "$last_vendor" != "$vendor" ]; then + last_vendor="$vendor" + if [ "$color" = dddddd ]; then + color=eeeeee + else + color=dddddd + fi + fi + + vendor_nice="$(grep -A1 -i "config VENDOR_$vendor" "$COREBOOT_DIR"/src/mainboard/$vendor/Kconfig.name|tail -n1|sed -n 's,^[[:space:]]*bool[[:space:]]*"\(.*\)"[[:space:]]*$,\1,p')" + + if [ -z "$vendor_nice" ]; then + vendor_nice="$(echo "$vendor" |sed -e "s/\(.\)/\u\1/g")"; + fi + if [ -z "$board_nice" ]; then + board_nice="$(grep -A2 -i "config MAINBOARD_PART_NUMBER" "$COREBOOT_DIR"/src/mainboard/$vendor/$board/Kconfig|tail -n1|sed -n 's,^[[:space:]]*default[[:space:]]*"\(.*\)"[[:space:]]*$,\1,p')" + fi + if [ -z "$board_nice" ]; then + board_nice="$(echo "$board" |sed -e "s,_, ,g;s/\(.\)/\u\1/g")"; + fi + + venboard="$vendor/$board" + if [ -n "$clone_of" ]; then + venboard="$clone_of" + fi + + lastgood="$(echo "$have"| sed -n "/^$(echo "$venboard"|sed 's,/,\\/,g'):/ s,^[^:]*:,,gp")" + + vendor_board_dir="$COREBOOT_DIR"/src/mainboard/"$venboard"; + + northbridge="$(sed -n "/^[[:space:]]*select NORTHBRIDGE_/ s,^[[:space:]]*select NORTHBRIDGE_,,p" "$vendor_board_dir/Kconfig")" + northbridge_nice="$(echo "$northbridge"|sed 's,AMD_AGESA_FAMILY\([0-9a-fA-F]*\)\(.*\),AMD Family \1h\2 (AGESA),g;s,AMD_PI_\(.*\),AMD \1 (PI),g;s,INTEL_FSP_\(.*\),Intel® \1 (FSP),g;s,AMD_FAMILY\([0-9a-fA-F]*\),AMD Family \1h,g;s,AMD_AMDFAM\([0-9a-fA-F]*\),AMD Family \1h,g;s,_, ,g;s,INTEL,Intel®,g;')" + + southbridge="$(sed -n "/[[:space:]]*select SOUTHBRIDGE_/ s,[[:space:]]*select SOUTHBRIDGE_\([^ ]*\).*$,\1,p" "$vendor_board_dir/Kconfig"|grep -v SKIP_|grep -v DISABLE_)" + southbridge_nice="$(echo "$southbridge"|sed 's,_, ,g;s,INTEL,Intel®,g')" + superio="$(sed -n "/[[:space:]]*select SUPERIO_/ s,[[:space:]]*select SUPERIO_,,p" "$vendor_board_dir/Kconfig"|grep -v OVERRIDE_FANCTL)" + superio_nice="$(echo "$superio"|sed 's,_, ,g;s,WINBOND,Winbond™,g;s,ITE,ITE™,g;s,SMSC,SMSC®,g;s,NUVOTON,Nuvoton ,g')" + cpu="$(sed -n "/ select CPU_/ s, select CPU_,,p" "$vendor_board_dir/Kconfig"|grep -v "AMD_AGESA_FAMILY"|grep -v CPU_MICROCODE_CBFS_NONE)" + case "$cpu" in + ALLWINNER_A10) + cpu_nice="Allwinner A10" + socket_nice="?";; + AMD_GEODE_*) + cpu_nice="AMD Geode™ ${cpu#AMD_GEODE_}"; + socket_nice="—";; + AMD_SOCKET_754) + cpu_nice="AMD Sempron™ / Athlon™ 64 / Turion™ 64"; + socket_nice="Socket 754";; + AMD_SOCKET_ASB2) + cpu_nice="AMD Turion™ II Neo/Athlon™ II Neo"; + socket_nice="ASB2 (BGA812)";; + AMD_SOCKET_S1G1) + cpu_nice="AMD Turion™ / X2 Sempron™"; + socket_nice="Socket S1G1";; + AMD_SOCKET_G34|AMD_SOCKET_G34_NON_AGESA) + cpu_nice="AMD Opteron™ Magny-Cours/Interlagos"; + socket_nice="Socket G34";; + AMD_SOCKET_C32|AMD_SOCKET_C32_NON_AGESA) + cpu_nice="AMD Opteron™ Magny-Cours/Interlagos"; + socket_nice="Socket C32";; + AMD_SOCKET_AM2) + cpu_nice="?"; + socket_nice="Socket AM2" + ;; + AMD_SOCKET_AM3) + cpu_nice="AMD Athlon™ 64 / FX / X2"; + socket_nice="Socket AM3" + ;; + AMD_SOCKET_AM2R2) + cpu_nice="AMD Athlon™ 64 / X2 / FX, Sempron™"; + socket_nice="Socket AM2+" + ;; + AMD_SOCKET_F) + cpu_nice="AMD Opteron™"; + socket_nice="Socket F" + ;; + AMD_SOCKET_F_1207) + cpu_nice="AMD Opteron™"; + socket_nice="Socket F 1207" + ;; + AMD_SOCKET_940) + cpu_nice="AMD Opteron™"; + socket_nice="Socket 940" + ;; + AMD_SOCKET_939) + cpu_nice="AMD Athlon™ 64 / FX / X2"; + socket_nice="Socket 939" + ;; + AMD_SC520) + cpu_nice="AMD Élan™SC520"; + socket_nice="—";; + ARMLTD_CORTEX_A9) + cpu_nice="ARM Cortex A9"; + socket_nice="?";; + DMP_VORTEX86EX) + cpu_nice="DMP VORTEX86EX"; + socket_nice="?";; + SAMSUNG_EXYNOS5420) + cpu_nice="Samsung Exynos 5420"; + socket_nice="?";; + SAMSUNG_EXYNOS5250) + cpu_nice="Samsung Exynos 5250"; + socket_nice="?";; + TI_AM335X) + cpu_nice="TI AM335X"; + socket_nice="?";; + INTEL_SLOT_1) + cpu_nice="Intel® Pentium® II/III, Celeron®"; + socket_nice="Slot 1";; + INTEL_SOCKET_MPGA604) + cpu_nice="Intel® Xeon®"; + socket_nice="Socket 604";; + INTEL_SOCKET_MFCPGA478) + cpu_nice="Intel® Core™ 2 Duo Mobile, Core™ Duo/Solo, Celeron® M"; + socket_nice="Socket mPGA478";; + INTEL_SOCKET_LGA771) + cpu_nice="Intel Xeon™ 5000 series"; + socket_nice="Socket LGA771";; + INTEL_SOCKET_LGA775) + cpu_nice="Intel® Core 2, Pentium 4/D"; + socket_nice="Socket LGA775";; + INTEL_SOCKET_PGA370) + cpu_nice="Intel® Pentium® III-800, Celeron®" + socket_nice="Socket 370";; + INTEL_SOCKET_MPGA479M) + cpu_nice="Intel® Mobile Celeron" + socket_nice="Socket 479" + ;; + INTEL_HASWELL) + cpu_nice="Intel® 4th Gen (Haswell) Core i3/i5/i7" + socket_nice="?" + ;; + INTEL_FSP_RANGELEY) + cpu_nice="Intel® Atom Rangeley (FSP)" + socket_nice="?" + ;; + INTEL_SOCKET_RPGA989|INTEL_SOCKET_LGA1155|INTEL_SOCKET_RPGA988B) + socket_nice="`echo $cpu | sed 's,INTEL_SOCKET_,Socket ,g'`" + case $northbridge in + INTEL_HASWELL) + cpu_nice="Intel® 4th Gen (Haswell) Core i3/i5/i7";; + INTEL_IVYBRIDGE|INTEL_FSP_IVYBRIDGE) + cpu_nice="Intel® 3rd Gen (Ivybridge) Core i3/i5/i7";; + INTEL_SANDYBRIDGE) + cpu_nice="Intel® 2nd Gen (Sandybridge) Core i3/i5/i7";; + *) + cpu_nice="$northbridge";; + esac + ;; + INTEL_SOCKET_441) + cpu_nice="Intel® Atom™ 230"; + socket_nice="Socket 441";; + INTEL_SOCKET_BGA956) + case $northbridge in + INTEL_GM45) + cpu_nice="Intel® Core 2 Duo (Penryn)" + socket_nice="Socket P";; + *) + cpu_nice="Intel® Pentium® M"; + socket_nice="BGA956";; + esac + ;; + INTEL_SOCKET_FC_PGA370) + cpu_nice="Intel® Pentium® III / Celeron®"; + socket_nice="Socket 370" + ;; + INTEL_EP80579) + cpu_nice="Intel® EP80579"; + socket_nice="Intel® EP80579" + ;; + INTEL_SOCKET_MFCBGA479) + cpu_nice="Intel® Mobile Celeron" + socket_nice="Socket 479";; + VIA_C3) + cpu_nice="VIA C3™"; + socket_nice="?" + ;; + VIA_C7) + cpu_nice="VIA C7™"; + socket_nice="?" + ;; + VIA_NANO) + cpu_nice="VIA Nano™"; + socket_nice="?" + ;; + QEMU_X86) + cpu_nice="QEMU x86"; + socket_nice="—" + ;; + "") + case $northbridge in + INTEL_NEHALEM) + cpu_nice="Intel® 1st Gen (Nehalem) Core i3/i5/i7" + socket_nice="?";; + RDC_R8610) + cpu_nice="RDC 8610" + socket_nice="—";; + AMD_AGESA_*|AMD_PI_*) + cpu_nice="$northbridge_nice" + socket_nice="?";; + *) + cpu_nice="$northbridge" + socket_nice="$northbridge";; + esac + ;; + *) + cpu_nice="$cpu" + socket_nice="$cpu";; + esac + + echo "<tr bgcolor=\"#$color\">" + + if [ -z "$board_url" ]; then + echo "<td>$vendor_nice" + else + echo "<td><a href='$board_url'>$vendor_nice</a>" + fi + if ! [ -z "$vendor_2nd" ]; then + echo " ($vendor_2nd)" + fi + + echo "</td><td><a href='https://www.coreboot.org/Board:$vendor/$board'>$board_nice</a></td>" + + if [ -z "$lastgood" ]; then + echo "<td style=\"background:red\">Unknown</td>" + else + lastgood_diff=0 + lastgood_ts=$(date -d "$lastgood" "+%s") + if [ "$lastgood_ts" != "" ]; then + current_ts=$(date "+%s") + if [ "$lastgood_ts" -lt "$current_ts" ]; then + lastgood_diff=$(( current_ts - lastgood_ts )) + # Convert seconds to days + lastgood_diff=$(( lastgood_diff / 86400 )) + # Set maximum age at 255 days for convenience of code + if [ $lastgood_diff -gt 255 ]; then + lastgood_diff=255 + fi + fi + fi + lastgood_diff_hex=$(echo "obase=16; $lastgood_diff" | bc) + if [ "$lastgood_diff" -lt 16 ]; then + lastgood_diff_hex="0${lastgood_diff_hex}" + fi + cell_bgcolor="#${lastgood_diff_hex}ff00" + echo "<td style=\"background:${cell_bgcolor}\"><a href='#$venboard'>$lastgood</a></td>" + fi + + echo "<td>$northbridge_nice</td>" + echo "<td>$southbridge_nice</td>" + echo "<td>$superio_nice</td>" + echo "<td>$cpu_nice</td>" + echo "<td>$socket_nice</td>" + if [ "$rom_package" = "" ]; then + echo "<td>?</td>" + else + echo "<td>$rom_package</td>" + fi + if [ "$rom_protocol" = "" ]; then + echo "<td>?</td>" + else + echo "<td>$rom_protocol</td>" + fi + if [ "$rom_socketed" = "y" ]; then + echo "<td style=\"background:lime\">Y</td>" + elif [ "$rom_socketed" = "n" ]; then + echo "<td style=\"background:red\">N</td>" + elif [ "$flashrom_support" = "variable" ]; then + echo "<td>...<sup>7</sup></td>" + elif [ "$rom_socketed" = "" ]; then + echo "<td>?</td>" + else + echo "<td>$rom_socketed</td>" + fi + if [ "$flashrom_support" = "y" ]; then + echo "<td style=\"background:lime\">Y</td>" + elif [ "$flashrom_support" = "n" ]; then + echo "<td style=\"background:red\">N</td>" + elif [ "$flashrom_support" = "coreboot-only" ]; then + echo "<td style=\"background:yellow\">...<sup>6</sup></td>" + elif [ "$flashrom_support" = "" ]; then + echo "<td>?</td>" + else + echo "<td>$flashrom_support</td>" + fi + if [ "$vendor_cooperation_score" = "4" ]; then + echo -n "<td style=\"background:lime\">" + elif [ "$vendor_cooperatio_scoren" = "3" ]; then + echo -n "<td style=\"background:yellow\">" + else + echo -n "<td>" + fi + if [ "$vendor_cooperation_page" != "" ]; then + echo "<a href='http://www.coreboot.org/$vendor_cooperation_page'>$vendor_cooperation_score</a>" + elif [ "$vendor_cooperation_score" = "" ]; then + echo "—" + else + echo "$vendor_cooperation_score" + fi + echo "</td></tr>" + done +done +echo "</table>" + +cat <<EOF +<small> +<sup>1</sup> ROM chip package (PLCC, DIP32, DIP8, SOIC8).<br /> +<sup>2</sup> ROM chip protocol/type (parallel flash, LPC, FWH, SPI).<br /> +<sup>3</sup> ROM chip socketed (Y/N)?<br /> +<sup>4</sup> Board supported by [http://www.flashrom.org flashrom] (Y/N)?<br /> +<sup>5</sup> Vendor Cooperation Score.<br /> +<sup>6</sup> [http://www.flashrom.org flashrom] does not work when the vendor BIOS is booted, but it does work when the machine is booted with coreboot.<br /> +<sup>7</sup> Some boards have ROM sockets, others are soldered.<br /> +</small> +EOF + + +echo "$detailed" diff --git a/util/docker/coreboot.org-status/kconfig2html b/util/docker/coreboot.org-status/kconfig2html new file mode 100755 index 0000000000..35386b14cb --- /dev/null +++ b/util/docker/coreboot.org-status/kconfig2html @@ -0,0 +1,118 @@ +#!/usr/bin/env python +# +# kconfig2wiki - Kconfig to MediaWiki converter for +# https://www.coreboot.org/coreboot_Options +# +# Copyright (C) 2010 coresystems GmbH +# based on http://landley.net/kdocs/make/menuconfig2html.py +# Copyright (C) by Rob Landley +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +import glob + +helplen = 0 +extra_chapters = 0 + +## +## Remove quotes from Kconfig string options +## +def zapquotes(str): + if str[0]=='"': str = str[1:str.rfind('"')] + return str + +## +## Escape HTML special characters +## +def htmlescape(str): + return str.strip().replace("&","&").replace("<","<").replace(">",">") + +## +## Process Kconfig file +## +def readfile(filename): + import sys + global helplen + + source=filename.replace("src/","").replace("/Kconfig","").replace("Kconfig","toplevel") + + try: + lines = open(filename).read().split("\n") + except IOError: + sys.stderr.write("File %s missing\n" % filename) + return + config = None + description = None + configtype = None + for i in lines: + if helplen: + i = i.expandtabs() + if not len(i) or i[:helplen].isspace(): + sys.stdout.write("%s<br />\n" % htmlescape(i)) + continue + else: + helplen = 0 + sys.stdout.write("</td></tr>\n") + + words = i.strip().split(None,1) + if not len(words): continue + + if words[0] in ("config", "menuconfig"): + config = words[1] + description = "" + elif words[0] in ("bool", "boolean", "tristate", "string", "hex", "int"): + configtype = htmlescape(zapquotes(words[0])) + if len(words)>1: description = htmlescape(zapquotes(words[1])) + elif words[0]=="prompt": + description = htmlescape(zapquotes(words[1])) + elif words[0] in ("help", "---help---"): + sys.stdout.write("<tr bgcolor=\"#eeeeee\">\n") + sys.stdout.write("<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>\n" % (config,source,configtype,description) ) + helplen = len(i[:i.find(words[0])].expandtabs()) + elif words[0] == "comment": + sys.stdout.write("<tr bgcolor=\"#eeeeee\">\n") + sys.stdout.write("<td></td><td>%s</td><td>(comment)</td><td></td><td>%s</td></tr>\n" % (source, htmlescape(zapquotes(words[1])))) + elif words[0]=="menu": + if len(words)>1: + temp = htmlescape(zapquotes(words[1])) + sys.stdout.write("<tr bgcolor=\"#6699dd\">\n") + sys.stdout.write("<td colspan=5>Menu: %s</td></tr>\n" % temp) + elif words[0] == "endmenu": + sys.stdout.write("\n") + elif words[0] == "source": + fn=zapquotes(words[1]) + for name in glob.glob(fn): + readfile(name) + elif words[0] in ("default","depends", "select", "if", "endif", "#"): pass + #else: sys.stderr.write("unknown: %s\n" % i) + if helplen: sys.stdout.write("</td></tr>\n") + +def main(): + import sys, time + + if len(sys.argv)!=3: + sys.stderr.write("Usage: kconfig2wiki kconfigfile version\n") + sys.exit(1) + + sys.stdout.write("This is an automatically generated list of '''coreboot compile-time options'''.\n") + sys.stdout.write("\nLast update: %s\n" % sys.argv[2]) + sys.stdout.write("<table border=\"0\" style=\"font-size: smaller\">\n"); + sys.stdout.write("<tr bgcolor=\"#6699dd\">\n") + sys.stdout.write("<td align=\"left\">Option</td>\n") + sys.stdout.write("<td align=\"left\">Source</td>\n") + sys.stdout.write("<td align=\"left\">Format</td>\n") + sys.stdout.write("<td align=\"left\">Short Description</td>\n") + sys.stdout.write("<td align=\"left\">Description</td></tr>\n") + readfile(sys.argv[1]) + sys.stdout.write("</table>\n") + +if __name__ == "__main__": + main() diff --git a/util/docker/coreboot.org-status/run.sh b/util/docker/coreboot.org-status/run.sh new file mode 100755 index 0000000000..08732e7372 --- /dev/null +++ b/util/docker/coreboot.org-status/run.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# This file is part of the coreboot project. +# +# Copyright (C) 2018 Google Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +set -e + +# This script is the entry point for this container and expects two git +# repositories in /data-in, board-status.git and coreboot.git (with the +# content of the repos of the same name found at https://review.coreboot.org/ +# and creates two files, board-status.html and kconfig-options.html in +# /data-out. + +cd /data-in/board-status.git +/opt/tools/status-to-html.sh > /tmp/board-status.html +mv /tmp/board-status.html /data-out/ + +cd /data-in/coreboot.git +/opt/tools/kconfig2html src/Kconfig $(git describe) > /tmp/kconfig-options.html +mv /tmp/kconfig-options.html /data-out/ |