All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix building bug with --enable-grub-emu-usb
@ 2009-06-17 13:27 Vladimir 'phcoder' Serbinenko
  2009-06-19 15:46 ` Pavel Roskin
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-17 13:27 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

Hello. This is a fix for problem in subject line. I believe this fix
to be correct and legitimate but as I don't know ruby well could
someone review it? If nobody knows ruby in depth I think we can commit
this even without deep review

-- 
Regards
Vladimir 'phcoder' Serbinenko

[-- Attachment #2: libusbfix.diff --]
[-- Type: text/x-diff, Size: 1580 bytes --]

diff --git a/ChangeLog b/ChangeLog
index f3e631c..c7526d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-06-17  Vladimir Serbinenko  <phcoder@gmail.com>
+
+	Fix libusb
+
+	* Makefile.in (LIBUSB): new macro
+	* genmk.rb (Utility/print_tail): new method
+	(Utility/rule): use intermediary variable #{prefix}_OBJECTS
+	(top level): call util.print_tail at the end.
+
 2009-06-16  James Jarvis  <James.Jarvis@ed.ac.uk>
 
 	* commands/help.c GRUB_MOD_INIT(echo): Fix the help output of
diff --git a/Makefile.in b/Makefile.in
index f82566a..cfbdfb8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -95,6 +95,7 @@ endif
 AWK = @AWK@
 LIBCURSES = @LIBCURSES@
 LIBLZO = @LIBLZO@
+LIBUSB = @LIBUSB@
 YACC = @YACC@
 UNIFONT_BDF = @UNIFONT_BDF@
 
diff --git a/genmk.rb b/genmk.rb
index 36f4020..3356c3e 100644
--- a/genmk.rb
+++ b/genmk.rb
@@ -220,6 +220,13 @@ class Utility
     @dir = dir
     @name = name
   end
+  def print_tail()
+    prefix = @name.to_var
+    print "#{@name}: $(#{prefix}_DEPENDENCIES) $(#{prefix}_OBJECTS)
+	$(CC) -o $@ $(#{prefix}_OBJECTS) $(LDFLAGS) $(#{prefix}_LDFLAGS)
+
+"
+  end
   attr_reader :dir, :name
 
   def rule(sources)
@@ -234,9 +241,7 @@ class Utility
 
     "CLEANFILES += #{@name}$(EXEEXT) #{objs_str}
 MOSTLYCLEANFILES += #{deps_str}
-
-#{@name}: $(#{prefix}_DEPENDENCIES) #{objs_str}
-	$(CC) -o $@ #{objs_str} $(LDFLAGS) $(#{prefix}_LDFLAGS)
+#{prefix}_OBJECTS += #{objs_str}
 
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
@@ -393,4 +398,5 @@ while l = gets
   end
 
 end
+utils.each {|util| util.print_tail()}
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix building bug with --enable-grub-emu-usb
  2009-06-17 13:27 [PATCH] fix building bug with --enable-grub-emu-usb Vladimir 'phcoder' Serbinenko
@ 2009-06-19 15:46 ` Pavel Roskin
  2009-06-19 16:03   ` Vladimir 'phcoder' Serbinenko
  2009-06-21 11:38   ` Robert Millan
  0 siblings, 2 replies; 6+ messages in thread
From: Pavel Roskin @ 2009-06-19 15:46 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, 2009-06-17 at 15:27 +0200, Vladimir 'phcoder' Serbinenko wrote:
> Hello. This is a fix for problem in subject line. I believe this fix
> to be correct and legitimate but as I don't know ruby well could
> someone review it? If nobody knows ruby in depth I think we can commit
> this even without deep review

I would prefer that we take a different approach with grub-emu.  I think
the USB support should be enabled whenever libusb is enabled.  If libusb
is missing, then the USB related code should be omitted from the sources
using preprocessor directives.  The build system doesn't need to know
anything about it.

Generally, please think how to reduce complexity, not how to add to it.
Complex systems are harder to maintain.

