summaryrefslogtreecommitdiff
path: root/morphlib/fsutils.py
Commit message (Collapse)AuthorAgeFilesLines
* Make invert_paths work more reliably for writable-allRichard Maw2014-11-121-36/+31
|
* Allow invert_paths to skip the top level directoryRichard Maw2014-10-291-0/+5
| | | | | | We're going to be passing it "$CHROOT/" as a writable directory by default, so it needs to be able to tell that it means to leave everything writable.
* Extend morphlib.fsutils.mount to take a fstypePedro Alvarez2014-03-181-3/+7
|
* rootfs-protection: Fix building with tempdir=/tmpRichard Maw2013-08-281-15/+19
| | | | | | | | | | | | | | | | | | The issue is that the tempdir is added at the end of the list of directories to keep writable, and entries earlier in the list are subdirectories of tempdir. The check encountered the subdirs first, so decided it must recurse and make everything else read-only. It never got as far as noticing that /tmp was requested writable. Now, every path is checked for being equal, then checked for being a subdirectory. This changed style to use any and generator expressions, as it was more concise than having an explicit loop for checking equality, then an explicit loop for checking subdirectory.
* fsutils: add invert_paths functionRichard Maw2013-08-151-8/+74
| | | | | | | | | | | | | | | | | | This will list all the paths generated by the walker generator function that aren't in the specified set. It removes directories from those returned by the walker, since with os.walk(topdown=True) this culls the search space. In the set of provided paths and the set of returned paths, if a directory is given, then its contents are virtually part of the set. This oddly specific behaviour is because invert_paths is to be used with linux-user-chroot to mark subtrees as read-only, when it only has a set of paths it wants to keep writable. It takes a walker, rather than being given a path and using os.walk, so that it is a pure function, so is easier to unit test.
* Move install_syslinux_mbr into syslinux pluginRichard Maw2012-08-061-9/+0
| | | | This is not used elsewhere, and probably never will.
* python scripts: pep8ize codebaseRichard Maw2012-08-011-3/+10
| | | | | | | | | This was done with the aid of the pep8 script, available by running `easy_install pep8`. It may be worth making this part of ./check, but that will require putting pep8 into the development tools stratum. This should be easy, given pep8 has no external dependencies.
* morphlib: add 'arch' field to morphologiesRichard Maw2012-06-131-1/+1
| | | | | | | | | | | | | | | | | | | This is an ugly, ugly way to do this, but time is pressing. SystemBuilder checks what arch is defined in the morphology, if it is an x86 (or None for compatibility) then it will do the syslinux install stuff. This hack is needed because syslinux is x86 specific and arm often has different requirements for where the kernel must be loaded from, sometimes it is flash, sometimes it is a different partition. This will likely become board specific, but for a qemu-system-arm, the kernel should be a separate file, to be passed on the command line. Having a different 'kind' for each architecture would be a nicer way, but would require more changes, since there are various checks for morphology['kind'] == 'system'
* morphlib.fsutils: setup_device_mapping simplifyRichard Maw2012-06-131-7/+3
| | | | | losetup has a --show option that will print the loop device the file was mapped to, this is better than parsing the output of losetup -j.
* create_fs: remove the filesystem size optionsRichard Maw2012-06-131-4/+1
|
* morph: remove dead code and replace Execute with app.runcmdRichard Maw2012-05-301-22/+22
|
* system image use systemd on vda1 and build in tmpRichard Maw2012-05-091-1/+1
| | | | | | | | | | | | | | | | Use the tempdir of the staging area instead of the chroot directory as the basedir for building system images. It would be better to create it directly in the cache, then rename it when finished, but commands need a filename and the cache provides an open file handle. Change the generated fstab and extlinux.conf to use systemd as the init and expect the root filesystem to be on vda1 instead of sda1. vda1 is slightly more efficient and is the default storage device for libvirt. This is safe to add before systemd is fully integrated, as if the kernel can't find that file it run /sbin/init, which is busybox
* Only create mount point if it is missingLars Wirzenius2012-04-201-1/+2
|
* morphlib.fsutils: remove debug print statementsRichard Maw2012-03-291-1/+0
|
* fsutils.setup_device_mapping: use a regexRichard Maw2012-03-281-6/+8
| | | | | | | sfdisk may omit a space between the partition name and the : if the partition name is long, so splitting into tokens doesn't always work. This regex should work better
* Fix a few typos and so on.Jannis Pohlmann2012-03-231-7/+9
|
* morphlib: move filesystem stuff out of builderRichard Maw2012-03-231-0/+70
The system images will later need to be read, so useful commands want to be shared