1. 04 May, 2020 5 commits
    • topjohnwu's avatar
      Force init to load fstab from file in 2SI · dbf8c412
      topjohnwu authored
      Patching DTBs is proven to be difficult and problematic as there are
      tons of different formats out there. Adding support for all the formats
      in magiskboot has been quite an headache in the past year, and it still
      definitely does not cover all possible cases of them out there.
      
      There is another issue: fake dt fstabs. Some super old devices do not
      have device trees in their boot images, so some custom ROM developers
      had came up with a "genius" solution: hardcode fstab entries directly
      in the kernel source code and create fake device tree nodes even if
      Android 10+ init can graciously take fstab files instead (-_-) 。。。
      
      And there is YET another issue: DTBs are not always in boot images!
      Google is crazy enough to litter DTBs all over the place, it is like
      they cannot make up their minds (duh). This means the dt fstabs can be
      either concatnated after the kernel (1), in the DTB partition (2), in
      the DTBO partition (3), in the recovery_dtbo section in boot images (4),
      or in the dtb section in boot images (5). FIVE f**king places, how can
      anyone keep up with that!
      
      With Android 10+ that uses 2 stage inits, it is crutual for Magisk to
      be able to modify fstab mount points in order to let the original init
      mount partitions for us, but NOT switch root and continue booting. For
      devices using dt for early mount fstab, we used to patch the DTB at
      install time with magiskboot. However these changes are permanent and
      cannot be restored back at reinstallation.
      
      With this commit, Magisk will read dt fstabs and write them to ramdisk
      at boot time. And in that case, the init binary will also be patched
      to force it to NEVER use fstabs in device-tree. By doing so, we can
      unify ramdisk based 2SI fstab patching as basically we are just patching
      fstab files. This also means we can manipulate fstab whatever Magisk
      needs in the future without the need to going through the headache that
      is patching DTBs at installation.
      dbf8c412
    • topjohnwu's avatar
      Strip Huawei specific logic · 8c4fd759
      topjohnwu authored
      Users should manually switch to recovery mode instead
      8c4fd759
    • Chris Renshaw's avatar
      scripts: don't abort if /vendor fails to mount · 23dc19ad
      Chris Renshaw authored
      - /vendor is used only on some older devices for recovery AVBv1 signing so is not critical if fails
      - this fixes installation in Lineage Recovery on some older devices where /vendor is actually by-name partitions like oem, cust (or even cache), which likely also don't require the AVBv1 signing
      23dc19ad
    • topjohnwu's avatar
      More complete support for fstab in dt · 0c99c4d9
      topjohnwu authored
      0c99c4d9
    • topjohnwu's avatar
      Workaround realpath FORTIFY crashes · 8ab04533
      topjohnwu authored
      8ab04533
  2. 02 May, 2020 1 commit
  3. 01 May, 2020 1 commit
  4. 30 Apr, 2020 3 commits
  5. 26 Apr, 2020 1 commit
  6. 24 Apr, 2020 4 commits
  7. 23 Apr, 2020 1 commit
  8. 22 Apr, 2020 2 commits
  9. 21 Apr, 2020 5 commits
  10. 20 Apr, 2020 3 commits
  11. 19 Apr, 2020 9 commits
  12. 18 Apr, 2020 4 commits
    • topjohnwu's avatar
      Support injecting magisk bins · 69a9d748
      topjohnwu authored
      69a9d748
    • topjohnwu's avatar
      Directly filter '.' and '..' in xreaddir · dcf07ad8
      topjohnwu authored
      dcf07ad8
    • topjohnwu's avatar
      Rename file · ed6cdb2e
      topjohnwu authored
      ed6cdb2e
    • topjohnwu's avatar
      Introduce new module mount implementation · a73e7e9f
      topjohnwu authored
      Rewrite the whole module mounting logic from scratch.
      Even the algorithm is different compared to the old one.
      
      This new design focuses on a few key points:
      - Modular: Custom nodes can be injected into the mount tree.
        It's the main reason for starting the rewrite (needed for Android 11)
      - Efficient: Compared to the existing implementation, this is the most
        efficient (both in terms of computation and memory usage) design I
        currently can come up with.
      - Accurate: The old mounting logic relies on handling specifically every
        edge case I can think of. During this rewrite I actually found some
        cases that the old design does not handle properly. This new design is
        architected in a way (node types and its rankings) that it should
        handle edge cases all by itself when constructing mount trees.
      a73e7e9f
  13. 12 Apr, 2020 1 commit