autodetect arm64 in the build script

This commit is contained in:
ading2210 2024-06-13 18:02:10 -07:00
parent f647a9f733
commit 73ff47a6b7
7 changed files with 28 additions and 8 deletions

View File

@ -9,7 +9,7 @@ jobs:
strategy: strategy:
matrix: matrix:
board: [dedede, octopus, coral, grunt, nissa, zork] board: [dedede, octopus, coral, grunt, nissa, zork, corsola, jacuzzi]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -2,6 +2,10 @@
Shimboot is a collection of scripts for patching a Chrome OS RMA shim to serve as a bootloader for a standard Linux distribution. It allows you to boot a full desktop Debian install on a Chromebook, without needing to unenroll it or modify the firmware. Shimboot is a collection of scripts for patching a Chrome OS RMA shim to serve as a bootloader for a standard Linux distribution. It allows you to boot a full desktop Debian install on a Chromebook, without needing to unenroll it or modify the firmware.
| <img src="https://raw.githubusercontent.com/ading2210/shimboot/main/website/assets/shimboot_demo_1.jpg" alt="Shimboot running on a HP Chromebook 11 G9 EE." width="400"/> | <img src="https://raw.githubusercontent.com/ading2210/shimboot/main/website/assets/shimboot_demo_2.jpg" alt="Shimboot running on an Acer Chromebook 311 C722." width="400"/> |
| ----- | ----- |
| Shimboot with KDE on a HP Chromebook 11 G9 EE | Shimboot with XFCE on an Acer Chromebook 311 C722 |
## Features: ## Features:
- Run a full Debian installation on a Chromebook - Run a full Debian installation on a Chromebook
- Does not modify the firmware - Does not modify the firmware
@ -62,7 +66,6 @@ On all devices, the following features will not work:
- Transparent disk compression - Transparent disk compression
- Full disk encryption - Full disk encryption
- Support for more distros (Ubuntu and Arch maybe) - Support for more distros (Ubuntu and Arch maybe)
- Support for ARM based Chromebooks (see [issue #8](https://github.com/ading2210/shimboot/issues/8))
- Eliminate binwalk dependency - Eliminate binwalk dependency
- Get audio to work on dedede - Get audio to work on dedede
- Get kexec working - Get kexec working
@ -76,6 +79,7 @@ PRs and contributions are welcome to help implement these features.
- WSL2 is supported if you are on Windows - WSL2 is supported if you are on Windows
- Github Codespaces is not supported at the moment - Github Codespaces is not supported at the moment
- A USB drive that is at least 8GB in size - A USB drive that is at least 8GB in size
- Cheap USB 2.0 drives typically won't work well due to their slow speeds
- At least 20GB of free disk space - At least 20GB of free disk space
### Build Instructions: ### Build Instructions:
@ -139,6 +143,8 @@ echo "MESA_LOADER_DRIVER_OVERRIDE=i965" | sudo tee -a /etc/environment
``` ```
You may need to change `i965` to `i915` (or `r100`/`r200` for AMD hardware), depending on what GPU you have. You may need to change `i965` to `i915` (or `r100`/`r200` for AMD hardware), depending on what GPU you have.
For ARM Chromebooks, you may have to tweak the [Xorg configuration](https://xkcd.com/963/) instead.
#### Can the rootfs be compressed to save space? #### Can the rootfs be compressed to save space?
Compressing the Debian rootfs with a squashfs is supported, and you can do this by running the regular Debian rootfs through `./build_squashfs.sh`. For example: Compressing the Debian rootfs with a squashfs is supported, and you can do this by running the regular Debian rootfs through `./build_squashfs.sh`. For example:
```bash ```bash

View File

@ -94,7 +94,7 @@ move_mounts() {
print_license() { print_license() {
cat << EOF cat << EOF
Shimboot v1.0.2 Shimboot v1.1.0
ading2210/shimboot: Boot desktop Linux from a Chrome OS RMA shim. ading2210/shimboot: Boot desktop Linux from a Chrome OS RMA shim.
Copyright (C) 2023 ading2210 Copyright (C) 2023 ading2210

View File

@ -19,19 +19,35 @@ assert_root
assert_args "$1" assert_args "$1"
parse_args "$@" parse_args "$@"
base_dir="$(realpath -m $(dirname "$0"))"
board="$1"
compress_img="${args['compress_img']}" compress_img="${args['compress_img']}"
rootfs_dir="${args['rootfs_dir']}" rootfs_dir="${args['rootfs_dir']}"
quiet="${args['quiet']}" quiet="${args['quiet']}"
desktop="${args['desktop']-'xfce'}" desktop="${args['desktop']-'xfce'}"
data_dir="${args['data_dir']}" data_dir="${args['data_dir']}"
arch="${args['arch']-'amd64'}" arch="${args['arch']-amd64}"
arm_boards="
corsola hana jacuzzi kukui strongbad nyan-big kevin bob
veyron-speedy veyron-jerry veyron-minnie scarlet elm
kukui peach-pi peach-pit stumpy daisy-spring
"
if grep -q "$board" <<< "$arm_boards"; then
echo "automatically detected arm64 device name"
arch="arm64"
fi
needed_deps="wget python3 unzip zip git debootstrap cpio binwalk pcregrep cgpt mkfs.ext4 mkfs.ext2 fdisk rsync depmod findmnt lz4" needed_deps="wget python3 unzip zip git debootstrap cpio binwalk pcregrep cgpt mkfs.ext4 mkfs.ext2 fdisk rsync depmod findmnt lz4"
if [ "$(check_deps "$needed_deps")" ]; then if [ "$(check_deps "$needed_deps")" ]; then
#install deps automatically on debian and ubuntu #install deps automatically on debian and ubuntu
if [ -f "/etc/debian_version" ]; then if [ -f "/etc/debian_version" ]; then
echo "attempting to install build deps" echo "attempting to install build deps"
apt-get install wget python3-all unzip zip debootstrap cpio binwalk pcregrep cgpt rsync kmod pv -y apt-get install wget python3-all unzip zip debootstrap cpio binwalk pcregrep cgpt rsync kmod pv lz4 -y
if [ "$arch" = "arm64" ]; then
apt-get install qemu-user-static binfmt-support -y
fi
fi fi
assert_deps "$needed_deps" assert_deps "$needed_deps"
fi fi
@ -45,8 +61,6 @@ sigint_handler() {
} }
trap sigint_handler SIGINT trap sigint_handler SIGINT
base_dir="$(realpath -m $(dirname "$0"))"
board="$1"
shim_url="https://dl.darkn.bio/api/raw/?path=/SH1mmer/$board.zip" shim_url="https://dl.darkn.bio/api/raw/?path=/SH1mmer/$board.zip"
boards_url="https://chromiumdash.appspot.com/cros/fetch_serving_builds?deviceCategory=ChromeOS" boards_url="https://chromiumdash.appspot.com/cros/fetch_serving_builds?deviceCategory=ChromeOS"

View File

@ -31,7 +31,7 @@ parse_args "$@"
rootfs_dir=$(realpath -m "${1}") rootfs_dir=$(realpath -m "${1}")
release_name="${2}" release_name="${2}"
packages="${args['custom_packages']-'task-xfce-desktop'}" packages="${args['custom_packages']-'task-xfce-desktop'}"
arch="${args['arch']-'amd64'}" arch="${args['arch']-amd64}"
chroot_mounts="proc sys dev run" chroot_mounts="proc sys dev run"
mkdir -p $rootfs_dir mkdir -p $rootfs_dir

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 MiB