From 902019f72905db694feb97cdb4f027d1576d3933 Mon Sep 17 00:00:00 2001 From: Pete Fotheringham Date: Fri, 12 Dec 2014 11:26:58 +0000 Subject: Document DTB_PATH write extension parameter --- morphlib/exts/kvm.write.help | 6 +++++- morphlib/exts/rawdisk.write.help | 5 +++++ morphlib/exts/virtualbox-ssh.write.help | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/morphlib/exts/kvm.write.help b/morphlib/exts/kvm.write.help index 26a54d9c..6df6c53c 100644 --- a/morphlib/exts/kvm.write.help +++ b/morphlib/exts/kvm.write.help @@ -42,6 +42,10 @@ help: | * AUTOSTART=` - boolean. If it is set, the VM will be started when it has been deployed. + * DTB_PATH=path: **(MANDATORY)** for systems that require a device tree + binary - Give the full path (without a leading /) to the location of the + DTB in the built system image . The deployment will fail if `path` does + not exist. + (See `morph help deploy` for details of how to pass parameters to write extensions) - diff --git a/morphlib/exts/rawdisk.write.help b/morphlib/exts/rawdisk.write.help index 81f35024..fe47c890 100644 --- a/morphlib/exts/rawdisk.write.help +++ b/morphlib/exts/rawdisk.write.help @@ -34,5 +34,10 @@ help: | * INITRAMFS_PATH=path: the location of an initramfs for the bootloader to tell Linux to use, rather than booting the rootfs directly. + * DTB_PATH=path: **(MANDATORY)** for systems that require a device tree + binary - Give the full path (without a leading /) to the location of the + DTB in the built system image . The deployment will fail if `path` does + not exist. + (See `morph help deploy` for details of how to pass parameters to write extensions) diff --git a/morphlib/exts/virtualbox-ssh.write.help b/morphlib/exts/virtualbox-ssh.write.help index b4c59553..7131f8b8 100644 --- a/morphlib/exts/virtualbox-ssh.write.help +++ b/morphlib/exts/virtualbox-ssh.write.help @@ -41,6 +41,11 @@ help: | * INITRAMFS_PATH=path: the location of an initramfs for the bootloader to tell Linux to use, rather than booting the rootfs directly. + * DTB_PATH=path: **(MANDATORY)** for systems that require a device tree + binary - Give the full path (without a leading /) to the location of the + DTB in the built system image . The deployment will fail if `path` does + not exist. + * AUTOSTART= - boolean. If it is set, the VM will be started when it has been deployed. -- cgit v1.2.1 From e93d7ed826431729ad458df643470b46c0a6865f Mon Sep 17 00:00:00 2001 From: Pete Fotheringham Date: Fri, 12 Dec 2014 11:30:13 +0000 Subject: Document BOOTLOADER_INSTALL and BOOTLOADER_CONFIG_FORMAT write extension parameters --- morphlib/exts/kvm.write.help | 16 ++++++++++++++++ morphlib/exts/rawdisk.write.help | 16 ++++++++++++++++ morphlib/exts/virtualbox-ssh.write.help | 16 ++++++++++++++++ morphlib/writeexts.py | 5 ++--- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/morphlib/exts/kvm.write.help b/morphlib/exts/kvm.write.help index 6df6c53c..8ddcb89c 100644 --- a/morphlib/exts/kvm.write.help +++ b/morphlib/exts/kvm.write.help @@ -47,5 +47,21 @@ help: | DTB in the built system image . The deployment will fail if `path` does not exist. + * BOOTLOADER_INSTALL=value: the bootloader to be installed + **(MANDATORY)** for non-x86 systems + + allowed values = + - 'extlinux' (default) - the extlinux bootloader will + be installed + - 'none' - no bootloader will be installed by `morph deploy`. A + bootloader must be installed manually. This value must be used when + deploying non-x86 systems such as ARM. + + * BOOTLOADER_CONFIG_FORMAT=value: the bootloader format to be used. + If not specified for x86-32 and x86-64 systems, 'extlinux' will be used + + allowed values = + - 'extlinux' + (See `morph help deploy` for details of how to pass parameters to write extensions) diff --git a/morphlib/exts/rawdisk.write.help b/morphlib/exts/rawdisk.write.help index fe47c890..d6c78573 100644 --- a/morphlib/exts/rawdisk.write.help +++ b/morphlib/exts/rawdisk.write.help @@ -39,5 +39,21 @@ help: | DTB in the built system image . The deployment will fail if `path` does not exist. + * BOOTLOADER_INSTALL=value: the bootloader to be installed + **(MANDATORY)** for non-x86 systems + + allowed values = + - 'extlinux' (default) - the extlinux bootloader will + be installed + - 'none' - no bootloader will be installed by `morph deploy`. A + bootloader must be installed manually. This value must be used when + deploying non-x86 systems such as ARM. + + * BOOTLOADER_CONFIG_FORMAT=value: the bootloader format to be used. + If not specified for x86-32 and x86-64 systems, 'extlinux' will be used + + allowed values = + - 'extlinux' + (See `morph help deploy` for details of how to pass parameters to write extensions) diff --git a/morphlib/exts/virtualbox-ssh.write.help b/morphlib/exts/virtualbox-ssh.write.help index 7131f8b8..4dddd987 100644 --- a/morphlib/exts/virtualbox-ssh.write.help +++ b/morphlib/exts/virtualbox-ssh.write.help @@ -46,6 +46,22 @@ help: | DTB in the built system image . The deployment will fail if `path` does not exist. + * BOOTLOADER_INSTALL=value: the bootloader to be installed + **(MANDATORY)** for non-x86 systems + + allowed values = + - 'extlinux' (default) - the extlinux bootloader will + be installed + - 'none' - no bootloader will be installed by `morph deploy`. A + bootloader must be installed manually. This value must be used when + deploying non-x86 systems such as ARM. + + * BOOTLOADER_CONFIG_FORMAT=value: the bootloader format to be used. + If not specified for x86-32 and x86-64 systems, 'extlinux' will be used + + allowed values = + - 'extlinux' + * AUTOSTART= - boolean. If it is set, the VM will be started when it has been deployed. diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py index 91936f64..068f0741 100644 --- a/morphlib/writeexts.py +++ b/morphlib/writeexts.py @@ -545,9 +545,8 @@ class WriteExtension(cliapp.Application): '''Does the user want to generate a bootloader config? The user may set $BOOTLOADER_CONFIG_FORMAT to the desired - format (u-boot or extlinux). If not set, extlinux is the - default but will be generated on x86-32 and x86-64, but not - otherwise. + format. 'extlinux' is the only allowed value, and is the default + value for x86-32 and x86-64. ''' -- cgit v1.2.1 From a23bcc6321ad8e31e277de9753fbaa98ee6d741d Mon Sep 17 00:00:00 2001 From: Pete Fotheringham Date: Fri, 12 Dec 2014 11:31:09 +0000 Subject: Whitespace removal --- morphlib/writeexts.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py index 068f0741..fd2f5529 100644 --- a/morphlib/writeexts.py +++ b/morphlib/writeexts.py @@ -83,14 +83,14 @@ class Fstab(object): class WriteExtension(cliapp.Application): '''A base class for deployment write extensions. - + A subclass should subclass this class, and add a ``process_args`` method. - + Note that it is not necessary to subclass this class for write extensions. This class is here just to collect common code for write extensions. - + ''' def setup_logging(self): @@ -125,13 +125,13 @@ class WriteExtension(cliapp.Application): def status(self, **kwargs): '''Provide status output. - + The ``msg`` keyword argument is the actual message, the rest are values for fields in the message as interpolated by %. - + ''' - + self.output.write('%s\n' % (kwargs['msg'] % kwargs)) self.output.flush() @@ -184,9 +184,9 @@ class WriteExtension(cliapp.Application): def _parse_size(self, size): '''Parse a size from a string. - + Return size in bytes. - + ''' m = re.match('^(\d+)([kmgKMG]?)$', size) -- cgit v1.2.1 From 5bdb4820b0eddf1d7f3a4a25a74819844e06e7a1 Mon Sep 17 00:00:00 2001 From: Pete Fotheringham Date: Fri, 12 Dec 2014 11:36:04 +0000 Subject: Document KERNEL_ARGS write extension parameter --- morphlib/exts/kvm.write.help | 9 +++++++++ morphlib/exts/rawdisk.write.help | 9 +++++++++ morphlib/exts/virtualbox-ssh.write.help | 9 +++++++++ morphlib/writeexts.py | 6 ++++++ 4 files changed, 33 insertions(+) diff --git a/morphlib/exts/kvm.write.help b/morphlib/exts/kvm.write.help index 8ddcb89c..04393b8a 100644 --- a/morphlib/exts/kvm.write.help +++ b/morphlib/exts/kvm.write.help @@ -63,5 +63,14 @@ help: | allowed values = - 'extlinux' + * KERNEL_ARGS=args: optional additional kernel command-line parameters to + be appended to the default set. The default set is: + + 'rw init=/sbin/init rootfstype=btrfs \ + rootflags=subvol=systems/default/run \ + root=[name or UUID of root filesystem]' + + (See https://www.kernel.org/doc/Documentation/kernel-parameters.txt) + (See `morph help deploy` for details of how to pass parameters to write extensions) diff --git a/morphlib/exts/rawdisk.write.help b/morphlib/exts/rawdisk.write.help index d6c78573..54af81c4 100644 --- a/morphlib/exts/rawdisk.write.help +++ b/morphlib/exts/rawdisk.write.help @@ -55,5 +55,14 @@ help: | allowed values = - 'extlinux' + * KERNEL_ARGS=args: optional additional kernel command-line parameters to + be appended to the default set. The default set is: + + 'rw init=/sbin/init rootfstype=btrfs \ + rootflags=subvol=systems/default/run \ + root=[name or UUID of root filesystem]' + + (See https://www.kernel.org/doc/Documentation/kernel-parameters.txt) + (See `morph help deploy` for details of how to pass parameters to write extensions) diff --git a/morphlib/exts/virtualbox-ssh.write.help b/morphlib/exts/virtualbox-ssh.write.help index 4dddd987..cb50acc0 100644 --- a/morphlib/exts/virtualbox-ssh.write.help +++ b/morphlib/exts/virtualbox-ssh.write.help @@ -62,6 +62,15 @@ help: | allowed values = - 'extlinux' + * KERNEL_ARGS=args: optional additional kernel command-line parameters to + be appended to the default set. The default set is: + + 'rw init=/sbin/init rootfstype=btrfs \ + rootflags=subvol=systems/default/run \ + root=[name or UUID of root filesystem]' + + (See https://www.kernel.org/doc/Documentation/kernel-parameters.txt) + * AUTOSTART= - boolean. If it is set, the VM will be started when it has been deployed. diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py index fd2f5529..6ab2dd55 100644 --- a/morphlib/writeexts.py +++ b/morphlib/writeexts.py @@ -474,6 +474,12 @@ class WriteExtension(cliapp.Application): self.status(msg='Creating extlinux.conf') config = os.path.join(real_root, 'extlinux.conf') + + ''' Please also update the documentation in the following files + if you change these default kernel args: + - kvm.write.help + - rawdisk.write.help + - virtualbox-ssh.write.help ''' kernel_args = ( 'rw ' # ro ought to work, but we don't test that regularly 'init=/sbin/init ' # default, but it doesn't hurt to be explicit -- cgit v1.2.1 From e22bd056920d936caf66a24554e4c3e31157d13c Mon Sep 17 00:00:00 2001 From: Pete Fotheringham Date: Fri, 12 Dec 2014 11:56:39 +0000 Subject: Add 'do not use' warnings to nfsboot write extension --- morphlib/exts/nfsboot.write | 13 +++++++++++-- morphlib/exts/nfsboot.write.help | 9 ++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/morphlib/exts/nfsboot.write b/morphlib/exts/nfsboot.write index 8d3d6df7..9fa6fc84 100755 --- a/morphlib/exts/nfsboot.write +++ b/morphlib/exts/nfsboot.write @@ -17,6 +17,16 @@ '''A Morph deployment write extension for deploying to an nfsboot server +*** DO NOT USE *** +- This was written before 'proper' deployment mechanisms were in place +It is unlikely to work at all and will not work correctly + +Use the pxeboot werite extension instead + +*** + + + An nfsboot server is defined as a baserock system that has tftp and nfs servers running, the tftp server is exporting the contents of /srv/nfsboot/tftp/ and the user has sufficient permissions to create nfs roots @@ -125,7 +135,7 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): self.status(msg='Creating destination directories') try: - cliapp.ssh_runcmd('root@%s' % location, + cliapp.ssh_runcmd('root@%s' % location, ['mkdir', '-p', orig_path, run_path]) except cliapp.AppException: raise cliapp.AppException('Could not create dirs %s and %s on %s' @@ -191,4 +201,3 @@ mv "$temp" "$target" NFSBootWriteExtension().run() - diff --git a/morphlib/exts/nfsboot.write.help b/morphlib/exts/nfsboot.write.help index 598b1b23..310fd7a4 100644 --- a/morphlib/exts/nfsboot.write.help +++ b/morphlib/exts/nfsboot.write.help @@ -1,6 +1,13 @@ help: | + *** DO NOT USE *** + - This was written before 'proper' deployment mechanisms were in place. + It is unlikely to work at all, and will not work correctly. + + Use the pxeboot write extension instead + + *** Deploy a system image and kernel to an nfsboot server. - + An nfsboot server is defined as a baserock system that has tftp and nfs servers running, the tftp server is exporting the contents of /srv/nfsboot/tftp/ and the user has sufficient -- cgit v1.2.1