Re: [Testing] GRUB and OLPC

2013-04-07 Thread Mitch Bradley
OLPC stopped making x86 machines some time ago.  XO-1 machines have
reached or exceeded their design lifetime.  I expect that, if there are
any active users of GRUB on OLPC machines, upgrading to new versions of
GRUB-booted OSs is becoming less and less attractive due to resource
constraints and hardware aging.

OLPC was targeted toward a very specific audience, and the overwhelming
number of active users is within that target audience.  In the early
days there was a lot of interest from developers of other OSs, but as
far as I can tell, that waned years ago as other platforms started to
capture peoples interest.

That being the case, I don't see any compelling reason to continue
maintaining the support.  Existing users could continue to use their
working builds.  It is hard to imagine that there are many (if any)
people who have a real need to install a fresh new version.

I would say that it is time to move on.

On 4/7/2013 12:45 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Hello, all. GRUB has supported OLPC for quite some time but I don't know
> if there are any remaining users. Given how small the intersection
> between geeks and XO-1 owners nowadays is, continuing support is
> problematic. Among other things it's likely to degrade over time unless
> at least minimum maintainance is done. AFAIK none of the active GRUB
> maintainers even possesses one. The current regular testing is limited
> to checking whether it builds. The underlying OLPC ieee1275 firmware
> implementation OFW supposedly supports also qemu and coreboot. While
> it's still somewhat functional in qemu, it lacks important drivers for
> modern system when booted with coreboot, most notably AHCI. Some basic
> automated testing can be performed with OFW on qemu. They currently
> aren't, another gap needed to fill.
> Half of the drivers for OLPC aren't included in this OFW-qemu, each of
> them with specific interface. As a matter of fact we have some
> workarounds enabled for real OLPC which are not needed in qemu but
> without them GRUB would hang on real machine. I don't know if they still
> work. So tests on qemu are better than nothing but give very small
> guarantee. Also OLPC is at intersection of generic i386
> XT-almost-compatible and OFW. Whether ieee1275 or i386 functions work
> better can be inferred from testing on real hardware but failing that
> none is used and corresponding functionality is just disabled. Because
> of all these reasons i386-ieee1275 lags behind and missing features
> often require special case-checking in other parts. E.g. write-back to
> nand is probably trivial to implement but can't be so without testing.
> Supporting jffs2 on nand without testing isn't realistic either.
> Because of all these reasons it may be time to either find solutions to
> at least some of problems (mainly lack of testing) or to retire the port
> altogether.
> 
> P.S: attitude of OFW devs of rejecting even an idea of GRUB for OLPC
> like I've just experienced on IRC isn't helpful.
> 
> 
> 
> ___
> Testing mailing list
> test...@lists.laptop.org
> http://lists.laptop.org/listinfo/testing
> 

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


Re: [PATCH] fix entry editor screen screen layout corruption in trunk

2013-04-07 Thread Andrey Borzenkov
В Sun, 7 Apr 2013 22:50:29 +0400
Andrey Borzenkov  пишет:

> В Sun, 07 Apr 2013 17:49:09 +0200
> Vladimir 'φ-coder/phcoder' Serbinenko  пишет:
> 
> > On 07.04.2013 14:26, Andrey Borzenkov wrote:
> > 
> > > В Wed, 03 Apr 2013 15:22:31 +0200
> > > Vladimir 'φ-coder/phcoder' Serbinenko  пишет:
> > > 
> > >> On 17.02.2013 16:15, Andrey Borzenkov wrote:
> > >>
> > >>> See screenshot for what I get using current trunk.
> > >>>
> > >>> I do not pretend to fully understand all this code so review is
> > >>> appreciated. So far it does fix both gfxterm and console cases for me.
> > >>
> > >> I've fixed the same problem by much smaller logic change
> > >>
> > > 
> > > Unfortunately now gfxterm case it completely broken. IIRC with my patch
> > > it worked right in both cases ...
> > > 
> > 
> > Thank you for reporting this. Fixed.
> > 
> > 
> 
> Not quite. Better, but ...
> 

Mail was rejected due to size so here link to screenshot:

http://susepaste.org/49485899 


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


Re: GRUB and OLPC

2013-04-07 Thread James Cameron
On Mon, Apr 08, 2013 at 12:45:25AM +0200, Vladimir '??-coder/phcoder' 
Serbinenko wrote:
> P.S: attitude of OFW devs of rejecting even an idea of GRUB for OLPC
> like I've just experienced on IRC isn't helpful.

