Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-5857

Fix pseudo errors preventing both multiple image building and bootstrap artifact generation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: yocto-3.1-dunfell
    • Labels:
    • Sprint:
      MEN Sprint 171, MEN Sprint 172
    • Story Points:
      8
    • Backlog:
      yes
    • Days in progress:
      4

      Description

      Fix the same problems as poky have fixed in these commits:

      commit f85a4a1462bc2105f7c62f2b09c1d092c7677ada
      Author: Paul Barker <pbarker@konsulko.com>
      Date:   Tue Jan 19 17:26:08 2021
      
          wic: Update pseudo db when excluding content from rootfs
          
          To exclude content from the rootfs, wic makes a copy (using hardlinks if
          possible) of the rootfs directory and associated pseudo db, then removes
          files & directories as needed. However if these files and directories
          are removed using the python functions os.remove and shutil.rmtree, the
          copied pseudo db will not be updated correctly. For files copied from
          the original rootfs, if hardlinks were used successfully when copying
          the rootfs this should mean that the relevant inodes can't be reused and
          so the risk of pseudo aborts should be avoided. However, this logic
          doesn't apply for directories (as they can't be hardlinked) or for files
          added via the '--include-path' argument (as they weren't present in the
          original rootfs) and so there remains some risk of inodes being reused
          and the pseudo db becoming corrupted.
          
          To fix this, use the 'rm' command under pseudo when removing files &
          directories from the copied rootfs to ensure that the copied pseudo db
          is updated.
          
          (From OE-Core rev: d5db7e268947f0392c2126137571a44acd29ccd6)
          
          Signed-off-by: Paul Barker <pbarker@konsulko.com>
          Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
      
      commit 90164f0f3d713de70842317869343dd4a3ef5140
      Author: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
      Date:   Sun Apr 19 08:35:29 2020
      
          wic: Fix permissions when using exclude or include path
          
          When parameters include_path or exclude_path are passed to the rootfs
          plugin, it will copy the partition content into a folder and make all
          the modifications there.
          
          This is done using copyhardlinktree(), which does not take into
          consideration the content of the pseudo folder, which contains the
          information about the right permissions and ownership of the folders.
          
          This results in a rootfs owned by the user that is running the wic
          command (usually UID 1000), which makes some rootfs unbootable.
          
          This bug can be easily triggerd with the following .wks
          
          part / --source rootfs --fstype=ext4 --exclude-path=home
          
          And this sequence:
          
          $ wic create test-permissions -e core-image-minimal -o test/
          $ sudo mount test/test-permissions-202004080823-sda.direct.p1 /mnt
          $ ls -la /mnt/etc/shadow
          
          To fix this we copy the content of the pseudo folders to the new folder
          and modify the pseudo database using the "pseudo -B" command.
          
          If the rootfs is not a rootfs generated by bitbake a warning is shown
          making the user aware that the permissions on the target might not match
          what he expects.
          
          WARNING: /tmp/test/../pseudo folder does not exist. Usernames and permissions will be invalid
          
          Cc: Paul Barker <pbarker@konsulko.com>
          (From OE-Core rev: fd739c15cdba221d9d497d3402b7d929c0be2ca4)
          
          Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
          Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
      
      commit 6bac089383d725793485ab559209a1bbcaf2719e
      Author: Ricardo Ribalda Delgado <ricardo@ribalda.com>
      Date:   Wed Mar 4 15:49:35 2020
      
          wic: Fix permissions when using exclude or include path
          
          When parameters include_path or exclude_path are passed to the rootfs
          plugin, it will copy the partition content into a folder and make all
          the modifications there.
          
          This is done using copyhardlinktree(), which does not take into
          consideration the content of the pseudo folder, which contains the
          information about the right permissions and ownership of the folders.
          
          This results in a rootfs owned by the user that is running the wic
          command (usually UID 1000), which makes some rootfs unbootable.
          
          To fix this we copy the content of the pseudo folders to the new folder
          and modify the pseudo database using the "pseudo -B" command.
          
          (From OE-Core rev: 36993eea89d1c011397b7692b9b8d61b499d0171)
          
          Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
          Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              a10040 Kristian Amlie
              Reporter:
              a10040 Kristian Amlie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: