0

I fully built fuchsia - and want to flash an usb device with it.

The correct command should be

fx mkzedboot /dev/sdb

fx mkzedboot /dev/sdb
/dev/sdb - DataTraveler 3.0
Changing ownership of /dev/sdb to erhard
[sudo] password for erhard: 
Opening device...
Create new GPT partition table... 
00000000-0000-0000-0000-000000000000
done
Create new partitions... 
done
Writing zedboot for EFI
43049+0 records in
43049+0 records out
22041088 bytes (22 MB, 21 MiB) copied, 2.09618 s, 10.5 MB/s
done
Closing device.

It seems there are only 22MB copied - is that right? What could be the problem?

de-facto
  • 283
  • 2
  • 8

2 Answers2

1

If you want a "live usb stick" then fx make-fuchsia-vol is likely what you want

raggi
  • 1,290
  • 9
  • 12
0

According to the documentation at Prepare a USB flash drive to be a bootable disk, fx mkzedboot only enables the flash drive to netboot for pave, so you must follow the instructions for pave.

I've installed Fuchsia into my USB flash drive without paving, using fx mkinstaller:

fx set workstation.x64 \
       --with //bundles:tools,//bundles:tests,//bundles:kitchen_sink \
       --ccache
  • Then, build
fx build
  • Run fx mkinstaller /dev/<usb_drive> in order to write the installer into an physical (or emulated) USB drive (usnig fx mkinstaller on a block device not connected through USB will fail)

  • Copy the USB flash drive into a disk image using dd. This is the "installer" disk image.

  • Create an image disk with the exact size of the USB drive. This is the target disk image.

  • Boot the installer using qemu-kvm, with the two disks images exposed as NVME. No network is needed for this step. EFI must be available; install ovmf following the instructions for your distro, or download the image directly.

sudo /usr/bin/qemu-system-x86_64 \
     -monitor stdio \
     -vga std \
     -machine accel=kvm \
     -m 4096\
     -device nvme,drive=nvme0,serial=deadbeaf1,num_queues=8 \
     -drive file=,if=none,id=nvme0 \
     -device nvme,drive=nvme1,serial=deadbeaf1,num_queues=8 \
     -drive file=,if=none,id=nvme1 \
     -boot once=c,menu=on \
     -net nic,macaddr=00:e0:4c:c2:85:01,model=rtl8139 \
     -net user \
     -rtc base=localtime \
     -name "Fuchsia" \
     -bios /usr/share/qemu/OVMF.fd
  • Inside the running Fuchsia, run installer and choose the right target device. Then, shutdown the VM. (unplug the USB flash drive if connected)

  • Once installed, boot the VM again (connect the USB if you installed there), removing the installer drive from the command line, and check what happens; try with other display drivers and framebuffer resolutions; try in a real machine.

However, once installed, the following happened to me, depending the machine settings:

  • On qemu with standard VGA display, the system boots, but the screen goes black.
  • On qemu with other display drivers (QLX, Vmware, etc) and in a real machine (my laptop), the screen freezes on the bootloader screen, and no debug information displayed.

In both cases, I'm able to access the shell through the serial port.

Amitie 10g
  • 81
  • 1
  • 7