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>
This commit is contained in:
Patrick Georgi 2018-06-08 18:10:58 +02:00 committed by Patrick Georgi
parent 31e0d42a1d
commit 79d26c7a83
13 changed files with 170 additions and 219 deletions

View File

@ -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]

View File

@ -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&")

View File

@ -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

View File

@ -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}`.

View File

@ -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>

View File

@ -1,2 +1,2 @@
#!/bin/sh #!/bin/sh
ls -d */*/*/*/ | `dirname $0`/bucketize.sh weekly | `dirname $0`/towiki.sh ls -d */*/*/*/ | `dirname $0`/bucketize.sh weekly | `dirname $0`/tohtml.sh

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
export COREBOOT_DIR="../coreboot" export COREBOOT_DIR="../coreboot.git"
export GIT_DIR="$COREBOOT_DIR/.git" export GIT_DIR="$COREBOOT_DIR/.git"
CODE_GITWEB="https://review.coreboot.org/gitweb/cgit/coreboot.git/commit/?id=" CODE_GITWEB="https://review.coreboot.org/gitweb/cgit/coreboot.git/commit/?id="
STATUS_GITWEB="https://review.coreboot.org/gitweb/cgit/board-status.git/tree/" STATUS_GITWEB="https://review.coreboot.org/gitweb/cgit/board-status.git/tree/"
if [ -f `dirname $0`/foreword.wiki ]; then if [ -f `dirname $0`/foreword.html ]; then
cat `dirname $0`/foreword.wiki cat `dirname $0`/foreword.html
fi fi
detailed= detailed=
nl=" nl="
@ -13,7 +13,7 @@ have=
while read line; do while read line; do
timeframe=`echo $line | cut -d: -f1` timeframe=`echo $line | cut -d: -f1`
rest=`echo $line | cut -d: -f2-` rest=`echo $line | cut -d: -f2-`
detailed="$detailed= $timeframe =$nl" detailed="$detailed<h1>$timeframe</h1>$nl"
for i in $rest; do for i in $rest; do
vendor_board=`echo $i | cut -d/ -f1-2` vendor_board=`echo $i | cut -d/ -f1-2`
commit=`echo $i | cut -d/ -f3` commit=`echo $i | cut -d/ -f3`
@ -27,36 +27,37 @@ while read line; do
have="$have$vendor_board:$datetime$nl" have="$have$vendor_board:$datetime$nl"
fi fi
detailed="$detailed[[Board:$vendor_board|$vendor_board]] at $datetime_human$nl" detailed="$detailed<a href='https://www.coreboot.org/Board:$vendor_board'>$vendor_board</a> at $datetime_human$nl"
detailed="$detailed[$CODE_GITWEB$upstream upstream tree] ($nl" detailed="$detailed<a href='$CODE_GITWEB$upstream'>upstream tree</a> ($nl"
for file in "$vendor_board/$commit/$datetime_path/"*; do for file in "$vendor_board/$commit/$datetime_path/"*; do
if [ "$file" = "$vendor_board/$commit/$datetime_path/revision.txt" ]; then if [ "$file" = "$vendor_board/$commit/$datetime_path/revision.txt" ]; then
continue continue
fi fi
detailed="$detailed[$STATUS_GITWEB$file `basename $file`] $nl" detailed="$detailed<a href='$STATUS_GITWEB$file'>`basename $file`</a> $nl"
done done
detailed="$detailed)$nl$nl" detailed="$detailed)<br />"
done done
done done
cat <<EOF cat <<EOF
== Motherboards supported in coreboot == <h1>Motherboards supported in coreboot</h1>
{| border="0" style="font-size: smaller" <table border="0" style="font-size: smaller">
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
! align="left" | Vendor <td>Vendor</td>
! align="left" | Mainboard <td>Mainboard</td>
! align="left" | Latest known good <td>Latest known good</td>
! align="left" | Northbridge <td>Northbridge</td>
! align="left" | Southbridge <td>Southbridge</td>
! align="left" | Super&nbsp;I/O <td>Super&nbsp;I/O</td>
! align="left" | CPU <td>CPU</td>
! align="left" | Socket <td>Socket</td>
! align="left" | <span title="ROM chip package">ROM&nbsp;<sup>1</sup></span> <td><span title="ROM chip package">ROM&nbsp;<sup>1</sup></span></td>
! align="left" | <span title="ROM chip protocol">P&nbsp;<sup>2</sup></span> <td><span title="ROM chip protocol">P&nbsp;<sup>2</sup></span></td>
! align="left" | <span title="ROM chip socketed?">S&nbsp;<sup>3</sup></span> <td><span title="ROM chip socketed?">S&nbsp;<sup>3</sup></span></td>
! align="left" | <span title="Board supported by flashrom?">F&nbsp;<sup>4</sup></span> <td><span title="Board supported by flashrom?">F&nbsp;<sup>4</sup></span></td>
! align="left" | <span title="Vendor Cooperation Score">VCS<sup>5</sup></span> <td><span title="Vendor Cooperation Score">VCS<sup>5</sup></span></td>
</tr>
EOF EOF
for category in laptop server desktop half mini settop "eval" sbc emulation misc unclass; do 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 case "$category" in
desktop) desktop)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Desktops / Workstations</h4> <td colspan="13"><h4>Desktops / Workstations</h4></td>
</tr>
EOF EOF
;; ;;
server) server)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Servers</h4> <td colspan="13"><h4>Servers</h4></td>
</tr>
EOF EOF
;; ;;
laptop) laptop)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Laptops</h4> <td colspan="13"><h4>Laptops</h4></td>
</tr>
EOF EOF
;; ;;
half) half)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Embedded / PC/104 / Half-size boards</h4> <td colspan="13"><h4>Embedded / PC/104 / Half-size boards</h4></td>
</tr>
EOF EOF
;; ;;
mini) mini)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Mini-ITX / Micro-ITX / Nano-ITX</h4> <td colspan="13"><h4>Mini-ITX / Micro-ITX / Nano-ITX</h4></td>
</tr>
EOF EOF
;; ;;
settop) settop)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Set-top-boxes / Thin clients</h4> <td colspan="13"><h4>Set-top-boxes / Thin clients</h4></td>
</tr>
EOF EOF
;; ;;
"eval") "eval")
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Devel/Eval Boards</h4> <td colspan="13"><h4>Devel/Eval Boards</h4></td>
</tr>
EOF EOF
;; ;;
sbc) sbc)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Single-Board computer</h4> <td colspan="13"><h4>Single-Board computer</h4></td>
</tr>
EOF EOF
;; ;;
emulation) emulation)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Emulation</h4> <td colspan="13"><h4>Emulation</h4></td>
</tr>
EOF EOF
;; ;;
misc) misc)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Miscellaneous</h4> <td colspan="13"><h4>Miscellaneous</h4></td>
</tr>
EOF EOF
;; ;;
unclass) unclass)
cat <<EOF cat <<EOF
|- bgcolor="#6699ff" <tr bgcolor="#6699ff">
| colspan="13" | <h4>Unclassified</h4> <td colspan="13"><h4>Unclassified</h4></td>
</tr>
EOF EOF
;; ;;
@ -399,21 +411,21 @@ EOF
socket_nice="$cpu";; socket_nice="$cpu";;
esac esac
echo "|- bgcolor=\"#$color\"" echo "<tr bgcolor=\"#$color\">"
if [ -z "$board_url" ]; then if [ -z "$board_url" ]; then
echo "| $vendor_nice" echo "<td>$vendor_nice"
else else
echo "| [$board_url $vendor_nice]" echo "<td><a href='$board_url'>$vendor_nice</a>"
fi fi
if ! [ -z "$vendor_2nd" ]; then if ! [ -z "$vendor_2nd" ]; then
echo "( $vendor_2nd )" echo " ($vendor_2nd)"
fi 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 if [ -z "$lastgood" ]; then
echo "| style=\"background:red\" | Unknown" echo "<td style=\"background:red\">Unknown</td>"
else else
lastgood_diff=0 lastgood_diff=0
lastgood_ts=$(date -d "$lastgood" "+%s") lastgood_ts=$(date -d "$lastgood" "+%s")
@ -434,62 +446,64 @@ EOF
lastgood_diff_hex="0${lastgood_diff_hex}" lastgood_diff_hex="0${lastgood_diff_hex}"
fi fi
cell_bgcolor="#${lastgood_diff_hex}ff00" 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 fi
echo "| $northbridge_nice" echo "<td>$northbridge_nice</td>"
echo "| $southbridge_nice" echo "<td>$southbridge_nice</td>"
echo "| $superio_nice" echo "<td>$superio_nice</td>"
echo "| $cpu_nice" echo "<td>$cpu_nice</td>"
echo "| $socket_nice" echo "<td>$socket_nice</td>"
if [ "$rom_package" = "" ]; then if [ "$rom_package" = "" ]; then
echo "| ?" echo "<td>?</td>"
else else
echo "| $rom_package" echo "<td>$rom_package</td>"
fi fi
if [ "$rom_protocol" = "" ]; then if [ "$rom_protocol" = "" ]; then
echo "| ?" echo "<td>?</td>"
else else
echo "| $rom_protocol" echo "<td>$rom_protocol</td>"
fi fi
if [ "$rom_socketed" = "y" ]; then if [ "$rom_socketed" = "y" ]; then
echo "| style=\"background:lime\" | Y" echo "<td style=\"background:lime\">Y</td>"
elif [ "$rom_socketed" = "n" ]; then elif [ "$rom_socketed" = "n" ]; then
echo "| style=\"background:red\" | N" echo "<td style=\"background:red\">N</td>"
elif [ "$flashrom_support" = "variable" ]; then elif [ "$flashrom_support" = "variable" ]; then
echo "| ...<sup>7</sup>" echo "<td>...<sup>7</sup></td>"
elif [ "$rom_socketed" = "" ]; then elif [ "$rom_socketed" = "" ]; then
echo "| ?" echo "<td>?</td>"
else else
echo "| $rom_socketed" echo "<td>$rom_socketed</td>"
fi fi
if [ "$flashrom_support" = "y" ]; then if [ "$flashrom_support" = "y" ]; then
echo "| style=\"background:lime\" | Y" echo "<td style=\"background:lime\">Y</td>"
elif [ "$flashrom_support" = "n" ]; then elif [ "$flashrom_support" = "n" ]; then
echo "| style=\"background:red\" | N" echo "<td style=\"background:red\">N</td>"
elif [ "$flashrom_support" = "coreboot-only" ]; then 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 elif [ "$flashrom_support" = "" ]; then
echo "| ?" echo "<td>?</td>"
else else
echo "| $flashrom_support" echo "<td>$flashrom_support</td>"
fi fi
if [ "$vendor_cooperation_score" = "4" ]; then if [ "$vendor_cooperation_score" = "4" ]; then
echo -n "| style=\"background:lime\"" echo -n "<td style=\"background:lime\">"
elif [ "$vendor_cooperatio_scoren" = "3" ]; then elif [ "$vendor_cooperatio_scoren" = "3" ]; then
echo -n "| style=\"background:yellow\"" echo -n "<td style=\"background:yellow\">"
else
echo -n "<td>"
fi fi
if [ "$vendor_cooperation_page" != "" ]; then 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 elif [ "$vendor_cooperation_score" = "" ]; then
echo "| —" echo "—"
else else
echo "| $vendor_cooperation_score" echo "$vendor_cooperation_score"
fi fi
echo echo "</td></tr>"
done done
done done
echo "|}" echo "</table>"
cat <<EOF cat <<EOF
<small> <small>

View File

@ -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/

View File

@ -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

View File

@ -1 +0,0 @@
This script creates the page https://www.coreboot.org/coreboot_Options