Commit Graph

6228 Commits

Author SHA1 Message Date
Dan Bungert edde096540 filesystem: capability flags in a specific order
Show DIRECT first, list CORE_BOOT ones later.
LP: #2033244
2023-08-28 19:02:26 -06:00
Dan Bungert f440e6dd1f
Merge pull request #1773 from dbungert/zfsutils-linux
install zfsutils-linux if needed
2023-08-28 18:38:46 -06:00
Dan Bungert 0bbec68bd9 installdeps: use confnew to workaround upgrade 2023-08-28 12:59:24 -06:00
Dan Bungert ad881dc948 pkghelper: dry run handling 2023-08-28 12:59:24 -06:00
Dan Bungert 18710aef48 runtests: +zfs 2023-08-28 12:59:24 -06:00
Dan Bungert 67102261c3 install: live pkgs can be installed in parallel
Split packages that must be done early from ones that can be done
in parallel with early install steps.
2023-08-28 12:59:24 -06:00
Dan Bungert 96c0c91d8a storage: trigger zfsutils-linux install if zpools
pre-Mantic installs can now zfsroot without autoinstall workarounds.
2023-08-25 16:35:56 -06:00
Dan Bungert aa27b33820 generalize live system package install
Add live_packages model method where install models may specify
packages needed in the live system.  Move efibootmgr there.
2023-08-25 16:35:50 -06:00
Dan Bungert ff990df628 storage: move reset_partition to model 2023-08-25 16:25:34 -06:00
Dan Bungert 443c87dc91
Merge pull request #1771 from dbungert/esb-feature-flag
several: add --no-enhanced-secureboot flag
2023-08-25 12:33:12 -06:00
Dan Bungert 5cdf879a55 several: add --no-enhanced-secureboot flag
It disables all core boot types really.  But this is the only planned core boot type at
this point.
2023-08-25 12:07:55 -06:00
Dan Bungert 05892f41c7
Merge pull request #1770 from dbungert/zfs-zsys-datasets
Create zpools / zfs datasets like ubiquity does
2023-08-25 07:17:24 -06:00
Dan Bungert fc3f179b99
Merge pull request #1769 from dbungert/bind-patch
scripts: add bind-patch.sh
2023-08-24 20:56:36 -06:00
Dan Bungert c652bde6f1 filesystem: create zpools/zfses like zsys-setup 2023-08-24 17:42:09 -06:00
Dan Bungert 65bd6752fa filesystem: add create_zfs helper 2023-08-24 17:42:09 -06:00
Dan Bungert ee589e34f1 filesystem: support default_features 2023-08-24 17:42:09 -06:00
Dan Bungert c73fac697e utils: add gen_zsys_uuid
Add gen_zsys_uuid, to generate a uuid of the same form as used in the
ubiquity zsys-setup script.
2023-08-24 17:42:09 -06:00
Dan Bungert c7eea37546 curtin: rev for zpool `key: null` syntax 2023-08-24 17:42:09 -06:00
Dan Bungert 451a9f3eb8
Merge pull request #1768 from dbungert/core-no-network
models: if core, do not require network
2023-08-21 15:32:32 -06:00
Michael Hudson-Doyle 76979c5fcf
Merge pull request #1765 from mwhudson/gap-min-size
Use the first fitting gap for ESP, instead of the largest gap
2023-08-22 09:22:04 +12:00
Dan Bungert 6cd151d249 scripts: add bind-patch.sh
scripts/bind-patch.sh is useful for modifying the snap in the live
environment, for quickly testing changes or for things that are too
obscure to test in other ways.
2023-08-21 11:42:24 -06:00
Dan Bungert b74d365915 models: if core, do not require network 2023-08-21 09:46:04 -06:00
Olivier Gayot a23755268a
Merge pull request #1767 from ogayot/fix-wants-oem-kernel
oem: fix IndexError when using OEMController.wants_oem_kernel
2023-08-18 13:04:16 +02:00
Olivier Gayot bf42341155 oem: fix IndexError when using OEMController.wants_oem_kernel
Traceback (most recent call last):
    File "subiquity/server/controllers/oem.py", line 161, in load_metapackages_list
      self.model.metapackages = [
    File "subiquity/server/controllers/oem.py", line 164, in <listcomp>
      wants_oem_kernel=await self.wants_oem_kernel(
    File "subiquity/server/controllers/oem.py", line 115, in wants_oem_kernel
      flavor = line.split("=", maxsplit=1)[1].strip()
  IndexError: list index out of range

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-08-18 12:26:20 +02:00
Michael Hudson-Doyle 778516a75c rename new function to first_gap_with_size 2023-08-18 15:29:20 +12:00
Michael Hudson-Doyle fc06fc0488 remove redundant logic 2023-08-18 15:27:29 +12:00
Michael Hudson-Doyle 7367a373ec Use the first fitting gap for ESP, instead of the largest gap 2023-08-17 16:43:49 +12:00
Michael Hudson-Doyle f338cfed64 add "in_extended" awareness to gap_with_size 2023-08-17 16:43:49 +12:00
Michael Hudson-Doyle 2abdfb5a48 add gap_with_size function to find a gap of a given size 2023-08-17 16:43:43 +12:00
Michael Hudson-Doyle 57c8a1a861
Merge pull request #1761 from mwhudson/rp-hacky-fixes
several fixes around reset partition handling
2023-08-17 14:53:29 +12:00
Michael Hudson-Doyle f86a1ef789 Merge Yao's fixes again. 2023-08-17 14:33:20 +12:00
Michael Hudson-Doyle 051b6cba12 extract code into a method to improve clarify, add comments 2023-08-17 14:23:16 +12:00
Michael Hudson-Doyle eb40871631
Merge pull request #5 from medicalwei/rp-hacky-fixes
Fixing some fixes regarding to RP
2023-08-15 10:44:14 +12:00
Yao Wei (魏銘廷) 9c37efd534 fix: call update-grub after closing 99_reset 2023-08-14 17:46:55 +08:00
Yao Wei (魏銘廷) e0e2515eb5 fix: put EFI boot entry of recovery partition last of boot order 2023-08-14 17:46:13 +08:00
Yao Wei (魏銘廷) 3716f1259f fix: fix calling partition_by_partuuid 2023-08-14 17:45:36 +08:00
Michael Hudson-Doyle 92f793ee9b simplify partition_by_partuuid 2023-08-14 09:12:47 +12:00
Michael Hudson-Doyle 1ab061f8d8 fix boot entry creation to use actual removable media path 2023-08-14 09:10:37 +12:00
Michael Hudson-Doyle 47dc10c0c6 several fixes around reset partition handling
1. adjust the RP to use a different casper uuid, to avoid confusing when
   install media is still present
2. record the partuuid of the RP on the kernel command line when booted
   from there so subiquity knows to add a grub boot entry pointing to it
   in this case
3. fix generating the grub boot entry pointing to the RP as this was
   broken in a few ways
4. get the logic the right way around to only set BootNext in
   reset-partition-only case
2023-08-14 09:08:17 +12:00
Michael Hudson-Doyle 45ee68116c
Merge pull request #1762 from mwhudson/curtin-update
update curtin, and add 'uuid' attribute to Partition objects
2023-08-11 07:36:51 +12:00
Michael Hudson-Doyle c028390a71 update curtin, and add 'uuid' attribute to Partition objects 2023-08-10 16:56:48 +12:00
Olivier Gayot fdbcd402b9
Merge pull request #1759 from ogayot/fix-manual-size
filesystem: store the actual size in bytes alongside the human readable size
2023-08-09 17:27:20 +02:00
Olivier Gayot cda6c54b87 filesystem: store the actual size in bytes alongside the human readable size
Currently, the partition form stores the size as a human readable value.
(e.g., 123456K, 1.1G, 1.876G, 100G). When we exit the size field (i.e., upon
losing focus), we convert the value to a number of bytes and then align
it up to the nearest MiB (or whatever the alignment requirement is).

Unfortunately, after computing the aligned value, we turn it back into a
human-readable string and store it as is. It is not okay because the
conversion does not ensure that the alignment requirement is still
honored.

For instance, if the user types in 1.1G, we do the following:

 * convert it to a number of bytes -> 1181116006.4 (surprise, it is not
   even an integer).

 * round it up to the nearest MiB -> 1181745152 (this is the correct
   value)

 * transform it into a human readable string and store it as is -> 1.1G
   - which actually corresponds to the original value.

This leads to an exception later when creating the partition:

    File "subiquity/models/filesystem.py", line 1841, in add_partition
      raise Exception(
   Exception: ('size %s or offset %s not aligned to %s', 1181116006, 1048576, 1048576)

Fixed by storing the actual size as a number of bytes - alongside the
human readable size.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-08-09 16:50:03 +02:00
Michael Hudson-Doyle b0f10300eb
Merge pull request #1758 from mwhudson/bootnext-rp
preserve old loaders, and set bootnext to rp
2023-08-09 10:52:55 +12:00
Michael Hudson-Doyle bdde2c142f
Merge pull request #1757 from mwhudson/persist-rich-mode
persist rich mode across updates
2023-08-08 21:32:38 +12:00
Michael Hudson-Doyle b2d112667f set bootnext to RP in reset-partition-only case 2023-08-08 21:25:26 +12:00
Michael Hudson-Doyle d2fb4cfa80 do not remove old UEFI loaders 2023-08-08 21:22:26 +12:00
Michael Hudson-Doyle a4c924f1f9 persist rich mode across updates 2023-08-08 14:16:36 +12:00
Michael Hudson-Doyle ce9a130f37 make initial setup of rich mode less confusing 2023-08-08 14:07:10 +12:00
Michael Hudson-Doyle 17e5aae5ab
Merge pull request #1756 from mwhudson/lp-2030478
fix setting a password for the live session user
2023-08-08 12:34:43 +12:00