[PATCH 1/5] search for fonts in /usr/share/fonts/uni

2012-07-10 Thread Jiri Slaby
From: Jiri Slaby jirisl...@gmail.com

Location of the fonts in Suse is /usr/share/fonts/uni. We have to use
this patch when packaging grub2. Instead, it would be great to have
this upstream so others may leverage that.

Signed-off-by: Jiri Slaby jirisl...@gmail.com
---
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 3a95b04..5ea7ffe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,7 +242,7 @@ fi
 FONT_SOURCE=
 
 for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
-  for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont; do
+  for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont 
/usr/share/fonts/uni; do
 if test -f $dir/unifont.$ext; then
   FONT_SOURCE=$dir/unifont.$ext
   break 2
-- 
1.7.10.4



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


[PATCH 3/5] msdos-part: allow embedding in extended partition

2012-07-10 Thread Jiri Slaby
From: Michael Chang mch...@suse.com

The same as in the previous patch, add a support for installing grub
into an extended partition.

Here, we do not ignore extended partitions anymore. Instead we call a
hook that makes sure we have the partition when installing.

Signed-off-by: Jiri Slaby jsl...@suse.cz
References: https://bugzilla.novell.com/show_bug.cgi?id=750897
---
 grub-core/partmap/msdos.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/grub-core/partmap/msdos.c b/grub-core/partmap/msdos.c
index 6e54a74..17f712e 100644
--- a/grub-core/partmap/msdos.c
+++ b/grub-core/partmap/msdos.c
@@ -181,11 +181,15 @@ grub_partition_msdos_iterate (grub_disk_t disk,
(unsigned long long) p.len);
 
  /* If this partition is a normal one, call the hook.  */
- if (! grub_msdos_partition_is_empty (e-type)
-  ! grub_msdos_partition_is_extended (e-type))
+ if (! grub_msdos_partition_is_empty (e-type))
{
  p.number++;
 
+ /* prevent someone doing mkfs or mkswap on an
+extended partition, but leave room for LILO */
+ if (grub_msdos_partition_is_extended (e-type))
+ p.len = 2;
+
  if (hook (disk, p))
return grub_errno;
}
-- 
1.7.10.4



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


[PATCH 4/5] Migrate PPC from Yaboot to Grub2

2012-07-10 Thread Jiri Slaby
From: Mark Hamzy ha...@us.ibm.com

Add configuration support for serial terminal consoles.  This will set the
maximum screen size so that text is not overwritten.

Signed-off-by: Jiri Slaby jsl...@suse.cz
---
 Makefile.util.def  |7 +++
 util/grub.d/20_ppc_terminfo.in |  114 
 2 files changed, 121 insertions(+)
 create mode 100644 util/grub.d/20_ppc_terminfo.in

