Re: grub-0.97: btrfs multidevice support [PATCH]

2009-09-27 Thread Robert Millan
On Sun, Sep 27, 2009 at 11:29:11AM +0800, Peng Tao wrote:
 
  It would be great if somebody could take up Edward's work and port it to
  GRUB 2. If nobody else does then I'd be interested in doing so myself,
  although I will not be able to start for a month or two from now.
 Is there any guild lines for porting GPLv2 code to GRUB2? I've looked
 at the GRUB2 wiki but very few things are documented there
 (http://grub.enbug.org/). I'd like to see what it would take to port
 the patches. If I can afford it, I'd like to try.

I assume you mean GPLv2-only code (as opposed to GPLv2-or-later). First
step would be to contact the copyright holders and ask them to relicense
under v3-compatible terms (e.g. GPLv2-or-later).  Chances are they didn't
chose these terms as an act of hostility, but were simply being zealous
about allowing something before they knew what it is.

If that doesn't work, we'll always have Par^W clean room
(http://en.wikipedia.org/wiki/Clean_room_design).

-- 
Robert Millan

  The DRM opt-in fallacy: Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all.


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Resignation

2009-09-27 Thread Robert Millan
On Fri, Sep 25, 2009 at 11:44:53PM -0400, Pavel Roskin wrote:
 Hello!
 
 I have very little time for GNU GRUB, and I don't want to exercise any
 authority in the project without being able to track the mailing list
 and participate in the discussions.
 
 I would like to resign as comaintainer of GNU GRUB starting immediately.
 
 I'll try to participate if I have time.  However, I cannot promise I'll
 reply to any pending e-mail.  If there are any issues waiting for my
 response, please bring them to the list again.

I'm sorry to hear that.

I'd like to ask you to reconsider, and giving it a while before making it
final.  Would you do that?

-- 
Robert Millan

  The DRM opt-in fallacy: Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all.


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: grub-0.97: btrfs multidevice support [PATCH]

2009-09-27 Thread Robert Millan
On Fri, Sep 25, 2009 at 08:38:10AM +1000, Bron Gondwana wrote:
 
 Edward - please do continue to develop patches for GRUB 1 (the one that
 still actually works plenty well enough for lots of people) and ignore the
 naysayers who are happy to throw out backwards compatibility.
 
 Sometimes you have to maintain crappy code because people out there depend
 on it.  And we thank those who step up and do it rather than throw their
 hands up and pretend it doesn't need doing!

Btw, I just wanted to add that although we decide to focus on the codebase
that has a future, it doesn't bother me at all that GRUB Legacy is useful to
others.  We made it free software so that it enables as many users as possible
to use their computer in freedom, and so that distributors can adopt it
despite our disrecommendation.

I don't regret that they have the practical means to disagree with us and take
a different path.  It's precisely the freedom we wanted them to benefit from!

Nevertheless, grub-devel is a mailing list for coordination of GRUB 2
development.  Most of us are volunteers and our time is quite limited, so
bringing up GRUB Legacy development here is at best a distraction.  I'll
appreciate if you won't do that anymore.

Thanks for listening

-- 
Robert Millan

  The DRM opt-in fallacy: Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all.


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Felix Zielcke
Am Samstag, den 26.09.2009, 22:48 +0200 schrieb Stefan Bienert:
 And another Hi,
 
 update: Using '--file' in the search did the trick! I really start
 loving Grub2: Really faster booting, seems to be easy to configure...
 
  2 days of booting with grub2 in EFI mode and still happy...
 
  Now I have several further questions:
 
  - Depending on whether an USB disk is connected, or not, the hd numbers
  change. Is there a setup to avoid changing the numbers in the entries on
  boot?

  Use UUIDs
  What is that?
  
  http://en.wikipedia.org/wiki/UUID
 
 You know, you make feeling me like a noob again.
 
   Where do I get it from? 
  
  grub-probe -t fs_uuid /
  or grub-probe -t fs_uuid -d /dev/sda1
  
  How do I incorporate this into
  grub.cg?
 
  search --set --fs-uuid abc-123...
 
 Just for the sake of completion: abc-123.../path/to/kernel?

No. If you use --fs-uuid instead of --file then you use the UUID.
I thought it would be clear, to just use the UUID value grub-probe tells
you. Without any path appended to it.

 I prefer using the search for a file, since I may switch disks without
 resetting the uuid.

If the file you use for the search command only exists once in your
system then it's fine.




-- 
Felix Zielcke
Proud Debian Maintainer



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Stefan Bienert
  Where do I get it from? 
 grub-probe -t fs_uuid /
 or grub-probe -t fs_uuid -d /dev/sda1

 How do I incorporate this into
 grub.cg?
 search --set --fs-uuid abc-123...
 Just for the sake of completion: abc-123.../path/to/kernel?

 No. If you use --fs-uuid instead of --file then you use the UUID.
 I thought it would be clear, to just use the UUID value grub-probe tells
 you. Without any path appended to it.

OK, after search-setting the UUID I just load the kernel as usual?

 I prefer using the search for a file, since I may switch disks without
 resetting the uuid.

 If the file you use for the search command only exists once in your
 system then it's fine.

This was obvious to me ;-)

greetings,

Stefan


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Felix Zielcke
Am Sonntag, den 27.09.2009, 13:11 +0200 schrieb Stefan Bienert:
   Where do I get it from? 
  grub-probe -t fs_uuid /
  or grub-probe -t fs_uuid -d /dev/sda1
 
  How do I incorporate this into
  grub.cg?
  search --set --fs-uuid abc-123...
  Just for the sake of completion: abc-123.../path/to/kernel?
 
  No. If you use --fs-uuid instead of --file then you use the UUID.
  I thought it would be clear, to just use the UUID value grub-probe tells
  you. Without any path appended to it.
 
 OK, after search-setting the UUID I just load the kernel as usual?

Yes.


-- 
Felix Zielcke
Proud Debian Maintainer



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Protection of boot sector and embedded area

2009-09-27 Thread Michal Suchanek
2009/9/27 James Courtier-Dutton james.dut...@gmail.com:
 2009/9/26 Vladimir 'phcoder' Serbinenko phco...@gmail.com:
 James Courtier-Dutton wrote:
 2009/9/26 Vladimir 'phcoder' Serbinenko phco...@gmail.com:

 It's generally a bad idea to chase grub out of MBR+embed area. It often
 results in unreliable configurations. Could you detail your usecase so
 we can seek for a bettere solution?


 The other thing sitting in the embedded area is a whole disc encryption 
 product.
 It takes up about 60 sectors of the 64 sectors of the embedded area.

 I guess you speak about truecrypt. In this case the solution I would
 recommend is to make grub load truecrypt's embedding area from a file on
 the disk (it probably can be extracted from truecrypt w/o installing
 booter). It's not a difficult task, just nobody did it yet (volunteers
 are welcome).
 Beware that truecrypt is distributed under a license which has legal
 danger to the end user.
 https://fedoraproject.org/wiki/ForbiddenItems#TrueCrypt
 Of course it's your choice to use it or not but I would suggest to avoid
 such software especially for the data you need to protect

 It is not truecrypt.
 I would argue that a full disk encryption product should be in the
 boot sector/embedded area and everything else, even grub should load
 after it.


Obviously your encryption solution does not encrypt the linux volume
which you boot using the USB stick so it has no reason to be loaded
when loading Linux, it can only cause harm by trying to decrypt what
is not encrypted.

Also as Grub can access the disk drives by various means (BIOS, PCI
device driver, ...) the encryption software would have to hijack all
these access paths transparently which I can't imagine happening.