I do apologise if my seeking for information appeared to be rejecting
the idea of GRUB for OLPC XO-1.  I really had no idea what you were
talking about, and you had to teach me first.  Since I am very
familiar with how OFW boots Linux, and not at all familiar how GRUB
boots FreeBSD, I am obviously biased toward OFW doing the task.

I look forward to hearing from users of GRUB booting on XO-1.  It
sounds like an interesting challenge.

--> phcoder (~phco...@245-188.1-85.cust.bluewin.ch) has joined #olpc
 Hello, all. Is anybody uses / is interested / finds interesting / ... 
GRUB2 OLPC support?
<-- PhoenixSTF has quit (Ping timeout: 276 seconds)
 grub is for PC BIOS, but OLPC XO has non-PC BIOS, therefore grub seems 
irrelevant.  what feature of grub are you looking for?
 Quozl: wrong. Platforms currently supported by GRUB:
 GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", 
"i386_coreboot",
"i386_multiboot", "i386_ieee1275", "x86_64_efi",
"mips_loongson", "sparc64_ieee1275",
"powerpc_ieee1275", "mips_arc", "ia64_efi",
"mips_qemu_mips" ]
 2 more in merge queue, yet one more in developpement
 What would be the point?
 (i'm willing to be convinced there is a valid purpose, but for the 
moment i can't see one).
 I think you don't see the current situation: OLPC is supported by 
GRUB2. The question is whether this support should be dropped as OLPC dies out 
and distances itself from geeks.
 I can't see OLPC in the GRUB_PLATFORMS, can you?
 i386-ieee1275 is OLPC
 Neato.  How could I have known that?
 ieee1275 is openfirmware
 I couldn't speak for the users of said support.  I've never used it, 
since the Open Firmware we have includes the necessary code to load kernel and 
ramdisk of any number of Linux instances.
 Why was i386-ieee1275 added?
 But not e.g. FreeBSD
 And it's easier to adapt existing distro by simply changing installed 
GRUB flavour that dancing with OFW.
 I'm sure Open Firmware could boot FreeBSD if somebody tried hard enough.
--> PhoenixSTF (~rudi@83.240.154.11) has joined #olpc
 So the choice is between dancing with GRUB or dancing with Open 
Firmware?  I'm biased, I'd always dance with Open Firmware.  So you should not 
ask me my opinion, as I have no relevant experience.
 Seems like a waste of time to have Open Firmware transfer control to 
GRUB only to have GRUB ask Open Firmware to read certain sectors and transfer 
control to something else.
 How quickly does this combination boot?
 No ARM support?
 Quozl: let me explain: all OLPC-grub devs have gone inactive, that's 
why the question of retiring the port is on the table in the first place. None 
of devs even has OLPC. The tests on i386-ieee1275 are performed at best in qemu 
but your OFW flavour seems to work well only with OLPC, despite claiming to 
work on qemu and coreboot as well (I tested both)
 Show me the tests?
 On coreboot it plainly doesn't see the disks (no AHCI support). 
Couldn't go any further from there.
 On qemu it overwrites 1M-1.5M range despite it being marked as usable
 phcoder: someone on de...@lists.laptop.org might be interested in helping
 perhaps sth more. I workarounded the ofw-qemu bugs to make our 
automated tests run.
 it seems clear that Quozl isn't :-)
 Are you sure this isn't breakage caused by qemu?  ;-)
 I've not used coreboot.  I'm just grabbing grub2 sources to find these 
tests.
 cjb: I'm composing a mail now to grub-devel, de...@lists.laptop.org 
and test...@lists.laptop.org to see if there is a way to reasonably keep it 
around
 sounds good, thanks
 Quozl: on ofw-i386 they are not automated: I gave up when searching 
for a way to boot grub.elf directly rather than going to prompt
 Automate by creating a directory boot and a file olpc.fth in it that 
names grub.elf in place of the kernel?
 Shipping price to Europe doubles the price of OLPC XO-1
 I don't speak forth
 You can learn.
 Quozl: I'm not interested in it.
 Okay.

-- 
James Cameron
http://quozl.linux.org.au/

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


GRUB and OLPC

2013-04-07 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Hello, all. GRUB has supported OLPC for quite some time but I don't know
if there are any remaining users. Given how small the intersection
between geeks and XO-1 owners nowadays is, continuing support is
problematic. Among other things it's likely to degrade over time unless
at least minimum maintainance is done. AFAIK none of the active GRUB
maintainers even possesses one. The current regular testing is limited
to checking whether it builds. The underlying OLPC ieee1275 firmware
implementation OFW supposedly supports also qemu and coreboot. While
it's still somewhat functional in qemu, it lacks important drivers for
modern system when booted with coreboot, most notably AHCI. Some basic
automated testing can be performed with OFW on qemu. They currently
aren't, another gap needed to fill.
Half of the drivers for OLPC aren't included in this OFW-qemu, each of
them with specific interface. As a matter of fact we have some
workarounds enabled for real OLPC which are not needed in qemu but
without them GRUB would hang on real machine. I don't know if they still
work. So tests on qemu are better than nothing but give very small
guarantee. Also OLPC is at intersection of generic i386
XT-almost-compatible and OFW. Whether ieee1275 or i386 functions work
better can be inferred from testing on real hardware but failing that
none is used and corresponding functionality is just disabled. Because
of all these reasons i386-ieee1275 lags behind and missing features
often require special case-checking in other parts. E.g. write-back to
nand is probably trivial to implement but can't be so without testing.
Supporting jffs2 on nand without testing isn't realistic either.
Because of all these reasons it may be time to either find solutions to
at least some of problems (mainly lack of testing) or to retire the port
altogether.

P.S: attitude of OFW devs of rejecting even an idea of GRUB for OLPC
like I've just experienced on IRC isn't helpful.



signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH 5/7] add imported "FDT" module for flattened device tree operations

