Il 29/11/2013 13:58, Fabio Fantoni ha scritto:
Il 29/11/2013 12:41, Vladimir 'φ-coder/phcoder' Serbinenko ha scritto:
On 29.11.2013 12:28, Fabio Fantoni wrote:
Il 28/11/2013 15:17, Fabio Fantoni ha scritto:
Il 28/11/2013 15:05, Vladimir 'φ-coder/phcoder' Serbinenko ha scritto:
On 28.11.2013 14:07, Fabio Fantoni wrote:
Il 27/11/2013 18:35, Andrey Borzenkov ha scritto:
В Wed, 27 Nov 2013 17:24:53 +0100
Fabio Fantoni <fabio.fant...@m2r.biz> пишет:

Il 27/11/2013 17:03, Vladimir 'φ-coder/phcoder' Serbinenko ha
scritto:
On 27.11.2013 16:59, Fabio Fantoni wrote:
Il 27/11/2013 12:50, Vladimir 'φ-coder/phcoder' Serbinenko ha
scritto:
That pretty much explains what happened: you don't have any
/boot/grub2/grub.cfg and when looking for /boot/grub/grub.cfg GRUB
found
its own memdisk and fell into recursion. I'm not sure what should
be the
proper way to solve this recursion.
Yes, it was a bit naive on my side. Recursion in principle can be
stopped by using global variable, but search is limited to the first
match only anyway, so I guess it is not worth it.

Anyone know how to exclude memdisk from the search please?
Please look in grub2 sources at docs/osdetect.cfg. It implements
advanced run-time detection of possible bootable files from
various operating systems. It boils down to loop across all devices, and of course you can either limit device names (like looking for hd*
only) or explicitly exclude known ones (like memdisk).

Is it possible to specify a different default grub.cfg path
(different
from all other distributions) changing this command:
./grub-mkstandalone --grub-mkimage=./grub-mkimage -o pvgrub2.xen -O
x86_64-xen -d grub-core/ boot/grub/grub.cfg
Is it hardcoded as /boot/grub/grub.cfg for grub memdisk or can be
set?

Not really. Currently the situation is

- grub-mkstandalone hardcodes $prefix as (memdisk)/boot/grub
- after launch grub unconditionally starts "normal" module if at all
     possible
- normal module always tries to load and execute $prefix/grub.cfg
if no
     explicit configuration file name is given as argument

But I think that using osdetect.cfg or something based on this idea
won't require changing defaults at all.
Thanks for your reply.

I did this script that is working about finding and include the
grub.cfg
of pv domUs with many cases:

cat > boot/grub/grub.cfg <<EOF
insmod lvm
insmod ext2
insmod part_msdos
insmod part_gpt
insmod btrfs

insmod regexp
for dev in (*); do
      # $device: parenthesis removed from $dev
      regexp -s device '\((.*)\)' $dev
      set root=$device
      for file in /boot/vmlinuz-* /boot/linux-*; do
          if test -f $file; then
              set saved_root=$root
          fi
      done
done
set root=$saved_root

if test -f /boot/grub2/grub.cfg ; then
      configfile /boot/grub2/grub.cfg
elif test -f /boot/grub/grub.cfg ; then
      configfile /boot/grub/grub.cfg
fi
EOF

@xen developer: Are there other modules to insert for other partitions or file systems, other grub cfg path for other distributions or other
kernel type to search that support xen pv domUs?
I think is good do and post complete pvgrub2 cfg that support all pv
domUs.

@xen and grub developer: I'm still unable to boot any entry of Sid pv
domU using official kernel:
xl -vvv create -c /etc/xen/sid.cfg
...
Caricamento Linux 3.11-1-amd64...
Caricamento ramdisk iniziale...
xc: debug: hypercall buffer: total allocations:247 total releases:247
xc: debug: hypercall buffer: current allocations:0 maximum
allocations:4
xc: debug: hypercall buffer: cache current size:4
xc: debug: hypercall buffer: cache hits:236 misses:4 toobig:7

Any ideas?

Ah I forgot: you need to "insmod xzio" since debian ones are compressed.
If you need more tests/informations tell me and I'll post them.

Thanks for any reply.

Thanks for reply, in the meantime I rebuilt updated grub2 from git
(commit    b67422d33de8eee83700db534a45b2ac5e5ed67a)  and there is a
regression from build of some days ago (I don't remember the exact
commit, probably was of 24 or 25 november).
Fails on script I posted on previous mail showing some errors:
kern/dl.c:619: module name: test
kern/dl.c:620: init function: 0x3f5abdd4
error: two arguments expected.
commands/wildcard.c:164: Regexp is ^vmlinuz-.*$
commands/wildcard.c:164: Regexp is ^linux-.*$
error: two arguments expected.
commands/wildcard.c:164: Regexp is ^vmlinuz-.*$
commands/wildcard.c:164: Regexp is ^linux-.*$
error: two arguments expected.
commands/wildcard.c:164: Regexp is ^vmlinuz-.*$
commands/wildcard.c:164: Regexp is ^linux-.*$
Full log with debug on attachment.

I updated git to commit 69ca97c820a623f85baf2db1627e19bef9c24e44 and the
regression persist.

About Sid boot adding "insmod xzio" not solve the problem.
Can you give me details of your working cases?
Can you send me the exact kernel? My sid kernel work fine.


(Resent re-adding xen-devel and grub-devel)

I have updated Sid domU today before retry with pvgrub2.
Latest version of kernel and grub is installed, on attachment the grub.cfg of domU. If domU's grub.cfg is ok, what is git commit and details of your pvgrub2 build working?

My actual build is:
git clone git://git.sv.gnu.org/grub.git
./autogen.sh
./configure --target=x86_64 --with-platform=xen
make
mkdir -p boot/grub/
cat > boot/grub/grub.cfg <<EOF
insmod lvm
insmod ext2
insmod part_msdos
insmod part_gpt
insmod btrfs
insmod xzio

insmod regexp
for dev in (*); do
    # $device: parenthesis removed from $dev
    regexp -s device '\((.*)\)' $dev
    set root=$device
    for file in /boot/vmlinuz-* /boot/linux-*; do
        if test -f $file; then
            set saved_root=$root
        fi
    done
done
set root=$saved_root

if test -f /boot/grub2/grub.cfg ; then
    configfile /boot/grub2/grub.cfg
elif test -f /boot/grub/grub.cfg ; then
    configfile /boot/grub/grub.cfg
fi
EOF
./grub-mkstandalone --grub-mkimage=./grub-mkimage -o pvgrub2.xen -O x86_64-xen -d grub-core/ boot/grub/grub.cfg

And I use Wheezy (debian 7) as dom0 with xen-unstable from git.

If you need more tests/informations tell me and I'll post them.

Thanks for any reply.

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
else
  search --no-floppy --fs-uuid --set=root 3ab55964-09d1-4853-be38-661b5a476a14
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=it_IT
  insmod gettext
fi
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu 
--class os $menuentry_id_option 
'gnulinux-simple-3ab55964-09d1-4853-be38-661b5a476a14' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
        else
          search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
        fi
        echo    'Caricamento Linux 3.11-2-amd64...'
        linux   /boot/vmlinuz-3.11-2-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro console=tty0 quiet
        echo    'Caricamento ramdisk iniziale...'
        initrd  /boot/initrd.img-3.11-2-amd64
}
submenu 'Opzioni avanzate per Debian GNU/Linux' $menuentry_id_option 
'gnulinux-advanced-3ab55964-09d1-4853-be38-661b5a476a14' {
        menuentry 'Debian GNU/Linux, con Linux 3.11-2-amd64' --class debian 
--class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.11-2-amd64-advanced-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.11-2-amd64...'
                linux   /boot/vmlinuz-3.11-2-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro console=tty0 quiet
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.11-2-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.11-2-amd64 (modalità 
ripristino)' --class debian --class gnu-linux --class gnu --class os 
$menuentry_id_option 
'gnulinux-3.11-2-amd64-recovery-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.11-2-amd64...'
                linux   /boot/vmlinuz-3.11-2-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro single console=tty0
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.11-2-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.11-1-amd64' --class debian 
--class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.11-1-amd64-advanced-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.11-1-amd64...'
                linux   /boot/vmlinuz-3.11-1-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro console=tty0 quiet
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.11-1-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.11-1-amd64 (modalità 
ripristino)' --class debian --class gnu-linux --class gnu --class os 
$menuentry_id_option 
'gnulinux-3.11-1-amd64-recovery-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.11-1-amd64...'
                linux   /boot/vmlinuz-3.11-1-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro single console=tty0
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.11-1-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.10-3-amd64' --class debian 
--class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.10-3-amd64-advanced-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.10-3-amd64...'
                linux   /boot/vmlinuz-3.10-3-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro console=tty0 quiet
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.10-3-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.10-3-amd64 (modalità 
ripristino)' --class debian --class gnu-linux --class gnu --class os 
$menuentry_id_option 
'gnulinux-3.10-3-amd64-recovery-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.10-3-amd64...'
                linux   /boot/vmlinuz-3.10-3-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro single console=tty0
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.10-3-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.10-2-amd64' --class debian 
--class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.10-2-amd64-advanced-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.10-2-amd64...'
                linux   /boot/vmlinuz-3.10-2-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro console=tty0 quiet
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.10-2-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.10-2-amd64 (modalità 
ripristino)' --class debian --class gnu-linux --class gnu --class os 
$menuentry_id_option 
'gnulinux-3.10-2-amd64-recovery-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.10-2-amd64...'
                linux   /boot/vmlinuz-3.10-2-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro single console=tty0
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.10-2-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.2.0-4-amd64' --class debian 
--class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.2.0-4-amd64-advanced-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.2.0-4-amd64...'
                linux   /boot/vmlinuz-3.2.0-4-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro console=tty0 quiet
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.2.0-4-amd64
        }
        menuentry 'Debian GNU/Linux, con Linux 3.2.0-4-amd64 (modalità 
ripristino)' --class debian --class gnu-linux --class gnu --class os 
$menuentry_id_option 
'gnulinux-3.2.0-4-amd64-recovery-3ab55964-09d1-4853-be38-661b5a476a14' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  
3ab55964-09d1-4853-be38-661b5a476a14
                else
                  search --no-floppy --fs-uuid --set=root 
3ab55964-09d1-4853-be38-661b5a476a14
                fi
                echo    'Caricamento Linux 3.2.0-4-amd64...'
                linux   /boot/vmlinuz-3.2.0-4-amd64 
root=UUID=3ab55964-09d1-4853-be38-661b5a476a14 ro single console=tty0
                echo    'Caricamento ramdisk iniziale...'
                initrd  /boot/initrd.img-3.2.0-4-amd64
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to