Thanks

Michal


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Michal Suchanek
2009/9/27 Stefan Bienert bien...@zbh.uni-hamburg.de:
 - The menu is rather small, is it possible to expand the display to
 1280x800?

 - Since I own a Macbook, I want my boot manager nice and shiny. How do I
 set the looks? E.g. Background image? Couldn't find helpful info in the
 manual-draft.

 If you use my repo, you can enable graphic mode for EFI, it even
 allows you to set a background image. Add these lines in grub.cfg:

 set gfxmode=0x0
 loadfont /unifont.pf2
 terminal_output.gfxterm
 background_image /splash.png

 So, my grub.cfg now contains:

 set gfxmode=0x0
 search --set --file /boot/unifont.pf2
 loadfont /boot/unifont.pf2
 terminal_output.gfxterm
 search --set --file /boot/splash.jpg
 background_image /boot/splash.jpg

 But this does not work. I also tried loading gfxterm in the
 grub2-console. Even with insmod video, insmod efi_fb before.
 If I cast terminal_output.gfxterm to the console, grub2 seems to hang.


Guess it might be broken.

Who has actually tested efi graphics, and on what hardware?

Does it clear/reset graphics before it hangs? If not we could perhaps
add some debug prints to find out what it is doing before the hang.

I could perhaps try the efi graphics driver on some iMacs later
this/next week (depending on the location where you are reading this).

Thanks

Michal


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Protection of boot sector and embedded area

2009-09-27 Thread James Courtier-Dutton
2009/9/27 Michal Suchanek hramr...@centrum.cz:

 Obviously your encryption solution does not encrypt the linux volume
 which you boot using the USB stick so it has no reason to be loaded
 when loading Linux, it can only cause harm by trying to decrypt what
 is not encrypted.
You make a assumption that the encryption program would cause harm. It does not.
One specifies which partitions to encrypt/decrypt and it leaves the rest alone.


 Also as Grub can access the disk drives by various means (BIOS, PCI
 device driver, ...) the encryption software would have to hijack all
 these access paths transparently which I can't imagine happening.

One would obviously need grub to only use BIOS calls and no direct PCI
device access for it to work together with the whole disc encryption
program in pre-boot stages. Alternatively, one would have to add
encryption support into grub itself that is not a good idea.
I think that maybe being able to install grub into it's own small
partition instead of the embedded area would be all I would need.

Kind Regards

James


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Protection of boot sector and embedded area

2009-09-27 Thread Vladimir 'phcoder' Serbinenko
James Courtier-Dutton wrote:
 2009/9/27 Michal Suchanek hramr...@centrum.cz:
   
 Obviously your encryption solution does not encrypt the linux volume
 which you boot using the USB stick so it has no reason to be loaded
 when loading Linux, it can only cause harm by trying to decrypt what
 is not encrypted.
 
 You make a assumption that the encryption program would cause harm. It does 
 not.
 One specifies which partitions to encrypt/decrypt and it leaves the rest 
 alone.

   
It's loaded uselessly. Actually normally there is no reason to encrypt
any of the files grub accesses. But authenticating files is needed.
(encryption doesn't prevent attacker from modifying files)
Encrypting is to keep secret
MAC or signatures is to keep unmodified.
GRUB and most OSes we support are free software so there is no reason to
keep them secret. Even proprietary for kernels you have, the binaries
aren't secret.
There are two reason full disk encryption exists:
1) I have everything encrypted is a good confidence-giving sentence
and good for marketing
2) If you encrypt everything you have no risk of forgetting encrypting
something (typical examples: swap, /tmp, /var/tmp). This renders the
approach fool-proof and easy to configure
 Also as Grub can access the disk drives by various means (BIOS, PCI
 device driver, ...) the encryption software would have to hijack all
 these access paths transparently which I can't imagine happening.

 
 One would obviously need grub to only use BIOS calls and no direct PCI
 device access for it to work together with the whole disc encryption
 program in pre-boot stages. 
The only reason we keep BIOS calls by default is that our own drivers
don't work in all configurations.
 Alternatively, one would have to add
 encryption support into grub itself that is not a good idea.
   
We have patches to do so. While encrypting a part of bootloader and a
kernel isn't security-improving, it renders encrypted configuration
easier (no need for separate /boot). So I'm favorable to it. Why do you
say it's a bad idea?
Signatures in grub are on todo list.
 I think that maybe being able to install grub into it's own small
 partition instead of the embedded area would be all I would need.
   
I explained why this all I need is problematic
 Kind Regards

 James


 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 http://lists.gnu.org/mailman/listinfo/grub-devel

   



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Stefan Bienert
Michal Suchanek wrote:
 2009/9/27 Stefan Bienert bien...@zbh.uni-hamburg.de:
 - The menu is rather small, is it possible to expand the display to
 1280x800?

 - Since I own a Macbook, I want my boot manager nice and shiny. How do I
 set the looks? E.g. Background image? Couldn't find helpful info in the
 manual-draft.
 If you use my repo, you can enable graphic mode for EFI, it even
 allows you to set a background image. Add these lines in grub.cfg:
 set gfxmode=0x0
 loadfont /unifont.pf2
 terminal_output.gfxterm
 background_image /splash.png
 So, my grub.cfg now contains:

 set gfxmode=0x0
 search --set --file /boot/unifont.pf2
 loadfont /boot/unifont.pf2
 terminal_output.gfxterm
 search --set --file /boot/splash.jpg
 background_image /boot/splash.jpg

 But this does not work. I also tried loading gfxterm in the
 grub2-console. Even with insmod video, insmod efi_fb before.
 If I cast terminal_output.gfxterm to the console, grub2 seems to hang.

 
 Guess it might be broken.
 
 Who has actually tested efi graphics, and on what hardware?
 
 Does it clear/reset graphics before it hangs? If not we could perhaps
 add some debug prints to find out what it is doing before the hang.

For me, the screen freezes, so graphics seem not to be cleared.

 I could perhaps try the efi graphics driver on some iMacs later
 this/next week (depending on the location where you are reading this).

That would be nice. I use Bean's repository.

greetings,

Stefan


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Current Grub2 problem with /boot on different drive

2009-09-27 Thread Dean Loros
I have looked as far as I can via Google to try to get into a terminal
similar to how things were done in grub. There is little to no
information available--I was very fluent in how to do things with
grub--I am at a loss as to achieve this in grub2. 


