Browse Source

x230: improve the build script

pull/61/head
Martin Kepplinger 5 years ago
parent
commit
692e3d42af
3 changed files with 75 additions and 3 deletions
  1. +1
    -0
      x230/.gitignore
  2. +2
    -2
      x230/README.md
  3. +72
    -1
      x230/build.sh

+ 1
- 0
x230/.gitignore View File

@ -1,3 +1,4 @@
output
x230_coreboot_seabios_*rom*
build
/config-*

+ 2
- 2
x230/README.md View File

@ -262,5 +262,5 @@ Mainly a tiny binary used by the Ethernet card and the Intel Management Engine.
## how to reproduce the release images
* `git clone https://github.com/merge/skulls`
* rename one of the included config files to `config-xxxxxxxxxx`.
* The x230 directory's `./build.sh` should produce the exact corresponding release image file.
* `cd skulls/x230`
* `./build.sh` and choose the configuration you want to build

+ 72
- 1
x230/build.sh View File

@ -1,8 +1,79 @@
#!/bin/bash
ls -1 config* || exit 0
. skulls_common.sh
warn_not_root
have_config=0
usage()
{
echo "Skulls for the X230"
echo " Run this script to rebuild a released image"
echo ""
echo "Usage: $0 [-c <config_file>]"
echo ""
echo " -c <config_file> to use for flashrom"
}
args=$(getopt -o c:h -- "$@")
if [ $? -ne 0 ] ; then
usage
exit 1
fi
eval set -- "$args"
while [ $# -gt 0 ]
do
case "$1" in
-c)
CONFIGFILE=$2
have_config=1
shift
;;
-h)
usage
exit 1
;;
--)
shift
break
;;
*)
echo "Invalid option: $1"
exit 1
;;
esac
shift
done
if [ ! "$have_config" -gt 0 ] ; then
configs_available=$(ls -1 | grep config || true)
if [ -z "${configs_available}" ] ; then
echo "No config file found. Please add -c <file>"
echo ""
usage
exit 1
fi
prompt="Please select a configuration to use for building or start with the -c option to use a different one:"
options=( $(find -maxdepth 1 -name "*config*" -print0 | xargs -0) )
PS3="$prompt "
select CONFIGFILE in "${options[@]}" "Quit" ; do
if (( REPLY == 1 + ${#options[@]} )) ; then
exit
elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then
break
else
echo "Invalid option. Try another one."
fi
done
fi
CONFIGFILE_READY=$(echo $CONFIGFILE | cut -d'-' -f2-)
cp $CONFIGFILE $CONFIGFILE_READY
cd ..
./build.sh --clean-slate --commit $(ls -1 x230/config-* | cut -c 13-22) x230

Loading…
Cancel
Save