~goneri/cloud-init:freebsd

Last commit made on 2019-04-20
Get this branch:
git clone -b freebsd https://git.launchpad.net/~goneri/cloud-init
Only Gonéri Le Bouder can upload to this branch. If you are Gonéri Le Bouder please log in for upload directions.

Branch merges

Branch information

Name:
freebsd
Repository:
lp:~goneri/cloud-init

Recent commits

727f86a... by Gonéri Le Bouder

freebsd: pass the mountpoint to growfs

growfs behaviour depends on the partition naming, if we use the
/dev/vtbd0p4 format, we can end-up with a "operation not permitted"
error. The good news is that growfs can also accept a mount point
as an argument.

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237392

cc751ab... by Gonéri Le Bouder

freebsd: move the BSD generic code a new bsd_util.py

dc28abf... by Gonéri Le Bouder

freebsd: interface are renamed by the renderer

Interfaces are automatically renamed by FreeBSD using
the following configuration in /etc/rc.conf:

```
ifconfig_fxp0_name="eth0"
```

The freebsd renderer already generate the correct configuration.
There is nothing more to do.

76ddaad... by Gonéri Le Bouder

freebsd: introduce the freebsd renderer

Refactoring of the FreeBSD code base to provide a real network renderer
for FreeBSD.

c9647ea... by Gonéri Le Bouder

freebsd: add NoCloud a potential datasource

a743cd5... by Gonéri Le Bouder

freebsd: NoCloud data source support

blkid is a Linux-only command. With this patch, cloud-init uses another
approach to find the data source on FreeBSD.

a12c0be... by Gonéri Le Bouder

freebsd: resizefs, add support for newfs -L argumet

newfs -L argument is used to specify a label for the new filesystem.

Without this patch, cc_resizefs.py returns the following error:

```
2019-04-19 15:40:28,010 - util.py[DEBUG]: Running module resizefs (<module 'cloudinit.config.cc_resizefs' from '/usr/local/lib/python2.7/site-packages/cloud_init-18.5-py2.7.egg/cloudinit/config/cc_resizefs.py'>) failed
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cloud_init-18.5-py2.7.egg/cloudinit/stages.py", line 812, in _run_modules
    freq=freq)
  File "/usr/local/lib/python2.7/site-packages/cloud_init-18.5-py2.7.egg/cloudinit/cloud.py", line 54, in run
    return self._runners.run(name, functor, args, freq, clear_on_fail)
  File "/usr/local/lib/python2.7/site-packages/cloud_init-18.5-py2.7.egg/cloudinit/helpers.py", line 187, in run
    results = functor(*args)
  File "/usr/local/lib/python2.7/site-packages/cloud_init-18.5-py2.7.egg/cloudinit/config/cc_resizefs.py", line 271, in handle
    if can_skip_resize(fs_type, resize_what, devpth):
  File "/usr/local/lib/python2.7/site-packages/cloud_init-18.5-py2.7.egg/cloudinit/config/cc_resizefs.py", line 165, in can_skip_resize
    return func(resize_what, devpth)
  File "/usr/local/lib/python2.7/site-packages/cloud_init-18.5-py2.7.egg/cloudinit/config/cc_resizefs.py", line 114, in _can_skip_resize_ufs
    optlist, _args = getopt.getopt(newfs_cmd[1:], opt_value)
  File "/usr/local/lib/python2.7/getopt.py", line 90, in getopt
    opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
  File "/usr/local/lib/python2.7/getopt.py", line 190, in do_shorts
    if short_has_arg(opt, shortopts):
  File "/usr/local/lib/python2.7/getopt.py", line 206, in short_has_arg
    raise GetoptError('option -%s not recognized' % opt, opt)
GetoptError: option -L not recognized
```

d49aee5... by Gonéri Le Bouder

freebsd: add support for the /dev/ufs/root format

Improve `find_freebsd_part()` in order to cover the `/dev/ufs/root`
device format.

54a2f23... by Gonéri Le Bouder

freebsd: growpart: lookup the partition name

Convert the /dev/$type/root format to /dev/$device. $type can be
label, gpt or ufs.

e45f35b... by Gonéri Le Bouder

freebsd: add GPT support to find_freebsd_part()

On a system with a GPT partition table, the root device is called
`/dev/gpt/rootfs`. This patch modify `find_freebsd_part()` to get
the real partition name.