2013-04-07 Thread Francesco Lavra
On 04/01/2013 06:42 PM, Francesco Lavra wrote:
> On 04/01/2013 04:16 AM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>> Could you put the library itself into a separate tar rather than patch?
> 
> I recall you saying a few months ago that you'd prefer rather without
> libfdt. In fact, libfdt contains much more than what is needed by GRUB.
> I rewrote the FDT-related functions needed by GRUB (using GRUB's naming
> convention) and put them in the standalone files grub-core/lib/fdt.c and
> include/grub/fdt.h. The .c file would need to be included in the linux
> loader module. I also changed loader/arm/linux.c to use the new functions.
> Attached are the needed files; the loader code already contains the
> changes which I proposed in my review of Leif's patch, but supports EFI
> only, not U-Boot. Also, my code is not completely tested yet, I just
> wanted to send it out to get your feedback.

Now I tested my code more thoroughly and fixed quite a few issues. In
attachment you can find the updated version of the fdt.c file.
As far as the linux loader is concerned, I had naively assumed that the
memory allocated with grub_efi_allocate_loader_memory() could be freed
with the usual grub_free(). But then I soon realized this was not the
case, and I wrote a small helper function to properly free the memory:

void
grub_efi_free_memory (void *start, grub_uint32_t size)
{
  grub_efi_free_pages ((grub_addr_t) start, (size >> PAGE_SHIFT) + 1);
}

This function should go in the same file as
grub_efi_allocate_loader_memory().

--
Francesco
/*
 *  GRUB  --  GRand Unified Bootloader
 *  Copyright (C) 2013  Free Software Foundation, Inc.
 *
 *  GRUB is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  GRUB is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with GRUB.  If not, see .
 */

#include 
#include 
#include 

#define FDT_SUPPORTED_VERSION	17

#define FDT_BEGIN_NODE	0x0001
#define FDT_END_NODE	0x0002
#define FDT_PROP	0x0003
#define FDT_NOP		0x0004
#define FDT_END		0x0009

#define struct_end(fdt)	\
	((grub_addr_t) fdt + grub_fdt_get_off_dt_struct(fdt)	\
	 + grub_fdt_get_size_dt_struct(fdt))

/* Size needed by a node entry: 2 tokens (FDT_BEGIN_NODE and FDT_END_NODE), plus
   the NULL-terminated string containing the name, plus padding if needed. */
#define node_entry_size(node_name)	\
	(2 * sizeof(grub_uint32_t)	\
	+ ALIGN_UP (grub_strlen (name) + 1, sizeof(grub_uint32_t)))

/* Size needed by a property entry: 1 token (FDT_PROPERTY), plus len and nameoff
   fields, plus the property value, plus padding if needed. */
#define prop_entry_size(prop_len)	\
	(3 * sizeof(grub_uint32_t) + ALIGN_UP(prop_len, sizeof(grub_uint32_t)))

