Skip to content
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

The Big Merge - Welcome SystemBoot #1255

Merged
merged 137 commits into from Jun 19, 2019
Merged

The Big Merge - Welcome SystemBoot #1255

merged 137 commits into from Jun 19, 2019

Conversation

@hugelgupf
Copy link
Member

@hugelgupf hugelgupf commented Jun 19, 2019

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...)

insomniacslk and others added 30 commits Apr 23, 2018
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
insomniacslk and others added 21 commits Apr 30, 2019
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>
* 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)
Copy link
Member

@rminnich rminnich Jun 19, 2019

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")
Copy link
Member

@rminnich rminnich Jun 19, 2019

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)
Copy link
Member

@rminnich rminnich Jun 19, 2019

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.

Copy link
Contributor

@insomniacslk insomniacslk Jun 19, 2019

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
Copy link
Member

@rminnich rminnich Jun 19, 2019

we probably ought to create an 'ansi' package, as this could be more useful than just in here.

"github.com/rekby/gpt"
)

var (
Copy link
Member

@rminnich rminnich Jun 19, 2019

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"
Copy link
Member

@rminnich rminnich Jun 19, 2019

not the u-root gpt package?

Copy link
Contributor

@insomniacslk insomniacslk Jun 19, 2019

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
Copy link
Member

@rminnich rminnich Jun 19, 2019

GPT means GUID Partition Table, so GPTTable means ... GUID Partition Table Table :-)

@hugelgupf hugelgupf merged commit 97c9606 into u-root:master Jun 19, 2019
9 checks passed
@hugelgupf hugelgupf deleted the big-merge-3 branch Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet