Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

how to split usb.go between cloud and local #146

Open
n2vi opened this issue Jan 29, 2019 · 0 comments
Open

how to split usb.go between cloud and local #146

n2vi opened this issue Jan 29, 2019 · 0 comments

Comments

@n2vi
Copy link

n2vi commented Jan 29, 2019

The NiChrome build assumes an Ubuntu machine; Debian is not close enough. No problem, just open an Ubuntu VM instance on a cloud provider like GCP and build there. It is less than obvious how to then make the usb stick. Here is what worked for me:

on a fresh VM instance:
install go1.11.5

NiChrome=$GOPATH/src/github.com/u-root/NiChrome
cd $GOPATH/src
git clone https://github.com/u-root/NiChrome
cd $NiChrome
bash travis.sh

on a local machine:
plug in a ChromeOS-formatted USBstick
use dmesg to determine device, say /dev/sdb

cd $GOPATH/src/github.com/u-root/u-root/cmds/gpt
upspin cp [email protected]/Public/NiChrome/gpt.go ./gpt.go
go build
sudo ./gpt -r /dev/sdb > config.txt

copy config.txt to the VM instance's $NiChrome

on the VM instance:

cd $NiChrome
vboot_reference/build/futility/futility vbutil_kernel --pack newKern --keyblock vboot_reference/tests/devkeys/recovery_kernel.keyblock --signprivate vboot_reference/tests/devkeys/recovery_kernel_data_key.vbprivk --version 1 --vmlinuz linux-stable/arch/x86/boot/bzImage --bootloader nocontent.efi --config config.txt --arch x86

copy newKern and initramfs.linux_amd64.cpio to local machine

on the local machine:
using the same device name as determined earlier

sudo dd if=newKern of=/dev/sdb2 bs=1M
sudo dd if=initramfs.linux_amd64.cpio  of=/dev/sdb3 bs=1M
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant