tree: 9ce6357b4359163983c4092ff8f68316d5934846 [path history] [tgz]
  1. http/
  2. scripts/
  3. README.md
  4. ubuntu.json
src/npb/disk-image/npb/npb-hooks/disk-image/README.md

Steps to create the disk image

Step 1. Download packer at packer.io.
Step 2. Build the disk image

./packer build ubuntu.json

The output will be in the folder output-ubuntu1804. The disk image is in RAW format.

Customize the disk image

scripts/post-installation.sh: the script that runs after Ubuntu Server is installed.

How to execute a command as a root user?

For example, if the password is 12345,

echo 12345 | sudo [command];

How to access the disk image after the building process (e.g. to install packages/to inspect the image manually)?

Adding the following to the post installation scirpt would make it sleeps until a file exists, which means you can make the file to exit. For example, if the file is /tmp/quit, then add the following to the post installation script,

while [ ! -f /tmp/quit ]
do
  sleep 1m
done

and to exit,

touch /tmp/quit