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 | |
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')
13 files changed, 171 insertions, 220 deletions
diff --git a/util/board_status/to-wiki/foreword.wiki b/util/board_status/to-wiki/foreword.wiki deleted file mode 100644 index 6b2af63aaf..0000000000 --- a/util/board_status/to-wiki/foreword.wiki +++ /dev/null @@ -1,38 +0,0 @@ -__NOTOC__ -This page was automatically generated. Please do not edit, any edits will be overwritten by an -automatic utility. - -= Mainboards supported by coreboot = - -This page shows two representations of the same data: - -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. - -After that, the page provides a time-ordered list of these contributed -reports, with the newest report first. - -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. - -We encourage developers and users to contribute reports so we know which -devices are well-tested. We have -[https://review.coreboot.org/gitweb/cgit/coreboot.git/tree/util/board_status a tool in the coreboot repository] -to make contributing easy. The data resides in the -[https://review.coreboot.org/gitweb/cgit/board-status.git/ board status repository]. -Contributing requires an account on review.coreboot.org - -Sometimes the same board is sold under different names, we've tried to -list all known names but some names might be missing. - -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 -[https://review.coreboot.org gerrit], so looking there could find some -code for boards that are not yet merged. - -= Vendor trees = -Some vendors have their own coreboot trees/fork, like for instance: -* [http://git.chromium.org/gitweb/?p=chromiumos/third_party/coreboot.git;a=summary chrome/chromium's tree] diff --git a/util/board_status/to-wiki/push-to-wiki.sh b/util/board_status/to-wiki/push-to-wiki.sh deleted file mode 100755 index 6ad3c4a3f8..0000000000 --- a/util/board_status/to-wiki/push-to-wiki.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# $1: file containing text -# $2: wiki page to update - -. ~/.wikiaccount -WIKIAPI="https://www.coreboot.org/api.php" -TITLE="$2" -cookie_jar="$HOME/.wikicookiejar" -#Will store file in wikifile - -#################login -#Login part 1 -CR=$(curl -sS \ - --location \ - --retry 2 \ - --retry-delay 5\ - --cookie $cookie_jar \ - --cookie-jar $cookie_jar \ - --user-agent "Curl Shell Script" \ - --keepalive-time 60 \ - --header "Accept-Language: en-us" \ - --header "Connection: keep-alive" \ - --compressed \ - --data-urlencode "lgname=${USERNAME}" \ - --data-urlencode "lgpassword=${USERPASS}" \ - --request "POST" "${WIKIAPI}?action=login&format=json") - -TOKEN=`echo $CR| sed -e 's,^.*"token":"\([^"]*\)".*$,\1,'` -if [ -z "$TOKEN" ]; then - exit -fi - -#Login part 2 -CR=$(curl -sS \ - --location \ - --cookie $cookie_jar \ - --cookie-jar $cookie_jar \ - --user-agent "Curl Shell Script" \ - --keepalive-time 60 \ - --header "Accept-Language: en-us" \ - --header "Connection: keep-alive" \ - --compressed \ - --data-urlencode "lgname=${USERNAME}" \ - --data-urlencode "lgpassword=${USERPASS}" \ - --data-urlencode "lgtoken=${TOKEN}" \ - --request "POST" "${WIKIAPI}?action=login&format=json") - -############### -#Get edit token -CR=$(curl -sS \ - --location \ - --cookie $cookie_jar \ - --cookie-jar $cookie_jar \ - --user-agent "Curl Shell Script" \ - --keepalive-time 60 \ - --header "Accept-Language: en-us" \ - --header "Connection: keep-alive" \ - --compressed \ - --request "POST" "${WIKIAPI}?action=query&meta=tokens&format=json") - -EDITTOKEN=`echo $CR| sed -e 's,^.*"csrftoken":"\([^"]*\)".*$,\1,'` -EDITTOKEN=`printf "$EDITTOKEN"` -if [ ${#EDITTOKEN} != 34 ]; then - exit -fi -######################### - -CR=$(curl -sS \ - --location \ - --cookie $cookie_jar \ - --cookie-jar $cookie_jar \ - --user-agent "Curl Shell Script" \ - --keepalive-time 60 \ - --header "Accept-Language: en-us" \ - --header "Connection: keep-alive" \ - --header "Expect:" \ - --form "token=${EDITTOKEN}" \ - --form "title=${TITLE}" \ - --form "text=<$1" \ - --request "POST" "${WIKIAPI}?action=edit&") 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/board_status/to-wiki/README b/util/docker/coreboot.org-status/board-status.html/README index 0a0d591c87..0a0d591c87 100644 --- a/util/board_status/to-wiki/README +++ b/util/docker/coreboot.org-status/board-status.html/README diff --git a/util/board_status/to-wiki/bucketize.sh b/util/docker/coreboot.org-status/board-status.html/bucketize.sh index cb643e73bc..cb643e73bc 100755 --- a/util/board_status/to-wiki/bucketize.sh +++ b/util/docker/coreboot.org-status/board-status.html/bucketize.sh 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/board_status/to-wiki/status-to-wiki.sh b/util/docker/coreboot.org-status/board-status.html/status-to-html.sh index 8d3d2a4a70..6630b30c1f 100755 --- a/util/board_status/to-wiki/status-to-wiki.sh +++ b/util/docker/coreboot.org-status/board-status.html/status-to-html.sh @@ -1,2 +1,2 @@ #!/bin/sh -ls -d */*/*/*/ | `dirname $0`/bucketize.sh weekly | `dirname $0`/towiki.sh +ls -d */*/*/*/ | `dirname $0`/bucketize.sh weekly | `dirname $0`/tohtml.sh diff --git a/util/board_status/to-wiki/towiki.sh b/util/docker/coreboot.org-status/board-status.html/tohtml.sh index e8d2fb22fd..b1a7ccdc9a 100755 --- a/util/board_status/to-wiki/towiki.sh +++ b/util/docker/coreboot.org-status/board-status.html/tohtml.sh @@ -1,10 +1,10 @@ #!/bin/sh -export COREBOOT_DIR="../coreboot" +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.wiki ]; then - cat `dirname $0`/foreword.wiki +if [ -f `dirname $0`/foreword.html ]; then + cat `dirname $0`/foreword.html fi detailed= nl=" @@ -13,7 +13,7 @@ have= while read line; do timeframe=`echo $line | cut -d: -f1` rest=`echo $line | cut -d: -f2-` - detailed="$detailed= $timeframe =$nl" + 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` @@ -27,36 +27,37 @@ while read line; do have="$have$vendor_board:$datetime$nl" fi - detailed="$detailed[[Board:$vendor_board|$vendor_board]] at $datetime_human$nl" - detailed="$detailed[$CODE_GITWEB$upstream upstream tree] ($nl" + 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[$STATUS_GITWEB$file `basename $file`] $nl" + detailed="$detailed<a href='$STATUS_GITWEB$file'>`basename $file`</a> $nl" done - detailed="$detailed)$nl$nl" + detailed="$detailed)<br />" done done cat <<EOF -== Motherboards supported in coreboot == - -{| border="0" style="font-size: smaller" -|- bgcolor="#6699ff" -! align="left" | Vendor -! align="left" | Mainboard -! align="left" | Latest known good -! align="left" | Northbridge -! align="left" | Southbridge -! align="left" | Super I/O -! align="left" | CPU -! align="left" | Socket -! align="left" | <span title="ROM chip package">ROM <sup>1</sup></span> -! align="left" | <span title="ROM chip protocol">P <sup>2</sup></span> -! align="left" | <span title="ROM chip socketed?">S <sup>3</sup></span> -! align="left" | <span title="Board supported by flashrom?">F <sup>4</sup></span> -! align="left" | <span title="Vendor Cooperation Score">VCS<sup>5</sup></span> +<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 @@ -65,78 +66,89 @@ for category in laptop server desktop half mini settop "eval" sbc emulation misc case "$category" in desktop) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Desktops / Workstations</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Desktops / Workstations</h4></td> +</tr> EOF ;; server) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Servers</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Servers</h4></td> +</tr> EOF ;; laptop) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Laptops</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Laptops</h4></td> +</tr> EOF ;; half) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Embedded / PC/104 / Half-size boards</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Embedded / PC/104 / Half-size boards</h4></td> +</tr> EOF ;; mini) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Mini-ITX / Micro-ITX / Nano-ITX</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Mini-ITX / Micro-ITX / Nano-ITX</h4></td> +</tr> EOF ;; settop) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Set-top-boxes / Thin clients</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Set-top-boxes / Thin clients</h4></td> +</tr> EOF ;; "eval") cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Devel/Eval Boards</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Devel/Eval Boards</h4></td> +</tr> EOF ;; sbc) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Single-Board computer</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Single-Board computer</h4></td> +</tr> EOF ;; emulation) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Emulation</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Emulation</h4></td> +</tr> EOF ;; misc) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Miscellaneous</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Miscellaneous</h4></td> +</tr> EOF ;; unclass) cat <<EOF -|- bgcolor="#6699ff" -| colspan="13" | <h4>Unclassified</h4> +<tr bgcolor="#6699ff"> +<td colspan="13"><h4>Unclassified</h4></td> +</tr> EOF ;; @@ -399,21 +411,21 @@ EOF socket_nice="$cpu";; esac - echo "|- bgcolor=\"#$color\"" + echo "<tr bgcolor=\"#$color\">" if [ -z "$board_url" ]; then - echo "| $vendor_nice" + echo "<td>$vendor_nice" else - echo "| [$board_url $vendor_nice]" + echo "<td><a href='$board_url'>$vendor_nice</a>" fi if ! [ -z "$vendor_2nd" ]; then - echo "( $vendor_2nd )" + echo " ($vendor_2nd)" fi - echo "| [[Board:$vendor/$board|$board_nice]]" + echo "</td><td><a href='https://www.coreboot.org/Board:$vendor/$board'>$board_nice</a></td>" if [ -z "$lastgood" ]; then - echo "| style=\"background:red\" | Unknown" + echo "<td style=\"background:red\">Unknown</td>" else lastgood_diff=0 lastgood_ts=$(date -d "$lastgood" "+%s") @@ -434,62 +446,64 @@ EOF lastgood_diff_hex="0${lastgood_diff_hex}" fi cell_bgcolor="#${lastgood_diff_hex}ff00" - echo "| style=\"background:${cell_bgcolor}\" | [[#$venboard|$lastgood]]" + echo "<td style=\"background:${cell_bgcolor}\"><a href='#$venboard'>$lastgood</a></td>" fi - echo "| $northbridge_nice" - echo "| $southbridge_nice" - echo "| $superio_nice" - echo "| $cpu_nice" - echo "| $socket_nice" + 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 "| ?" + echo "<td>?</td>" else - echo "| $rom_package" + echo "<td>$rom_package</td>" fi if [ "$rom_protocol" = "" ]; then - echo "| ?" + echo "<td>?</td>" else - echo "| $rom_protocol" + echo "<td>$rom_protocol</td>" fi if [ "$rom_socketed" = "y" ]; then - echo "| style=\"background:lime\" | Y" + echo "<td style=\"background:lime\">Y</td>" elif [ "$rom_socketed" = "n" ]; then - echo "| style=\"background:red\" | N" + echo "<td style=\"background:red\">N</td>" elif [ "$flashrom_support" = "variable" ]; then - echo "| ...<sup>7</sup>" + echo "<td>...<sup>7</sup></td>" elif [ "$rom_socketed" = "" ]; then - echo "| ?" + echo "<td>?</td>" else - echo "| $rom_socketed" + echo "<td>$rom_socketed</td>" fi if [ "$flashrom_support" = "y" ]; then - echo "| style=\"background:lime\" | Y" + echo "<td style=\"background:lime\">Y</td>" elif [ "$flashrom_support" = "n" ]; then - echo "| style=\"background:red\" | N" + echo "<td style=\"background:red\">N</td>" elif [ "$flashrom_support" = "coreboot-only" ]; then - echo "| style=\"background:yellow\" | ...<sup>6</sup>" + echo "<td style=\"background:yellow\">...<sup>6</sup></td>" elif [ "$flashrom_support" = "" ]; then - echo "| ?" + echo "<td>?</td>" else - echo "| $flashrom_support" + echo "<td>$flashrom_support</td>" fi if [ "$vendor_cooperation_score" = "4" ]; then - echo -n "| style=\"background:lime\"" + echo -n "<td style=\"background:lime\">" elif [ "$vendor_cooperatio_scoren" = "3" ]; then - echo -n "| style=\"background:yellow\"" + echo -n "<td style=\"background:yellow\">" + else + echo -n "<td>" fi if [ "$vendor_cooperation_page" != "" ]; then - echo "| [[$vendor_cooperation_page|$vendor_cooperation_score]]" + echo "<a href='http://www.coreboot.org/$vendor_cooperation_page'>$vendor_cooperation_score</a>" elif [ "$vendor_cooperation_score" = "" ]; then - echo "| —" + echo "—" else - echo "| $vendor_cooperation_score" + echo "$vendor_cooperation_score" fi - echo + echo "</td></tr>" done done -echo "|}" +echo "</table>" cat <<EOF <small> diff --git a/util/optionlist/kconfig2html b/util/docker/coreboot.org-status/kconfig2html index 35386b14cb..35386b14cb 100755 --- a/util/optionlist/kconfig2html +++ b/util/docker/coreboot.org-status/kconfig2html 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/ diff --git a/util/optionlist/Makefile b/util/optionlist/Makefile deleted file mode 100644 index 05f720cedc..0000000000 --- a/util/optionlist/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (C) 2010 coresystems GmbH -# -# 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. -# - -VERSION := $(shell git describe --dirty --always || git describe) - -all: - cd ../..; util/optionlist/kconfig2wiki src/Kconfig $(VERSION) > util/optionlist/Options.wiki - -clean: - rm -rf Options.wiki diff --git a/util/optionlist/README b/util/optionlist/README deleted file mode 100644 index da3efb33b2..0000000000 --- a/util/optionlist/README +++ /dev/null @@ -1 +0,0 @@ -This script creates the page https://www.coreboot.org/coreboot_Options |