All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atom2 <ariel.atom2@web2web.at>
To: Ian Campbell <ian.campbell@citrix.com>, Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com
Subject: Re: [PATCH OSSTEST 1/2] uboot: use "readlink -f"
Date: Fri, 27 Mar 2015 17:31:26 +0100	[thread overview]
Message-ID: <551585DE.20600@web2web.at> (raw)
In-Reply-To: <1427448519.13935.73.camel@citrix.com>

Am 27.03.15 um 10:28 schrieb Ian Campbell:
> Unfortunately this has unexpectedly made things worse. See:
> http://www.chiark.greenend.org.uk/~xensrcts/logs/36757/
>
> The issue is that readlink -f returns the full absolute path, so given
>      $ ls /boot/xen*
>      xen -> xen-X.Y
>      xen-X.Y
> Then:
>      $ readlink /boot/xen
>      xen-X.Y
>      $ readlink -f /boot/xen
>      /boot/xen-X.Y
>
> This breaks because on these systems /boot is a separate partition, so
> from the bootloaders point of view we need to be accessing /xen-X.Y
> not /boot/xen-X.Y.
>
> I don't know of an easy way to get the path of a file relative to the
> filesystem root which contains it. So I would propose to drop the second
> hunk and the second paragraph of the commit message and to make the
> first hunk simply "flaskpolicy=$flaskpolicy" (rather than unescaping the
> usages, this will make it easier to change in the future).
>
> I think that resubmission will end up being to the new colo at this
> point.
>
Hi Ian,
wouldn't the following snippet of code actually achieve what you want:

mylink="$(readlink -f /boot/xen)"
relpath="${mylink#$(stat -c "%m" "$mylink")}"

Regards Atom2

P.S. I know I still owe you the 64bit stat counter changes.
I haven't forgotten about it, but have not been able to dig into it yet.

  parent reply	other threads:[~2015-03-27 16:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 11:45 [PATCH OSSTEST 0/2] Uboot patches for XSM test case Wei Liu
2015-03-24 11:45 ` [PATCH OSSTEST 1/2] uboot: use "readlink -f" Wei Liu
2015-03-24 12:23   ` Ian Campbell
2015-03-27  9:28   ` Ian Campbell
2015-03-27 10:46     ` [PATCH OSSTEST v2 1/2] uboot: do not use readlink on xsm policy Ian Campbell
2015-03-31 12:27       ` Ian Jackson
2015-03-27 10:46     ` [PATCH OSSTEST v2 2/2] uboot: make flask loading address host property Ian Campbell
2015-03-27 16:31     ` Atom2 [this message]
2015-03-27 17:06       ` [PATCH OSSTEST 1/2] uboot: use "readlink -f" Ian Campbell
2015-03-24 11:45 ` [PATCH OSSTEST 2/2] uboot: make flask loading address host property Wei Liu
2015-03-24 12:23   ` Ian Campbell
2015-03-25 10:18   ` Ian Campbell
2015-03-27 14:54   ` Ian Campbell

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=551585DE.20600@web2web.at \
    --to=ariel.atom2@web2web.at \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.