On 09/25/2009 12:36 PM, Dean Loros wrote:
 Hi Vladimir--

 I am unclear as to your meaning of setI have defined /dev/sda in
 console as the grub install to MBR  my /boot is in /dev/sdc1. This is
 after I installed the .deb from Colin's PPA that included the patch.
 So I would think that I am using your patched grub2. Please correct me
 if I have not understood you.

 Cheers!!!
 Dean

 On Fri, Sep 25, 2009 at 7:21 AM, Vladimir 'phcoder' Serbinenko
 phco...@gmail.com mailto:phco...@gmail.com wrote:

 Dean Loros wrote:
  I have installed the patched Grub2 that Colin has in his PPA 
 done the
  normal updating that he requested including confirming that it is
  installed to my first drive. It is the only grub installed on my
 system,
  so I feel very certain that I was using it during my timed run last
  evening. To re-confirm:
 
  d...@linux:~/Desktop$ sudo grub-install /dev/sda
  Installation finished. No error reported.
  This is the contents of the device map /boot/grub/device.map.
  Check if this is correct or not. If any of the lines is incorrect,
  fix it and re-run the script `grub-install'.
 
  (hd0)/dev/sda
  (hd1)/dev/sdb
  (hd2)/dev/sdc
  (hd3)/dev/sdd
  d...@linux:~/Desktop$ grub-install -v
  grub-install (GNU GRUB 1.97~beta3)
 
  Is there anything else you want me to check?
 
 
 I already said: try set from grub console
  Cheers!!!
  Dean

Dean Loros
autocrosser at ubuntuforums.org
Performance by Design Ltd.

___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Current Grub2 problem with /boot on different drive

2009-09-27 Thread Felix Zielcke
Am Sonntag, den 27.09.2009, 07:53 -0700 schrieb Dean Loros:
 I have looked as far as I can via Google to try to get into a terminal
 similar to how things were done in grub. There is little to no
 information available--I was very fluent in how to do things with
 grub--I am at a loss as to achieve this in grub2.  
 

Vladimir means to press `c' when the menu gets shown and to type `set'
and then tell us the output.

 On 09/25/2009 12:36 PM, Dean Loros wrote: 
  Hi Vladimir--
  
  I am unclear as to your meaning of setI have defined /dev/sda
  in console as the grub install to MBR  my /boot is in /dev/sdc1.
  This is after I installed the .deb from Colin's PPA that included
  the patch. So I would think that I am using your patched grub2.
  Please correct me if I have not understood you.
  
  Cheers!!!
  Dean
  
  On Fri, Sep 25, 2009 at 7:21 AM, Vladimir 'phcoder' Serbinenko
  phco...@gmail.com wrote:
  Dean Loros wrote:
   I have installed the patched Grub2 that Colin has in his
  PPA  done the
   normal updating that he requested including confirming
  that it is
   installed to my first drive. It is the only grub installed
  on my system,
   so I feel very certain that I was using it during my timed
  run last
   evening. To re-confirm:
  
   d...@linux:~/Desktop$ sudo grub-install /dev/sda
   Installation finished. No error reported.
   This is the contents of the device
  map /boot/grub/device.map.
   Check if this is correct or not. If any of the lines is
  incorrect,
   fix it and re-run the script `grub-install'.
  
   (hd0)/dev/sda
   (hd1)/dev/sdb
   (hd2)/dev/sdc
   (hd3)/dev/sdd
   d...@linux:~/Desktop$ grub-install -v
   grub-install (GNU GRUB 1.97~beta3)
  
   Is there anything else you want me to check?
  
  
  
  I already said: try set from grub console
   Cheers!!!
   Dean
  
  
 Dean Loros
 autocrosser at ubuntuforums.org
 Performance by Design Ltd.
 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 http://lists.gnu.org/mailman/listinfo/grub-devel


-- 
Felix Zielcke
Proud Debian Maintainer



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Bean
On Sun, Sep 27, 2009 at 9:00 PM, Stefan Bienert
bien...@zbh.uni-hamburg.de wrote:
 For me, the screen freezes, so graphics seem not to be cleared.

 I could perhaps try the efi graphics driver on some iMacs later
 this/next week (depending on the location where you are reading this).

 That would be nice. I use Bean's repository.

Hi,

Most likely it doesn't get the frame buffer address right, so screen
is written to somewhere else, this also consist with the fact you
don't see any console output until x starts.

BTW, when you use the linux command, it should show some line about
detected video card info, can you paste it here.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Stefan Bienert
Bean wrote:
 On Sun, Sep 27, 2009 at 9:00 PM, Stefan Bienert
 bien...@zbh.uni-hamburg.de wrote:
 For me, the screen freezes, so graphics seem not to be cleared.

 I could perhaps try the efi graphics driver on some iMacs later
 this/next week (depending on the location where you are reading this).
 That would be nice. I use Bean's repository.
 
 Hi,
 
 Most likely it doesn't get the frame buffer address right, so screen
 is written to somewhere else, this also consist with the fact you
 don't see any console output until x starts.
 
 BTW, when you use the linux command, it should show some line about
 detected video card info, can you paste it here.
 

Ok, here is what I get after choosing the linux menu entry. Everything
before the menu shows up, is to quick to read.

OUTPUT-Start
Rom image present.
  [Linux-bzimage, setup=0x2c00, size=0x2784a0]
  Video mode: 1280x800-32
  Frame buffer base: 0x8001
  Video line length: 8192
OUTPUT-End

I hope this is the requested info. Do provide other stuff, I probably
need a detailed instruction.

BTW, I cannot switch to terminal from X after starting with Grub2.

greetings,

Stefan


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [GITGRUB] New menu interface (implementation)

2009-09-27 Thread Michal Suchanek
Hello

2009/9/25 Bean bean12...@gmail.com:
 Hi,

 Update:

 Some adjustment to data representation. For example:

 background = /splash.png

 means loads splash.png, no extra handling if loading fails (text mode
 or file not found)

 background = /splash.png,,blue

 means loads splash.png, if it fails, replace it with rect that has
 blue background

This sounds reasonable for a background image. The background can be
also used for transparent parts of the image. For a label icon the
background should be probably taken from the label, including
transparent background or image background. If the icon fails to load
the size is zero unless explicitly scaled.


 Add new number format to specify size for both graphic and text mode:

 space = 10/0

I would prefer if the spacing would not need to be specified
separately for text mode and graphics mode.

I hope I can get to creating some layout mockups so that we can see if
that is feasible.


 10 pixel in graphic text, 0 in text mode

 New layout manger, it support the following parameters:

 columns
 valign
 halign
 width
 height
 vspace
 hspace
 vmargin
 hmargin

 width/height is the size of widget, if it's not set, the size is
 calculated automatically using the size of child widgets

For sizing two modes are useful: the minimum sizing that assigns the
size required to display all content and the maximum sizing that
expands the widget as much as possible. If width = 100% means that any
siblings are not displayed because the widget occupies exactly the
available space then a different notation would be useful for taking a
share of the available width.


 vmargin, hmargin is the distance between horizontal and vertical
 border, positive value is from left/top, while negative value is from
 right/bottom, for example:

 panel
 {
  vmargin = -0
  hmargin = -0
 }

 places the panel in the bottom right corner.

How does this resolve the problem of setting the top, left, bottom and
right margin without knowing the size (width, height) of the panel?

I know that when panel is drawn the size is known but the size might
not be known when the configuration is written (different screen sizes
or label lengths). Setting the size (width, height) might be
appropriate in some cases but in most it should be calculated
automatically so that the layout fits in the available space.

I might want a bit of space (like 0.5 em or 0.5c) around a label so
that the label text is not sticking to the border as it was in the
last demo.

If I have a background picture over which I want to draw the menu and
it has a designated area for this I can either measure the menu
position as x,y,width, height or as top, left, bottom, right. The
latter has the advantage that if I decide to allow scaling the picture
I can measure the margin in % and the rounding error for each border
is the same. For x,y,width,height the rounding error of the bottom
corner is twice as large.

In the general case I would want to avoid the menu sticking to the
border of the screen which again calls for a margin.


 Here is a sample config file that shows different valign/halign
 combination, the image file is inside the previous menu.zip.

 screen
 {
  halign = center
  valign = center
  columns = 3

This is not nice because when you add a new panel it wraps to the next
row. For most uses grouping panels in a single direction seems more
useful. When they have some logical order that order is preserved when
a new panel is added.

  background = /menu/back.png

  panel
  {
    background = ,blue
    hspace = 10/0
    vspace = 5/0
    halign = left
    valign = top
    width = 28%
    height = 28%

Calculating this value is error prone and redundant since it is the
same for all panels.

Thanks

Michal


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Michal Suchanek
2009/9/27 Stefan Bienert bien...@zbh.uni-hamburg.de:
 Bean wrote:
 On Sun, Sep 27, 2009 at 9:00 PM, Stefan Bienert
 bien...@zbh.uni-hamburg.de wrote:
 For me, the screen freezes, so graphics seem not to be cleared.

 I could perhaps try the efi graphics driver on some iMacs later
 this/next week (depending on the location where you are reading this).
 That would be nice. I use Bean's repository.

 Hi,

 Most likely it doesn't get the frame buffer address right, so screen
 is written to somewhere else, this also consist with the fact you
 don't see any console output until x starts.

 BTW, when you use the linux command, it should show some line about
 detected video card info, can you paste it here.


 Ok, here is what I get after choosing the linux menu entry. Everything
 before the menu shows up, is to quick to read.

 OUTPUT-Start
 Rom image present.
  [Linux-bzimage, setup=0x2c00, size=0x2784a0]
  Video mode: 1280x800-32
  Frame buffer base: 0x8001
  Video line length: 8192
 OUTPUT-End

 I hope this is the requested info. Do provide other stuff, I probably
 need a detailed instruction.

 BTW, I cannot switch to terminal from X after starting with Grub2.

Meaning that the keyboard combo does nothing or that switching to the
console does nothing?

It should not do anything visible if the console is drawn in a wrong
place as  suggested.

Thanks

Michal


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Stefan Bienert
Michal Suchanek wrote:
 2009/9/27 Stefan Bienert bien...@zbh.uni-hamburg.de:
 Bean wrote:
 On Sun, Sep 27, 2009 at 9:00 PM, Stefan Bienert
 bien...@zbh.uni-hamburg.de wrote:
 For me, the screen freezes, so graphics seem not to be cleared.

 I could perhaps try the efi graphics driver on some iMacs later
 this/next week (depending on the location where you are reading this).
 That would be nice. I use Bean's repository.
 Hi,

 Most likely it doesn't get the frame buffer address right, so screen
 is written to somewhere else, this also consist with the fact you
 don't see any console output until x starts.

 BTW, when you use the linux command, it should show some line about
 detected video card info, can you paste it here.

 Ok, here is what I get after choosing the linux menu entry. Everything
 before the menu shows up, is to quick to read.

 OUTPUT-Start
 Rom image present.
  [Linux-bzimage, setup=0x2c00, size=0x2784a0]
  Video mode: 1280x800-32
  Frame buffer base: 0x8001
  Video line length: 8192
 OUTPUT-End

 I hope this is the requested info. Do provide other stuff, I probably
 need a detailed instruction.

 BTW, I cannot switch to terminal from X after starting with Grub2.
 
 Meaning that the keyboard combo does nothing or that switching to the
 console does nothing?
 
 It should not do anything visible if the console is drawn in a wrong
 place as  suggested.

Screen switches to nothing. So X switches to the console and then the
screen stays black.

greetings,

Stefan


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Support for howmany option in grub2

2009-09-27 Thread jezz
Hello,
I am using Debian GNU/Linux as my primary system. As a loader I am using GRUB.
Actually I have upgraded to GRUB2. I don't know, if it was feature of original
(legacy) GRUB or it was functionality provided by debian scripts (update-grub),
for generating menu.lst. There was feature - howmany. This option specifies
number of kernels, that user wants to have in boot menu. Script, that modifies
menu.lst, use this variable. I like this feature, because I have usually more
kernels, but I want to see only last two versions in GRUB menu. I have created
patch, that add support for this to /etc/grub.d/10_linux. I have created this
patch against version shipped with Debian (1.97~beta3-1) - I don't know if
there are some Debian specific modifications. Also there should be variable
GRUB_HOW_MANY propagated from /etc/default/grub (my patch don't do
this).
Kernel and it's rescue variant is counted as one kernel.

I have already reported this bug to Debian BTS:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548600

Regards

-- 
Jezz
mail:   j...@hkfree.org
jabber: j...@njs.netlab.cz
--- 10_linux	2009-08-10 19:49:44.0 +0200
+++ 10_linux.new	2009-09-27 16:09:49.490014838 +0200
@@ -66,7 +66,17 @@
 if grub_file_is_not_garbage $i ; then echo -n $i  ; fi
   done`
 
