mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-18 02:39:59 +00:00
Merge branch 'nerf' of https://github.com/vejmarie/heads into vejmarie-nerf
This commit is contained in:
commit
bac09ec191
2
Makefile
2
Makefile
@ -10,7 +10,7 @@ INSTALL := $(pwd)/install
|
||||
log_dir := $(build)/log
|
||||
|
||||
BOARD ?= qemu-coreboot
|
||||
CONFIG := $(pwd)/boards/$(BOARD).config
|
||||
CONFIG := $(pwd)/boards/$(BOARD)/$(BOARD).config
|
||||
|
||||
ifneq "y" "$(shell [ -r '$(CONFIG)' ] && echo y)"
|
||||
$(error $(CONFIG): board configuration does not exist)
|
||||
|
44
boards/winterfell/uinit.go
Normal file
44
boards/winterfell/uinit.go
Normal file
@ -0,0 +1,44 @@
|
||||
// Copyright 2012-2017 the u-root Authors. All rights reserved
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// This is winterfell init script
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
commands = []string{
|
||||
"/bbin/insmod /lib/modules/nvme-core.ko",
|
||||
"/bbin/insmod /lib/modules/nvme.ko",
|
||||
"/bbin/insmod /lib/modules/libata.ko",
|
||||
"/bbin/insmod /lib/modules/libahci.ko",
|
||||
"/bbin/insmod /lib/modules/ahci.ko",
|
||||
"/bbin/rsdp",
|
||||
}
|
||||
)
|
||||
|
||||
func main() {
|
||||
for _, line := range commands {
|
||||
log.Printf("Executing Command: %v", line)
|
||||
cmdSplit := strings.Split(line, " ")
|
||||
if len(cmdSplit) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
cmd := exec.Command(cmdSplit[0], cmdSplit[1:]...)
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Stdout = os.Stdout
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Print(err)
|
||||
}
|
||||
|
||||
}
|
||||
log.Print("Uinit Done!")
|
||||
}
|
@ -7,20 +7,32 @@
|
||||
|
||||
u-root_url := github.com/u-root/u-root
|
||||
u-root_output := $(build)/$(BOARD)/u-root.cpio
|
||||
UROOT_CMDS ?=
|
||||
|
||||
export GOPATH=$(build)/go
|
||||
src_cmds := $(foreach cmd,$(UROOT_CMDS),github.com/u-root/u-root/cmds/$(cmd))
|
||||
|
||||
$(GOPATH):
|
||||
$(call do,GO GET,$(u-root_url),\
|
||||
go get $(u-root_url) \
|
||||
)
|
||||
|
||||
$(u-root_output): $(GOPATH)
|
||||
clean:
|
||||
rm -f $(build)/$(BOARD)/u-root.cpio
|
||||
|
||||
$(u-root_output): $(GOPATH) clean
|
||||
ifeq ($(shell test -e boards/$(BOARD)/uinit.go && echo -n yes),yes)
|
||||
ifeq ($(shell (test -d $(GOPATH)/src/github.com/u-root/u-root/cmds/uinit || echo -n yes)),yes)
|
||||
mkdir $(GOPATH)/src/github.com/u-root/u-root/cmds/uinit
|
||||
endif
|
||||
cp boards/$(BOARD)/uinit.go $(GOPATH)/src/github.com/u-root/u-root/cmds/uinit
|
||||
endif
|
||||
$(call do,U-ROOT,$@,\
|
||||
$(GOPATH)/bin/u-root \
|
||||
-build=bb \
|
||||
-format=cpio \
|
||||
-o $@ \
|
||||
-o $@ \
|
||||
$(src_cmds)\
|
||||
)
|
||||
|
||||
# Override the initrd inputs and add in the kernel modules
|
||||
|
Loading…
Reference in New Issue
Block a user