All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hu <robert.hu@vmm.sh.intel.com>
To: robert.hu@intel.com
Cc: "Pang, LongtaoX" <longtaox.pang@intel.com>,
	ian.jackson@eu.citrix.com, Ian Campbell <ian.campbell@citrix.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [osstest test] 56922: regressions - FAIL
Date: Sat, 23 May 2015 16:53:43 +0800	[thread overview]
Message-ID: <1432371223.12629.11.camel@localhost> (raw)
In-Reply-To: <1432369911.12629.5.camel@localhost>

On Sat, 2015-05-23 at 16:31 +0800, Robert Hu wrote:
> On Fri, 2015-05-22 at 15:21 +0100, Ian Campbell wrote:
> > On Fri, 2015-05-22 at 14:42 +0100, Ian Campbell wrote:
> > > From my particular grub.cfg. For real usage setupboot_grub2 will
> > > obviously need to become cleverer to count things correctly.
> > 
> > I've not tested extensively but the following incremental patch seems to
> > do the right thing, at least by inspection of the resulting grub.cfg.
> > 
> > Needs more testing (e.g. I haven't tried non-XSM yet) and review from
> > Ian I think, since there may be a more idiomatically Perl way to
> > manipulate the @offsets array (in particular shrinking it).
Carefully read your code and I think they can handle submenu (even
submenu in a submenu) correctly. Thanks for correcting my previous
implementation.
Just my 2 cents below inline.
> > 
> > Ian.
> > 
> > diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
> > index 282175b..b5148fd 100644
> > --- a/Osstest/Debian.pm
> > +++ b/Osstest/Debian.pm
> > @@ -393,8 +393,6 @@ sub setupboot_grub1 ($$$$) {
> >  # Note on running OSSTest on Squeeze with old Xen kernel: check out
> >  # Debian bug #633127 "/etc/grub/20_linux does not recognise some old
> >  # Xen kernels"
> > -# Currently setupboot_grub2 relies on Grub menu not having submenu.
> > -# Check Debian bug #690538.
> >  sub setupboot_grub2 ($$$$) {
> >      my ($ho,$want_kernver,$want_xsm,$xenhopt,$xenkopt) = @_;
> >      my $bl= { };
> > @@ -405,7 +403,7 @@ sub setupboot_grub2 ($$$$) {
> >      my $parsemenu= sub {
> >          my $f= bl_getmenu_open($ho, $rmenu, "$stash/$ho->{Name}--grub.cfg.1");
> >      
> > -        my $count= 0;
> > +        my @offsets = (0);
> >          my $entry;
> >          my $submenu;
> >          while (<$f>) {
> > @@ -417,6 +415,8 @@ sub setupboot_grub2 ($$$$) {
> >                          "$submenu->{StartLine}. ".
> >                          "Our want kern is $want_kernver");
> >                      $submenu=undef;
> > +                    $#offsets = $#offsets-1;
> > +                    $offsets[$#offsets]++;
may consider 'pop/push' operations on @offsets array? I worry about if
'$#offsets-1' can always shrink array size correctly. pop/push anyway is
some official way to do this.
> >                      next;
> >                  }
> >                  my (@missing) =
> > @@ -446,11 +446,12 @@ sub setupboot_grub2 ($$$$) {
> >              }
> >              if (m/^menuentry\s+[\'\"](.*)[\'\"].*\{\s*$/) {
> >                  die $entry->{StartLine} if $entry;
> > -                $entry= { Title => $1, StartLine => $., Number => $count };
> > -                $count++;
> > +                $entry= { Title => $1, StartLine => $., MenuEntryPath => join ">", @offsets };
> > +                $offsets[$#offsets]++;
> >              }
> >              if (m/^submenu\s+[\'\"](.*)[\'\"].*\{\s*$/) {
> > -                $submenu={ StartLine =>$.};
> > +                $submenu={ StartLine =>$., MenuEntryPath => join ">", @offsets };
Here MenuEntryPath element for $submenu is actually debug purpose only,
I think, may be can remove it. correct me if I'm wrong.
> > +                $offsets[$#offsets+1] = 0;
> I see your points now.
> Seems you even considers nested submenu in the future.:)
> Just 1 question (I'm not a Perl expert): after "$offsets[$#offsets+1] =
> 0;", $#offsets increases automatically/implicitly, right?
> >              }
> >              if (m/^\s*multiboot\s*(?:\/boot)?\/(xen\S+)/) {
> >                  die unless $entry;
> > @@ -511,7 +512,7 @@ sub setupboot_grub2 ($$$$) {
> >              }
> >              print ::EO <<END or die $!;
> >  
> > -GRUB_DEFAULT=$entry->{Number}
> > +GRUB_DEFAULT="$entry->{MenuEntryPath}"
> >  END
> >  
> >              print ::EO <<END or die $! if defined $xenhopt;
> > 
> > 
> 
> 

  reply	other threads:[~2015-05-23  8:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <osstest-56922-mainreport@xen.org>
2015-05-22  9:57 ` [osstest test] 56922: regressions - FAIL Ian Campbell
2015-05-22 11:32   ` Ian Campbell
2015-05-22 12:30     ` Ian Campbell
2015-05-22 12:47       ` Robert Hu
2015-05-22 12:58         ` Ian Campbell
2015-05-22 13:42           ` Ian Campbell
2015-05-22 14:21             ` Ian Campbell
2015-05-23  3:35               ` Robert Hu
2015-05-23  6:46                 ` Robert Hu
2015-05-23  6:58                   ` Ian Campbell
2015-05-23  7:52                     ` Robert Hu
2015-05-23  8:25                       ` Ian Campbell
2015-05-23  8:28                         ` Robert Hu
2015-05-23  8:31               ` Robert Hu
2015-05-23  8:53                 ` Robert Hu [this message]
2015-05-24 13:53                   ` Ian Campbell
2015-05-25  2:25                     ` Robert Hu
2015-05-25  3:04                       ` Robert Hu
2015-05-23 13:34               ` Robert Hu

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=1432371223.12629.11.camel@localhost \
    --to=robert.hu@vmm.sh.intel.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=longtaox.pang@intel.com \
    --cc=robert.hu@intel.com \
    --cc=xen-devel@lists.xen.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.