-while [ x$list != x ] ; do
+# Validate GRUB_HOW_MANY variable
+case $GRUB_HOW_MANY in
+  [0-9]|[0-9][0-9])
+howmany=$GRUB_HOW_MANY
+;;
+  *)
+howmany=99
+;;
+esac
+
+while [ x$list != x -a $howmany -gt 0 ] ; do
   linux=`version_find_latest $list`
   echo Found linux image: $linux 2
   basename=`basename $linux`
@@ -75,6 +85,7 @@
   version=`echo $basename | sed -e s,^[^0-9]*-,,g`
   alt_version=`echo $version | sed -e s,\.old$,,g`
   linux_root_device_thisversion=${LINUX_ROOT_DEVICE}
+  howmany=$((howmany-1))
 
   initrd=
   for i in initrd.img-${version} initrd-${version}.img \


signature.asc
Description: Digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [GITGRUB] New menu interface (implementation)

2009-09-27 Thread Bean
On Mon, Sep 28, 2009 at 12:12 AM, Michal Suchanek hramr...@centrum.cz wrote:
 Add new number format to specify size for both graphic and text mode:

 space = 10/0

 I would prefer if the spacing would not need to be specified
 separately for text mode and graphics mode.

 I hope I can get to creating some layout mockups so that we can see if
 that is feasible.


Hi,

You can still use character unit as:

space = 1

But the problem is that minimum value is 1. In text mode, 1 character
size is significant. We don't want to spend valuable space for
parameters like vspace and hspace. But in graphic mode, we can afford
some pixel on spacing.


 10 pixel in graphic text, 0 in text mode

 New layout manger, it support the following parameters:

 columns
 valign
 halign
 width
 height
 vspace
 hspace
 vmargin
 hmargin

 width/height is the size of widget, if it's not set, the size is
 calculated automatically using the size of child widgets

 For sizing two modes are useful: the minimum sizing that assigns the
 size required to display all content and the maximum sizing that
 expands the widget as much as possible. If width = 100% means that any
 siblings are not displayed because the widget occupies exactly the
 available space then a different notation would be useful for taking a
 share of the available width.


Yep, I have plans for the min_width/min_height/max_width/max_height property.


 vmargin, hmargin is the distance between horizontal and vertical
 border, positive value is from left/top, while negative value is from
 right/bottom, for example:

 panel
 {
  vmargin = -0
  hmargin = -0
 }

 places the panel in the bottom right corner.

 How does this resolve the problem of setting the top, left, bottom and
 right margin without knowing the size (width, height) of the panel?

 I know that when panel is drawn the size is known but the size might
 not be known when the configuration is written (different screen sizes
 or label lengths). Setting the size (width, height) might be
 appropriate in some cases but in most it should be calculated
 automatically so that the layout fits in the available space.


It'd work as expected, you can see it by setting the width/height of
the last panel to 28%/28%, it'd still stick to the border. The program
do this in two steps, first the size, then the position, it allows to
the widget to change the size before position is calculated.

 I might want a bit of space (like 0.5 em or 0.5c) around a label so
 that the label text is not sticking to the border as it was in the
 last demo.

