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

Conversation

Projects
None yet
@hugelgupf
Copy link
Member

commented Jun 19, 2019

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 some commits Apr 23, 2018

Merge pull request #1 from insomniacslk/add-stickler-config
Adding .stickler.yml configuration file
Escape quoted dollar sign for grub2 config
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
Added simple VPD library (#7)
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
Merge pull request #21 from insomniacslk/tpm_interface
Redesigned to have a TPM interface and TPM1 and TPM2 implementations
Merge pull request #22 from insomniacslk/tpm_info
created tpm.Info, refactored around it. Fixed potential FD leak

insomniacslk and others added some commits Apr 30, 2019

[checker] Explicitly set stdin/out/err in CommandExecutor
Also use Run instead of Start + Wait

Signed-off-by: Andrea Barberio <insomniac@slackware.it>
Add docker/qemu integration test run to travis.yml
Signed-off-by: Yaroslav Kolomiiets <yrk@fb.com>
[netboot] Call fixmynetboot if netboot fails
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>
Remove kexecbin package support
Signed-off-by: zaolin <zaolin.daisuki@gmail.com>
uinit: Add interactive mode
Signed-off-by: zaolin <zaolin.daisuki@gmail.com>
add config flag to selct bootconfig
Signed-off-by: Jens Drenhaus <jens.drenhaus@9elements.com>
Merge pull request #105 from systemboot/bootconfig-flag
localboot: add config flag to select bootconfig
invert interactive flag, only forbig user interaction, don't change s…
…leep behavior

Signed-off-by: tfg13 <tobifleig@gmail.com>
Merge pull request #124 from systemboot/interactive
uinit: Add interactive mode
Efi integration (#106)
* 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>
Move systemboot commands.
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>
systemboot: fix up imports to use u-root packages
Signed-off-by: Chris Koch <chrisko@google.com>
Vendor systemboot dependencies
Signed-off-by: Chris Koch <chrisko@google.com>
Combine READMEs from u-root and systemboot
Signed-off-by: Chris Koch <chrisko@google.com>
Fix systemboot lint errors
Signed-off-by: Chris Koch <chrisko@google.com>
Add license declaration to systemboot files
Signed-off-by: Chris Koch <chrisko@google.com>
Remove systemboot Travis configuration
Signed-off-by: Chris Koch <chrisko@google.com>
Fix up systemboot uinit to use fbnetboot
Signed-off-by: Chris Koch <chrisko@google.com>
Add systemboot template, which includes systemboot uinit
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)

This comment has been minimized.

Copy link
@rminnich

rminnich Jun 19, 2019

Member

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

This comment has been minimized.

Copy link
@rminnich

rminnich Jun 19, 2019

Member

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)

This comment has been minimized.

Copy link
@rminnich

rminnich Jun 19, 2019

Member

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.

This comment has been minimized.

Copy link
@insomniacslk

insomniacslk Jun 19, 2019

Contributor

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

This comment has been minimized.

Copy link
@rminnich

rminnich Jun 19, 2019

Member

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

"github.com/rekby/gpt"
)

var (

This comment has been minimized.

Copy link
@rminnich

rminnich Jun 19, 2019

Member

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"

This comment has been minimized.

Copy link
@rminnich

rminnich Jun 19, 2019

Member

not the u-root gpt package?

This comment has been minimized.

Copy link
@insomniacslk

insomniacslk Jun 19, 2019

Contributor

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

This comment has been minimized.

Copy link
@rminnich

rminnich Jun 19, 2019

Member

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

DCO DCO
Details
ci/circleci: check_licenses Your tests passed on CircleCI!
Details
ci/circleci: clean-code Your tests passed on CircleCI!
Details
ci/circleci: compile_cmds Your tests passed on CircleCI!
Details
ci/circleci: race Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test-integration-amd64 Your tests passed on CircleCI!
Details
ci/circleci: test-integration-arm Your tests passed on CircleCI!
Details
u-root.u-root #20190619.2 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.