-
Notifications
You must be signed in to change notification settings - Fork 425
The Big Merge - Welcome SystemBoot #1255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adding .stickler.yml configuration file
Grub2 supports quoting. I have introduced minimal unquoting with this patch to support dollar-sign for variable expansion. https://www.gnu.org/software/grub/manual/grub/grub.html#Quoting
Implemented a simple VPD library, using the sysfs interface at /sys/firmware/vpd . See https://chromium.googlesource.com/chromiumos/platform/vpd/ for details. There are three methods, Get, Set, and GetAll. Unfortunately Set doesn't currently work, because the sysfs interface does not support writing. To write, this library needs a backend able to write to flash chips, like the command line tool flashrom[1] or flashtools[2]. [1] https://www.flashrom.org [2] https://github.com/osresearch/flashtools
Redesigned to have a TPM interface and TPM1 and TPM2 implementations
created tpm.Info, refactored around it. Fixed potential FD leak
Also use Run instead of Start + Wait Signed-off-by: Andrea Barberio <insomniac@slackware.it>
Signed-off-by: Yaroslav Kolomiiets <yrk@fb.com>
fixmynetboot is now part of the netboot workflow. It is called automatically if netboot fails, if speficied in the VPD variables, or if `-fix` is passed. Also corrected error handling logic in checker and restructured command execution. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
Signed-off-by: zaolin <zaolin.daisuki@gmail.com>
Signed-off-by: zaolin <zaolin.daisuki@gmail.com>
Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com>
localboot: add config flag to select bootconfig
…leep behavior Signed-off-by: tfg13 <tobifleig@gmail.com>
uinit: Add interactive mode
* localboot: add multiboot support Enables localboot to handle multiboot menu entries using kexeec support for multiboot Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * review fixes Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * review: rework ScanGrubConfigs Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * fix bootconfig struct tag Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * review: add safeguard to recursive grub.cfg search Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * localboot: add multiboot support Enables localboot to handle multiboot menu entries using kexeec support for multiboot Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * initial draft, support for vfat and ext4 Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * add config flag to selct bootconfig Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * fix rebase Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * rework bootconfig.go due to new mulitboot interface Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * fix rebase Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * localboot/grub.go: rework fsuuid validation Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * localboot/grub.go: reset kernelBaseDir for every grub menuentry Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * rework measurement of bootconfigs Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * clean up comments Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * crypto: remove TryMeasureBootconfig() Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com> * storage/blockdev.go: fix PartitionsByFsUUID Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com>
localboot -> cmds/boot/localboot netboot -> cmds/boot/fbnetboot uinit -> cmds/boot/uinit cmds/fixmynetboot -> examples/fixmynetboot cmds/vpdbootmanager -> tools/vpdbootmanager Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
The "boot" template just includes all bootloader commands. The "systemboot" template includes a uinit that automatically does fbnetboot and localboot. Signed-off-by: Chris Koch <chrisko@google.com>
if err := cmd.Run(); err != nil { | ||
log.Printf("Error calling fixmynetboot: %v", err) | ||
log.Print("fixmynetboot failed. Check the above output to manually debug the issue.") | ||
os.Exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for later, but we could probably just use log.Fatalf for this sort of case.
if sline[0] == "search" { | ||
for _, str1 := range sline { | ||
if str1 == "--set=root" { | ||
log.Printf("Kernel seems to be on an other partitioin then the grub.cfg file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for later, fix spelling of partition.
) | ||
|
||
// TODO backward compatibility for BIOS mode with partition type 0xee | ||
// TODO use a proper parser for grub config (see grub.go) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a proper grub parser is ... a lot. it's just about a programming language. I would rather argue that we should stick with simple grub, since the inventor of the grub configuration language doesn't like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, we eventually decided to stay with a simple grub parser, it's really too much to handle, especially being a "transition" boot mode
@@ -0,0 +1,47 @@ | |||
// Copyright 2017-2019 the u-root Authors. All rights reserved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably ought to create an 'ansi' package, as this could be more useful than just in here.
"github.com/rekby/gpt" | ||
) | ||
|
||
var ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to do: all this needs to be either // +build linux OR variables like this could go into a blockdev_linux.go file
"strconv" | ||
"strings" | ||
|
||
"github.com/rekby/gpt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the u-root gpt package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I wrote this before the u-root gpt package (and if not, I probably just didn't see it)
return uuid | ||
} | ||
|
||
// GetGPTTable tries to read a GPT table from the block device described by the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT means GUID Partition Table, so GPTTable means ... GUID Partition Table Table :-)
Merges the entire http://github.com/systemboot/systemboot repo into u-root, as discussed offline.
Sorry, had to redo this since u-root made some changes at master and merging didn't work for GitHub. (Independent trees are probably not a use case they see often...)