Message ID | 1539922549-5432-1-git-send-email-haojian.zhuang@linaro.org |
---|---|
State | New |
Headers | show |
Series | [Linaro-uefi] atf-build.sh: fix to calculate atf version | expand |
On Fri, Oct 19, 2018 at 12:15:49PM +0800, Haojian Zhuang wrote: > commit 1a0f11213a539a5d0c5d05bfaa68ccc75cb340aa > Author: Soby Mathew <soby.mathew@arm.com> > Date: Mon Oct 1 16:16:34 2018 +0100 > > Update the version to 2.0 > > Change-Id: Icbc556d47a58d0870577b1bf1cd27cc5827fd56d > Signed-off-by: Soby Mathew <soby.mathew@arm.com> > > Since ARM Trusted Firmware version is updated to 2.0, the calculation > of ATF is wrong. It could only calculate version for 1.x. Whoops. > Update the calculation to support 2.x or n.x. > > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> > --- > atf-build.sh | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/atf-build.sh b/atf-build.sh > index fb80ad0..c6ec3e3 100755 > --- a/atf-build.sh > +++ b/atf-build.sh > @@ -25,9 +25,12 @@ function check_atf_buildver > MAJOR=`grep "^VERSION_MAJOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` > [ $? -ne 0 ] && return 1 > MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` > - [ $? -ne 0 ] && return 1 Why is this test deleted? This checks the command success, not the version number. > - if [ "$MAJOR" -eq 1 -a "$MINOR" -ge 2 ]; then > + if [ "$MAJOR" -eq 1 ]; then > + if [ "$MINOR" -ge 2 ]; then > + ATF_BUILDVER=2 > + fi > + else This bit is clearly a bugfix. / Leif > ATF_BUILDVER=2 > fi > } > -- > 2.7.4 >
On Fri, 19 Oct 2018 at 12:30, Leif Lindholm <leif.lindholm@linaro.org> wrote: > > On Fri, Oct 19, 2018 at 12:15:49PM +0800, Haojian Zhuang wrote: > > commit 1a0f11213a539a5d0c5d05bfaa68ccc75cb340aa > > Author: Soby Mathew <soby.mathew@arm.com> > > Date: Mon Oct 1 16:16:34 2018 +0100 > > > > Update the version to 2.0 > > > > Change-Id: Icbc556d47a58d0870577b1bf1cd27cc5827fd56d > > Signed-off-by: Soby Mathew <soby.mathew@arm.com> > > > > Since ARM Trusted Firmware version is updated to 2.0, the calculation > > of ATF is wrong. It could only calculate version for 1.x. > > Whoops. > > > Update the calculation to support 2.x or n.x. > > > > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> > > --- > > atf-build.sh | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/atf-build.sh b/atf-build.sh > > index fb80ad0..c6ec3e3 100755 > > --- a/atf-build.sh > > +++ b/atf-build.sh > > @@ -25,9 +25,12 @@ function check_atf_buildver > > MAJOR=`grep "^VERSION_MAJOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` > > [ $? -ne 0 ] && return 1 > > MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` > > - [ $? -ne 0 ] && return 1 > > Why is this test deleted? This checks the command success, not the version number. > When the version is 2.0, the MINOR variable is 0. If we keep checking at here, we'll get exit and ATF_BUILDVER keeps in 1. So we should only check MAJOR variable. Best Regards Haojian
On Fri, Oct 19, 2018 at 12:32:47PM +0800, Haojian Zhuang wrote: > On Fri, 19 Oct 2018 at 12:30, Leif Lindholm <leif.lindholm@linaro.org> wrote: > > > > On Fri, Oct 19, 2018 at 12:15:49PM +0800, Haojian Zhuang wrote: > > > commit 1a0f11213a539a5d0c5d05bfaa68ccc75cb340aa > > > Author: Soby Mathew <soby.mathew@arm.com> > > > Date: Mon Oct 1 16:16:34 2018 +0100 > > > > > > Update the version to 2.0 > > > > > > Change-Id: Icbc556d47a58d0870577b1bf1cd27cc5827fd56d > > > Signed-off-by: Soby Mathew <soby.mathew@arm.com> > > > > > > Since ARM Trusted Firmware version is updated to 2.0, the calculation > > > of ATF is wrong. It could only calculate version for 1.x. > > > > Whoops. > > > > > Update the calculation to support 2.x or n.x. > > > > > > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> > > > --- > > > atf-build.sh | 7 +++++-- > > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > > > diff --git a/atf-build.sh b/atf-build.sh > > > index fb80ad0..c6ec3e3 100755 > > > --- a/atf-build.sh > > > +++ b/atf-build.sh > > > @@ -25,9 +25,12 @@ function check_atf_buildver > > > MAJOR=`grep "^VERSION_MAJOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` > > > [ $? -ne 0 ] && return 1 > > > MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` > > > - [ $? -ne 0 ] && return 1 > > > > Why is this test deleted? This checks the command success, not the version number. > > > > When the version is 2.0, the MINOR variable is 0. If we keep checking > at here, we'll > get exit and ATF_BUILDVER keeps in 1. So we should only check MAJOR variable. I understand that. But why are you deleting a test for whether the grep command was successful? Regards, Leif
Fixed. Best Regards Haojian ________________________________ From: Leif Lindholm <leif.lindholm@linaro.org> Sent: Friday, October 19, 2018 12:37:33 PM To: Haojian Zhuang Cc: Linaro UEFI Mailman List; Ard Biesheuvel Subject: Re: [PATCH] atf-build.sh: fix to calculate atf version On Fri, Oct 19, 2018 at 12:32:47PM +0800, Haojian Zhuang wrote: > On Fri, 19 Oct 2018 at 12:30, Leif Lindholm <leif.lindholm@linaro.org> wrote: > > > > On Fri, Oct 19, 2018 at 12:15:49PM +0800, Haojian Zhuang wrote: > > > commit 1a0f11213a539a5d0c5d05bfaa68ccc75cb340aa > > > Author: Soby Mathew <soby.mathew@arm.com> > > > Date: Mon Oct 1 16:16:34 2018 +0100 > > > > > > Update the version to 2.0 > > > > > > Change-Id: Icbc556d47a58d0870577b1bf1cd27cc5827fd56d > > > Signed-off-by: Soby Mathew <soby.mathew@arm.com> > > > > > > Since ARM Trusted Firmware version is updated to 2.0, the calculation > > > of ATF is wrong. It could only calculate version for 1.x. > > > > Whoops. > > > > > Update the calculation to support 2.x or n.x. > > > > > > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> > > > --- > > > atf-build.sh | 7 +++++-- > > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > > > diff --git a/atf-build.sh b/atf-build.sh > > > index fb80ad0..c6ec3e3 100755 > > > --- a/atf-build.sh > > > +++ b/atf-build.sh > > > @@ -25,9 +25,12 @@ function check_atf_buildver > > > MAJOR=`grep "^VERSION_MAJOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` > > > [ $? -ne 0 ] && return 1 > > > MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` > > > - [ $? -ne 0 ] && return 1 > > > > Why is this test deleted? This checks the command success, not the version number. > > > > When the version is 2.0, the MINOR variable is 0. If we keep checking > at here, we'll > get exit and ATF_BUILDVER keeps in 1. So we should only check MAJOR variable. I understand that. But why are you deleting a test for whether the grep command was successful? Regards, Leif <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <meta name="Generator" content="Microsoft Exchange Server"> <!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style> </head> <body> <meta content="text/html; charset=utf-8"> <meta name="x_Generator" content="Microsoft Word 15 (filtered medium)"> <style> <!-- @font-face {font-family:"Cambria Math"} @font-face {font-family:DengXian} @font-face {} p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:11.0pt; font-family:DengXian} a:x_link, span.x_MsoHyperlink {color:blue; text-decoration:underline} a:x_visited, span.x_MsoHyperlinkFollowed {color:#954F72; text-decoration:underline} .x_MsoChpDefault {} @page WordSection1 {margin:72.0pt 90.0pt 72.0pt 90.0pt} div.x_WordSection1 {} --> </style> <div lang="ZH-CN" link="blue" vlink="#954F72"> <div class="x_WordSection1"> <p class="x_MsoNormal"><span lang="EN-US">Fixed.</span></p> <p class="x_MsoNormal"><span lang="EN-US" style="font-size:12.0pt"> </span></p> <p class="x_MsoNormal"><span lang="EN-US" style="font-size:12.0pt">Best Regards</span></p> <p class="x_MsoNormal"><span lang="EN-US" style="font-size:12.0pt">Haojian</span></p> <p class="x_MsoNormal"><span lang="EN-US"> </span></p> </div> <hr tabindex="-1" style="display:inline-block; width:98%"> <div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Leif Lindholm <leif.lindholm@linaro.org><br> <b>Sent:</b> Friday, October 19, 2018 12:37:33 PM<br> <b>To:</b> Haojian Zhuang<br> <b>Cc:</b> Linaro UEFI Mailman List; Ard Biesheuvel<br> <b>Subject:</b> Re: [PATCH] atf-build.sh: fix to calculate atf version</font> <div> </div> </div> </div> <font size="2"><span style="font-size:11pt;"> <div class="PlainText">On Fri, Oct 19, 2018 at 12:32:47PM +0800, Haojian Zhuang wrote:<br> > On Fri, 19 Oct 2018 at 12:30, Leif Lindholm <leif.lindholm@linaro.org> wrote:<br> > ><br> > > On Fri, Oct 19, 2018 at 12:15:49PM +0800, Haojian Zhuang wrote:<br> > > > commit 1a0f11213a539a5d0c5d05bfaa68ccc75cb340aa<br> > > > Author: Soby Mathew <soby.mathew@arm.com><br> > > > Date: Mon Oct 1 16:16:34 2018 +0100<br> > > ><br> > > > Update the version to 2.0<br> > > ><br> > > > Change-Id: Icbc556d47a58d0870577b1bf1cd27cc5827fd56d<br> > > > Signed-off-by: Soby Mathew <soby.mathew@arm.com><br> > > ><br> > > > Since ARM Trusted Firmware version is updated to 2.0, the calculation<br> > > > of ATF is wrong. It could only calculate version for 1.x.<br> > ><br> > > Whoops.<br> > ><br> > > > Update the calculation to support 2.x or n.x.<br> > > ><br> > > > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org><br> > > > ---<br> > > > atf-build.sh | 7 +++++--<br> > > > 1 file changed, 5 insertions(+), 2 deletions(-)<br> > > ><br> > > > diff --git a/atf-build.sh b/atf-build.sh<br> > > > index fb80ad0..c6ec3e3 100755<br> > > > --- a/atf-build.sh<br> > > > +++ b/atf-build.sh<br> > > > @@ -25,9 +25,12 @@ function check_atf_buildver<br> > > > MAJOR=`grep "^VERSION_MAJOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'`<br> > > > [ $? -ne 0 ] && return 1<br> > > > MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'`<br> > > > - [ $? -ne 0 ] && return 1<br> > ><br> > > Why is this test deleted? This checks the command success, not the version number.<br> > ><br> > <br> > When the version is 2.0, the MINOR variable is 0. If we keep checking<br> > at here, we'll<br> > get exit and ATF_BUILDVER keeps in 1. So we should only check MAJOR variable.<br> <br> I understand that.<br> But why are you deleting a test for whether the grep command was<br> successful?<br> <br> Regards,<br> <br> Leif<br> </div> </span></font> </body> </html>
diff --git a/atf-build.sh b/atf-build.sh index fb80ad0..c6ec3e3 100755 --- a/atf-build.sh +++ b/atf-build.sh @@ -25,9 +25,12 @@ function check_atf_buildver MAJOR=`grep "^VERSION_MAJOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` [ $? -ne 0 ] && return 1 MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` - [ $? -ne 0 ] && return 1 - if [ "$MAJOR" -eq 1 -a "$MINOR" -ge 2 ]; then + if [ "$MAJOR" -eq 1 ]; then + if [ "$MINOR" -ge 2 ]; then + ATF_BUILDVER=2 + fi + else ATF_BUILDVER=2 fi }