mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-31 00:24:17 +00:00
Merge branch 'vejmarie-nerf'
This commit is contained in:
commit
18a7d5e16d
2
Makefile
2
Makefile
@ -10,7 +10,7 @@ INSTALL := $(pwd)/install
|
|||||||
log_dir := $(build)/log
|
log_dir := $(build)/log
|
||||||
|
|
||||||
BOARD ?= qemu-coreboot
|
BOARD ?= qemu-coreboot
|
||||||
CONFIG := $(pwd)/boards/$(BOARD).config
|
CONFIG := $(pwd)/boards/$(BOARD)/$(BOARD).config
|
||||||
|
|
||||||
ifneq "y" "$(shell [ -r '$(CONFIG)' ] && echo y)"
|
ifneq "y" "$(shell [ -r '$(CONFIG)' ] && echo y)"
|
||||||
$(error $(CONFIG): board configuration does not exist)
|
$(error $(CONFIG): board configuration does not exist)
|
||||||
|
@ -6,20 +6,21 @@ CONFIG_LINUX_CONFIG=config/linux-linuxboot.config
|
|||||||
|
|
||||||
ifeq "$(CONFIG_UROOT)" "y"
|
ifeq "$(CONFIG_UROOT)" "y"
|
||||||
CONFIG_BUSYBOX=n
|
CONFIG_BUSYBOX=n
|
||||||
endif
|
else
|
||||||
|
|
||||||
CONFIG_CRYPTSETUP=y
|
CONFIG_CRYPTSETUP=y
|
||||||
#CONFIG_FLASHROM=y
|
|
||||||
CONFIG_FLASHTOOLS=y
|
|
||||||
CONFIG_GPG=y
|
|
||||||
CONFIG_KEXEC=y
|
|
||||||
CONFIG_UTIL_LINUX=y
|
|
||||||
CONFIG_LVM2=y
|
CONFIG_LVM2=y
|
||||||
CONFIG_MBEDTLS=y
|
CONFIG_MBEDTLS=y
|
||||||
CONFIG_PCIUTILS=y
|
CONFIG_PCIUTILS=y
|
||||||
CONFIG_POPT=y
|
CONFIG_POPT=y
|
||||||
CONFIG_QRENCODE=y
|
CONFIG_QRENCODE=y
|
||||||
CONFIG_TPMTOTP=y
|
CONFIG_TPMTOTP=y
|
||||||
|
endif
|
||||||
|
|
||||||
|
#CONFIG_FLASHROM=y
|
||||||
|
CONFIG_FLASHTOOLS=y
|
||||||
|
CONFIG_GPG=y
|
||||||
|
CONFIG_KEXEC=y
|
||||||
|
CONFIG_UTIL_LINUX=y
|
||||||
CONFIG_DROPBEAR=y
|
CONFIG_DROPBEAR=y
|
||||||
#CONFIG_FROTZ=y
|
#CONFIG_FROTZ=y
|
||||||
|
|
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!")
|
||||||
|
}
|
@ -4,30 +4,51 @@
|
|||||||
# This is not a normal Heads module, since it builds all of its
|
# This is not a normal Heads module, since it builds all of its
|
||||||
# own dependencies.
|
# own dependencies.
|
||||||
#
|
#
|
||||||
|
|
||||||
u-root_url := github.com/u-root/u-root
|
u-root_url := github.com/u-root/u-root
|
||||||
u-root_output := $(build)/$(BOARD)/u-root.cpio
|
u-root_output := $(build)/$(BOARD)/u-root.cpio
|
||||||
|
UROOT_CMDS ?=
|
||||||
|
|
||||||
export GOPATH=$(build)/go
|
export GOPATH=$(build)/go
|
||||||
|
u-root_src_cmds := $(foreach cmd,$(UROOT_CMDS),github.com/u-root/u-root/cmds/$(cmd))
|
||||||
|
|
||||||
$(GOPATH):
|
$(GOPATH):
|
||||||
$(call do,GO GET,$(u-root_url),\
|
$(call do,GO GET,$(u-root_url),\
|
||||||
go get $(u-root_url) \
|
go get $(u-root_url) \
|
||||||
)
|
)
|
||||||
|
|
||||||
$(u-root_output): $(GOPATH)
|
#
|
||||||
|
# If the board directory has its own go commands, copy them
|
||||||
|
# into the u-root tree so that they will be bundled into the go initrd
|
||||||
|
# TODO: generalize this to support more commands
|
||||||
|
# TODO: fix this sort that it doesn't leave commands lying around
|
||||||
|
#
|
||||||
|
ifeq "y" "$(shell [ -r 'boards/$(BOARD)/uinit.go' ] && echo y)"
|
||||||
|
u-root_uinit := $(GOPATH)/src/github.com/u-root/u-root/cmds/uinit/uinit.go
|
||||||
|
$(u-root_uinit): boards/$(BOARD)/uinit.go
|
||||||
|
$(call install,$<,$@)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(u-root_output): $(GOPATH) $(u-root_uinit)
|
||||||
$(call do,U-ROOT,$@,\
|
$(call do,U-ROOT,$@,\
|
||||||
$(GOPATH)/bin/u-root \
|
$(GOPATH)/bin/u-root \
|
||||||
-build=bb \
|
-build=bb \
|
||||||
-format=cpio \
|
-format=cpio \
|
||||||
-o $@ \
|
-o $@ \
|
||||||
|
$(u-root_src_cmds)\
|
||||||
)
|
)
|
||||||
|
|
||||||
# Override the initrd inputs and add in the kernel modules
|
# Override the initrd inputs and add in the kernel modules
|
||||||
initrd-$(CONFIG_UROOT) += $(u-root_output)
|
initrd-$(CONFIG_UROOT) += $(u-root_output)
|
||||||
|
|
||||||
|
|
||||||
# If we are building for u-root, disable the default CONFIG_HEADS
|
|
||||||
ifeq "$(CONFIG_UROOT)" "y"
|
ifeq "$(CONFIG_UROOT)" "y"
|
||||||
|
# If we are building for u-root, disable the default CONFIG_HEADS
|
||||||
|
# so that the heads/initrd/etc directories will not be included
|
||||||
CONFIG_HEADS=n
|
CONFIG_HEADS=n
|
||||||
|
|
||||||
|
# Since we do not include u-root in modules-y, we have to define our
|
||||||
|
# own intermediate and clean targets here
|
||||||
|
u-root.intermediate: $(u-root_output)
|
||||||
|
u-root.clean:
|
||||||
|
$(RM) $(u-root_output)
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user