diff --git a/README.md b/README.md index bc42840..5b002ae 100644 --- a/README.md +++ b/README.md @@ -77,12 +77,11 @@ PRs and contributions are welcome to help implement these features. - Github Codespaces is not supported at the moment - A USB drive that is at least 8GB in size - At least 20GB of free disk space -- An x86-based Chromebook ### Build Instructions: 1. Find the board name of your Chromebook. You can search for the model name on [chrome100.dev](https://chrome100.dev/). 1. Clone this repository and cd into it. -2. Run `sudo ./build_complete.sh ` to download the required data and build the disk image. +2. Run `sudo ./build_complete.sh ` to download the required data and build the disk image. If you have an ARM-based Chromebook, pass `arch=arm64` in as an option. Alternatively, you can run each of the steps manually: 1. Grab a Chrome OS RMA Shim from somewhere. Most of them have already been leaked and aren't too difficult to find. diff --git a/build_complete.sh b/build_complete.sh index 2c46ffe..02b16b1 100755 --- a/build_complete.sh +++ b/build_complete.sh @@ -26,7 +26,7 @@ desktop="${args['desktop']-'xfce'}" data_dir="${args['data_dir']}" arch="${args['arch']-'amd64'}" -needed_deps="wget python3 unzip zip git debootstrap cpio binwalk pcregrep cgpt mkfs.ext4 mkfs.ext2 fdisk rsync depmod findmnt" +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 #install deps automatically on debian and ubuntu if [ -f "/etc/debian_version" ]; then diff --git a/shim_utils.sh b/shim_utils.sh index 541e060..41bb97c 100755 --- a/shim_utils.sh +++ b/shim_utils.sh @@ -32,7 +32,7 @@ extract_initramfs_arm() { #extract the kernel lz4 archive from the partition local binwalk_out="$(binwalk $kernel_bin --run-as=root)" - local lz4_offset="$(echo "$binwalk_out" | pcregrep -o1 "(\d+).+?LZ4 compressed data")" + local lz4_offset="$(echo "$binwalk_out" | pcregrep -o1 "(\d+).+?LZ4 compressed data" | head -n1)" local lz4_file="$working_dir/kernel.lz4" local kernel_img="$working_dir/kernel_decompressed.bin" dd if=$kernel_bin of=$lz4_file iflag=skip_bytes,count_bytes skip=$lz4_offset