firecracker
firecracker copied to clipboard
`./devtool build_rootfs` falsely reports success even with obvious failures.
Describe the bug
Shortened terminal output:
/tmp/tmp.SBl1JVqBlu/firecracker/tools$ ./devtool build_rootfs
./devtool: line 2090: mkfs.ext4: command not found
Mounting /firecracker/build/rootfs/bionic.rootfs.ext4 on /firecracker/build/rootfs/mnt ...
mount: /firecracker/build/rootfs/mnt: mount failed: Operation not permitted.
[...lots of apt stuff...]
[...ssh stuff...]
[... lots of Apt stuff...]
tar: dev/urandom: Cannot mknod: Operation not permitted
tar: dev/zero: Cannot mknod: Operation not permitted
tar: dev/tty: Cannot mknod: Operation not permitted
tar: dev/full: Cannot mknod: Operation not permitted
tar: dev/random: Cannot mknod: Operation not permitted
tar: dev/null: Cannot mknod: Operation not permitted
tar: dev/pts/ptmx: Cannot mknod: Operation not permitted
tar: Exiting with failure status due to previous errors
umount: /firecracker/build/rootfs/mnt: not mounted.
[Firecracker devtool] Successfully built rootfs!
[Firecracker devtool] Rootfs image binary and private key placed in /tmp/tmp.SBl1JVqBlu/firecracker/build/rootfs/bionic.rootfs.ext4 and /tmp/tmp.SBl1JVqBlu/firecracker/build/rootfs/ssh/id_rsa, respectively!
echo $?
0
Full gist: https://gist.github.com/wimax-grapl/b7cb39669be63d142493fb18736d28ac
Now, the mkfs is easy enough to fix; the mount is probably easy to fix; but I don't love that the devtool script continues chugging along despite not completing one of its most important steps. Seems like you may want a set -euo pipefail somewhere along the line.
Environment
[ - Firecracker version.] v1.0.0 branch
[ - Host and guest kernel versions.]
[ - Rootfs used.]
[ - Architecture.] x86
[ - Any other relevant software versions.]
Additional context
Checks
- [x] Have you searched the Firecracker Issues database for similar problems? It looks similar to https://github.com/firecracker-microvm/firecracker/issues/2831
- [x] Have you read the existing relevant Firecracker documentation?
- [x] Are you certain the bug being reported is a Firecracker issue?
Note: This is also true of the kernel build
Hello, I am representing a group of undergraduate UT Austin students aiming to contribute to open-source virtualization projects on behalf of a virtualization course. Could we have this issue assigned to us?
Hi, we are currently working on revamping this part of the code.
We have finished our overhaul of how to build rootfs and related artifacts in https://github.com/firecracker-microvm/firecracker/pull/3896. Please try the new script in https://github.com/firecracker-microvm/firecracker/blob/main/resources/rebuild.sh#L48, and reopen the issue if you still encounter problems. Thanks!