summaryrefslogtreecommitdiff
path: root/morphlib
Commit message (Collapse)AuthorAgeFilesLines
* One 'arch' to rule them allSam Thursfield2013-03-159-96/+120
| | | | | | | | | | | | | Define a specific set of 4 architectures that Morph supports, and only expose that value to morphologies. Since GNU triplets are very common we also expose a GNU triplet. Other morphologies should work out their configuration based on MORPH_ARCH. This commit also removes the morphlib.util.arch() function, which detected the machine Morph is running on via 'uname -m'. Morph's architecture names do not necessarily map to the output of 'uname -m' so we should not rely on it anywhere.
* Fix trebuchet plugin to not depend on host architectureSam Thursfield2013-03-151-8/+20
|
* Enable syslinux systembuilder on all systemsSam Thursfield2013-03-141-11/+8
| | | | | | This is a kludge which I am only doing because we are removing this plugin soon. Morph no longer has a way to detect the architecture that it is running on and no longer needs one anywhere else.
* Only build systems againSam Thursfield2013-03-141-1/+1
| | | | | We can no longer build strata individually because we don't know what architecture they are for.
* Allow unknown values of build-mode through with just a warningSam Thursfield2013-03-131-3/+4
| | | | | | | This gives us some forward compatibility leeway to introduce new build modes, as long as they are compatible with staging. As suggested by Richard Maw.
* Only bind mount necessary directories in chrootSam Thursfield2013-03-131-7/+5
| | | | | If for example /bin is a symlink, we shouldn't and can't mount the host system's /bin over the top.
* Don't install bootstrapped chunks when building artifacts in other strataSam Thursfield2013-03-131-0/+12
| | | | | | | | | | | When building a stratum artifact it's easy to only include chunks that were built in 'staging' mode. Constructing the staging area doesn't use that code path, though, so we need an extra hack to filter out those artifacts while building. It may be neater to express stratum build-depends as actual dependencies on the stratum artifact, rather than each of its constituent chunks as we do now.
* Don't include bootstrap chunks in output strataSam Thursfield2013-03-131-3/+8
| | | | | This is necessary so that the build-essential stratum doesn't end up containing three different compilers.
* Add 'prefix' property for chunks within strataSam Thursfield2013-03-1311-16/+48
| | | | | | | | | Morph no longer supports setting the prefix using the --prefix argument / setting. This was only used in tests and during bootstrap. If a chunk build-depends on a chunk within a stratum which has a custom prefix, that prefix is appended to the PATH in the build environment.
* Add 'build-mode' field for chunks in a stratumSam Thursfield2013-03-139-33/+51
| | | | | | | | | | | | | | | | | | | | | | | | | Allowed values: staging: build with a staging chroot (default) test: build with the host's tools bootstrap: build with the host's tools, and do not include this chunk in the final stratum artifact In the past, 'normal mode' has been used to describe building a chunk with the host's tools. We don't want that mode to ever be used, because it is a huge hole in reproducability, but we need to keep it around to avoid making Morph's cmdtest suite depend on Baserock. Hopefully naming it 'test' should discourage potential abusers. It is unfortunate that the build tests now take a separate code path compared to real-world usage of Morph. However, this is necessary to avoid a circular dependency between Morph's test suite and the build-essential stratum in Baserock. We do whole-build testing of Baserock, too, so the 'staging' code path is still tested outside of Morph. However, testing a staging area requires populating it with at minimum a working shell, and this is a bit too complex to go in Morph's test suite.
* Set environment variables defining target for build-essentialSam Thursfield2013-03-137-40/+60
| | | | | | In the future we will allow this to be modified to provide a cross-bootstrap mode, but for now we use the same target as the host compiler.
* Refactor build processSam Thursfield2013-03-1311-134/+130
| | | | | | | | | | | | | | | | | | Reorganise the build_artifact() and build_artifacts() functions to allow more complex work when setting up chunk builds in build_artifact(). The staging area now holds the BuildEnvironment object (the environment variables that should be set during build). This makes sense because all build commands should be run inside the staging area and therefore through the StagingArea object. The BuildEnvironment object is now considered immutable after it is created. The environment is used in cache key computation when computing what artifacts are required; if it changes after that point we risk either computing different artifact keys for the same artifact or missing data in the cache key that should be included in the hash. Better to force changes into a separate 'extra_env' variable.
* Remove support for bootstrap mode in staging areaSam Thursfield2013-03-133-39/+16
| | | | | This involved having a staging area with split personalities and was generally a bit ugly.
* Remove features used by old bootstrap methodSam Thursfield2013-03-136-83/+50
| | | | | | That means that bootstrapping Baserock is currently not possible with this branch of Morph, but there's no reason it cannot be bootstrapped using an older version of Morph instead.
* Fix incorrect commentSam Thursfield2013-03-131-5/+0
|
* Test that chunk artifacts are NOT compressedLars Wirzenius2013-03-131-1/+7
|
* Turn off rootfs-tarball compressionLars Wirzenius2013-03-131-3/+1
|
* Do not compress chunk artifacts upon creationLars Wirzenius2013-03-131-1/+1
| | | | | | | | | We already silently, automatically decompress if the artifact is compressed. It is thus safe to turn off compression. Compression saves disk space, but on ARM it takes up a lot extra time, and we have lots of disk space, so for speed, not compressing is a good idea.
* Fix deploy to not assume artifacts are compressedLars Wirzenius2013-03-131-2/+1
|
* Merge remote-tracking branch ↵Sam Thursfield2013-03-121-2/+2
|\ | | | | | | 'origin/baserock/richardholland/morph-deploy--tempdir'
| * Fixed 'morph deploy' to obey --tempdirRic Holland2013-03-071-2/+2
| | | | | | | | Allowed user to set the location of the temp directory using --tempdir
| * Merge branch 'baserock/richardholland/fix-virtualbox-deploy' into ↵Ric Holland2013-03-071-3/+5
| |\ | | | | | | | | | baserock/richardholland/improve-output-messages
* | \ Merge remote-tracking branch ↵Lars Wirzenius2013-03-116-7/+71
|\ \ \ | | | | | | | | | | | | | | | | | | | | 'origin/baserock/richardholland/environment-logging' into staging Added a "pragma: no cover" to make the test suite pass.
| * | | Change morph to reduce loogign of the environmentRic Holland2013-03-082-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added function log_dict_diff to identify and record changes in dicts to the debug log This new function was then implemented in app.py to log changes in the environment
| * | | Merge branch 'liw/pre-commands' into stagingSam Thursfield2013-03-074-5/+51
| |\ \ \ |/ / / / | | | | | | | | | | | | Conflicts: morphlib/morph2.py
| * | | Fix copyright yearsSam Thursfield2013-03-071-1/+1
| | | |
| * | | Add pre- and post-commands for chunksLars Wirzenius2013-02-194-4/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have configure-commands. Add pre-configure-commands and post-configure-commands. Likewise for build-command, test-commands, and install-commands. Added-to-pacify: Rob Kendrick
* | | | Merge remote-tracking branch ↵Lars Wirzenius2013-03-061-3/+5
|\ \ \ \ | | |_|/ | |/| | | | | | 'origin/baserock/richardholland/fix-virtualbox-deploy' into staging
| * | | Fix virtualbox deploymentRic Holland2013-03-051-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | It was missing an import for sys. It did not have the size of the disk either, this has also been fixed
* | | | Merge remote-tracking branch ↵Lars Wirzenius2013-03-061-4/+6
|\ \ \ \ | | |_|/ | |/| | | | | | 'origin/baserock/richardholland/improve-output-messages' into staging
| * | | Improve "morph build" progress messages:Ric Holland2013-03-051-4/+6
| |/ / | | | | | | | | | | | | | | | Added chunk name in status when starting build Added the name of parent artifact (chunk that installing chunk was installed for) to start of build message
* | | B&M: Share error message formatting codeRichard Maw2013-03-042-28/+54
| | | | | | | | | | | | | | | | | | | | | This makes the warning messages include how to fix the problem. morphlib.git.check_config_set will return the values of the keys which were set, so it can be used to get git config.
* | | Merge branch 'baserock/richardmaw/branch-and-merge-git-config-warnings-v2' ↵baserock/genivi/baseline/releases/F-0.1Richard Maw2013-03-012-2/+40
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | of git://git.baserock.org/baserock/baserock/morph Reviewed-by: Sam Thursfield Reviewed-by: Lars Wirzenius
| * | | B&M: Check git config before some subcommandsRichard Maw2013-03-012-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some subcommands use git to create commits, in which case user config needs to be set. Others imply commits may be created, e.g. by cloning a repository, at which point it is useful to have a reminder that the configuration needs to be set.
| * | | B&M: Commit to build branches with user's emailRichard Maw2013-03-011-2/+1
| |/ / | | | | | | | | | | | | | | | While it may be useful to have the username and machine the commit was made on, it's more useful to have the committer's email address, and the email field is for email addresses.
* | | Fix existence checks to not follow symlinksLars Wirzenius2013-03-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we hardlink the staging area tree, we were checking if the target file already exists with os.path.exists. Unfortunately, this follows a symlink, and in this case, we don't want to: if the symlink target exists, and is a symlink, we want to remove the symlink only, and we don't care about its target. The target file may exists because of overlapping files in chunks. Reported-By: Paul Sherwood
* | | Fix settings['tempdir'] not being setJonathan Maw2013-03-011-0/+5
|/ /
* | Add the ability for chunk morphs to specify devicesJonathan Maw2013-02-283-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Within a linux-user-chroot, we do not want to allow arbitrary code to create device nodes, but still want it to be possible to create a device node. This commit creates and handles the 'devices' field in a chunk morphology, which takes: * filename. A string, e.g. "/dev/null" * uid. The ID of the user the file belongs to, e.g. 0 for root. * gid. The ID of the group the file belongs to, e.g. 0 for root. * type. A string of either 'c' for a character device or 'b' for a block device. * major. The device's major number. * minor. The device's minor number. * permissions. A string of the octal number that would be passed to chmod e.g. '0777'
* | Perform *-commands in linux-user-chrootJonathan Maw2013-02-281-2/+17
| |
* | Hardlink files into the staging-areaJonathan Maw2013-02-283-69/+180
| | | | | | | | | | | | Instead of repeatedly unpacking tarballs into a succession of staging- areas, it will unpack each tarball only once, then hardlink all the files into the staging-area instead.
* | Merge branch 'richardmaw/artifact-inspection-plugin-rebase-v2' of ↵Richard Maw2013-02-276-58/+469
|\ \ | | | | | | | | | | | | | | | git://git.baserock.org/baserock/baserock/morph Reviewed-by: Lars Wirzenius
| * | Add version guessing for autotools projectsJannis Pohlmann2013-02-211-1/+139
| | | | | | | | | | | | | | | This is more of a rough sketch so far, it's very ugly but it does work for a fair amount of projects.
| * | Add image inspection pluginJannis Pohlmann2013-02-211-0/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a `run-in-artifact` command which allows another command to be run in a system. There is also a `content-manifest` command which gives a manifest of the artifacts, which commits they were built from, and if possible, a version. This adds a morphlib.bins.call_in_artifact_directory() method to run a command inside an artifact and to generate a manifest.
| * | Add ExtractedTarball class and method to extract/mount an artifactJannis Pohlmann2013-02-213-1/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ExtractedTarball is more or less the equivalent to MountableImage for artifacts that are not mountable images. So in order to inspect root file system tarballs, ExtractedTarball can be used, for disk images, MountableImage can be used. The morphlib.bins.call_in_artifact_directory() method combines these two classes and provides a way to extract/mount an artifact and call a callback with the temporary directory / mount point as its first argument. Using this, a plugin that runs a command relative to an artifact's root directory can be written easily.
| * | Move MountableImage class into morphlibJannis Pohlmann2013-02-213-57/+85
| | | | | | | | | | | | | | | | | | | | | This class would be pretty useful in other cases where a system image needs to be mounted and inspected. Also updates the Trebuchet plugin to use this class.
* | | Avoid infinite looping when walking artifact dep graphLars Wirzenius2013-02-221-3/+3
| | | | | | | | | | | | Reported-By: Sam Thursfield
* | | Allow building strata with 'morph build-morphology' againSam Thursfield2013-02-221-1/+1
|/ / | | | | | | This is mainly to fix bootstrap.
* | Merge branch 'liw/build-progress2'Sam Thursfield2013-02-212-3/+14
|\ \
| * | Make BuildCommand report current and total build stepsLars Wirzenius2013-02-212-3/+14
| | | | | | | | | | | | | | | | | | This adds a [Build 1/12765] to the output of the building of each artifact. This makes it easier to see how much work there might still be remaining.
* | | Merge branch 'samthursfield/only-build-systems' of ↵Richard Maw2013-02-211-1/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | git://git.baserock.org/baserock/baserock/morph This includes a merge fixup in ./check, so that it does not complain about build-system-autotools' test's tabs.