Skip to content

Commit

Permalink
make fix bwrap script more verbose and increase zram allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ading2210 committed Aug 28, 2024
1 parent a9599e8 commit d7a49c3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,20 @@ PRs and contributions are welcome to help implement these features.

Note: If you are building for an ARM Chromebook, you need the `qemu-user-static` and `binfmt-support` packages.

#### 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.
2. Download a Chrome OS [recovery image](https://chromiumdash.appspot.com/serving-builds?deviceCategory=ChromeOS) for your board.
3. Unzip the shim and the recovery image if you have not done so already.
4. Run `mkdir -p data/rootfs` to create a directory to hold the rootfs.
5. Run `sudo ./build_rootfs.sh data/rootfs bookworm` to build the base rootfs.
6. Run `sudo ./patch_rootfs.sh path_to_shim path_to_reco data/rootfs` to patch the base rootfs and add any needed drivers.
7. Run `sudo ./build.sh image.bin path_to_shim data/rootfs` to generate a disk image at `image.bin`.

[Prebuilt images](https://github.com/ading2210/shimboot/releases) are available if you don't have a suitable device to run the build on.

<details>
<summary><b>Alternatively, you can run each of the steps manually:</b></summary>

1. Grab a Chrome OS RMA Shim from somewhere. Most of them have already been leaked and aren't too difficult to find.
2. Download a Chrome OS [recovery image](https://chromiumdash.appspot.com/serving-builds?deviceCategory=ChromeOS) for your board.
3. Unzip the shim and the recovery image if you have not done so already.
4. Run `mkdir -p data/rootfs` to create a directory to hold the rootfs.
5. Run `sudo ./build_rootfs.sh data/rootfs bookworm` to build the base rootfs.
6. Run `sudo ./patch_rootfs.sh path_to_shim path_to_reco data/rootfs` to patch the base rootfs and add any needed drivers.
7. Run `sudo ./build.sh image.bin path_to_shim data/rootfs` to generate a disk image at `image.bin`.
</details>

### Booting the Image:
1. Obtain a shimboot image by downloading a [prebuilt one](https://github.com/ading2210/shimboot/releases) or building it yourself.
2. Flash the shimboot image to a USB drive or SD card. Use the [Chromebook Recovery Utility](https://chrome.google.com/webstore/detail/chromebook-recovery-utili/pocpnlppkickgojjlmhdmidojbmbodfm) or [dd](https://linux.die.net/man/1/dd) if you're on Linux.
Expand Down Expand Up @@ -191,7 +194,7 @@ $ nmcli connection edit <your connection name>
#### Steam doesn't work.
Steam doesn't work out of the box due to security features in the shim kernel preventing the `bwrap` library from working. See [issue #12](https://github.com/ading2210/shimboot/issues/26#issuecomment-2151893062) for more info.

To get Steam running, install and run it normally. It will fail and show a message saying that "Steam now requires user namespaces to be enabled." Run `fix_brwap` in your terminal, relaunch Steam, and it should be working again.
To get Steam running, install and run it normally. It will fail and show a message saying that "Steam now requires user namespaces to be enabled." Run `fix_bwrap` in your terminal, relaunch Steam, and it should be working again.

## Copyright:
Shimboot is licensed under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.txt). Unless otherwise indicated, all code has been written by me, [ading2210](https://github.com/ading2210).
Expand Down
2 changes: 1 addition & 1 deletion rootfs/opt/setup_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ if [ ! "$disable_base_pkgs" ]; then

#set up zram
echo "ALGO=lzo" >> /etc/default/zramswap
echo "PERCENT=50" >> /etc/default/zramswap
echo "PERCENT=100" >> /etc/default/zramswap

#update apt-file cache
if which apt-file >/dev/null; then
Expand Down
12 changes: 11 additions & 1 deletion rootfs/usr/local/bin/fix_bwrap
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@ fix_perms() {
chmod u+s "$target_file"
}

echo "Fixing permissions for /usr/bin/bwrap"
fix_perms /usr/bin/bwrap

if [ ! -d "$HOME_DIR/.steam/" ]; then
echo "Steam not installed, so exiting early."
echo "Done."
exit 0
fi

echo "Fixing permissions bwrap binaries in Steam"
steam_bwraps="$(find "$HOME_DIR/.steam/" -name 'srt-bwrap')"
for bwrap_bin in $steam_bwraps; do
cp /usr/bin/bwrap "$bwrap_bin"
fix_perms "$bwrap_bin"
done
done

echo "Done."

0 comments on commit d7a49c3

Please sign in to comment.