From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH OSSTEST 1/2] uboot: use "readlink -f" Date: Fri, 27 Mar 2015 17:06:13 +0000 Message-ID: <1427475973.13935.193.camel@citrix.com> 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> <551585DE.20600@web2web.at> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YbXi6-0006oM-Ue for xen-devel@lists.xenproject.org; Fri, 27 Mar 2015 17:06:19 +0000 In-Reply-To: <551585DE.20600@web2web.at> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Atom2 Cc: xen-devel@lists.xenproject.org, Wei Liu , ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2015-03-27 at 17:31 +0100, Atom2 wrote: > 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")}" Modulo the quoting of the shell-within-Perl we are dealing with here I think it might, yes. Thanks. > 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. No worries.