public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Chao Zeng <chao.zeng@siemens.com>, Le Jin <le.jin@siemens.com>,
	Christopher Larson <kergoth@gmail.com>
Subject: [PATCH v2 2/6] sdk: Make all links in the SDK chroot relative
Date: Sat, 28 Mar 2020 12:24:42 +0100	[thread overview]
Message-ID: <5176be74d9b8758bc8096c203aae528fd5495970.1585394686.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1585394686.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1585394686.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

This, in combination with interp and rpatch rewriting, will allow to use
the SDK outside of its chroot.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/image-sdk-extension.bbclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/meta/classes/image-sdk-extension.bbclass b/meta/classes/image-sdk-extension.bbclass
index b9f2cf4a..84ac9c6d 100644
--- a/meta/classes/image-sdk-extension.bbclass
+++ b/meta/classes/image-sdk-extension.bbclass
@@ -18,6 +18,20 @@ do_populate_sdk() {
     # Remove setup scripts
     sudo rm -f ${SDKCHROOT_DIR}/chroot-setup.sh ${SDKCHROOT_DIR}/configscript.sh
 
+    # Make all links relative
+    for link in $(find ${SDKCHROOT_DIR}/ -type l); do
+        target=$(readlink $link)
+
+        if [ "${target#/}" != "${target}" ]; then
+            basedir=$(dirname $link)
+            new_target=$(realpath --no-symlinks -m --relative-to=$basedir ${SDKCHROOT_DIR}/${target})
+
+            # remove first to allow rewriting directory links
+            sudo rm $link
+            sudo ln -s $new_target $link
+        fi
+    done
+
     # Copy mount_chroot.sh for convenience
     sudo cp ${ISARROOT}/scripts/mount_chroot.sh ${SDKCHROOT_DIR}
 
-- 
2.16.4


  parent reply	other threads:[~2020-03-28 11:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 11:24 [PATCH v2 0/6] Evolve SDK to chroot-free usage Jan Kiszka
2020-03-28 11:24 ` [PATCH v2 1/6] sdk: Add support for adding self-defined sdk packages Jan Kiszka
2020-06-08 10:22   ` Jan Kiszka
2020-06-12  9:34     ` Baurzhan Ismagulov
2020-06-12  9:54       ` Jan Kiszka
2020-06-12 10:05         ` Jan Kiszka
2020-06-12 10:30           ` Jan Kiszka
2020-06-22  8:09           ` Jan Kiszka
2020-03-28 11:24 ` Jan Kiszka [this message]
2020-03-28 11:24 ` [PATCH v2 3/6] sdk: Add script to relocate SDK Jan Kiszka
2020-03-28 11:24 ` [PATCH v2 4/6] sdk: Do not ship the isar-apt repo Jan Kiszka
2020-03-28 11:24 ` [PATCH v2 5/6] sdk: Inject sysroot path when calling relocated toolchain Jan Kiszka
2020-07-14 20:22   ` [PATCH v3 " Jan Kiszka
2020-08-31 16:32     ` Jan Kiszka
2020-09-21  9:27       ` Jan Kiszka
2020-09-21 10:05         ` Baurzhan Ismagulov
2020-09-21 11:47           ` Jan Kiszka
2020-03-28 11:24 ` [PATCH v2 6/6] sdk: Update README.sdk Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5176be74d9b8758bc8096c203aae528fd5495970.1585394686.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=chao.zeng@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=kergoth@gmail.com \
    --cc=le.jin@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox