summaryrefslogtreecommitdiff
path: root/Makefile-switchroot.am
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* Support mounting /sysroot (and /boot) read-onlyColin Walters2019-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to support extending the read-only state to cover `/sysroot` and `/boot`, since conceptually all of the data there should only be written via libostree. Or at least for `/boot` should *mostly* just be written by ostree. This change needs to be opt-in though to avoid breaking anyone. Add a `sysroot/readonly` key to the repository config which instructs `ostree-remount.service` to ensure `/sysroot` is read-only. This requires a bit of a dance because `/sysroot` is actually the same filesystem as `/`; so we make `/etc` a writable bind mount in this case. We also need to handle `/var` in the "OSTree default" case of a bind mount; the systemd generator now looks at the writability state of `/sysroot` and uses that to determine whether it should have the `var.mount` unit happen before or after `ostree-remount.service.` Also add an API to instruct the libostree shared library that the caller has created a new mount namespace. This way we can freely remount read-write. This approach extends upon in a much better way previous work we did to support remounting `/boot` read-write. Closes: https://github.com/ostreedev/ostree/issues/1265
* Makefile: declare ostree_boot_SCRIPTS and append valuesRicardo Salveti2019-11-061-1/+1
| | | | | | | | | ostree_boot_SCRIPTS was being set on both Makefile-boot.am and Makefile-switchroot.am, causing the first one to be replaced by the other at the final Makefile, so declare as empty and append on both places instead. Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
* prepare-root: Fix compilation with --with-static-compilerColin Walters2019-04-251-1/+1
| | | | | | | Closes: https://github.com/ostreedev/ostree/issues/1845 Closes: #1846 Approved by: akiernan
* ostree-prepare-root: Log journal message after finding deploymentJonathan Lebon2019-04-181-0/+5
| | | | | | | | | Log a structured journal message when resolving the deployment path. This will be used by the `rpm-ostree history` command to find past deployments the system has booted into. Closes: #1842 Approved by: cgwalters
* build: Use ostree_prepare_root_CPPFLAGS for ostree-prepare-rootAlex Kiernan2018-07-041-1/+1
| | | | | | | | | | | | Swap from AM_CPPFLAGS to ostree_prepare_root_CPPFLAGS when compiling ostree-prepare-root statically. This fixes a problem when you have systemd and libmount, but only ostree_prepare_root_CPPFLAGS includes -DHAVE_SYSTEMD_AND_LIBMOUNT=1. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Closes: #1670 Approved by: jlebon
* switchroot: Fix split source/build directoryAlex Kiernan2018-02-051-1/+1
| | | | | | | | | | If you have split source and build directories, then building static ostree-prepare-root fails to find the source files. https://github.com/ostreedev/ostree/issues/1429 Closes: #1445 Approved by: cgwalters
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* build: Add distcheck configure flags to fix systemd and bash-completionPhilip Withnall2017-08-221-0/+3
| | | | | | | | | | | | When running distcheck, the systemd system-generator and bash-completion scripts are installed in absolute paths (/usr and /lib) as looked up from their pkg-config files. This breaks distcheck. Use a ${prefix}-relative path for both of them when configuring for distcheck. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1103 Approved by: cgwalters
* Switch to using a systemd generator for /varColin Walters2017-05-161-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If one wants to set up a mount for `/var` in `/etc/fstab`, it won't be mounted since `ostree-prepare-root` set up a bind mount for `/var` to `/sysroot/ostree/$stateroot/var`, and systemd will take the already extant mount over what's in `/etc/fstab`. There are a few options to fix this, but what I settled on is parsing `/etc/fstab` in a generator (exactly like `systemd-fstab-generator` does), except here we look for an explicit mount for `/var`, and if one *isn't* found, synthesize the default ostree mount to the stateroot. Another nice property is that if an admin creates a `var.mount` unit in `/etc` for example, that will also override our mount. Note that today ostree doesn't hard depend on systemd, so this behavior only kicks in if we're built with systemd *and* libmount support (for parsing `/etc/fstab`). I didn't really test that case though. Initially I started writing this as a "pure libc" program, but at one point decided to use `libostree.so` to find the booted deployment. That didn't work out because `/boot` wasn't necessarily mounted and hence we couldn't find the bootloader config. A leftover artifact from this is that the generator code calls into libostree via the "cmd private" infrastructure. But it's an easy way to share code, and doesn't hurt. Closes: #859 Approved by: jlebon
* build: clean up ostree-remount if building without systemdSimon McVittie2016-11-291-0/+4
| | | | | | | | | This is necessary for "make distcheck" on Travis-CI. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Closes: #600 Approved by: cgwalters
* switchroot: Fix build on UbuntuWilliam Manley2016-09-011-1/+1
| | | | | | | | | | | | Was failing with error: src/switchroot/ostree-prepare-root.c:30:20: fatal error: config.h: No such file or directory compilation terminated. Reported by and fix provided by @gatispaeglis. Closes: #485 Approved by: cgwalters
* switchroot: Move `path_is_on_readonly_fs` to header fileWilliam Manley2016-08-301-11/+4
| | | | | | | | | | This simplifies the build system by removing the need for `libswitchroot-mountutil.la`. Original idea by @cgwalters in #477. Closes: #478 Approved by: cgwalters
* ostree-prepare-root: Allow building statically with muslWilliam Manley2016-08-301-3/+25
| | | | | | | | | | | | | | | | | | | | | If the `--with-static-compiler=musl-gcc` configure flag is given. ostree-prepare-root can be used as init in a system without a populated /lib. To support this use case we need to link statically as we will be unable to locate libc.so at run time if it's not installed in /lib. We support building ostree-prepare-root with a different compiler to the rest of ostree so we can use musl rather than glibc. This reduces the size of the executable significantly: from ~700K -> ~30K. We have to use `_SCRIPTS` here to get autotools to install this as an executable but without generating rules to make it itself which we have specified manually. See https://lists.gnu.org/archive/html/help-gnu-utils/2007-01/msg00007.html for advice on using autotools in this manner. Closes: #477 Approved by: cgwalters
* Move ostree-* executables to /usr/lib/ostreeGatis Paeglis2016-08-111-2/+4
| | | | | | | | | | | | | | | | | Why not to use libexecdir? Because this directory does not exist on some distros or paths between distros varies. There are several reasons why a well known path is prefered, for example when generating a kernel command line: init=${ostree}/usr/lib/ostree-boot/ostree-prepare-root In addition this saves us some typing in a console when wanting to access the "ostree" cmd line. Closes: #449 Approved by: cgwalters
* Add support for mkinitcpioDaniel Narvaez2013-10-241-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=710682
* Remove built in "triggers"Colin Walters2013-07-071-2/+0
| | | | | | | | | | | | | | | Originally, the idea was that clients would replicate "OS/tree"s from a build server, but we'd run things like "ldconfig" on the client. This was to allow adding e.g. the nVidia binary driver. However, the triggers were the only thing in the system at the moment that really had expected knowledge of the *contents* of the OS, like the location of binaries. For now, it's architecturally cleaner if we move the burden of triggers to the tree builder (e.g. gnome-ostree or RPM). Eventually we may want OSTree to assist with this type of thing (perhaps something like RPM %ghost), but this is the right thing to do now.
* [INCOMPATIBLE CHANGE] Implement new deployment modelColin Walters2013-07-071-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | See https://wiki.gnome.org/OSTree/DeploymentModel2 This is a major rework of the on-disk filesystem layout, and the boot process. OSTree now explicitly supports upgrading kernels, and these upgrades are also atomic. The core concept of the new model is the "deployment list", which is an ordered list of bootable operating system trees. The deployment list is reflected in the bootloader configuration; which has a kernel argument that tells the initramfs (dracut) which operating system root to use. Invidiual notable changes that come along with this: 1) Operating systems should now come with their etc in usr/etc; OSTree will perform a 3-way merge at deployment time, and place etc in the actual root. This avoids the need for a bind mount, and is just a lot cleaner. 2) OSTree no longer bind mounts /root, /home, and /tmp. It is expected that the the OS/ has these as symbolic links into /var. At the moment, OSTree only supports managing syslinux; other bootloader backends will follow.
* dracut: Add ostree-remountColin Walters2013-06-041-2/+17
| | | | | | | | | | | | | Linux creates a copy of the soure mount flags when creating a bind mount; if the source is read-only, then the bind mount is. The problem is that systemd will remount the rootfs read/write, but each mount (/home, /var etc.) will still be read-only. We need to remount every bind mount except for /usr to read-write too. This only "worked" with the old ostree-switch-root because it effectively force mounted the rootfs read-write always, ignoring the "ro" flag.
* ostree-prepare-root: New binary, used for systemd-in-initramfs setupsColin Walters2013-06-021-1/+4
| | | | | | Rather than attempting to hack up the "switch-root" functionality of systemd, this binary allows us to simply prepare the root before we switch into it.
* build: Add --enable-triggers-onlyColin Walters2012-08-261-0/+2
| | | | | For bootstrapping gnome-ostree, we need to install the triggers early on, before we actually build the real ostree binary.
* Add ostree-switch-root hereColin Walters2012-02-051-0/+22
Merge the code from ostree-init; now that we're back to targeting an initramfs (dracut), we don't need to statically link the binary, so there's no strong reason to have a separate module.