From mboxrd@z Thu Jan 1 00:00:00 1970 From: Atom2 Subject: Re: [PATCH OSSTEST 1/2] uboot: use "readlink -f" Date: Fri, 27 Mar 2015 17:31:26 +0100 Message-ID: <551585DE.20600@web2web.at> References: <1427197552-29042-1-git-send-email-wei.liu2@citrix.com> <1427197552-29042-2-git-send-email-wei.liu2@citrix.com> <1427448519.13935.73.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YbXAR-00070Z-PJ for xen-devel@lists.xenproject.org; Fri, 27 Mar 2015 16:31:31 +0000 In-Reply-To: <1427448519.13935.73.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , Wei Liu Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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.