[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] pvgrub2 launch of Xen 4.5.1 DomU just drops to grub2 prompt ?



On 10/20/2015 02:58 AM, Ian Campbell wrote:
Where does this file end up? Is it a file within the guest filesystem? The
runes here suggest it is part of the host, which doesn't seem right.

Once you have started grub in the guest then all of the referenced files
need to either be in the guest file system or in a memdisk which you have
built into the grub image.

Remember, Grub cannot see anything in the dom0 filesystem.

I'd suggest exploring what grub can see from the grub prompt using ls on
each device etc and try executing variants on the commands which you are
embedding as above directly to experiment and find the correct set of
things to do.

Also, what does grub.cfg within the guest contain?

After figuring out that grub2-mkstandalone presumes a '/boot/grub/...' path, and ignores my usage of any other paths, e.g. '/boot/grub2/...', I've managed to get this manually-cobbled config to boot the guest.

I'm using a DIY'd pvgrub2 blob; atm, the distro-provided blob fails to launch the guest (ref: http://lists.opensuse.org/opensuse-virtual/2015-10/msg00014.html)

@ Dom0 host, the simplest config that I can get to work is

        cd /home/tmp/pvgrub2

        cat << EOF > boot/grub/grub.cfg
        insmod part_msdos
        set root=(xen/xvda,msdos1)
linux /vmlinuz-xen root=/dev/xvdc1 noresume quiet splash=silent textmode=1 xencons=xvc0 console=hvc0 noirqdebug elevator=noop
        initrd /initrd-xen
        configfile /boot/grub2/grub.cfg
        boot
        EOF

Note^^ the specification of symlinks, "vmlinuz-xen & initrd-xen",

        grub2-mkstandalone \
         --compress=no \
         --fonts="unicode" \
         --themes="" \
         -O x86_64-xen \
         -o grub-x86_64-xen \
         boot/grub/grub.cfg

With

        cat ~/test.cfg
                name        = 'test'
                builder     = 'linux'
                kernel      = '/home/tmp/pvgrub2/grub-x86_64-xen'
                disk        = [ '/dev/VG0/testBOOT,raw,xvda,backendtype=phy,rw',
                                '/dev/VG0/testROOT,raw,xvdc,backendtype=phy,rw' 
]
                vif         = [ 'mac=00:16:3E:10:10:01, bridge=br0, 
vifname=vifT',]
                vfb         = [ 'type=vnc, vncdisplay=1001, 
vnclisten=127.0.0.1' ]
                on_shutdown = 'destroy'
                on_reboot   = 'restart'
                on_crash    = 'destroy'
                maxmem      = 1024
                memory      = 1024

Guest boot

        xl create -c ~/test.cfg

completes

        Welcome to openSUSE 13.2 "Harlequin" - Kernel 4.2.3-1.gef1562d-xen 
(xvc0).

In the DomU guest

        cat /proc/cmdline
root=/dev/xvdc1 noresume quiet splash=silent textmode=1 xencons=xvc0 console=hvc0 noirqdebug elevator=noop

It appears that the cmd line is passed only from the grub2-mkstandalone-created memdisk's embedded grub.cfg, ignoring completely the Guest's 'configfile=/boot/grub2/grub.cfg', which contains,

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

                ### BEGIN /etc/grub.d/00_header ###
                if [ -f ${config_directory}/grubenv ]; then
                  load_env -f ${config_directory}/grubenv
                elif [ -s $prefix/grubenv ]; then
                  load_env
                fi
                if [ "${next_entry}" ] ; then
                   set default="${next_entry}"
                   set next_entry=
                   save_env next_entry
                   set boot_once=true
                else
                   set default="${saved_entry}"
                fi

                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='hd2,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='hd2,msdos1' a1100344-3f89-4c5c-b5c7-7657b9135fc1
                else
search --no-floppy --fs-uuid --set=root a1100344-3f89-4c5c-b5c7-7657b9135fc1
                fi
                    font="/usr/share/grub2/unicode.pf2"
                fi

                if loadfont $font ; then
                  set gfxmode=auto
                  load_video
                  insmod gfxterm
                  set locale_dir=$prefix/locale
                  set lang=en_US
                  insmod gettext
                fi
                terminal_output gfxterm
                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' f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                else
search --no-floppy --fs-uuid --set=root f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                fi
                insmod gfxmenu
                loadfont ($root)/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2
                loadfont ($root)/grub2/themes/openSUSE/DejaVuSans10.pf2
                loadfont ($root)/grub2/themes/openSUSE/DejaVuSans12.pf2
                loadfont ($root)/grub2/themes/openSUSE/ascii.pf2
                insmod png
                set theme=($root)/grub2/themes/openSUSE/theme.txt
                export theme
                if [ x${boot_once} = xtrue ]; then
                  set timeout=0
                elif [ x$feature_timeout_style = xy ] ; then
                  set timeout_style=menu
                  set timeout=8
                # Fallback normal timeout code in case the timeout_style 
feature is
                # unavailable.
                else
                  set timeout=8
                fi
                ### END /etc/grub.d/00_header ###

                ### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-a1100344-3f89-4c5c-b5c7-7657b9135fc1' {
                        load_video
                        set gfxpayload=keep
                        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' f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                        else
search --no-floppy --fs-uuid --set=root f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                        fi
                        echo    'Loading Linux 4.2.3-1.gef1562d-xen ...'
linux /vmlinuz-4.2.3-1.gef1562d-xen root=/dev/xvdc1 /dev/xvdc1 noresume splash=silent quiet showopts
                        echo    'Loading initial ramdisk ...'
                        initrd  /initrd-4.2.3-1.gef1562d-xen
                }
submenu 'Advanced options for openSUSE' $menuentry_id_option 'gnulinux-advanced-a1100344-3f89-4c5c-b5c7-7657b9135fc1' { menuentry 'openSUSE, with Linux 4.2.3-1.gef1562d-xen' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.2.3-1.gef1562d-xen-advanced-a1100344-3f89-4c5c-b5c7-7657b9135fc1' {
                                load_video
                                set gfxpayload=keep
                                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' f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                                else
search --no-floppy --fs-uuid --set=root f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                                fi
                                echo    'Loading Linux 4.2.3-1.gef1562d-xen ...'
linux /vmlinuz-4.2.3-1.gef1562d-xen root=/dev/xvdc1 /dev/xvdc1 noresume splash=silent quiet showopts
                                echo    'Loading initial ramdisk ...'
                                initrd  /initrd-4.2.3-1.gef1562d-xen
                        }
menuentry 'openSUSE, with Linux 4.2.3-1.gef1562d-xen (recovery mode)' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.2.3-1.gef1562d-xen-recovery-a1100344-3f89-4c5c-b5c7-7657b9135fc1' {
                                load_video
                                set gfxpayload=keep
                                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' f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                                else
search --no-floppy --fs-uuid --set=root f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                                fi
                                echo    'Loading Linux 4.2.3-1.gef1562d-xen ...'
linux /vmlinuz-4.2.3-1.gef1562d-xen root=/dev/xvdc1 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe
                                echo    'Loading initial ramdisk ...'
                                initrd  /initrd-4.2.3-1.gef1562d-xen
                        }
menuentry 'openSUSE, with Linux xen' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-xen-advanced-a1100344-3f89-4c5c-b5c7-7657b9135fc1' {
                                load_video
                                set gfxpayload=keep
                                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' f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                                else
search --no-floppy --fs-uuid --set=root f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                                fi
                                echo    'Loading Linux xen ...'
linux /vmlinuz-xen root=/dev/xvdc1 /dev/xvdc1 noresume splash=silent quiet showopts
                                echo    'Loading initial ramdisk ...'
                                initrd  /initrd-xen
                        }
menuentry 'openSUSE, with Linux xen (recovery mode)' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-xen-recovery-a1100344-3f89-4c5c-b5c7-7657b9135fc1' {
                                load_video
                                set gfxpayload=keep
                                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' f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                                else
search --no-floppy --fs-uuid --set=root f8f5e4ca-3f78-4db4-bba5-1a405f896f0a
                                fi
                                echo    'Loading Linux xen ...'
linux /vmlinuz-xen root=/dev/xvdc1 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe
                                echo    'Loading initial ramdisk ...'
                                initrd  /initrd-xen
                        }
                }

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

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

                ### BEGIN /etc/grub.d/20_memtest86+ ###
                ### END /etc/grub.d/20_memtest86+ ###

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

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

                ### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ###
                ### END /etc/grub.d/80_suse_btrfs_snapshot ###

                ### BEGIN /etc/grub.d/90_persistent ###
                ### END /etc/grub.d/90_persistent ###



(1) I don't yet know why the distro-provided pvgrub2 blob is failing to launch the Xen guest. I suspect bad search/specific paths.

(2) I'm not yet clear how to correctly 'chainload' the DomU Guest's grub.cfg to pick-up kernel cmdline params, &/or support multiple kernels via symlink or version-specific names


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.