cloud-init-pre-network:
runs before network service.
this service gets metadata from local datasources
in order to configure network stuff before network service
and configures the instance on its first booot
cloud-init:
runs after network service and will get userdata/metadata
from datasources(local/network). This service fixes disk
and filesystem
add first-boot-setup and no-network options
update documentation
On some configurations, /sbin and /usr/sbin may not even be in the $PATH,
meaning that the configure routine would fail if this is where resize2fs
lives. Secondly, we must ensure that disks now uses this explicit path.
This ensures correct functionality during non privileged testing, and
consistency with installed behaviour.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
cloud-init-firstboot service will do initial tasks
* create and set up default user
* get and process metadata/userdata from datasources
* disable root login
this service will run once (firstboot)
cloud-init service won't run at the first boot
but it will do at next boot times
* verify/fix/resize/grow up partitions and filesystems
* get and process userdata from datasources (TODO: optional)
add blkid library
functions:
* disk_for_path: is a useful function to get
the disk path where a specific is mounted
for instance: / -> /dev/sda
* disk_resize_grow: resizes/grows partitions and filesystems
this function uses the last disk partition/filesystem
for resize it
We call `mkdir -p` for easy code here, but we still have to
split the path into dirname first and check if we actually
have to create it or not, and try and catch any errors in that
path.