You can do this with vspace/hspace. The last panel looks compact as it
does specify width/height so that the minimum required size is used.


 If I have a background picture over which I want to draw the menu and
 it has a designated area for this I can either measure the menu
 position as x,y,width, height or as top, left, bottom, right. The
 latter has the advantage that if I decide to allow scaling the picture
 I can measure the margin in % and the rounding error for each border
 is the same. For x,y,width,height the rounding error of the bottom
 corner is twice as large.

 In the general case I would want to avoid the menu sticking to the
 border of the screen which again calls for a margin.


Actually, when vmargin and hmargin is positive number, it's exactly
the same as x,y, but it also allows to stick to other borders, which
is impossible for x,y without setting the size.


 Here is a sample config file that shows different valign/halign
 combination, the image file is inside the previous menu.zip.

 screen
 {
  halign = center
  valign = center
  columns = 3

 This is not nice because when you add a new panel it wraps to the next
 row. For most uses grouping panels in a single direction seems more
 useful. When they have some logical order that order is preserved when
 a new panel is added.


For single row, set
columns = 0

For single column, set:
columns = 1

  background = /menu/back.png

  panel
  {
    background = ,blue
    hspace = 10/0
    vspace = 5/0
    halign = left
    valign = top
    width = 28%
    height = 28%

 Calculating this value is error prone and redundant since it is the
 same for all panels.

This is just a demo, in fact, you can skip the width/height parameter
and it will calculate the minimum size for you. But in this case, you
can't see the valign/halign property in action inside the panel.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Bean
On Sun, Sep 27, 2009 at 11:44 PM, Stefan Bienert
bien...@zbh.uni-hamburg.de wrote:
 Bean wrote:
 On Sun, Sep 27, 2009 at 9:00 PM, Stefan Bienert
 bien...@zbh.uni-hamburg.de wrote:
 For me, the screen freezes, so graphics seem not to be cleared.

 I could perhaps try the efi graphics driver on some iMacs later
 this/next week (depending on the location where you are reading this).
 That would be nice. I use Bean's repository.

 Hi,

 Most likely it doesn't get the frame buffer address right, so screen
 is written to somewhere else, this also consist with the fact you
 don't see any console output until x starts.

 BTW, when you use the linux command, it should show some line about
 detected video card info, can you paste it here.


 Ok, here is what I get after choosing the linux menu entry. Everything
 before the menu shows up, is to quick to read.

 OUTPUT-Start
 Rom image present.
  [Linux-bzimage, setup=0x2c00, size=0x2784a0]
  Video mode: 1280x800-32
  Frame buffer base: 0x8001
  Video line length: 8192
 OUTPUT-End

 I hope this is the requested info. Do provide other stuff, I probably
 need a detailed instruction.


Hi,

This looks legit for me, I don't know why it does work, perhaps it
write to the other video card ?

 BTW, I cannot switch to terminal from X after starting with Grub2.

Yep, this is normal. EFI uses non zero gart address, but linux assume
0. X would reset gart, but after it exits, the original gart address
is restored and which would cause problem.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Macbook, Efi, Display mode

2009-09-27 Thread Stefan Bienert
 OUTPUT-Start
 Rom image present.
  [Linux-bzimage, setup=0x2c00, size=0x2784a0]
  Video mode: 1280x800-32
  Frame buffer base: 0x8001
  Video line length: 8192
 OUTPUT-End

 I hope this is the requested info. Do provide other stuff, I probably
 need a detailed instruction.

 
 Hi,
 
 This looks legit for me, I don't know why it does work, perhaps it
 write to the other video card ?

Ohter video card? I have a Macbook, NOT a Macbook Pro. I have only one card!

 BTW, I cannot switch to terminal from X after starting with Grub2.

 Yep, this is normal. EFI uses non zero gart address, but linux assume
 0. X would reset gart, but after it exits, the original gart address
 is restored and which would cause problem.

OK, so we know that there is something broken but everything is behaving
 like one would expect in this situation? That sounds relatively optimistic.

greetings,

Stefan




___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Grub-devel Digest, Vol 67, Issue 84

2009-09-27 Thread Dean Loros
Thank You Felix!!! That was the information I lacked!!!

Information for Vladimir  Colin:

Results of set:

sh:grub set
?=0
color_highlight=magenta/black   *(custom colour to match grub image)*
color_normal=red/black   *(same comment)*
default=0
gfxmode=640x480
pager=
prefix=(UUID=fc1446a5-94e9-40f8-9ebb-2442107fc13c)/boot/grub
root=hd2,2

I can verify that I am using Colin's PPA versions of grub2, grub-pc 
grub-common.
Time to menu is constant @ 3 1/2 minutes--there is a additional 30sec
after the booting kernel is selected.

Dean Loros
autocrosser at ubuntuforums

 I have looked as far as I can via Google to try to get into a terminal
 similar to how things were done in grub. There is little to no
 information available--I was very fluent in how to do things with
 grub--I am at a loss as to achieve this in grub2. 


 On 09/25/2009 12:36 PM, Dean Loros wrote:
   
 Hi Vladimir--

 I am unclear as to your meaning of setI have defined /dev/sda in
 console as the grub install to MBR  my /boot is in /dev/sdc1. This is
 after I installed the .deb from Colin's PPA that included the patch.
 So I would think that I am using your patched grub2. Please correct me
 if I have not understood you.

 Cheers!!!
 Dean

 On Fri, Sep 25, 2009 at 7:21 AM, Vladimir 'phcoder' Serbinenko
 phco...@gmail.com mailto:phco...@gmail.com wrote:

 Dean Loros wrote:
  I have installed the patched Grub2 that Colin has in his PPA 
 done the
  normal updating that he requested including confirming that it is
  installed to my first drive. It is the only grub installed on my
 system,
  so I feel very certain that I was using it during my timed run last
  evening. To re-confirm:
 
  d...@linux:~/Desktop$ sudo grub-install /dev/sda
  Installation finished. No error reported.
  This is the contents of the device map /boot/grub/device.map.
  Check if this is correct or not. If any of the lines is incorrect,
  fix it and re-run the script `grub-install'.
 
  (hd0)/dev/sda
  (hd1)/dev/sdb
  (hd2)/dev/sdc
  (hd3)/dev/sdd
  d...@linux:~/Desktop$ grub-install -v
  grub-install (GNU GRUB 1.97~beta3)
 
  Is there anything else you want me to check?
 
 
 I already said: try set from grub console
  Cheers!!!
  Dean

 
 Dean Loros
 autocrosser at ubuntuforums.org
 Performance by Design Ltd.

 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.gnu.org/pipermail/grub-devel/attachments/20090927/e179025d/attachment.html

 --

 Message: 2
 Date: Sun, 27 Sep 2009 16:56:51 +0200
 From: Felix Zielcke fziel...@z-51.de
 Subject: Re: Current Grub2  problem with /boot on different drive
 To: The development of GRUB 2 grub-devel@gnu.org
 Message-ID: 1254063411.2872.3.ca...@fz.local
 Content-Type: text/plain; charset=UTF-8

 Am Sonntag, den 27.09.2009, 07:53 -0700 schrieb Dean Loros:
   
 I have looked as far as I can via Google to try to get into a terminal
 similar to how things were done in grub. There is little to no
 information available--I was very fluent in how to do things with
 grub--I am at a loss as to achieve this in grub2.  

 
 Vladimir means to press `c' when the menu gets shown and to type `set'
 and then tell us the output.

   
 On 09/25/2009 12:36 PM, Dean Loros wrote: 
 
 Hi Vladimir--

 I am unclear as to your meaning of setI have defined /dev/sda
 in console as the grub install to MBR  my /boot is in /dev/sdc1.
 This is after I installed the .deb from Colin's PPA that included
 the patch. So I would think that I am using your patched grub2.
 Please correct me if I have not understood you.

 Cheers!!!
 Dean

 On Fri, Sep 25, 2009 at 7:21 AM, Vladimir 'phcoder' Serbinenko
 phco...@gmail.com wrote:
 Dean Loros wrote:
  I have installed the patched Grub2 that Colin has in his
 PPA  done the
  normal updating that he requested including confirming
 that it is
  installed to my first drive. It is the only grub installed
 on my system,
  so I feel very certain that I was using it during my timed
 run last
  evening. To re-confirm:
 
  d...@linux:~/Desktop$ sudo grub-install /dev/sda
  Installation finished. No error reported.
  This is the contents of the device
 map /boot/grub/device.map.
  Check if this is correct or not. If any of the lines is
 incorrect,
  fix it and re-run the script `grub-install'.
 
  (hd0)/dev/sda
  (hd1)/dev/sdb
  (hd2)/dev/sdc
  (hd3)/dev/sdd
  d...@linux:~/Desktop$ grub-install -v
  grub-install (GNU GRUB 1.97~beta3)
 
  Is there anything else you want me to check?
 
 
 
 I already said: try set from grub console
  Cheers

Re: [GITGRUB] New menu interface (implementation)

2009-09-27 Thread Michal Suchanek
Hello

2009/9/27 Bean bean12...@gmail.com:
 On Mon, Sep 28, 2009 at 12:12 AM, Michal Suchanek hramr...@centrum.cz wrote:
 Add new number format to specify size for both graphic and text mode:

 space = 10/0

 I would prefer if the spacing would not need to be specified
 separately for text mode and graphics mode.

 I hope I can get to creating some layout mockups so that we can see if
 that is feasible.


 Hi,

 You can still use character unit as:

 space = 1

 But the problem is that minimum value is 1. In text mode, 1 character
 size is significant. We don't want to spend valuable space for

We do. It improves readability.

 parameters like vspace and hspace. But in graphic mode, we can afford
 some pixel on spacing.

Does that mean that now the units are characters in text mode and
pixels in graphics when specified separately?

Also when the vspace is set to 1 instead of 5/0 the text does not fit
into the panel but is still drawn. The widgets should really use
viewport for drawing to avoid these overflows. Unfortunately, this is
probably not available in text mode but it should not be hard to add.




 10 pixel in graphic text, 0 in text mode

 New layout manger, it support the following parameters:

 columns
 valign
 halign
 width
 height
 vspace
 hspace
 vmargin
 hmargin

 width/height is the size of widget, if it's not set, the size is
 calculated automatically using the size of child widgets

 For sizing two modes are useful: the minimum sizing that assigns the
 size required to display all content and the maximum sizing that
 expands the widget as much as possible. If width = 100% means that any
 siblings are not displayed because the widget occupies exactly the
 available space then a different notation would be useful for taking a
 share of the available width.


 Yep, I have plans for the min_width/min_height/max_width/max_height property.

That's probably not the thing I had in mind. Well, perhaps setting
max_width to 100% would do what width=* in HTML.



 vmargin, hmargin is the distance between horizontal and vertical
 border, positive value is from left/top, while negative value is from
 right/bottom, for example:

 panel
 {
  vmargin = -0
  hmargin = -0
 }

 places the panel in the bottom right corner.

 How does this resolve the problem of setting the top, left, bottom and
 right margin without knowing the size (width, height) of the panel?

 I know that when panel is drawn the size is known but the size might
 not be known when the configuration is written (different screen sizes
 or label lengths). Setting the size (width, height) might be
 appropriate in some cases but in most it should be calculated
 automatically so that the layout fits in the available space.


 It'd work as expected, you can see it by setting the width/height of
 the last panel to 28%/28%, it'd still stick to the border. The program
 do this in two steps, first the size, then the position, it allows to
 the widget to change the size before position is calculated.

I don't want to set the size of anything, ever. There still should be
a way to get borders into the layout.

 I might want a bit of space (like 0.5 em or 0.5c) around a label so
 that the label text is not sticking to the border as it was in the
 last demo.

 You can do this with vspace/hspace. The last panel looks compact as it
 does specify width/height so that the minimum required size is used.


 If I have a background picture over which I want to draw the menu and
 it has a designated area for this I can either measure the menu
 position as x,y,width, height or as top, left, bottom, right. The
 latter has the advantage that if I decide to allow scaling the picture
 I can measure the margin in % and the rounding error for each border
 is the same. For x,y,width,height the rounding error of the bottom
 corner is twice as large.

 In the general case I would want to avoid the menu sticking to the
 border of the screen which again calls for a margin.


 Actually, when vmargin and hmargin is positive number, it's exactly
 the same as x,y, but it also allows to stick to other borders, which

By stick to the border I mean the ugly situation when the element
content touches the border visually blending with it.

 is impossible for x,y without setting the size.

AFAIK it's still impossible to make a panel with the same distance
from each border of the screen without setting its size manually.

All my attempts failed miserably.

The other problem is that the text is not shown for some reason in the
demo with Debian/Ubuntu/Gentoo and the blue squares are still shown in
text mode.



 Here is a sample config file that shows different valign/halign
 combination, the image file is inside the previous menu.zip.

 screen
 {
  halign = center
  valign = center
  columns = 3

 This is not nice because when you add a new panel it wraps to the next
 row. For most uses grouping panels in a single direction seems more
 useful. When they have some logical order that 

Re: [GITGRUB] New menu interface (implementation)

2009-09-27 Thread Michal Suchanek
Hello

I tried looking at the overflow but i seriously have no idea what are
all these regions the gfx_region_update_* gets.

There is some scn_x and scn_y but these do not seem to be the screen
coordinates of the region.

If I could tell for what region I am doing the update (that is the
x,y,width,height of the region in screen coordinates) I could set the
viewport accordingly so that the content does not overflow.

At the very least the patch replicates the same breakage in much fewer
lines of code.

Thanks

Michal
diff --git a/menu/gfx_region.c b/menu/gfx_region.c
index 8812da7..39dcc1d 100644
--- a/menu/gfx_region.c
+++ b/menu/gfx_region.c
@@ -27,8 +27,8 @@
 
 #define DEFAULT_VIDEO_MODE auto
 
-static int screen_width;
-static int screen_height;
+static unsigned screen_width;
+static unsigned screen_height;
 
 static grub_err_t
 grub_gfx_region_init (void)
@@ -36,6 +36,7 @@ grub_gfx_region_init (void)
   const char *modevar;
   struct grub_video_mode_info mode_info;
   grub_err_t err;
+  unsigned size = -1; /*FIXME int_max? */
 
   modevar = grub_env_get (gfxmode);
   if (! modevar || *modevar == 0)
@@ -61,8 +62,8 @@ grub_gfx_region_init (void)
   if (err)
 return err;
 
-  screen_width = mode_info.width;
-  screen_height = mode_info.height;
+  grub_video_set_viewport(0, 0, size, size); /* Set maximum viewport. */
+  grub_video_get_viewport(size, size, screen_width, screen_height);
 
   return grub_errno;
 }
@@ -140,7 +141,8 @@ static void
 grub_gfx_region_update_rect (struct grub_menu_region_rect *rect,
 			 int width, int height, int scn_x, int scn_y)
 {
-  grub_video_fill_rect (rect-color, scn_x, scn_y, width, height);
+  grub_video_set_viewport(scn_x, scn_y, width, height);
+  grub_video_fill_rect (rect-color, 0, 0, width, height);
 }
 
 static void
@@ -148,60 +150,11 @@ grub_gfx_region_update_text (struct grub_menu_region_text *text,
 			 int x, int y, int width, int height,
 			 int scn_x, int scn_y)
 {
-  int left_x, base_y;
-  grub_uint32_t code;
-  const grub_uint8_t *ptr;
-  struct grub_video_bitmap glyph_bitmap;
-
-  scn_x -= x;
-  scn_y -= y;
-
-  glyph_bitmap.mode_info.mode_type =
-(1  GRUB_VIDEO_MODE_TYPE_DEPTH_POS)
-| GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP;
-  glyph_bitmap.mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED;
-  glyph_bitmap.mode_info.bpp = 1;
-  glyph_bitmap.mode_info.bytes_per_pixel = 0;
-  glyph_bitmap.mode_info.number_of_colors = 2;
-  glyph_bitmap.mode_info.bg_red = 0;
-  glyph_bitmap.mode_info.bg_green = 0;
-  glyph_bitmap.mode_info.bg_blue = 0;
-  glyph_bitmap.mode_info.bg_alpha = 0;
-  grub_video_unmap_color(text-color,
-			 glyph_bitmap.mode_info.fg_red,
-			 glyph_bitmap.mode_info.fg_green,
-			 glyph_bitmap.mode_info.fg_blue,
-			 glyph_bitmap.mode_info.fg_alpha);
+  int base_y;
+  grub_video_set_viewport(scn_x, scn_y, width, height);
 
   base_y = grub_font_get_ascent (text-font);
-  for (ptr = (const grub_uint8_t *) text-text, left_x = 0;
-   grub_utf8_to_ucs4 (code, 1, ptr, -1, ptr)  0; )
-{
-  struct grub_font_glyph *glyph;
-  int x1, y1, w1, h1, ox, oy;
-
-  glyph = grub_font_get_glyph_with_fallback (text-font, code);
-  x1 = left_x + glyph-offset_x;
-  y1 = base_y - glyph-offset_y - glyph-height;
-  ox = x1;
-  oy = y1;
-  w1 = glyph-width;
-  h1 = glyph-height;
-
-  if (grub_menu_region_check_rect (x1, y1, w1, h1,
-   x, y, width, height))
-	{
-	  glyph_bitmap.mode_info.pitch = glyph-width;
-	  glyph_bitmap.mode_info.width = glyph-width;
-	  glyph_bitmap.mode_info.height = glyph-height;
-	  glyph_bitmap.data = glyph-bitmap;
-	  grub_video_blit_bitmap (glyph_bitmap, GRUB_VIDEO_BLIT_BLEND,
-  scn_x + x1, scn_y + y1,
-  x1 - ox, y1 - oy, w1, h1);
-	}
-
-  left_x += glyph-device_width;
-}
+  grub_font_draw_string(text-text, text-font, text-color, -x, -y + base_y);
 }
 
 static void
@@ -209,8 +162,9 @@ grub_gfx_region_update_bitmap (struct grub_menu_region_bitmap *bitmap,
 			   int x, int y, int width, int height,
 			   int scn_x, int scn_y)
 {
+  grub_video_set_viewport(scn_x, scn_y, width, height);
   grub_video_blit_bitmap (bitmap-bitmap, GRUB_VIDEO_BLIT_REPLACE,
-			  scn_x, scn_y, x, y, width, height);
+			  0, 0, x, y, width, height);
 }
 
 static struct grub_menu_region grub_gfx_region =
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: Current Grub2 problem with /boot on different drive

2009-09-27 Thread Dean Loros
Thank You Felix!!! That was the information I lacked!!! Sorry all about the 
prior overly-general subject

Information for Vladimir  Colin:

Results of set:

sh:grub set
?=0
color_highlight=magenta/black   *(custom colour to match grub image)*
color_normal=red/black   *(same comment)*
default=0
gfxmode=640x480
pager=
prefix=(UUID=fc1446a5-94e9-40f8-9ebb-2442107fc13c)/boot/grub
root=hd2,2

I can verify that I am using Colin's PPA versions of grub2, grub-pc 
grub-common.
Time to menu is constant @ 3 1/2 minutes--there is a additional 30sec
after the booting kernel is selected.

Dean Loros
autocrosser at ubuntuforums


  I have looked as far as I can via Google to try to get into a terminal
  similar to how things were done in grub. There is little to no
  information available--I was very fluent in how to do things with
  grub--I am at a loss as to achieve this in grub2. 
 
 
  On 09/25/2009 12:36 PM, Dean Loros wrote:

   
  Hi Vladimir--
 
  I am unclear as to your meaning of setI have defined /dev/sda in
  console as the grub install to MBR  my /boot is in /dev/sdc1. This is
  after I installed the .deb from Colin's PPA that included the patch.
  So I would think that I am using your patched grub2. Please correct me
  if I have not understood you.
 
  Cheers!!!
  Dean
 
  On Fri, Sep 25, 2009 at 7:21 AM, Vladimir 'phcoder' Serbinenko
  phco...@gmail.com mailto:phco...@gmail.com wrote:
 
  Dean Loros wrote:
   I have installed the patched Grub2 that Colin has in his PPA 
  done the
   normal updating that he requested including confirming that it is
   installed to my first drive. It is the only grub installed on my
  system,
   so I feel very certain that I was using it during my timed run last
   evening. To re-confirm:
  
   d...@linux:~/Desktop$ sudo grub-install /dev/sda
   Installation finished. No error reported.
   This is the contents of the device map /boot/grub/device.map.
   Check if this is correct or not. If any of the lines is incorrect,
   fix it and re-run the script `grub-install'.
  
   (hd0)/dev/sda
   (hd1)/dev/sdb
   (hd2)/dev/sdc
   (hd3)/dev/sdd
   d...@linux:~/Desktop$ grub-install -v
   grub-install (GNU GRUB 1.97~beta3)
  
   Is there anything else you want me to check?
  
  
  I already said: try set from grub console
   Cheers!!!
   Dean
 
  
 
  Dean Loros
  autocrosser at ubuntuforums.org
  Performance by Design Ltd.
 
  -- next part --
  An HTML attachment was scrubbed...
  URL: 
  http://lists.gnu.org/pipermail/grub-devel/attachments/20090927/e179025d/attachment.html
 
  --
 
  Message: 2
  Date: Sun, 27 Sep 2009 16:56:51 +0200
  From: Felix Zielcke fziel...@z-51.de
  Subject: Re: Current Grub2  problem with /boot on different drive
  To: The development of GRUB 2 grub-devel@gnu.org
  Message-ID: 1254063411.2872.3.ca...@fz.local
  Content-Type: text/plain; charset=UTF-8
 
  Am Sonntag, den 27.09.2009, 07:53 -0700 schrieb Dean Loros:

   
  I have looked as far as I can via Google to try to get into a terminal
  similar to how things were done in grub. There is little to no
  information available--I was very fluent in how to do things with
  grub--I am at a loss as to achieve this in grub2.  
 
  
 
  Vladimir means to press `c' when the menu gets shown and to type `set'
  and then tell us the output.
 

   
  On 09/25/2009 12:36 PM, Dean Loros wrote: 
  
 
  Hi Vladimir--
 
  I am unclear as to your meaning of setI have defined /dev/sda
  in console as the grub install to MBR  my /boot is in /dev/sdc1.
  This is after I installed the .deb from Colin's PPA that included
  the patch. So I would think that I am using your patched grub2.
  Please correct me if I have not understood you.
 
  Cheers!!!
  Dean
 
  On Fri, Sep 25, 2009 at 7:21 AM, Vladimir 'phcoder' Serbinenko
  phco...@gmail.com wrote:
  Dean Loros wrote:
   I have installed the patched Grub2 that Colin has in his
  PPA  done the
   normal updating that he requested including confirming
  that it is
   installed to my first drive. It is the only grub installed
  on my system,
   so I feel very certain that I was using it during my timed
  run last
   evening. To re-confirm:
  
   d...@linux:~/Desktop$ sudo grub-install /dev/sda
   Installation finished. No error reported.
   This is the contents of the device
  map /boot/grub/device.map.
   Check if this is correct or not. If any of the lines is
  incorrect,
   fix it and re-run the script `grub-install'.
  
   (hd0)/dev/sda
   (hd1)/dev/sdb
   (hd2)/dev/sdc
   (hd3)/dev/sdd
   d...@linux:~/Desktop$ grub-install -v
   grub

Re: grub-0.97: btrfs multidevice support [PATCH]

2009-09-27 Thread Peng Tao
On Sun, Sep 27, 2009 at 6:18 PM, Robert Millan r...@aybabtu.com wrote:
 On Sun, Sep 27, 2009 at 11:29:11AM +0800, Peng Tao wrote:
 
  It would be great if somebody could take up Edward's work and port it to
  GRUB 2. If nobody else does then I'd be interested in doing so myself,
  although I will not be able to start for a month or two from now.
 Is there any guild lines for porting GPLv2 code to GRUB2? I've looked
 at the GRUB2 wiki but very few things are documented there
 (http://grub.enbug.org/). I'd like to see what it would take to port
 the patches. If I can afford it, I'd like to try.

 I assume you mean GPLv2-only code (as opposed to GPLv2-or-later). First
 step would be to contact the copyright holders and ask them to relicense
 under v3-compatible terms (e.g. GPLv2-or-later).  Chances are they didn't
 chose these terms as an act of hostility, but were simply being zealous
 about allowing something before they knew what it is.

 If that doesn't work, we'll always have Par^W clean room
 (http://en.wikipedia.org/wiki/Clean_room_design).
Edward's patch (stage2/fsys_btrfs.c) is declared GPLv2-or-later. But
stage2/btrfs.h (which is extracted from btrfs-progs) is GPLv2-only. At
the point, we only need a clean room for btrfs.h, right?
And I'm not sure what a clean room design in GRUB2 looks like. Is
there an example?

 --
 Robert Millan

  The DRM opt-in fallacy: Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all.


 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 http://lists.gnu.org/mailman/listinfo/grub-devel




-- 
Cheers,
Peng Tao
State Key Laboratory of Networking and Switching Technology
Beijing Univ. of Posts and Telecoms.


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [GITGRUB] New menu interface (implementation)

2009-09-27 Thread Bean
On Mon, Sep 28, 2009 at 7:01 AM, Michal Suchanek hramr...@centrum.cz wrote:
 Hello

 I tried looking at the overflow but i seriously have no idea what are
 all these regions the gfx_region_update_* gets.

 There is some scn_x and scn_y but these do not seem to be the screen
 coordinates of the region.

 If I could tell for what region I am doing the update (that is the
 x,y,width,height of the region in screen coordinates) I could set the
 viewport accordingly so that the content does not overflow.

 At the very least the patch replicates the same breakage in much fewer
 lines of code.

Hi,

I've tried to use viewport method before, but there seems to be some
bug in video system that the font doesn't drawn at all. I can see the
text when removing grub_video_set_viewport, and the position is
correct.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [GITGRUB] New menu interface (implementation)

2009-09-27 Thread Bean
On Mon, Sep 28, 2009 at 4:46 AM, Michal Suchanek hramr...@centrum.cz wrote:
 Does that mean that now the units are characters in text mode and
 pixels in graphics when specified separately?

Hi,

No, the default unit is still character. In fact, I've removed to p
unit that's specific to graphic
mode, now if you want to set pixel size, you need to use the '/'
method like 100/1 (100 pixels in graphic mode, 1 in text mode).

 Also when the vspace is set to 1 instead of 5/0 the text does not fit
 into the panel but is still drawn. The widgets should really use
 viewport for drawing to avoid these overflows. Unfortunately, this is
 probably not available in text mode but it should not be hard to add.

There are viewport function in region, available in graphic and text
mode. I can use it to limit the widget.

 For sizing two modes are useful: the minimum sizing that assigns the
 size required to display all content and the maximum sizing that
 expands the widget as much as possible. If width = 100% means that any
 siblings are not displayed because the widget occupies exactly the
 available space then a different notation would be useful for taking a
 share of the available width.


 Yep, I have plans for the min_width/min_height/max_width/max_height property.

 That's probably not the thing I had in mind. Well, perhaps setting
 max_width to 100% would do what width=* in HTML.

Currently, if you don't set width/height property, it would assign
minimum size automatically,  width = 100% means it has the same width
as its parent, the child widget would reposition according to that.

 I don't want to set the size of anything, ever. There still should be
 a way to get borders into the layout.

But layout ready has borders, just set the top_left/top/../bottom property.

 By stick to the border I mean the ugly situation when the element
 content touches the border visually blending with it.

My meaning of sticky is that the widget has a constant distance from
one of the border, for example, -1, -1 means it's -1c -1c from the
bottom right corner.


 is impossible for x,y without setting the size.

 AFAIK it's still impossible to make a panel with the same distance
 from each border of the screen without setting its size manually.

 All my attempts failed miserably.

Doesn't the demo work ? The last panel only sets vmargin and hmargin,
width and height is calculated automatically and it's in the bottom
right corner.


 The other problem is that the text is not shown for some reason in the
 demo with Debian/Ubuntu/Gentoo and the blue squares are still shown in
 text mode.

The title property has renamed text, and to remove the blue
square, just change

image = /menu/ubunti.png,,blue

to

image = /menu/ubunti.png

as the previous one would create a rect if image can't be loaded.

 For single row, set
 columns = 0

 For single column, set:
 columns = 1


 These look sensible except 0 meaning infinite is somewhat needlessly 
 confusing.

 What's columns = 3 for other than showing a demo? Which could be
 done in other ways, anyway.

 There are numerous bugs in the table layout already, and if you go
 with tables there's going to be no end of them.

 The table has no colspan/rowspan which people will likely expect of tables.

 The last cell that has hmargin/vmargin is ignored by the table layout
 to the point that it can overlap other cells.

 The cells in the last row are aligned differently than the above cells
 because the number of cells considered for the table layout is not
 divisible by the number of columns.

 hspace/vspace is ignored when the valign/halign is center.

 Last but not least tables which are a packing of elements modulo
 number of columns are fundamentally broken way of rendering a set of
 elements. A table is called for when you have elements that are sorted
 into a two dimensional space of indices. Then you can find a
 particular element by finding its row and column index. We don't have
 that kind of data in Grub.

 It is completely feasible to have multiple one-dimensional lists side
 by side or one below another.

 For example a row of bootloader icons and a row of tool icons. There
 is no relationship between the elements in the two lists so there is
 no problem with the lists scrolling independently. When a new
 bootloader is added the tools are not affected.

 Similarly you can have a list of Debian kernels in one column and a
 list of Gentoo kernels in another. Again they are independent of each
 other. Adding a Debian kernel should not affect Gentoo kernels nor the
 other way around so this is not a table.

 Even HTML does not have a mod N table. It has TR and TD. Managing a
 mod N table in a sensible way is a nightmare. When you actually have a
 table then you have to make sure you add a row at a time and pad with
 empty cells to preserve the columns. When you have a one-dimensional
 list adding to the middle of the list reflows all the later elements
 so it is not obvious what was changed