diff --git a/Makefile.util.def b/Makefile.util.def
index b80187c..4a4f754 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -434,6 +434,13 @@ script = {
 };
 
 script = {
+  name = '20_ppc_terminfo';
+  common = util/grub.d/20_ppc_terminfo.in;
+  installdir = grubconf;
+  condition = COND_HOST_LINUX;
+};
+
+script = {
   name = '30_os-prober';
   common = util/grub.d/30_os-prober.in;
   installdir = grubconf;
diff --git a/util/grub.d/20_ppc_terminfo.in b/util/grub.d/20_ppc_terminfo.in
new file mode 100644
index 000..10d6658
--- /dev/null
+++ b/util/grub.d/20_ppc_terminfo.in
@@ -0,0 +1,114 @@
+#! /bin/sh
+set -e
+
+# grub-mkconfig helper script.
+# Copyright (C) 2006,2007,2008,2009,2010  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 http://www.gnu.org/licenses/.
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+libdir=@libdir@
+. @datadir@/@PACKAGE@/grub-mkconfig_lib
+
+export TEXTDOMAIN=@PACKAGE@
+export TEXTDOMAINDIR=@localedir@
+
+X=80
+Y=24
+TERMINAL=ofconsole
+
+argument () {
+  opt=$1
+  shift
+
+  if test $# -eq 0; then
+  echo $0: option requires an argument -- '$opt' 12
+  exit 1
+  fi
+  echo $1
+}
+
+check_terminfo () {
+
+  while test $# -gt 0
+  do
+option=$1
+shift
+
+case $option in
+terminfo | TERMINFO)
+;;
+
+-g)
+NEWXY=`argument $option $@`
+NEWX=`echo $NEWXY | cut -d x -f 1`
+NEWY=`echo $NEWXY | cut -d x -f 2`
+
+if [ ${NEWX} -ge 80 ] ; then
+  X=${NEWX}
+else
+  echo Warning: ${NEWX} is less than the minimum size of 80
+fi
+
+if [ ${NEWY} -ge 24 ] ; then
+  Y=${NEWY}
+else
+  echo Warning: ${NEWY} is less than the minimum size of 24
+fi
+
+shift
+;;
+
+*)
+#   # accept console or ofconsole
+#   if [ $option != console -a $option != ofconsole ] ; then
+# echo Error: GRUB_TERMINFO unknown console: $option
+# exit 1
+#   fi
+#   # perfer console
+#   TERMINAL=console
+# accept ofconsole
+if [ $option != ofconsole ] ; then
+  echo Error: GRUB_TERMINFO unknown console: $option
+  exit 1
+fi
+# perfer console
+TERMINAL=ofconsole
+;;
+esac
+
+  done
+
+}
+
+if ! uname -m | grep -q ppc ; then
+  exit 0
+fi
+
+if [ x${GRUB_TERMINFO} != x ] ; then
+  F1=`echo ${GRUB_TERMINFO} | cut -d   -f 1`
+
+  if [ ${F1} != terminfo ] ; then
+echo Error: GRUB_TERMINFO is set to \${GRUB_TERMINFO}\ The first word 
should be terminfo.
+exit 1
+  fi
+
+  check_terminfo ${GRUB_TERMINFO}
+fi
+
+cat  EOF
+  terminfo -g ${X}x${Y} ${TERMINAL}
+EOF
-- 
1.7.10.4



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


[PATCH 5/5] add GRUB_CMDLINE_LINUX_RECOVERY for recovery mode

2012-07-10 Thread Jiri Slaby
From: Michael Chang mch...@suse.com

We, in suse, do not use single user mode but with specific kernel
command line options decided in YaST. These command line could be
applied to grub2's recovery mode via the new setting
GRUB_CMDLINE_LINUX_RECOVERY.

The same holds for debian and the script is actually adapted from
there.

Signed-off-by: Jiri Slaby jsl...@suse.cz
---
 util/grub-mkconfig.in   |6 +-
 util/grub.d/10_linux.in |2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 516be86..82917d7 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -140,6 +140,9 @@ GRUB_DEVICE_BOOT_UUID=`${grub_probe} --device 
${GRUB_DEVICE_BOOT} --target=fs_u
 # choosing Hurd filesystem module.
 GRUB_FS=`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2 /dev/null || 
echo unknown`
 
+# Not everyone uses single as recovery, let them override.
+GRUB_CMDLINE_LINUX_RECOVERY=single
+
 if test -f ${sysconfdir}/default/grub ; then
   . ${sysconfdir}/default/grub
 fi
@@ -216,7 +219,8 @@ export GRUB_DEFAULT \
   GRUB_INIT_TUNE \
   GRUB_SAVEDEFAULT \
   GRUB_ENABLE_CRYPTODISK \
-  GRUB_BADRAM
+  GRUB_BADRAM \
+  GRUB_CMDLINE_LINUX_RECOVERY
 
 if test x${grub_cfg} != x; then
   rm -f ${grub_cfg}.new
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 14402e8..6066d32 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -243,7 +243,7 @@ while [ x$list != x ] ; do
   ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}
   if [ x${GRUB_DISABLE_RECOVERY} != xtrue ]; then
 linux_entry ${OS} ${version} recovery \
-single ${GRUB_CMDLINE_LINUX}
+${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_RECOVERY}
   fi
 
   list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
-- 
1.7.10.4



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


Re: Secure Boot. Why don't you take the wind out of their sails?

2012-07-10 Thread richardvo...@gmail.com
On Tue, Jul 10, 2012 at 12:04 AM, Chris Murphy li...@colorremedies.com wrote:

 On Jul 9, 2012, at 7:23 PM, richardvo...@gmail.com wrote:
  All
 systems ship with verification disabled, and all the major motherboard
 manufacturers have indicated that secure boot will always stay an
 opt-in mechanism.

 This is mystifying because it directly contradicts the Microsoft Windows 
 hardware certification requirements, which require that to get the made for 
 Windows 8 certification, the hardware must be UEFI, must implement Secure 
 Boot, must have it enabled by default (except servers), and must have a 
 Microsoft key included. It also requires a user chooseable option to disable 
 Secure Boot on x86, but not ARM.

Maybe I'm missing something, but when I read this, it doesn't say the
hardware must have Secure Boot enabled by default.  Rather, it must be
enabled by the OEM as part of the Windows preinstallation process, so
that it's enabled when it reaches the end user.  System builders are
still going to purchase UEFI Secure Boot-capable motherboards with
Secure Boot disabled-by-default, and they will just work if you want
to install Linux.  End-users who bought pre-installed Windows will
have to change the configuration option in system setup, which for
someone planning to install a new OS from scratch is not a major
hurdle.  It will be a minor road bump for people using live-CD style
media (including USB), but won't be a showstopper if the user actually
has permission from the computer owner to boot the alternate media.
What likely is that it will prevent unauthorized (by the owner)
rebooting public computers using alternate media, but that's not
exactly a valid scenario to begin with.

ARM is a red herring, IMO.  Pretty much all ARM processors include
some sort of code security module that blocks external access to the
bootloader without the correct reprogramming key.  This is pretty
standard for embedded systems, and has been for decades.  Most
embedded systems aren't designed to boot from removable media.

Most tablets don't give the end user root privilege.  That's a shame,
and something we should work to fix, but going around telling everyone
that the world will end if Microsoft gets Secure Boot onto media
devices is just dishonest.  Those devices have been locked down
already, and the world didn't end.

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


Re: Secure Boot. Why don't you take the wind out of their sails?

2012-07-10 Thread Bruce Dubbs

richardvo...@gmail.com wrote:


Maybe I'm missing something, but when I read this, it doesn't say the
hardware must have Secure Boot enabled by default.  Rather, it must be
enabled by the OEM as part of the Windows preinstallation process, so
that it's enabled when it reaches the end user.  System builders are
still going to purchase UEFI Secure Boot-capable motherboards with
Secure Boot disabled-by-default, and they will just work if you want
to install Linux.


For people who are not experts, trying Linux or another operating system 
becomes much more intimidating.  They have to go into the BIOS and 
change something.  Then, to go back to Windows, they have to do it again.


Will this discourage users from trying something else?  You bet.

End-users who bought pre-installed Windows will

have to change the configuration option in system setup, which for
someone planning to install a new OS from scratch is not a major
hurdle.  It will be a minor road bump for people using live-CD style
media (including USB), but won't be a showstopper if the user actually
has permission from the computer owner to boot the alternate media.
What likely is that it will prevent unauthorized (by the owner)
rebooting public computers using alternate media, but that's not
exactly a valid scenario to begin with.


But is is for private computers.  My LUG frequently gives out DVDs with 
various Live system and say try it.  That will become much more 
problematic.


I still don't know how someone is supposed to be able to boot Windows 
within a VM with this new paradigm.


  -- Bruce

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


Re: Secure Boot. Why don't you take the wind out of their sails?

2012-07-10 Thread Lennart Sorensen
On Tue, Jul 10, 2012 at 11:29:21AM -0500, Bruce Dubbs wrote:
 For people who are not experts, trying Linux or another operating
 system becomes much more intimidating.  They have to go into the
 BIOS and change something.  Then, to go back to Windows, they have
 to do it again.

No windows boots fine without the secure boot enabled.

 Will this discourage users from trying something else?  You bet.

Oh that's for sure.  That part is clearly on purpose. :)

 But is is for private computers.  My LUG frequently gives out DVDs
 with various Live system and say try it.  That will become much more
 problematic.
 
 I still don't know how someone is supposed to be able to boot
 Windows within a VM with this new paradigm.

Windows will work fine without secure boot, it just won't have the
malware protection secure boot is supposed to offer.

-- 
Len Sorensen

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


Build error due to missing vga_common.c

2012-07-10 Thread Anton Blanchard

Hi,

It looks like we need to regenerate po/POTFILES.in. I see this
when building a fresh checkout on powerpc:

make[3]: Entering directory `/root/grub/po'
make[3]: *** No rule to make target `.././grub-core/term/i386/vga_common.c', 
needed by `grub.pot-update'.

Anton

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