Skip to content
Permalink
1.0
Switch branches/tags
Go to file
* diskutils: Add partprobe after partition creation

There can be a timing issue where partition creation finishes but the
devtmpfs files are not populated in time for partition initialization.
So to deal with this, we call partprobe here to query and flush the
partition table information, which should enforce that the devtmpfs
files are created when partprobe returns control.

* diskutils: invoke partprobe with flock

Added flock because "partprobe -s" apparently doesn't always block.
flock is part of the util-linux package and helps to synchronize access
with other cooperating processes. The important part is it will block
if the fd is busy, and then execute the command. Adding a 5 second timeout
to prevent us from possibly waiting forever.

* diskutils: Update timeout variable name

* diskutils: clarify debug log message

* Add parted to documentation and quickstart runner

Signed-off-by: Chris Co <chrco@microsoft.com>
6 contributors

Users who have contributed to this file

Build Requirements

Requirements were validated on Ubuntu 18.04

Requirements for building images with a toolkit:

# Add a backports repo in order to install the latest version of Go.
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update

# Install required dependencies.
sudo apt -y install make tar wget curl rpm qemu-utils golang-1.15-go genisoimage python-minimal bison gawk parted

# Recommended but not required: `pigz` for faster compression operations.
sudo apt -y install pigz

# Fix go 1.15 link
sudo ln -vsf /usr/lib/go-1.15/bin/go /usr/bin/go

# Install Docker.
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

You will need to log out and log back in for user changes to take effect.