autoport: Allow binary prerequisites to be placed in the autoport directory.

This allow an easy creation of standalone "autoport pack".

Change-Id: Ibe9e38aa3b4bbd7260104e1c2a11630790ff4d2f
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10370
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
This commit is contained in:
Vladimir Serbinenko 2015-05-29 20:49:09 +02:00
parent a78f699807
commit 39e25eceaf
2 changed files with 26 additions and 3 deletions

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
) )
func RunAndSave(output string, name string, arg ...string) { func TryRunAndSave(output string, name string, arg []string) error {
cmd := exec.Command(name, arg...) cmd := exec.Command(name, arg...)
f, err := os.Create(output) f, err := os.Create(output)
@ -22,9 +22,27 @@ func RunAndSave(output string, name string, arg ...string) {
err = cmd.Start() err = cmd.Start()
if err != nil { if err != nil {
log.Fatal(err) return err
} }
cmd.Wait() cmd.Wait()
return nil
}
func RunAndSave(output string, name string, arg ...string) {
err := TryRunAndSave(output, name, arg)
if err == nil {
return
}
idx := strings.LastIndex(name, "/")
relname := name
if idx >= 0 {
relname = name[idx+1:]
}
relname = "./" + relname
err = TryRunAndSave(output, relname, arg)
if err != nil {
log.Fatal(err)
}
} }
func MakeLogs(outDir string) { func MakeLogs(outDir string) {

View File

@ -25,7 +25,12 @@ This will allow autoport to detect as much as possible
make make
cd ../autoport cd ../autoport
go build go build
./autoport --input_log=logs --make_logs --coreboot_dir=../.. sudo ./autoport --input_log=logs --make_logs --coreboot_dir=../..
Note: in case you have problems getting gcc and golang to target machine
you can just compile on another machine and transfer binaries
`autoport`, `inteltool` and `ectool`. You'll still need other prerequisites
but you may place them in the same directory as autoport.
* Look for output unknown PCI devices. E.g. * Look for output unknown PCI devices. E.g.