As pointed out elsewhere, dd-ing over a running OS is never a good idea. An alternative (and the usual way you'd develop embedded systems) is to have your OS image served from a network drive and the target board perform a network boot. This speeds up the initial development and you only need to write out the SD cards as you get closer to completion and need ...
Use with caution
This works for me because I am using a read-only root filesystem with a custom Buildroot OS. This script hasn't been tested on Raspbian yet, but will probably work.
echo "Copying image to RPi..."
sshpass -p PASSWORD scp /PATH/TO/SDCARD.img USER@RPI:/tmp/sdcard.img
echo "Flashing image to /dev/mmvblk0 on RPi..."
Use an SD card large enough to hold multiple partitions
The SD card should hold a boot partition (0) and three OS partitions (1-3).
The boot loader on the boot partition would examine the partition labels to determine what to load. Suppose the labels are:
The loader knows to load the OS from partition ...
I figured out what my issue was. For some reason, the version of build root I pulled down didn't contain the proper files for the Pi 3 B+. These are the steps that I followed:
git clone https://github.com/buildroot/buildroot.git
dd bs=4M status=progress if=./output/images/sdcard.img of=/dev/sdb
I then put the ...
The apt command is the Debian solution to download packages from a repository, including their dependencies. If you want to use apt, you have to create a system that is based on these packages.
If you create a system with Buildroot, you can't use apt, even if you compile an apt program for that system. Whatever you want to install later with apt would most ...
Here a rough approach:
Replace /sbin/init with upgrade tool.
Tell init to re-exec itself.
Kill all other remaining processes (for example with kill -9 -1)
Use pivot_root and chroot to replace the root filesystem.
If necessary exec the next stage to drop references the old root.
Recursively unmount the old root.
Write the new image.
In retrospect, this was a dumb question - trying to run an embedded Raspberry Pi OS on QEMU is not supported. Those who run Raspbian on QEMU use a custom kernel specifically designed for QEMU.
The reason I was doing this is because the serial and HDMI adapters I ordered for my Pi are still in the mail (any month now).
There's a silver lining - I just ...