Skip to content

Instantly share code, notes, and snippets.

@chuckwolber
Last active May 5, 2021 05:39
Show Gist options
  • Save chuckwolber/8d5fd45f6410c9a5775dbbf3bae69628 to your computer and use it in GitHub Desktop.
Save chuckwolber/8d5fd45f6410c9a5775dbbf3bae69628 to your computer and use it in GitHub Desktop.
Yocto Dunfell & Hardknott - intercept_scripts image failure workaround.
If you see something like this:
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/delay_to_first_boot ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/delay_to_first_boot')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/postinst_intercept ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/postinst_intercept')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_desktop_database ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_desktop_database')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_font_cache ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_font_cache')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_gio_module_cache ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_gio_module_cache')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_gtk_icon_cache ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_gtk_icon_cache')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_gtk_immodules_cache ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_gtk_immodules_cache')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_mime_database ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_mime_database')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_pixbuf_cache ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_pixbuf_cache')
WARNING: initramfs-image-1.0-r0 do_rootfs: copyfile: failed to chown/chmod /mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_udev_hwdb ([Errno 1] Operation not permitted: '/mnt/yocto/tmp-glibc/work/qemux86_64-linux/initramfs-image/1.0-r0/intercept_scripts-ab5fc79ba06afc73d1ce67ccc123856c4d86bbf03dd1452f9a641d94bec00f1d/update_udev_hwdb')
WARNING: initramfs-image-1.0-r0 do_rootfs: udev-hwdb.postinst returned 126, marking as unpacked only, configuration required on target.
This is the commit that caused it:
https://git.openembedded.org/openembedded-core/commit/meta/classes/image.bbclass?id=9463be2292b942a1072eea88881b9644e55aadb9&h=master
Go here to understand why this is happening:
https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/package_manager/__init__.py?8e7128b19588d9b7d5ddfab2277a0a0d79bc63ce#n173
The error occurs because of the copyfile on line 192. It is attempting to
change the ownership of a file to the root user, but this fails because of
the above commit that adds intercept_scripts to PSEUDO_IGNORE_PATHS means
the chown happens outside of the pseudo functionality.
Add this to your image recipe _after_ the core-image is imported to work around the problem.
python () {
pseudo_ignore_paths = d.getVar('PSEUDO_IGNORE_PATHS')
result = ','.join([x for x in pseudo_ignore_paths.split(',') if "intercept_scripts" not in x])
d.setVar('PSEUDO_IGNORE_PATHS', result)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment