All of lore.kernel.org
 help / color / mirror / Atom feed
* installing iso images in legacy mode
@ 2017-07-31 15:27 Markus Volk
  2017-08-01 19:58 ` Markus Volk
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Volk @ 2017-07-31 15:27 UTC (permalink / raw)
  To: yocto

Iso Images (x86_64) created with the current master fail when trying to install using the legacy bios startup. Live boot from usb is fine, but when installing, i´m getting an error ... "/usr/share/locale" could not be found. After reboot i'm getting dropped to grub-shell, because the kernel could not be loaded.

When setting the bios startup to uefi mode, everything works as expected.

Has legacy pcbios mode been dropped or is this some kind of bug ?

-- 
Markus Volk <f_l_k@t-online.de>


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

* Re: installing iso images in legacy mode
  2017-07-31 15:27 installing iso images in legacy mode Markus Volk
@ 2017-08-01 19:58 ` Markus Volk
  2017-08-02  7:48   ` Markus Volk
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Volk @ 2017-08-01 19:58 UTC (permalink / raw)
  To: yocto

I had some time to look at this issue today. Since grub was recently updated i tried using the old recipes from pyro. This fixed booting without efi. Then i had a look at meta/recipes-core/initrdscripts/files/init-install.sh

My suspicion was, that this line

grub_version=$(grub-install -v|sed 's/.* \([0-9]\).*/\1/')

turns out to be zero with grub-202, and thereby messes the whole thing up

Changing to:

grub_version=202

fixed my legacy boot problem.

:)

On Mon, 31 Jul 2017 17:27:07 +0200
Markus Volk <f_l_k@t-online.de> wrote:

> Iso Images (x86_64) created with the current master fail when trying to install using the legacy bios startup. Live boot from usb is fine, but when installing, i´m getting an error ... "/usr/share/locale" could not be found. After reboot i'm getting dropped to grub-shell, because the kernel could not be loaded.
> 
> When setting the bios startup to uefi mode, everything works as expected.
> 
> Has legacy pcbios mode been dropped or is this some kind of bug ?
> 
> -- 
> Markus Volk <f_l_k@t-online.de>
> -- 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


-- 
Markus Volk <f_l_k@t-online.de>


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

* Re: installing iso images in legacy mode
  2017-08-01 19:58 ` Markus Volk
@ 2017-08-02  7:48   ` Markus Volk
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Volk @ 2017-08-02  7:48 UTC (permalink / raw)
  To: yocto

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

Perhaps the issue should be fixed by making this switch static ?



On Tue, 1 Aug 2017 21:58:16 +0200
Markus Volk <f_l_k@t-online.de> wrote:

> I had some time to look at this issue today. Since grub was recently updated i tried using the old recipes from pyro. This fixed booting without efi. Then i had a look at meta/recipes-core/initrdscripts/files/init-install.sh
> 
> My suspicion was, that this line
> 
> grub_version=$(grub-install -v|sed 's/.* \([0-9]\).*/\1/')
> 
> turns out to be zero with grub-202, and thereby messes the whole thing up
> 
> Changing to:
> 
> grub_version=202
> 
> fixed my legacy boot problem.
> 
> :)
> 
> On Mon, 31 Jul 2017 17:27:07 +0200
> Markus Volk <f_l_k@t-online.de> wrote:
> 
> > Iso Images (x86_64) created with the current master fail when trying to install using the legacy bios startup. Live boot from usb is fine, but when installing, i´m getting an error ... "/usr/share/locale" could not be found. After reboot i'm getting dropped to grub-shell, because the kernel could not be loaded.
> > 
> > When setting the bios startup to uefi mode, everything works as expected.
> > 
> > Has legacy pcbios mode been dropped or is this some kind of bug ?
> > 
> > -- 
> > Markus Volk <f_l_k@t-online.de>
> > -- 
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
> 
> 
> -- 
> Markus Volk <f_l_k@t-online.de>
> -- 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


-- 
Markus Volk <f_l_k@t-online.de>

[-- Attachment #2: 0001-init-install.sh-fix-grub-install-for-legacy-pcbios.patch --]
[-- Type: application/octet-stream, Size: 4241 bytes --]

From 76f3ca1a8b62357252098aa4d3033a98548d258f Mon Sep 17 00:00:00 2001
From: MarkusVolk <f_l_k@t-online.de>
Date: Wed, 2 Aug 2017 09:38:42 +0200
Subject: [PATCH] init-install.sh: fix grub install for legacy pcbios
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: MarkusVolk <f_l_k@t-online.de>

grub_version=$(grub-install -v|sed 's/.* \([0-9]\).*/\1/')

This switch inside the script seems to fail for grub-2.02. Due to the fact,
that there isn´t any legacy grub recipe inside the yocto layer it should be more failproof to make this switch static

The assumption, the output of grub-install wouldn´t change inside minor releases turns out  to be  somewhat audacious.

Signed-off-by: MarkusVolk <f_l_k@t-online.de>
---
 .../recipes-core/initrdscripts/files/init-install.sh | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 572613ecd4..ac393d927d 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -132,9 +132,9 @@ fi
 
 disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
 
-grub_version=$(grub-install -v|sed 's/.* \([0-9]\).*/\1/')
+legacy_grub=0
 
-if [ $grub_version -eq 0 ] ; then
+if [ $legacy_grub -eq 1 ] ; then
     bios_boot_size=0
 else
     # For GRUB 2 we need separate parition to store stage2 grub image
@@ -166,7 +166,7 @@ if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then
     rootwait="rootwait"
 fi
 
-if [ $grub_version -eq 0 ] ; then
+if [ $legacy_grub -eq 1 ] ; then
     bios_boot=''
     bootfs=${device}${part_prefix}1
     rootfs=${device}${part_prefix}2
@@ -179,7 +179,7 @@ else
 fi
 
 echo "*****************"
-[ $grub_version -ne 0 ] && echo "BIOS boot partition size: $bios_boot_size MB ($bios_boot)"
+[ $legacy_grub -ne 1 ] && echo "BIOS boot partition size: $bios_boot_size MB ($bios_boot)"
 echo "Boot partition size:   $boot_size MB ($bootfs)"
 echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
 echo "Swap partition size:   $swap_size MB ($swap)"
@@ -188,7 +188,7 @@ echo "Deleting partition table on ${device} ..."
 dd if=/dev/zero of=${device} bs=512 count=35
 
 echo "Creating new partition table on ${device} ..."
-if [ $grub_version -eq 0 ] ; then
+if [ $legacy_grub -eq 1 ] ; then
     parted ${device} mktable msdos
     echo "Creating boot partition on $bootfs"
     parted ${device} mkpart primary ext3 0% $boot_size
@@ -202,11 +202,11 @@ else
 fi
 
 echo "Creating rootfs partition on $rootfs"
-[ $grub_version -eq 0 ] && pname='primary' || pname='root'
+[ $legacy_grub -eq 1 ] && pname='primary' || pname='root'
 parted ${device} mkpart $pname ext3 $rootfs_start $rootfs_end
 
 echo "Creating swap partition on $swap"
-[ $grub_version -eq 0 ] && pname='primary' || pname='swap'
+[ $legacy_grub -eq 1 ] && pname='primary' || pname='swap'
 parted ${device} mkpart $pname linux-swap $swap_start 100%
 
 parted ${device} print
@@ -230,7 +230,7 @@ mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
 echo "Copying rootfs files..."
 cp -a /src_root/* /tgt_root
 if [ -d /tgt_root/etc/ ] ; then
-    if [ $grub_version -ne 0 ] ; then
+    if [ $legacy_grub -ne 1 ] ; then
         boot_uuid=$(blkid -o value -s UUID ${bootfs})
         swap_part_uuid=$(blkid -o value -s PARTUUID ${swap})
         bootdev="UUID=$boot_uuid"
@@ -252,7 +252,7 @@ umount /src_root
 # Handling of the target boot partition
 mount $bootfs /boot
 echo "Preparing boot partition..."
-if [ -f /etc/grub.d/00_header -a $grub_version -ne 0 ] ; then
+if [ -f /etc/grub.d/00_header -a $legacy_grub -ne 1 ] ; then
     echo "Preparing custom grub2 menu..."
     root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs})
     boot_uuid=$(blkid -o value -s UUID ${bootfs})
@@ -268,7 +268,7 @@ _EOF
 fi
 grub-install ${device}
 
-if [ $grub_version -eq 0 ] ; then
+if [ $legacy_grub -eq 1 ] ; then
     echo "(hd0) ${device}" > /boot/grub/device.map
     echo "Preparing custom grub menu..."
     echo "default 0" > /boot/grub/menu.lst
-- 
2.11.1


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

end of thread, other threads:[~2017-08-02  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-31 15:27 installing iso images in legacy mode Markus Volk
2017-08-01 19:58 ` Markus Volk
2017-08-02  7:48   ` Markus Volk

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.