summaryrefslogtreecommitdiff
path: root/morphlib/writeexts.py
Commit message (Collapse)AuthorAgeFilesLines
* Prevent cliapp from logging env. variables with 'PASSWORD' in their nameSam Thursfield2014-09-191-0/+4
| | | | | The upstream cliapp project is not interested in this functionality right now.
* deploy: Make Python extensions log debug messages to MORPH_LOG_FD by defaultSam Thursfield2014-09-011-1/+24
| | | | | | | | | Previously logging was disabled for Python deploy extensions. We get a lot of useful information for free in the log file by doing this: the environment will be written when the subprocess starts, and if it crashes the full backtrace will be written there too. Subcommand execution with cliapp.runcmd() will also be logged.
* Merge remote-tracking branch 'origin/baserock/james/writeexts_support_jetson'baserock/richardmaw/james/writeexts_support_jetsonRichard Maw2014-08-121-19/+79
|\
| * Add support for a device tree to be set using DTB_PATHbaserock/james/writeexts_support_jetsonJames Thomas2014-08-031-0/+21
| |
| * Make bootloader config/install more genericJames Thomas2014-08-031-17/+52
| | | | | | | | | | | | | | | | | | | | | | | | Remove the BOOTLOADER environment variable and instead favour BOOTLOADER_CONFIG_FORMAT to set the desired bootloader format, and BOOTLOADER_INSTALL to set the type of bootloader to install. For example, since u-boot can boot using extlinux.conf files, it's conceivable that someone might want to do CONFIG_FORMAT=extlinux.conf, INSTALL=u-boot. However, for most platforms you would want to set INSTALL to "none"
| * Support setting a different root device using ROOT_DEVICEJames Thomas2014-08-031-2/+5
|/
* Check for presence of btrfs before trying to use itSam Thursfield2014-06-111-1/+12
| | | | | | | | | | | | | | | | If btrfs is not present in the kernel we end up with strange output like this: Error creating disk image2014-06-10 16:00:40 [devel-system-x86_64-generic][my-raw-disk-image][rawdisk.write]Failure to create disk image at /src/tmp/testdev.img ERROR: Command failed: mount -o loop /src/tmp/testdev.img /src/tmp/deployments/tmpQ7wXO1/tmp4lVDcu/tmpvHSzDE mount: mounting /dev/loop0 on /src/tmp/deployments/tmpQ7wXO1/tmp4lVDcu/tmpvHSzDE failed: Device or resource busy To avoid this confusing error, Morph should explicitly check first.
* Use UUID in fstab entries if providedRichard Maw2014-06-041-4/+6
| | | | | | | | | | | | | | This makes systems use the UUID of the disk in the fstab when there is no pre-existing fstab entry for /. This happens whether the system has an initramfs or not, since it should be harmless, and by this point we're in userland, so can know what the UUIDs are. Passing the UUID to `complete_fstab_for_btrfs_layout` is optional, and defaults to the old behaviour of using /dev/sda, since it is called directly by some write extensions for doing upgrades, and upgrading systems that use an initramfs will be part of a later patch.
* Make uuid mandatory when calling create_btrfs_system_layoutRichard Maw2014-06-041-1/+1
| | | | | | | | | | It's only ever called from the core of the write extensions library, so we can change it to be mandatory in all cases. install_extlinux is left with the uuid being optional and defaulting to /dev/sda, since it is called directly from the rawdisk write extension currently, and upgrades of systems that have an initramfs will be part of a later patch series.
* Add initramfs support to write extensions that produce disksRichard Maw2014-06-021-8/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If INITRAMFS_PATH is specified and the file exists, then the produced kernel command line will use root=UUID=$uuid_of_created_disk rather than root=/dev/sda, which may be incorrect. Help files have been updated to mention the new option. This leads to an unfortunate duplication of the path to the initramfs, in both the location field of the nested deployment and the INITRAMFS_PATH of the disk image creation. However, an initramfs could be produced by a chunk and put in the same place, so it doesn't make sense to couple the rawdisk and initramfs write extensions to remove this duplication. Similarly, there may be multiple valid initramfs in the rootfs e.g. extlinux loads a hypervisor, which is Linux + initramfs, and the initramfs then boots a guest Linux system, which uses a different initramfs. This makes it important to explicitly let the rootfs write extensions know which to use, or not as the case may be. util-linux's blkid is required, since the busybox version ignores the options to filter its output, and parsing the output is undesirable. Because syslinux's btrfs subvolume support is limited to being able to use a non-0 default subvolume, the initramfs has to be copied out of the run-time rootfs subvolume and into the boot subvolume. This pushed the required disk space of a minimal system over the 512M threshold because we do not have the userland tooling support to be able to do a btrfs file contents clone.
* Fix state subvolume generator to preserve permissionsbaserock/danielsilverstone/vagrant-supportDaniel Silverstone2014-05-161-1/+1
| | | | | | shutil.move() does not preserve permissions, file modes, ownerships etc, resulting in much confusion when prepopulating a non-root user during deployment. This change to `mv` fixes that.
* deploy: Share SSH connectivity check in the common writeexts.py codeSam Thursfield2014-04-151-0/+9
| | | | | Also, change it to log the real error message in morph.log before raising a more general exception to the user.
* Adding support to add extra kernel args in extlinux.confPedro Alvarez2014-04-041-1/+5
|
* Make parse_autostart() into more general get_environment_boolean()Sam Thursfield2014-03-041-7/+7
| | | | | Also, be more flexible when parsing environment booleans -- convert to lower case and match 0/1 and true/false as well as yes/no.
* deploy: Finish off the Btrfs system layout implementationSam Thursfield2014-03-041-42/+141
| | | | | | | | | | | | | | | The shared state directories defined in writeexts.py (/var, /home etc.) are now separate Btrfs subvolumes that are mounted in place using fstab. There are some warnings on mounting /var and /srv about the mountpoint not being empty. Not yet investigated. If a configure extension has already added / to the fstab, use the device it chose rather than assuming /dev/sda. This is required for the vdaboot.configure extension that we use for OpenStack deployments. Similarly, if a configure extension has added an entry for a state directory in /etc/fstab already, we don't replace it with a /state/xxx directory. That's only done as a default behaviour.
* Adding syslinux 'menu.c32' file during the deployment.Pedro Alvarez2014-03-041-1/+19
| | | | | We will need this file to enable a bootloader menu to choose between OS after an upgrade.
* Import morphlib as we are using morphlib.ErrorTiago Gomes2013-07-171-0/+1
|
* Allow to set the number of cpus for virtualbox and kvm deployments.Tiago Gomes2013-07-021-0/+4
|
* Write extensions: Flush output when using status()Richard Maw2013-06-101-0/+1
| | | | | This is required to get real-time output and the timestamps meaning anything useful.
* Set up a symlink to the default system version in rawdisk/kvm/vboxTiago Gomes2013-06-141-4/+5
| | | | | | | deployments Also Change them to use the "default" symlink in the extlinux.conf they create, instead of hardcoding the current system version name
* Make create_local_system fail if DISK_SIZE isn't definedJonathan Maw2013-05-291-1/+5
|
* Remove executable permissions from *.py files that have themLars Wirzenius2013-05-281-0/+0
|
* Use the name factory for the first system version.Tiago Gomes2013-05-231-1/+1
|
* Allow installing extlinux to other system versions.Tiago Gomes2013-05-201-4/+4
|
* Use a kernel named 'kernel' instead of 'linux'Jonathan Maw2013-05-131-2/+2
|
* Merge branch 'jonathan/disk-layout' of ↵Richard Maw2013-05-131-25/+47
|\ | | | | | | ssh://trove.baserock.org/baserock/baserock/morph
| * Add 'state' dirs as btrfs subvolumesJonathan Maw2013-05-131-0/+11
| | | | | | | | | | | | These subvolumes exist in state/{home,opt,srv} of the disk's root. They are not mounted by default.
| * Use a different disk system layout for rawdiskJonathan Maw2013-05-131-25/+36
| | | | | | | | | | This is in preparation for making deployments able to upgrade existing baserock systems.
* | Merge branch 'baserock/richardmaw/kvm-write-allow-autostart' of ↵Richard Maw2013-05-131-0/+12
|\ \ | |/ |/| | | | | | | git://git.baserock.org/baserock/baserock/morph Reviewed-by: Jonathan Maw on IRC.
| * Add AUTOSTART to kvm and libvirt write extensionsRichard Maw2013-05-081-0/+12
| | | | | | | | | | | | If AUTOSTART is 'yes' then the VM will be started once it is created. If it is 'no' or undefined, then it will need to be manually started. If it is any other value, then an exception is raised.
* | Fix typoLars Wirzenius2013-05-091-1/+1
| |
* | Merge branch 'liw/fix-rawdisk-on-arm'Lars Wirzenius2013-05-091-1/+24
|\ \ | |/ |/| | | Reviewed-By: Jonathan Maw (on irc)
| * Fix recognition of x86-32Lars Wirzenius2013-05-081-1/+5
| | | | | | | | Reported-by: Richard Maw
| * Make bootloader installation for disk images optionalLars Wirzenius2013-05-081-1/+20
| |
* | Add entry for / in fstab but only if there isn't oneLars Wirzenius2013-05-021-2/+18
|/
* Add method to parse $RAM_SIZELars Wirzenius2013-03-281-4/+24
|
* Add ATTACH_DISKS support to kvmLars Wirzenius2013-03-201-0/+8
|
* Add missing "import sys" to fix error messagesLars Wirzenius2013-02-121-0/+1
| | | | Reported-By: Richard Maw
* Refactor: Add WriteExtension.create_local_system methodLars Wirzenius2013-02-071-1/+35
| | | | | | | | | | This allows code sharing amongst all the places that create a system in a raw disk image. This also adds the creation of a factory-run subvolume, and fixes error messages for errors that happen during a disk image creation. Suggested-By: Richard Maw Suggested-By: Sam Thursfield
* Do away with unnecessary fstab entries for proc, sysLars Wirzenius2013-02-071-2/+0
| | | | Suggested-By: Richard Maw
* Let mount choose loop deviceLars Wirzenius2013-02-071-2/+1
| | | | Suggested-By: Richard Maw
* Create hole in-process without executing dd(1)Lars Wirzenius2013-02-071-7/+4
| | | | Suggested-By: Richard Maw
* Add morphlib module for common write extension codeLars Wirzenius2013-02-061-0/+157