Skip to content
Snippets Groups Projects
  1. Apr 08, 2025
  2. Apr 02, 2025
  3. Mar 27, 2025
  4. Mar 14, 2025
  5. Feb 17, 2025
  6. Feb 11, 2025
  7. Feb 08, 2025
  8. Jan 31, 2025
  9. Jan 24, 2025
  10. Dec 30, 2024
    • Minecrell's avatar
      main/postmarketos-initramfs: skip mounting /boot if rootfs is in fstab (MR 5920) · 755132f6
      Minecrell authored and Clayton Craft's avatar Clayton Craft committed
      There is a special check in init_2nd.sh for older postmarketOS
      installations that do not have a valid /etc/fstab file. When /boot does not
      appear in fstab, it searches for the boot partition and mounts it manually.
      
      However, /boot might be intentionally omitted in fstab, e.g. because we
      just have a single rootfs partition that also contains /boot. In that case
      it will wait forever, trying to find the missing boot partition.
      
      The old installations do not have any entries in fstab, so fix this by
      checking if the file is empty instead (with all comments and whitespace
      removed).
      [ci:skip-build]: already built successfully in CI
      755132f6
    • Minecrell's avatar
      Revert "main/postmarketos-initramfs: mount subpartitions if root or boot is... · 2965a659
      Minecrell authored and Clayton Craft's avatar Clayton Craft committed
      Revert "main/postmarketos-initramfs: mount subpartitions if root or boot is missing (MR 5625)" (MR 5920)
      
      This reverts commit 1259d74b.
      
      The main reason why that change was necessary is because we skipped
      mounting subpartitions entirely if we found a potential root partition
      (which could be simply a crypto_LUKS partition from a different distro).
      Now that we look only for the actual root partition (based on the UUID),
      this should not happen anymore.
      
      Checking both conditions causes delays if there is no boot partition,
      e.g. if pmOS was installed with --single-partition. Usually we don't need
      to mount the boot partition anymore, because all needed files are part of
      the initramfs. So let's drop the check for the boot partition again and
      rely on the UUIDs to ensure we set up the correct partitions.
      2965a659
    • Minecrell's avatar
      main/postmarketos-initramfs: mount root partition we unlocked (MR 5920) · 033d5f79
      Minecrell authored and Clayton Craft's avatar Clayton Craft committed
      When using an encrypted installation of postmarketOS, the pmos_root_uuid=
      on the cmdline only tells us the UUID of the crypto_LUKS partition. Once
      the partition is unlocked, we perform the the old unreliable auto detection
      again. This might mount the wrong partition if multiple installations of
      pmOS are attached to the system.
      
      After we unlock the root partition, we know exactly where the root
      partition is supposed to be (= at /dev/mapper/root). Let's use that
      directly instead of going through the whole detection sequence again.
      033d5f79
    • Minecrell's avatar
      main/postmarketos-initramfs: don't fallback looking for root when given UUID or path (MR 5920) · e5a1370d
      Minecrell authored and Clayton Craft's avatar Clayton Craft committed
      Right now we fallback to the old behavior of searching for the "pmOS_root"
      label when the root partition specified by pmos_root_uuid= on the cmdline
      is not found. This works fine most of the time, but there are edge cases in
      which this does not behave correctly. Problems occur especially if there
      are multiple installations of pmOS (e.g. one on internal storage, and one
      on USB drive/SD card). Depending on timing or enumeration order, the system
      might boot into the wrong rootfs if the intended root partition shows up
      too late.
      
      For the boot partition we already enforce the UUID provided on the cmdline.
      Let's apply the same for the root partition to ensure we always boot into
      the correct root partition.
      e5a1370d
  11. Dec 17, 2024
    • Minecrell's avatar
      main/postmarketos-initramfs: add cmdline to expose specific USB storage (MR 5912) · 35c98d44
      Minecrell authored and Alexey Minnekhanov's avatar Alexey Minnekhanov committed
      In addition to the pmos.debug-shell cmdline argument, add
      pmos.usb-storage=<block-device> to set up the USB mass storage gadget by
      default when going into debug shell. This allows building a special boot
      image/option that directly exposes the storage for flashing, without having
      to type in extra debug-shell commands.
      35c98d44
    • Minecrell's avatar
      main/postmarketos-initramfs: unify setup_usb_storage (MR 5912) · ce05d2d8
      Minecrell authored and Alexey Minnekhanov's avatar Alexey Minnekhanov committed
      Right now we have two similar implementations of setting up a USB mass
      storage gadget, in init_functions.sh and as separate script for the
      debug-shell. Given that init_functions.sh is available in debug-shell
      anyway, unify both in a common setup_usb_storage_configfs() function.
      
      Having this included in the initramfs debug-shell by default (without
      installing postmarketos-mkinitfs-hook-debug-shell) also simplifies
      recovery, since you can set up the USB storage for repairing the flashed
      postmarketOS installation in case of boot failures. The size overhead is
      minimal, since this has no extra dependencies.
      ce05d2d8
  12. Dec 16, 2024
    • Minecrell's avatar
      main/postmarketos-initramfs: resize btrfs after mount (MR 5844) · f9174c6d
      Minecrell authored and Oliver Smith's avatar Oliver Smith committed
      BTRFS only supports online resizing. Right now we implement that by
      temporarily mounting the file system, resizing it, and then unmounting it
      again. But most of this is redundant since we mount the rootfs at /sysroot
      immediately after.
      
      Avoid this by splitting the file system resizing in offline resize (before
      mount) and online resize (after mount) and resize BTRFS after mounting
      /sysroot. For EXT4 we can either do offline resizing or online resizing.
      Keep offline resizing for now for better compatibility with older kernels.
      F2FS does not seem to support online resizing, so we need to keep the
      functionality for offline resizing anyway.
      
      Drop the splash for now, since it would introduce flickering on each boot.
      We can restore it later if needed (ideally by adding a way to update the
      splash message without restarting pbsplash).
      f9174c6d
    • Minecrell's avatar
      main/postmarketos-initramfs: don't resize ext4 with fsck errors (MR 5844) · 8e2ce06a
      Minecrell authored and Oliver Smith's avatar Oliver Smith committed
      Right now we use the resize2fs -f (force) option, which "Forces resize2fs
      to proceed with the filesystem resize operation, overriding some safety
      checks which resize2fs normally enforces." For example, this flag instructs
      resize2fs to attempt resizing file systems with errors in some situations.
      
      We primarily care about resizing the file system on initial boot, where we
      shouldn't have any errors in the file system. For all other subsequent
      boots, we shouldn't risk the filesystem data just to resize it again.
      So let's drop the -f flag and only resize clean file systems.
      8e2ce06a
    • Minecrell's avatar
      main/postmarketos-initramfs: always resize rootfs during boot (MR 5844) · 892d5bb1
      Minecrell authored and Oliver Smith's avatar Oliver Smith committed
      At the moment, the root file system is only resized to span the entire
      partition if we previously also resized the partition itself. However, if
      a rootfs image without subpartitions is flashed to a pre-existing partition
      this means that the installation only has very limited space available
      without manual resizing.
      
      Such a setup is used for devices using the "fastboot-bootpart" flasher
      (e.g. asus-me176c), where boot and root images are flashed to two separate
      partitions and the device boots directly from the boot partition.
      
      Avoid this problem on these devices by always resizing the root file system
      on each boot. All the resize tools exit early if the file system is already
      expanded to the maximum size. It's faster to call resize2fs unconditionally
      instead of manually checking if the file system needs resizing before.
      Similar tooling like systemd-growfs also resizes unconditionally.
      892d5bb1
  13. Dec 10, 2024
  14. Dec 05, 2024
    • Minecrell's avatar
      main/postmarketos-initramfs: start mdev/udev before setting up USB (MR 5852) · 85e0c1f0
      Minecrell authored and Oliver Smith's avatar Oliver Smith committed
      There might be additional kernel modules needed for the USB UDC to show up.
      This used to work fine, but broke when the initramfs was unified with the
      minimal one. We need to load modules/start udev before setting up USB.
      
      Fix this by duplicating the setup calls in both init.sh and init_2nd.sh.
      Both calls already have checks to allow calling them multiple times,
      so we don't need to handle the initramfs-extra case in a special way.
      [ci:skip-build]: already built successfully in CI
      85e0c1f0
  15. Nov 27, 2024
  16. Nov 21, 2024
    • Minecrell's avatar
      main/postmarketos-initramfs: add missing USB gadget modules (MR 5795) · 22f96f6d
      Minecrell authored
      init_functions.sh makes use of the mass_storage and acm USB gadget
      functions for error reporting, but the necessary kernel modules are not
      included in the initramfs at the moment. Because of this, the functionality
      works only on kernels where all these USB gadget functions are built-in and
      not built as modules.
      
      Add the missing modules and fix the sort order while at it.
      
      [ci:skip-build]: bug in CI prevents build testing armv7, succeeded locally
      22f96f6d
  17. Nov 06, 2024
  18. Nov 05, 2024
  19. Nov 01, 2024
  20. Oct 31, 2024
Loading