-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix building bug with --enable-grub-emu-usb
  2009-06-19 15:46 ` Pavel Roskin
@ 2009-06-19 16:03   ` Vladimir 'phcoder' Serbinenko
  2009-06-21 11:38   ` Robert Millan
  1 sibling, 0 replies; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-19 16:03 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

On Fri, Jun 19, 2009 at 5:46 PM, Pavel Roskin <proski@gnu.org> wrote:

> On Wed, 2009-06-17 at 15:27 +0200, Vladimir 'phcoder' Serbinenko wrote:
> > Hello. This is a fix for problem in subject line. I believe this fix
> > to be correct and legitimate but as I don't know ruby well could
> > someone review it? If nobody knows ruby in depth I think we can commit
> > this even without deep review
>
> I would prefer that we take a different approach with grub-emu.  I think
> the USB support should be enabled whenever libusb is enabled.

See my other patch for it

>  If libusb
> is missing, then the USB related code should be omitted from the sources
> using preprocessor directives.  The build system doesn't need to know
> anything about it.

This proposition would go to Marco Gerards - original author of this code. I
personaly don't like putting a whole file in #ifdef but it's matter of taset
(AFAIK there is no technical reason not to do so). Perhaps we can discuss it
on IRC?

>
>
> Generally, please think how to reduce complexity, not how to add to it.
> Complex systems are harder to maintain.
>
This patch wouldn't increase complexity. It just moves a bit of complexity
from ruby to (g)make by defining a variable.

>
> --
> Regards,
> Pavel Roskin
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git

[-- Attachment #2: Type: text/html, Size: 2597 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix building bug with --enable-grub-emu-usb
  2009-06-19 15:46 ` Pavel Roskin
  2009-06-19 16:03   ` Vladimir 'phcoder' Serbinenko
@ 2009-06-21 11:38   ` Robert Millan
  2009-06-21 12:34     ` Vladimir 'phcoder' Serbinenko
  1 sibling, 1 reply; 6+ messages in thread
From: Robert Millan @ 2009-06-21 11:38 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Jun 19, 2009 at 11:46:06AM -0400, Pavel Roskin wrote:
> 
> Generally, please think how to reduce complexity, not how to add to it.
> Complex systems are harder to maintain.

In general, I completely agree with this.

However grub-emu has very special requirements that could make it desireable
sometimes.  Its purpose is to emulate GRUB as faithfully as possible to
uncover bugs so in general we want to use interfaces as lower as possible
_but_ it's sometimes useful to be able to isolate those bugs, which makes
options to choose between higher or lower interfaces also desireable.

For example, should we use our USB drivers against libusb, or should we
ditch libusb and use our *HCI controllers against libpci?  Should we use
our gfxterm against SDL, or should we use our own hardware drivers to
access the hardware (sort of) directly like X does?

I think we need some balance here, and decide on a case by case basis.

Anyway, given that grub-emu is a debugging/development tool, I'm not sure
it's that useful to export those flags to autoconf.  We could just live
with #ifdefs in the code IMHO.  Distributors are going to ship whatever we
choose as default for grub-emu anyway.

-- 
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."



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix building bug with --enable-grub-emu-usb
  2009-06-21 11:38   ` Robert Millan
@ 2009-06-21 12:34     ` Vladimir 'phcoder' Serbinenko
  2009-07-16 15:38       ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-21 12:34 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]

> Anyway, given that grub-emu is a debugging/development tool, I'm not sure
> it's that useful to export those flags to autoconf.  We could just live
> with #ifdefs in the code IMHO.  Distributors are going to ship whatever we
> choose as default for grub-emu anyway.
>
Actually the problem isn't grub-emu. It's building system. This was just a
revealer. Build system needs improvements and reorganisation. And we should
remove this bug too because it's one of the obstacles to e.g. declare all
the  filesystems as a variable in one place

>
> --
> 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
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git

[-- Attachment #2: Type: text/html, Size: 1801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix building bug with --enable-grub-emu-usb
  2009-06-21 12:34     ` Vladimir 'phcoder' Serbinenko
@ 2009-07-16 15:38       ` Vladimir 'phcoder' Serbinenko
  0 siblings, 0 replies; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-07-16 15:38 UTC (permalink / raw)
  To: The development of GRUB 2

comitted

On Sun, Jun 21, 2009 at 2:34 PM, Vladimir 'phcoder'
Serbinenko<phcoder@gmail.com> wrote:
>
>
>>
>> Anyway, given that grub-emu is a debugging/development tool, I'm not sure
>> it's that useful to export those flags to autoconf.  We could just live
>> with #ifdefs in the code IMHO.  Distributors are going to ship whatever we
>> choose as default for grub-emu anyway.
>
> Actually the problem isn't grub-emu. It's building system. This was just a
> revealer. Build system needs improvements and reorganisation. And we should
> remove this bug too because it's one of the obstacles to e.g. declare all
> the  filesystems as a variable in one place
>>
>> --
>> 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
>
>
>
> --
> Regards
> Vladimir 'phcoder' Serbinenko
>
> Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-16 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 13:27 [PATCH] fix building bug with --enable-grub-emu-usb Vladimir 'phcoder' Serbinenko
2009-06-19 15:46 ` Pavel Roskin
2009-06-19 16:03   ` Vladimir 'phcoder' Serbinenko
2009-06-21 11:38   ` Robert Millan
2009-06-21 12:34     ` Vladimir 'phcoder' Serbinenko
2009-07-16 15:38       ` Vladimir 'phcoder' Serbinenko

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.