54 Commits (fcf6e2fb25fded1c0b849094dbe2632ab121d09b)

Author SHA1 Message Date
Chrysostomus fcf6e2fb25 fix typos 4 years ago
Chrysostomus 092374d08c Add modified list to global storage 4 years ago
Chrysostomus f53f43ad03 Remove some unnecessary bits 4 years ago
Chrysostomus 4b6718b354 Further generalize subvolume handling 4 years ago
Chrysostomus 942221c764 Generalize subvolume handling 4 years ago
Chrysostomus 271122865f define global storage 4 years ago
Chrysostomus 727f7859b7 Mount @swap to /swap when needed 4 years ago
Chrysostomus b180cbd47d Generate a subvolume for swap if swapfile is used 4 years ago
Gaël PORTAY 6e9ce7194f [mount] Ignore unformatted filesystems only
Mount guesses the filesystem if it is unset or if it is set to auto,
thanks to blkid. That is the case for the bind mountpoints like /dev or
/run/udev in mount.conf. See `mount(8)` for more details.
4 years ago
Gaël PORTAY 163351a803 [mount] Ignore empty or unformatted filesystems 4 years ago
Gaël PORTAY c6feedf923 [mount] Ignore empty mountpoints 4 years ago
Gaël PORTAY 54fd1f4b26 [mount] Print a warning if mount failure
The return of the call to libcalamares.utils.mount is never tested and
it may fail silently; this causes some mounpoints to be missing.

This adds a warning if mountpoint cannot be mounted.

	chcon: failed to get security context of '/tmp/verity': Operation not supported
	06:44:23 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
	    Running "env" ("mount", "-t", "unformatted", "/dev/sdb2", "/tmp/calamares-root-kv8dqgb5/tmp/verity")
	    ..  Finished. Exit code: 32
	    ..  Target cmd: ("mount", "-t", "unformatted", "/dev/sdb7", "/tmp/calamares-root-kv8dqgb5/tmp/verity") output:
	 mount: /tmp/calamares-root-kv8dqgb5/tmp/verity: unknown filesystem type 'unformatted'.
4 years ago
Adriaan de Groot 1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
5 years ago
Adriaan de Groot 863a4cc2a4 REUSE: (GPL-3.0-or-later) Python modules 5 years ago
Adriaan de Groot 35fb8dcc27 [mount] Warn if chcon is missing, rather than fail
FIXES #1429
5 years ago
Adriaan de Groot 52af9dbaad [mount] Add docstrings to methods 6 years ago
Adriaan de Groot 395c375c60 [mount] Winnow partition list
- Simplify the iteration by first determining which partitions
   are mountable (at all).
 - This guards against the very rare case that a partition
   does not have a mountPoint at all (the if guarded against that)
   where the lambda passed to sort() would get a KeyError.
6 years ago
Arnaud Ferraris 257f5da1af mount: Use a single partitions list sorted by mount point
Instead of having a special case for extra mounts to be processed right
after the rootfs, a better approach is to add them to the partitions
list, and then sort the list by mount point.

This way, we make sure every partition is mounted right when it is
needed: `/` is obviously mounted first, `/run` is mounted before
`/run/udev`, and so on.

The overall process is therefore more generic and should suit all
use-cases.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris bf47e761b0 mount: Make sure extra mounts are mounted right after /
When the rootfs partition is read-only, mount points for the other
partitions cannot be created, therefore they need to be created in a
tmpfs, already mounted somewhere in `/`.

However, the extra mounts are only mounted at the end, which causes an
error as no tmpfs is currently mounted.

This patch makes sure all extra mounts are mounted right after the `/`
partition, allowing the use of a read-only rootfs.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Kevin Kofler ecc32ab9b6 [mount] Update copyright notice 6 years ago
Kevin Kofler 34083344a4 mount: copy the SELinux context of the host directory to the mountpoint
On systems with SELinux enabled, we have to create the directories on
top of which we mount another partition or virtual file system (e.g.,
/dev) with the correct SELinux context, BEFORE we mount the other
partition. Otherwise, SELinux will get really confused when systemd
tries to recreate the mount tree for a private file system namespace for
a service. And unfortunately, even an autorelabel does not fix it
because it runs when /dev etc. are already mounted.

