ading2210 / shimboot

Boot a desktop Linux distribution from a Chrome OS RMA shim.
https://shimboot.ading.dev
GNU General Public License v3.0
68 stars 22 forks source link

error in the /build_squashfs.sh script #31

Closed Ordeeper closed 3 weeks ago

Ordeeper commented 1 month ago

Describe the bug I'm trying to compress the root filesystem to save space.

To Reproduce Steps to reproduce the behavior:

  1. sudo ./build_rootfs.sh data/rootfs bookworm custom_packages="gnome-core task-desktop tasksel remmina remmina-plugin-rdp remmina-plugin-secret vim flatpak"
  2. sudo ./build_squashfs.sh data/rootfs_compressed data/rootfs data/shim_zork.bin
  3. See error

Output

  sudo DEBUG=1 ./build_squashfs.sh data/rootfs_compressed data/rootfs data/shim_zork.bin
[sudo] password for root:
+ . ./common.sh
++ set -e
++ '[' 1 ']'
++ set -x
++ export DEBUG=1
++ DEBUG=1
+ . ./image_utils.sh
+ . ./shim_utils.sh
+ assert_root
+ '[' 0 -ne 0 ']'
+ assert_deps 'git make gcc binwalk pcregrep'
+ local 'needed_commands=git make gcc binwalk pcregrep'
++ check_deps 'git make gcc binwalk pcregrep'
++ local 'needed_commands=git make gcc binwalk pcregrep'
++ for command in $needed_commands
++ command -v git
++ for command in $needed_commands
++ command -v make
++ for command in $needed_commands
++ command -v gcc
++ for command in $needed_commands
++ command -v binwalk
++ for command in $needed_commands
++ command -v pcregrep
+ local missing_commands=
+ '[' '' ']'
+ assert_args data/shim_zork.bin
+ '[' -z data/shim_zork.bin ']'
++ realpath -m data/rootfs_compressed
+ rootfs_dir=/home/arch-user/Downloads/teste2/teste4/shimboot/data/rootfs_compressed
++ realpath -m data/rootfs
+ old_dir=/home/arch-user/Downloads/teste2/teste4/shimboot/data/rootfs
++ realpath -m data/shim_zork.bin
+ shim_path=/home/arch-user/Downloads/teste2/teste4/shimboot/data/shim_zork.bin
+ shim_rootfs=/tmp/shim_rootfs
+ root_squashfs=/home/arch-user/Downloads/teste2/teste4/shimboot/data/rootfs_compressed/root.squashfs
+ modules_squashfs=/home/arch-user/Downloads/teste2/teste4/shimboot/data/rootfs_compressed/modules.squashfs
+ unionfs_dir=/tmp/unionfs-fuse
+ echo 'compiling unionfs-fuse'
compiling unionfs-fuse
+ compile_unionfs /tmp/unionfs-fuse/unionfs /tmp/unionfs-fuse
+ local out_path=/tmp/unionfs-fuse/unionfs
+ local working_path=/tmp/unionfs-fuse
+ local repo_url=https://github.com/rpodgorny/unionfs-fuse
++ pwd
+ local original_dir=/home/arch-user/Downloads/teste2/teste4/shimboot
++ nproc --all
+ local core_count=4
+ rm -rf /tmp/unionfs-fuse
+ git clone https://github.com/rpodgorny/unionfs-fuse -b master --depth=1 /tmp/unionfs-fuse
Cloning into '/tmp/unionfs-fuse'...
remote: Enumerating objects: 65, done.
remote: Counting objects:   1% (1/6remote: Counting objects:   3% (2/6remote: Counting objects:   4% (3/6remote: Counting objects:   6% (4/6remote: Counting objects:   7% (5/6remote: Counting objects:   9% (6/6remote: Counting objects:  10% (7/6remote: Counting objects:  12% (8/6remote: Counting objects:  13% (9/6remote: Counting objects:  15% (10/remote: Counting objects:  16% (11/remote: Counting objects:  18% (12/remote: Counting objects:  20% (13/remote: Counting objects:  21% (14/remote: Counting objects:  23% (15/remote: Counting objects:  24% (16/remote: Counting objects:  26% (17/remote: Counting objects:  27% (18/remote: Counting objects:  29% (19/remote: Counting objects:  30% (20/remote: Counting objects:  32% (21/remote: Counting objects:  33% (22/remote: Counting objects:  35% (23/remote: Counting objects:  36% (24/remote: Counting objects:  38% (25/remote: Counting objects:  40% (26/remote: Counting objects:  41% (27/remote: Counting objects:  43% (28/remote: Counting objects:  44% (29/remote: Counting objects:  46% (30/remote: Counting objects:  47% (31/remote: Counting objects:  49% (32/remote: Counting objects:  50% (33/remote: Counting objects:  52% (34/remote: Counting objects:  53% (35/remote: Counting objects:  55% (36/remote: Counting objects:  56% (37/remote: Counting objects:  58% (38/remote: Counting objects:  60% (39/remote: Counting objects:  61% (40/remote: Counting objects:  63% (41/remote: Counting objects:  64% (42/remote: Counting objects:  66% (43/remote: Counting objects:  67% (44/remote: Counting objects:  69% (45/remote: Counting objects:  70% (46/remote: Counting objects:  72% (47/remote: Counting objects:  73% (48/remote: Counting objects:  75% (49/remote: Counting objects:  76% (50/remote: Counting objects:  78% (51/remote: Counting objects:  80% (52/remote: Counting objects:  81% (53/remote: Counting objects:  83% (54/remote: Counting objects:  84% (55/remote: Counting objects:  86% (56/remote: Counting objects:  87% (57/remote: Counting objects:  89% (58/remote: Counting objects:  90% (59/remote: Counting objects:  92% (60/remote: Counting objects:  93% (61/remote: Counting objects:  95% (62/remote: Counting objects:  96% (63/remote: Counting objects:  98% (64/remote: Counting objects: 100% (65/remote: Counting objects: 100% (65/65), done.
remote: Compressing objects:   1% (remote: Compressing objects:   3% (remote: Compressing objects:   4% (remote: Compressing objects:   6% (remote: Compressing objects:   7% (remote: Compressing objects:   9% (remote: Compressing objects:  10% (remote: Compressing objects:  12% (remote: Compressing objects:  14% (remote: Compressing objects:  15% (remote: Compressing objects:  17% (remote: Compressing objects:  18% (remote: Compressing objects:  20% (remote: Compressing objects:  21% (remote: Compressing objects:  23% (remote: Compressing objects:  25% (remote: Compressing objects:  26% (remote: Compressing objects:  28% (remote: Compressing objects:  29% (remote: Compressing objects:  31% (remote: Compressing objects:  32% (remote: Compressing objects:  34% (remote: Compressing objects:  35% (remote: Compressing objects:  37% (remote: Compressing objects:  39% (remote: Compressing objects:  40% (remote: Compressing objects:  42% (remote: Compressing objects:  43% (remote: Compressing objects:  45% (remote: Compressing objects:  46% (remote: Compressing objects:  48% (remote: Compressing objects:  50% (remote: Compressing objects:  51% (remote: Compressing objects:  53% (remote: Compressing objects:  54% (remote: Compressing objects:  56% (remote: Compressing objects:  57% (remote: Compressing objects:  59% (remote: Compressing objects:  60% (remote: Compressing objects:  62% (remote: Compressing objects:  64% (remote: Compressing objects:  65% (remote: Compressing objects:  67% (remote: Compressing objects:  68% (remote: Compressing objects:  70% (remote: Compressing objects:  71% (remote: Compressing objects:  73% (remote: Compressing objects:  75% (remote: Compressing objects:  76% (remote: Compressing objects:  78% (remote: Compressing objects:  79% (remote: Compressing objects:  81% (remote: Compressing objects: 100% (64/64), done.
remote: Total 65 (delta 3), reused 28 (delta 0), pack-reused 0
Receiving objects: 100% (65/65), 68.71 KiB | 4.58 MiB/s, done.
Resolving deltas: 100% (3/3), done.
+ cd /tmp/unionfs-fuse
+ env LDFLAGS=-static CFLAGS=-O3 make -j4
make -C src/
make[1]: Entering directory '/tmp/unionfs-fuse/src'
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o unionfs.o unionfs.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o fuse_ops.o fuse_ops.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o opts.o opts.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o debug.o debug.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o findbranch.o findbranch.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o readdir.o readdir.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o general.o general.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o unlink.o unlink.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o rmdir.o rmdir.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o cow.o cow.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o cow_utils.o cow_utils.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o string.o string.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o usyslog.o usyslog.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o hashtable.o hashtable.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o hashtable_itr.o hashtable_itr.c
cc -O3 -W -Wall -fPIC -I/usr/include/fuse3 -DFUSE_USE_VERSION=35 -D_FILE_OFFSET_BITS=64 -DLIBC_XATTR   -c -o unionfsctl.o unionfsctl.c
cc -static -o unionfsctl unionfsctl.o
ar rc libunionfs.a fuse_ops.o opts.o debug.o findbranch.o readdir.o general.o unlink.o rmdir.o cow.o cow_utils.o string.o usyslog.o hashtable.o hashtable_itr.o
cc -static -o unionfs unionfs.o libunionfs.a -lfuse3 -lpthread
cc -shared -o libunionfs.so fuse_ops.o opts.o debug.o findbranch.o readdir.o general.o unlink.o rmdir.o cow.o cow_utils.o string.o usyslog.o hashtable.o hashtable_itr.o -lfuse3 -lpthread
/usr/bin/ld: cannot find -lfuse3: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:34: unionfs] Error 1
make[1]: Leaving directory '/tmp/unionfs-fuse/src'
make: *** [Makefile:6: build] Error 2

Target Chrome OS Device:

Build Device:

OS: Arch Linux x86_64
Host: H81MHV3 2.0 5.0
Kernel: 6.9.3-arch1-1
Uptime: 2 hours, 42 mins
Packages: 1061 (pacman)
Shell: fish 3.7.1
Resolution: 1366x768
WM: i3
Theme: FlatColor [GTK2/3]
Icons: flattrcolor [GTK2/3]
Terminal: tmux
CPU: Intel i5-4690 (4) @ 3.900GHz
GPU: Intel HD Graphics
Memory: 4107MiB / 15916MiB
ading2210 commented 1 month ago

You should install the libfuse3-dev package (or the equivalent of it on Arch).

Ordeeper commented 4 weeks ago

I downloaded what I believe is the equivalent of "libfuse3-dev" on Arch, which is "fuse3", but it didn't work. I tried it on a Debian-based system with libfuse3-dev, and all the scripts executed successfully. However, when making the bootable USB, it boots and goes to the selection screen, but when selecting Linux, the screen flickers and then goes into Chrome OS instead of Linux.

ading2210 commented 3 weeks ago

So the fuse3 package on Arch is incomplete and doesn't actually have the static library in it (you need libfuse3.a). You need to compile and install libfuse3 from source.