Submarine
Introduction

Section Under Construction

Submarine

Experimental bootloader for ChromeOS' Depthcharge

Submarine provides a minimal Linux environment that lives in a small partition (16mb) on the disk. This is used to boot into a full Linux distro using kexec.

Prebuilt Images

If you're just trying to get Linux running on your Chromebook, these are likely the images you need.

We offer prebuilt versions of the images per each commit:

The kpart file can be flashed to an existing partition, see Usage

Dependencies

Please make sure you have these dependencies first before building.

make
gcc
flex
bison
elfutils-devel
parted
vboot-utils
golang
xz
bc
openssl-devel

Additionally, you'll need to install u-root. To install the latest version:

go install github.com/u-root/u-root@latest

Building

Simply clone this repo with submodules, so pass --recurse-submodules to git clone, then:

make -j$(nproc) <x86_64|arm64>

Please note that you must pass an architecture target.

The build output is located in build/. For testing, an image is built at build/submarine.bin which you can directly flash onto an external drive. So, for example, replace /dev/sdX with the device file of the external drive:

sudo dd if=build/submarine.bin of=/dev/sdX

Usage

Before you can boot submarine, you need to enable booting from external storage. On your Chrome device, press Ctrl + Alt + F2 (This will either be the forward or refresh key on the top row) to switch to vt2. Log in as root (chronos, no password) and run the following commands:

sudo enable_dev_usb_boot

For quick testing, you can flash submarine-<arch>.bin to an external drive. This image includes a partition table already set up for booting ChromeOS kernels.

Alternatively, you can create your own partition to install submarine to. Start by creating a 16mb EXT4 partition using your favorite partitioning tool. Next you will edit the partition flags to tell depthcharge that you can boot from that partition by running cgpt add -i <partition number> -t kernel -P 15 -T 1 -S 1 /dev/sdX. As always, substitute in the correct values for your drive. You can then flash submarine-<arch>.kpart to the partition you just created.

After installing submarine to an external drive, plug in your drive with submarine to your ChromeOS device. On the developer mode screen, press Ctrl + U to boot from external storage. If all goes well, you should soon see the submarine boot menu.

If you run into any issues, please report them. Include the model of your device, which can be found on the developer mode screen.