#define SKIP_NODE_NAME(name, token, end)	\
  name = (char *) ((token) + 1);	\
  while (name < (char *) end)	\
  {	\
if (!*name++)	\
  break;	\
  }	\
  token = (grub_uint32_t *) ALIGN_UP((grub_addr_t) (name), sizeof(*token))


static grub_uint32_t *get_next_node (const void *fdt, char *node_name)
{
  grub_uint32_t *end = (void *) struct_end (fdt);
  grub_uint32_t *token;

  if (node_name >= (char *) end)
return NULL;
  while (*node_name++)
  {
if (node_name >= (char *) end)
  	  return NULL;
  }
  token = (grub_uint32_t *) ALIGN_UP ((grub_addr_t) node_name, 4);
  while (token < end)
  {
switch (grub_be_to_cpu32(*token))
{
  case FDT_BEGIN_NODE:
token = get_next_node (fdt, (char *) (token + 1));
if (!token)
  return NULL;
break;
  case FDT_END_NODE:
token++;
if (token >= end)
  return NULL;
return token;
  case FDT_PROP:
/* Skip property token and following data (len, nameoff and property
   value). */
token += prop_entry_size(grub_be_to_cpu32(*(token + 1)))
 / sizeof(*token);
break;
  case FDT_NOP:
token++;
break;
  default:
return NULL;
}
  }
  return NULL;
}

static int get_mem_rsvmap_size (const void *fdt)
{
  int size = 0;
  grub_uint64_t *ptr = (void *) ((grub_addr_t) fdt
 + grub_fdt_get_off_mem_rsvmap (fdt));

  do
  {
size += 2 * sizeof(*ptr);
if (!*ptr && !*(ptr + 1))
  return size;
ptr += 2;
  } while ((grub_addr_t) ptr <= (grub_addr_t) fdt + grub_fdt_get_totalsize (fdt)
  - 2 * sizeof(grub_uint64_t));
  return -1;
}

static grub_uint32_t get_free_space (void *fdt)
{
  int mem_rsvmap_size = get_mem_rsvmap_size (fdt);

  if (mem_rsvmap_

Re: [PATCH 6/7] add ARM Linux loader

2013-04-07 Thread Francesco Lavra
Hi, I noticed another minor issue in this patch.

On 03/24/2013 06:01 PM, Leif Lindholm wrote:
> --- grub-core/loader/arm/linux.c  1970-01-01 00:00:00 +
> +++ grub-core/loader/arm/linux.c  2013-03-24 13:49:04 +
[...]
> +static grub_err_t
> +grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
> +  int argc, char *argv[])
> +{
> +  grub_file_t file;
> +  int size;
> +
> +  if (argc == 0)
> +return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
> +
> +  file = grub_file_open (argv[0]);
> +  if (!file)
> +return grub_errno;
> +
> +  size = grub_file_size (file);
> +  if (size == 0)
> +goto fail;
> +
> +#ifdef GRUB_MACHINE_EFI
> +  initrd_start = (grub_addr_t) grub_efi_allocate_loader_memory 
> (LINUX_INITRD_PHYS_OFFSET, size);
> +#else
> +  initrd_start = LINUX_INITRD_ADDRESS;
> +#endif
> +  grub_dprintf ("loader", "Loading initrd to 0x%08x\n",
> + (grub_addr_t) initrd_start);
> +
> +  if (grub_file_read (file, (void *) initrd_start, size) != size)
> +goto fail;
> +
> +  initrd_end = initrd_start + size;
> +
> +  return GRUB_ERR_NONE;

The file should be closed also if the initrd is successfully loaded.

> +
> +fail:
> +  grub_file_close (file);
> +
> +  return grub_errno;
> +}

--
Francesco

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


Raspberry pi support

2013-04-07 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Based on Leif Lindholm's patches I could go to GRUB console on raspberry pi.
The biggest problem is that cache flushing is simply skipped. Another problem
is that due to different linux image format linux loader doesn't work. I didn't
test grub-install but fed GRUB to uboot using kermit.
Is there any advantage in building armv6 binary by default unless user overrides
through TARGET_CFLAGS?
Some of the fixes are to make tools work on amd64


=== modified file 'conf/Makefile.common'
--- conf/Makefile.common2013-04-07 00:41:07 +
+++ conf/Makefile.common2013-04-07 16:08:07 +
@@ -40,8 +40,7 @@
 if COND_arm
 # Image entry point always in ARM (A32) state - ensure proper functionality if
 # the rest is built for the Thumb (T32) state.
-  CFLAGS_PLATFORM += -mthumb-interwork -mno-unaligned-access -mlong-calls
-  CCASFLAGS_PLATFORM = -Wa,-mimplicit-it=thumb
+  CFLAGS_PLATFORM += -mthumb-interwork -march=armv6 -mlong-calls
   LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
 endif
 

=== modified file 'configure.ac'
--- configure.ac2013-04-07 00:41:07 +
+++ configure.ac2013-04-07 16:08:07 +
@@ -717,7 +717,7 @@
 fi
 
 # Check for libgcc symbols
-AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 
_restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 
__moddi3 __divdi3 __ctzdi2 __ctzsi2)
+AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 
_restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 
__moddi3 __divdi3 __ctzdi2 __ctzsi2 __aeabi_ulcmp)
 
 if test "x$TARGET_APPLE_CC" = x1 ; then
 CFLAGS="$TARGET_CFLAGS -nostdlib"

