From 717b8947d5501a8710b675c0dcc264efd2358341 Mon Sep 17 00:00:00 2001 From: Matti Hyttinen Date: Mon, 24 Feb 2020 17:49:56 +0200 Subject: [PATCH 1/2] Update main.py Unset GRUB_SAVEDEFAULT if / or /boot is in btrfs or f2fs partition. This avoids the error "sparse file not allowed" at boot time. Btrfs and f2fs do not support saving default entry in grub. --- src/modules/grubcfg/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/modules/grubcfg/main.py b/src/modules/grubcfg/main.py index 0df255e75..ef77b988c 100644 --- a/src/modules/grubcfg/main.py +++ b/src/modules/grubcfg/main.py @@ -72,6 +72,12 @@ def modify_grub_default(partitions, root_mount_point, distributor): swap_uuid = "" swap_outer_uuid = "" swap_outer_mappername = None + no_save_default = False + + for partition in partitions: + if partition["mountPoint"] in ("/", "/boot") and partition["fs"] in ("btrfs", "f2fs"): + no_save_default = True + break if have_plymouth: use_splash = "splash" @@ -191,6 +197,9 @@ def modify_grub_default(partitions, root_mount_point, distributor): # We're not updating because of *keepDistributor*, but if # this was a comment line, then it's still not been set. have_distributor_line = have_distributor_line or not lines[i].startswith("#") + # If btrfs or f2fs is used, don't save default + if no_save_default and lines[i].startswith("GRUB_SAVEDEFAULT="): + lines[i] = "#GRUB_SAVEDEFAULT=\"true\"" else: lines = [] From 0c8257df3def9cc4cd73f910bec2de4cf0abc74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 24 Feb 2020 18:22:32 +0100 Subject: [PATCH 2/2] [initcpio] Don't claim other swap From downstream ee99e34e25ed1224504bbef93fb41e5cad6b0ee8 --- src/modules/initcpiocfg/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index 621352fc5..3d570ff94 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -4,7 +4,7 @@ # === This file is part of Calamares - === # # Copyright 2014, Rohan Garg -# Copyright 2015,2019, Philip Müller +# Copyright 2015,2019-2020, Philip Müller # Copyright 2017, Alf Gaida # Copyright 2019, Adriaan de Groot # @@ -137,6 +137,10 @@ def modify_mkinitcpio_conf(partitions, root_mount_point): hooks.append("plymouth") for partition in partitions: + if partition["fs"] == "linuxswap" and not partition.get("claimed", None): + # Skip foreign swap + continue + if partition["fs"] == "linuxswap": swap_uuid = partition["uuid"] if "luksMapperName" in partition: