firecracker icon indicating copy to clipboard operation
firecracker copied to clipboard

`./devtool build_rootfs` falsely reports success even with obvious failures.

Open wimax-grapl opened this issue 3 years ago • 1 comments
trafficstars

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?

wimax-grapl avatar Feb 23 '22 16:02 wimax-grapl

Note: This is also true of the kernel build

wimax-grapl avatar Apr 01 '22 17:04 wimax-grapl

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?

srujanm111 avatar Mar 28 '23 00:03 srujanm111

Hi, we are currently working on revamping this part of the code.

pb8o avatar May 15 '23 13:05 pb8o

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!

roypat avatar Oct 09 '23 10:10 roypat