Skip to contentSkip to conversation

arago-image: make all symlinks relative in /boot

PATCH New Jacob Stiffler 1 participant 1 message May 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arago-image: make all symlinks relative in /boot

* In krogoth, the device trees are installed as symlinks to absolute paths within the filesystem.
* This breaks loading the device trees over NFS as the symlinks will not resolve on the NFS server.
* Therefore replace the ROOTFS_POSTPROCESS_COMMAND make_zimage_symlink_relative with a more general routine to make all symlinks in /boot relative.

---
 meta-arago-distro/recipes-core/images/arago-image.inc | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
meta-arago-distro/recipes-core/images/arago-image.inc +17 -1
index 7fb5726..af28cd0 100644
@@ -21,6 +21,22 @@ export IMAGE_BASENAME = "arago-image"
 
 IMAGE_LINGUAS = ""
 
-ROOTFS_POSTPROCESS_COMMAND += "make_zimage_symlink_relative;"
+make_bootfiles_symlinks_relative() {
+    for f in "${IMAGE_ROOTFS}/boot"/*
+    do
+        [ -L "$f" ] || continue
+
+        l=$(readlink "$f")
+        if [ "${l:0:6}" == "/boot/" ]
+        then
+            ln -sf "${l##/boot/}" "$f"
+        elif ["${l:0:1}" == "/" ]
+        then
+            ln -sf "..$l" "$f"
+        fi
+    done
+}
+
+ROOTFS_POSTPROCESS_COMMAND += "make_bootfiles_symlinks_relative;"
 
 inherit core-image
Signature · 1 line
2.7.4