Without this fix, on Fedora >= 30, the system installed with Calamares
would fail to start the dbus-broker system bus, leading to several
important pieces of functionality not working (e.g., shutdown as
non-root).

On systems without SELinux enabled, chcon (which is part of coreutils)
will just print a warning and do nothing, so this should always be safe.
6 years ago
Adriaan de Groot 7d0874e23b [mount] Bail on bad config
- One might argue whether an empty list of partitions to mount is
   a bad thing. It suggests that the partition module wasn't used,
   and so we're in an OEM situation -- but then everything should
   already be mounted anyway. That's why I choose empty -> bail.
6 years ago
Adriaan de Groot ff6a3608a6 [mount] [networkcfg] [openrcdmcryptcfg] Translate module name 6 years ago
Adriaan de Groot e4d67b5572 [mount] Handle missing configuration keys gracefully
- If a key is missing from mount.conf, don't raise KeyError
 - If both keys are missing, suggest that mount.conf might
   be missing instead (a consequence of INSTALL_CONFIG=OFF, for
   instance).
 - Simplify code a bit.
 - Don't bother returning None explicitly.
6 years ago
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https 7 years ago
Kai Dohmen 6f680c0269 Fix unknown partition-type Fat32 at mount and in fstab
Only the string "fat32" and "fat16" will be replaced with vfat. If an
case sensitive "Fat32" some problems occure:
- mount: partition cannot be mounted (e.g. a fat32 efi partition)
- fstab: system won't even boot because fstab does not know the type "Fat32"
8 years ago
Alf Gaida 5ed51bc5b0 reworked intendation 8 years ago
Alf Gaida 33b5cefebb Fixed pep8 whining in module mount
Added myself to copyright
8 years ago
Teo Mrnjavac e9ecb64a36 Special case for Btrfs root: create subvolumes and mount them. 9 years ago
Teo Mrnjavac db63109539 Mount correctly. 9 years ago
Teo Mrnjavac 5ddd0f523b Use luksMapperName as check. 9 years ago
Teo Mrnjavac f861c13dad Improve LUKS check and use luksUuid instead of uuid. 9 years ago
Teo Mrnjavac e1ee6e181a Proper check for luksMapperName key. 9 years ago
Teo Mrnjavac f5f73fbd4d Use the mapper name to mount if it's a LUKS partition. 9 years ago
Gormogon db7577b9f8 More PEP 10 years ago
Philip 016dd71db4 [mount] add python doc strings 10 years ago
Gormogon 113d9db7cb Python Better Docstrings 10 years ago
Gormogon 7989267e81 Unused Imports 10 years ago
Gormogon d8df3d7a59 [PEP 8] General Style Part 1 10 years ago
Gormogon 8e1480431a [PEP 263] Corrected Encoding Headers 10 years ago
Kevin Kofler e6d65d047b Fix unpackfs wrongly excluding separately-mounted partitions.
mount: Remember the extraMounts (and extraMountsEfi, if applicable) in
the global storage (as "extraMounts").

unpackfs: Read the extra mounts from the global storage to generate the
exclude list instead of trying to detect it from the "mount" command's
output, because the latter also includes normally-mounted destination
partitions.

This makes having separate partitions for non-/ mountpoints work again.
10 years ago
demmm c1a1399958 adding new bootloader job
options are to use grub for BIOS, gummiboot for efi
set extra mountpoint when efi is found
11 years ago
Teo Mrnjavac 51d12b2b35 The vfat driver apparently supports FAT16 too, be consistent. 11 years ago
Teo Mrnjavac 482b2c0da2 Fix fstype names for mount -t syntax. 11 years ago
Aurélien Gâteau 9708669ac7 Use libcalamares.utils.mount 11 years ago
Aurélien Gâteau 0946789f9e Move mounting of special partitions from grub to mount 11 years ago
Teo Mrnjavac 2ba96d3b6b PEPify mount 11 years ago
Teo Mrnjavac 4fc2efb7fa Correctly report exit status from Python modules. 11 years ago
Teo Mrnjavac beafcd9cc4 Consistency: calamares_main ==> run; global_storage => globalStorage 11 years ago
Aurélien Gâteau 20521f278c Update doc 11 years ago