From 528e43991c689b9ab93a3a4c30391d4f35a929c6 Mon Sep 17 00:00:00 2001 From: Daniel Rossier Date: Wed, 2 Dec 2026 11:36:18 +0100 Subject: [PATCH] usr-linux: copy into the extracted rootfs through its real path rsync 3.2.7-1ubuntu1.5 refuses, as root, to follow a symlink owned by an ordinary user. rootfs/fs is the builder's symlink to WORKDIR/fs, so the rootfs.cpio deploy stopped with "refusing to follow a symlink owned by an untrusted user". Resolve the symlink first and hand rsync the directory. --- build/meta-usr/recipes-usr/linux/usr-linux_1.0.bb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/meta-usr/recipes-usr/linux/usr-linux_1.0.bb b/build/meta-usr/recipes-usr/linux/usr-linux_1.0.bb index 675f61cdb..4e8430b66 100644 --- a/build/meta-usr/recipes-usr/linux/usr-linux_1.0.bb +++ b/build/meta-usr/recipes-usr/linux/usr-linux_1.0.bb @@ -102,9 +102,14 @@ python do_deploy() { # starts over from it. # # -rlt, not -a: see the p2 copy below. + # + # rootfs/fs is the builder's symlink to WORKDIR/fs, and rsync run as + # root refuses to follow a symlink an ordinary user owns: hand it the + # resolved directory. + try: - utils_sudo(["rsync", "-rlt", "--keep-dirlinks", - deploy_src + "/", f"{IB_ROOTFS_PATH}/fs/"], check=True) + utils_sudo(["rsync", "-rlt", "--keep-dirlinks", deploy_src + "/", + os.path.realpath(f"{IB_ROOTFS_PATH}/fs") + "/"], check=True) except Exception: utils_sudo(["rm", "-rf", os.path.join(d.getVar('WORKDIR'), "fs")]) raise