=== modified file 'grub-core/kern/arm/dl.c'
--- grub-core/kern/arm/dl.c 2013-04-07 00:41:07 +
+++ grub-core/kern/arm/dl.c 2013-04-07 16:08:07 +
@@ -27,9 +27,6 @@
 #ifdef GRUB_UTIL
 # include 
 #else
-# if !defined(__thumb2__)
-#  error "Relocations not implemented for A32 ("ARM") instruction set yet!"
-# endif
 
 grub_err_t reloc_jump24 (grub_uint32_t *addr, Elf32_Addr sym_addr);
 grub_err_t reloc_thm_call (grub_uint16_t *addr, Elf32_Addr sym_addr);
@@ -169,8 +166,8 @@
 }
 
 #ifdef GRUB_UTIL
-  grub_util_info ("relative destination = 0x%08x",
- (unsigned int)target + offset);
+  grub_util_info ("relative destination = 0x%08lx",
+ (unsigned long)target + offset);
 #endif
 
   /* Reassemble instruction word */
@@ -358,6 +355,7 @@
  return retval;
  }
  break;
+   case R_ARM_CALL:
case R_ARM_JUMP24:
  {
retval = reloc_jump24 (target, sym_addr);

=== modified file 'grub-core/kern/dl.c'
--- grub-core/kern/dl.c 2013-03-19 19:25:09 +
+++ grub-core/kern/dl.c 2013-04-07 16:08:07 +
@@ -588,7 +588,7 @@
 {
   grub_dprintf ("modules", "flushing 0x%lx bytes at %p\n",
(unsigned long) mod->sz, mod->base);
-  grub_arch_sync_caches (mod->base, mod->sz);
+  //  grub_arch_sync_caches (mod->base, mod->sz);
 }
 
 /* Load a module from core memory.  */

=== modified file 'include/grub/libgcc.h'
--- include/grub/libgcc.h   2013-04-07 00:41:07 +
+++ include/grub/libgcc.h   2013-04-07 16:08:07 +
@@ -122,4 +122,5 @@
 void EXPORT_FUNC (__aeabi_uidiv) (void);
 void EXPORT_FUNC (__aeabi_uidivmod) (void);
 void EXPORT_FUNC (__wrap___clear_cache) (void *, void *);
+void EXPORT_FUNC (__aeabi_ulcmp) (void);
 #endif

=== modified file 'include/grub/uboot/api_public.h'
--- include/grub/uboot/api_public.h 2013-04-07 00:41:07 +
+++ include/grub/uboot/api_public.h 2013-04-07 16:08:07 +
@@ -61,9 +61,6 @@
 
 typedef int (*scp_t) (int, int *, ...);
 
-typedef grub_uint16_t uint16_t;
-typedef grub_uint32_t uint32_t;
-
 #define API_SIG_VERSION1
 #define API_SIG_MAGIC  "UBootAPI"
 #define API_SIG_MAGLEN 8
@@ -71,8 +68,8 @@
 struct api_signature
 {
   char magic[API_SIG_MAGLEN];  /* magic string */
-  uint16_t version;/* API version */
-  uint32_t checksum;   /* checksum of this sig struct */
+  grub_uint16_t version;   /* API version */
+  grub_uint32_t checksum;  /* checksum of this sig struct */
   scp_t syscall;   /* entry point to the API */
 };
 

=== modified file 'util/grub-mkimagexx.c'
--- util/grub-mkimagexx.c   2013-04-07 00:41:07 +
+++ util/grub-mkimagexx.c   2013-04-07 16:08:07 +
@@ -553,7 +553,7 @@
   case R_ARM_THM_CALL:
   case R_ARM_THM_JUMP24:
 {
-  grub_util_info ("  
THM_JUMP24:\ttarget=0x%08x\toffset=(0x%08x)", (unsigned int) target, sym_addr);
+  grub_util_info ("  
THM_JUMP24:\ttarget=0x%08lx\toffset=(0x%08x)",(unsigned long) target, 
sym_addr);
   sym_addr -= offset;
   /* Thumb instructions can be 16-bit aligned */
   reloc_thm_call ((grub_uint16_t *) target, sym_addr);





signature.asc
Description: 

Re: [PATCH] fix entry editor screen screen layout corruption in trunk

2013-04-07 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 07.04.2013 14:26, Andrey Borzenkov wrote:

> В Wed, 03 Apr 2013 15:22:31 +0200
> Vladimir 'φ-coder/phcoder' Serbinenko  пишет:
> 
>> On 17.02.2013 16:15, Andrey Borzenkov wrote:
>>
>>> See screenshot for what I get using current trunk.
>>>
>>> I do not pretend to fully understand all this code so review is
>>> appreciated. So far it does fix both gfxterm and console cases for me.
>>
>> I've fixed the same problem by much smaller logic change
>>
> 
> Unfortunately now gfxterm case it completely broken. IIRC with my patch
> it worked right in both cases ...
> 

Thank you for reporting this. Fixed.




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: autogen.sh from bzr failed : configure.ac:382: error: expected source file, required through AC_LIBSOURCES, not found

2013-04-07 Thread Daniel Kahn Gillmor
On 04/07/2013 02:22 AM, Andrey Borzenkov wrote:
> В Sun, 07 Apr 2013 00:04:08 -0400 Daniel Kahn Gillmor 
>  пишет:
  [...]
>> missing file grub-core/gnulib/getopt1.c
> 
> Do you actually have this file? Just to be sure?

hm, good call, the file wasn't there.  after checking at the bzr webview
[0] to see that it's actually supposed to be on trunk in the first place
(and not generated by some previous autotools step or something), i did
a bit of further digging.  it was a problem with my use of git-bzr,
reported now at http://bugs.debian.org/704913

i'm now using standard bzr instead of git-bzr to do the repository work,
and the build seems to be working fine.

Sorry about the false alarm,

--dkg

[0]
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/grub-core/gnulib/getopt1.c



signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] reimplement grub-reboot to nor depend on GRUB_DEFAULT=saved

2013-04-07 Thread Paul Menzel
Am Sonntag, den 07.04.2013, 14:34 +0400 schrieb Andrey Borzenkov:
> В Sat, 06 Apr 2013 21:52:15 +0200
> Vladimir 'φ-coder/phcoder' Serbinenko  пишет:
> 
> > On 30.01.2013 10:08, Andrey Borzenkov wrote:
> > 
> > > +   savenev next_entry
> > > +   savenev next_entry
> > 
> > Have you actually tested this patch? This is not a correct comand name.
> > 
> 
> Not really; it was more a question "would this even be considered".
> 
> Here is updated patch which I actually did test :)
> 
> From: Andrey Borzenkov 
> Subject: [PATCH] reimplement grub-reboot to nor depend on GRUB_DEFAULT=saved

s,nor,not,

> To: grub-devel@gnu.org
> 
> Use separate environment variable next_entry to indicate one time
> boot entry. CMOS button still takes precedent. It makes grub-reboot
> usable also when GRUB_DEFAULT is set to explicit value.
> 
> It retains support for prev_saved_entry for compatibility. Also
> grub-reboot will restore saved_entry from prev_saved_entry first time
> it is called.
> 
> As a side effect it also fixes a problem that saved_entry is lost
> after two consequitive grub-reboot calls.

s,consequitive,consecutive,

> 
> Signed-off-by: Andrey Borzenkov 
> 
> ---
>  ChangeLog|  5 +
>  util/grub-reboot.in  | 17 ++---
>  util/grub-set-default.in |  1 +
>  util/grub.d/00_header.in | 14 +-
>  4 files changed, 25 insertions(+), 12 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 9163911..df12f4b 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,8 @@
> +2013-04-07  Andrey Borzenkov 
> +
> + Reimplement grub-reboot to not depend on saved_entry. Use next_entry
> + variabe for one time boot menu entry.

*variab*l*e

> +
>  2013-04-06  Andrey Borzenkov 
>  
>   * conf/Makefile.extra-dist (EXTRA_DIST): Add
> diff --git a/util/grub-reboot.in b/util/grub-reboot.in
> index 1a91d36..d132e4f 100644
> --- a/util/grub-reboot.in
> +++ b/util/grub-reboot.in
> @@ -46,8 +46,6 @@ export TEXTDOMAINDIR="@localedir@"
>  usage () {
>  gettext_printf "Usage: %s [OPTION] MENU_ENTRY\n" "$self"
>  gettext "Set the default boot menu entry for GRUB, for the next boot 
> only."; echo
> -gettext_printf "This requires setting GRUB_DEFAULT=saved in 
> %s/default/grub.\n" "$sysconfdir"
> -echo
>  print_option_help "-h, --help" "$(gettext "print this message and exit")"
>  print_option_help "-v, --version" "$(gettext "print the version 
> information and exit")"
>  dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s 
> instead of the %s directory" "@grubdirname@" "$grubdir")"
> @@ -129,17 +127,14 @@ fi
>  
>  grubdir=`echo "${bootdir}/@grubdirname@" | sed 's,//*,/,g'`
>  
> -prev_saved_entry=`$grub_editenv ${grubdir}/grubenv list | sed -n 
> 's/^saved_entry=//p'`
> +# Restore saved_entry if it was set by previous version
> +prev_saved_entry=`$grub_editenv ${grubdir}/grubenv list | sed -n 
> 's/^prev_saved_entry=//p'`
>  if [ "$prev_saved_entry" ]; then
> -$grub_editenv ${grubdir}/grubenv set prev_saved_entry="$prev_saved_entry"
> -else
> -# We need some non-empty value for prev_saved_entry so that GRUB will
> -# recognise that grub-reboot has been used and restore the previous
> -# saved entry. "0" is the same as an empty value, i.e. the first menu
> -# entry.
> -$grub_editenv ${grubdir}/grubenv set prev_saved_entry=0
> +$grub_editenv ${grubdir}/grubenv set saved_entry="$prev_saved_entry"
> +$grub_editenv ${grubdir}/grubenv unset prev_saved_entry
>  fi
> -$grub_editenv ${grubdir}/grubenv set saved_entry="$entry"
> +
> +$grub_editenv ${grubdir}/grubenv set next_entry="$entry"
>  
>  # Bye.
>  exit 0
> diff --git a/util/grub-set-default.in b/util/grub-set-default.in
> index ea18da1..d607318 100644
> --- a/util/grub-set-default.in
> +++ b/util/grub-set-default.in
> @@ -130,6 +130,7 @@ fi
>  grubdir=`echo "${bootdir}/@grubdirname@" | sed 's,//*,/,g'`
>  
>  $grub_editenv ${grubdir}/grubenv unset prev_saved_entry
> +$grub_editenv ${grubdir}/grubenv unset next_entry
>  $grub_editenv ${grubdir}/grubenv set saved_entry="$entry"
>  
>  # Bye.
> diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
> index 3da5d12..2c4bb0a 100644
> --- a/util/grub.d/00_header.in
> +++ b/util/grub.d/00_header.in
> @@ -51,13 +51,25 @@ if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
>  cat <  if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
> set default="${GRUB_DEFAULT_BUTTON}"
> +elif [ "\${next_entry}" ] ; then
> +   set default="\${next_entry}"
> +   set next_entry=
> +   save_env next_entry
> +   set boot_once=true
>  else
> set default="${GRUB_DEFAULT}"
>  fi
>  EOF
>  else
>  cat < -set default="${GRUB_DEFAULT}"
> +if [ "\${next_entry}" ] ; then
> +   set default="\${next_entry}"
> +   set next_entry=
> +   save_env next_entry
> +   set boot_once=true
> +else
> +   set default="${GRUB_DEFAULT}"
> +fi
>  EOF
>  fi
>  cat <

signature.asc
Description: This is a digitally signed message part
___

Re: [PATCH] reimplement grub-reboot to nor depend on GRUB_DEFAULT=saved

2013-04-07 Thread Andrey Borzenkov
В Sat, 06 Apr 2013 21:52:15 +0200
Vladimir 'φ-coder/phcoder' Serbinenko  пишет:

> On 30.01.2013 10:08, Andrey Borzenkov wrote:
> 
> > +   savenev next_entry
> > +   savenev next_entry
> 
> Have you actually tested this patch? This is not a correct comand name.
> 

Not really; it was more a question "would this even be considered".

Here is updated patch which I actually did test :)

From: Andrey Borzenkov 
Subject: [PATCH] reimplement grub-reboot to nor depend on GRUB_DEFAULT=saved
To: grub-devel@gnu.org

Use separate environment variable next_entry to indicate one time
boot entry. CMOS button still takes precedent. It makes grub-reboot
usable also when GRUB_DEFAULT is set to explicit value.

It retains support for prev_saved_entry for compatibility. Also
grub-reboot will restore saved_entry from prev_saved_entry first time
it is called.

As a side effect it also fixes a problem that saved_entry is lost
after two consequitive grub-reboot calls.

Signed-off-by: Andrey Borzenkov 

---
 ChangeLog|  5 +
 util/grub-reboot.in  | 17 ++---
 util/grub-set-default.in |  1 +
 util/grub.d/00_header.in | 14 +-
 4 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9163911..df12f4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-07  Andrey Borzenkov 
+
+   Reimplement grub-reboot to not depend on saved_entry. Use next_entry
+   variabe for one time boot menu entry.
+
 2013-04-06  Andrey Borzenkov 
 
* conf/Makefile.extra-dist (EXTRA_DIST): Add
diff --git a/util/grub-reboot.in b/util/grub-reboot.in
index 1a91d36..d132e4f 100644
--- a/util/grub-reboot.in
+++ b/util/grub-reboot.in
@@ -46,8 +46,6 @@ export TEXTDOMAINDIR="@localedir@"
 usage () {
 gettext_printf "Usage: %s [OPTION] MENU_ENTRY\n" "$self"
 gettext "Set the default boot menu entry for GRUB, for the next boot 
only."; echo
-gettext_printf "This requires setting GRUB_DEFAULT=saved in 
%s/default/grub.\n" "$sysconfdir"
-echo
 print_option_help "-h, --help" "$(gettext "print this message and exit")"
 print_option_help "-v, --version" "$(gettext "print the version 
information and exit")"
 dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s 
instead of the %s directory" "@grubdirname@" "$grubdir")"
@@ -129,17 +127,14 @@ fi
 
 grubdir=`echo "${bootdir}/@grubdirname@" | sed 's,//*,/,g'`
 
-prev_saved_entry=`$grub_editenv ${grubdir}/grubenv list | sed -n 
's/^saved_entry=//p'`
+# Restore saved_entry if it was set by previous version
+prev_saved_entry=`$grub_editenv ${grubdir}/grubenv list | sed -n 
's/^prev_saved_entry=//p'`
 if [ "$prev_saved_entry" ]; then
-$grub_editenv ${grubdir}/grubenv set prev_saved_entry="$prev_saved_entry"
-else
-# We need some non-empty value for prev_saved_entry so that GRUB will
-# recognise that grub-reboot has been used and restore the previous
-# saved entry. "0" is the same as an empty value, i.e. the first menu
-# entry.
-$grub_editenv ${grubdir}/grubenv set prev_saved_entry=0
+$grub_editenv ${grubdir}/grubenv set saved_entry="$prev_saved_entry"
+$grub_editenv ${grubdir}/grubenv unset prev_saved_entry
 fi
-$grub_editenv ${grubdir}/grubenv set saved_entry="$entry"
+
+$grub_editenv ${grubdir}/grubenv set next_entry="$entry"
 
 # Bye.
 exit 0
diff --git a/util/grub-set-default.in b/util/grub-set-default.in
index ea18da1..d607318 100644
--- a/util/grub-set-default.in
+++ b/util/grub-set-default.in
@@ -130,6 +130,7 @@ fi
 grubdir=`echo "${bootdir}/@grubdirname@" | sed 's,//*,/,g'`
 
 $grub_editenv ${grubdir}/grubenv unset prev_saved_entry
+$grub_editenv ${grubdir}/grubenv unset next_entry
 $grub_editenv ${grubdir}/grubenv set saved_entry="$entry"
 
 # Bye.
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 3da5d12..2c4bb0a 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -51,13 +51,25 @@ if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
 cat <

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