[SOLVED] Salix and Grub2

You have a problem with Salix? Post here and we'll do what we can to help.
fran
Posts: 18
Joined: 21. Jun 2012, 17:15

Re: Salix and Grub2

Post by fran »

No. I didn't install lilo at all during installation steps.
I've got grub 2 in my main OS in the sda disc.
In that OS I've got grub customizer that recognizes Salix (as a Slackware).
Regarding the boot, I found this initr file

Code: Select all

#!/bin/ash
#
# /init:  init script to load kernel modules from an initramfs
#         This requires that your kernel supports initramfs!!!
#
# Copyright 2004  Slackware Linux, Inc., Concord, CA, USA
# Copyright 2007, 2008, 2009, 2010  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


# With a generic kernel, you need to load the modules needed to mount the
# root partition.  This might mean a SCSI, RAID, or other drive controller
# module, as well as the module to support the root filesystem.  Once the
# root partition is mounted all the other modules will be available so you
# don't need to load them here.
#
# Config files used by this script:
#
# /rootdev        Contains the name of the root device, such as: /dev/hda1 
#
# /rootfs         Contains the root filesystem type, such as: xfs
#
# /initrd-name    Contains the name of the initrd file.
#
# /resumedev      Contains the name of the device to resume from hibernation.
#
# /luksdev        Contains colon separated list of luks encrypted devices to
#                 be unlocked.
#
# /lukskey        Contains the path to a LUKS key-file for automatic unlock
#                 Format: LABEL=<partition_label>:/path/to/file
#                         UUID=<partition_uuid>:/path/to/file
#
# /wait-for-root  Contains a number - the init script will wait this amount
#                 of seconds before creating device nodes.
#
# /keymap         Contains the name for a custom keyboard map 
#
# Optional:
#
# /load_kernel_modules
#                 A script that uses modprobe to load the desired modules.
#
#                 There's an example in here.  To actually use it, you'll
#                 need to make it executable:  
#
#                     chmod 755 load_kernel_modules

INITRD=$(cat /initrd-name)
ROOTDEV=$(cat /rootdev)
ROOTFS=$(cat /rootfs)
LUKSDEV=$(cat /luksdev)
LUKSKEY=$(cat /lukskey)
RESUMEDEV=$(cat /resumedev)
WAIT=$(cat /wait-for-root)
KEYMAP=$(cat /keymap)
INIT=/sbin/init

PATH="/sbin:/bin:/usr/sbin:/usr/bin"

# Mount /proc and /sys:
mount -n proc /proc -t proc
mount -n sysfs /sys -t sysfs

if grep devtmpfs /proc/filesystems 1>/dev/null 2>/dev/null ; then
  DEVTMPFS=1
  mount -n devtmpfs /dev -t devtmpfs
fi	

# Parse command line
for ARG in $(cat /proc/cmdline); do
  case $ARG in
    0|1|2|3|4|5|6|S|s|single)
      RUNLEVEL=$ARG
    ;;
    init=*)
      INIT=$(echo $ARG | cut -f2 -d=)
    ;;
    luksdev=/dev/*)
      LUKSDEV=$(echo $ARG | cut -f2 -d=)
    ;;
    lukskey=*)
      LUKSKEY=$(echo $ARG | cut -f2- -d=)
    ;;
    rescue)
      RESCUE=1
    ;;
    resume=*)
      RESUMEDEV=$(echo $ARG | cut -f2 -d=)
    ;;
    root=/dev/*)
      ROOTDEV=$(echo $ARG | cut -f2 -d=)
    ;;
    root=LABEL=*)
      ROOTDEV=$(echo $ARG | cut -f2- -d=)
    ;;
    root=UUID=*)
      ROOTDEV=$(echo $ARG | cut -f2- -d=)
    ;;
    rootfs=*)
      ROOTFS=$(echo $ARG | cut -f2 -d=)
    ;;
    waitforroot=*)
      WAIT=$(echo $ARG | cut -f2 -d=)
    ;;
  esac
done

# Load kernel modules:
if [ ! -d /lib/modules/$(uname -r) ]; then
  echo "No kernel modules found for Linux $(uname -r)."
elif [ -x ./load_kernel_modules ]; then # use load_kernel_modules script:
  echo "${INITRD}:  Loading kernel modules from initrd image:"
  . ./load_kernel_modules
else # load modules (if any) in order:
  if ls /lib/modules/$(uname -r)/*.*o 1> /dev/null 2> /dev/null ; then
    echo "${INITRD}:  Loading kernel modules from initrd image:"
    for module in /lib/modules/$(uname -r)/*.*o ; do
      /sbin/modprobe $module
    done
    unset module
  fi
fi

# Sometimes the devices need extra time to be available.
# A root filesystem on USB is a good example of that.
sleep $WAIT

# If udevd is available, use it to generate block devices
# else use mdev to read sysfs and generate the needed devices 
if [ -x /sbin/udevd -a -x /sbin/udevadm ]; then
  /sbin/udevd --daemon --resolve-names=never
  /sbin/udevadm trigger --subsystem-match=block --action=add
  /sbin/udevadm settle --timeout=10
else
  [ "$DEVTMPFS" != "1" ] && mdev -s
fi

# Load a custom keyboard mapping:
if [ -n "$KEYMAP" ]; then
  echo "${INITRD}:  Loading '$KEYMAP' keyboard mapping:"
  tar xzOf /etc/keymaps.tar.gz ${KEYMAP}.bmap | loadkmap
fi

if [ "$RESCUE" = "" ]; then 
  # Initialize RAID:
  if [ -x /sbin/mdadm ]; then
    /sbin/mdadm -E -s >/etc/mdadm.conf
    /sbin/mdadm -S -s
    /sbin/mdadm -A -s
    # This seems to make the kernel see partitions more reliably:
    fdisk -l /dev/md* 1> /dev/null 2> /dev/null
  fi

  # Unlock any encrypted partitions necessary to access the
  # root filesystem, such as encrypted LVM Physical volumes, disk
  # partitions or mdadm arrays.
  # Unavailable devices such as LVM Logical Volumes will need to be
  # deferred until they become available after the vgscan.

  if [ -x /sbin/cryptsetup ]; then

    # Determine if we have to use a LUKS keyfile:
    if [ ! -z "$LUKSKEY" ]; then
      mkdir  /mountkey
      KEYPART=$(echo $LUKSKEY |cut -f1 -d:)
      LUKSPATH="/mountkey$(echo $LUKSKEY |cut -f2 -d:)"
      # Catch possible mount failure:
      if blkid -t TYPE=vfat $KEYPART 1>/dev/null 2>&1 ; then
        MOUNTOPTS="-t vfat -o shortname=mixed"
      else
        MOUNTOPTS="-t auto"
      fi
      mount $MOUNTOPTS $(findfs $KEYPART) /mountkey 2>/dev/null
      # Check if we can actually use this file:
      if [ ! -f $LUKSPATH ]; then
        LUKSKEY=""
      else
        echo ">>> Using LUKS key file: '$LUKSKEY'"
        LUKSKEY="-d $LUKSPATH"
      fi
    fi

    LUKSLIST_DEFERRED=""
    LUKSLIST=$(echo $LUKSDEV | tr -s ':' ' ')
    for LUKSDEV in $LUKSLIST ; do
      if /sbin/cryptsetup isLuks ${LUKSDEV} 1>/dev/null 2>/dev/null ; then
        if echo $ROOTDEV | grep -q "LABEL=" || echo $ROOTDEV | grep -q "UUID=" ; then
          CRYPTDEV="luks$(basename $LUKSDEV)"
        elif [ "x$ROOTDEV" = "x$(basename $ROOTDEV)" ]; then
          CRYPTDEV="$ROOTDEV"
        else
          CRYPTDEV="luks$(basename $LUKSDEV)"
        fi
        echo "Unlocking LUKS encrypted device '${LUKSDEV}' as luks mapped device '$CRYPTDEV':"
        /sbin/cryptsetup ${LUKSKEY} luksOpen ${LUKSDEV} ${CRYPTDEV} </dev/tty0 >/dev/tty0 2>&1
        if [ "$ROOTDEV" = "$LUKSDEV" -o "$ROOTDEV" = "$CRYPTDEV" ] ; then
          ROOTDEV="/dev/mapper/$CRYPTDEV"
        fi
      else
        LUKSLIST_DEFERRED="${LUKSLIST_DEFERRED} ${LUKSDEV}"
      fi
    done
  fi

  # Initialize LVM:
  if [ -x /sbin/vgchange ]; then
    /sbin/vgchange -ay --ignorelockingfailure
  fi
  
  # Unlock any LUKS encrypted devices that were deferred above but have now
  # become available due to the vgscan (i.e. filesystems on LVM Logical Volumes)

  if [ -x /sbin/cryptsetup -a -n "${LUKSLIST_DEFERRED}" ]; then
    for LUKSDEV in ${LUKSLIST_DEFERRED} ; do
      if /sbin/cryptsetup isLuks ${LUKSDEV} 1>/dev/null 2>/dev/null ; then
        if echo $ROOTDEV | grep -q "LABEL=" || echo $ROOTDEV | grep -q "UUID=" ; then
          CRYPTDEV="luks$(basename $LUKSDEV)"
        elif [ "x$ROOTDEV" = "x$(basename $ROOTDEV)" ]; then
          CRYPTDEV="$ROOTDEV"
        else
          CRYPTDEV="luks$(basename $LUKSDEV)"
        fi
        echo "Unlocking LUKS encrypted device '${LUKSDEV}' as luks mapped device '$CRYPTDEV':"
        /sbin/cryptsetup ${LUKSKEY} luksOpen ${LUKSDEV} ${CRYPTDEV} </dev/tty0 >/dev/tty0 2>&1
        if [ "$ROOTDEV" = "$LUKSDEV" -o "$ROOTDEV" = "$CRYPTDEV" ] ; then
          ROOTDEV="/dev/mapper/$CRYPTDEV"
        fi
      else
        echo "LUKS device '${LUKSDEV}' unavailable for unlocking!"
      fi
    done
  fi

  # Find root device if a label or UUID was given:
  if echo $ROOTDEV | grep -q "LABEL=" || \
     echo $ROOTDEV | grep -q "UUID=" ; then
    ROOTDEV=$(findfs $ROOTDEV)
  fi

  # Clean up after LUKS unlock using a keyfile:
  if grep -q mountkey /proc/mounts 2>/dev/null ; then
    umount -l /mountkey
    rmdir /mountkey 2>/dev/null
  fi
  
  # Resume state from swap
  if [ "$RESUMEDEV" != "" ]; then
    if ls -l $RESUMEDEV | grep -q "^l" ; then
      RESUMEDEV=$(ls -l $RESUMEDEV | awk '{ print $NF }')
    fi
    echo "Trying to resume from $RESUMEDEV"
    RESMAJMIN=$(ls -l $RESUMEDEV | tr , : | awk '{ print $5$6 }')
    echo $RESMAJMIN > /sys/power/resume
  fi
  
  # Switch to real root partition:
  echo 0x0100 > /proc/sys/kernel/real-root-dev
  mount -o ro -t $ROOTFS $ROOTDEV /mnt
  
  if [ ! -r /mnt/sbin/init ]; then
    echo "ERROR:  No /sbin/init found on rootdev (or not mounted).  Trouble ahead."
    echo "        You can try to fix it. Type 'exit' when things are done." 
    echo
    /bin/sh
  fi
else
  echo
  echo "RESCUE mode"
  echo
  echo "        You can try to fix or rescue your system now. If you want"
  echo "        to boot into your fixed system, mount your root filesystem"
  echo "        read-only under /mnt:"
  echo
  echo "            # mount -o ro -t filesystem root_device /mnt"
  echo
  echo "        Type 'exit' when things are done."
  echo
  /bin/sh
fi

if pgrep udevd >/dev/null ; then
  /sbin/udevadm settle --timeout=30
  pkill udevd
fi

unset ERR
mount -o move /proc /mnt/proc
mount -o move /sys /mnt/sys
[ "$DEVTMPFS" = "1" ] && mount -o move /dev /mnt/dev
echo "${INITRD}:  exiting"
exec switch_root /mnt $INIT $RUNLEVEL
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Salix and Grub2

Post by Shador »

Run update-grub or grub-mkconfig -o /boot/grub/grub.cfg on the system where your grub.cfg is stored (i.e. update your bootloader config): If you generate an initrd but don't tell your bootloader to load it, it's useless!

If it doesn't work afterwards post the grub.cfg of your grub installation and the output of ls -l /boot on your Salix system.
Image
fran
Posts: 18
Joined: 21. Jun 2012, 17:15

Re: Salix and Grub2

Post by fran »

Shador wrote:Run update-grub or grub-mkconfig -o /boot/grub/grub.cfg on the system where your grub.cfg is stored
OK. I did it with no result
Shador wrote:post the grub.cfg of your grub installation

Code: Select all

#
# 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 [ "${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 recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
set locale_dir=($root)/boot/grub/locale
set lang=it
insmod gettext
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=7
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
insmod png
if background_image /boot/grub/linuxmint.png ; then
  set color_normal=white/black
  set color_highlight=white/light-gray
else
  set menu_color_normal=white/black
  set menu_color_highlight=white/light-gray
fi
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux_proxy ###
menuentry 'Linux Mint 10, 2.6.35-30-generic (/dev/sda1)' --class linuxmint --class gnu-linux --class gnu --class os {
	recordfail
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
	linux	/boot/vmlinuz-2.6.35-30-generic root=UUID=becc3759-5b33-494f-b1ad-42cfda035866 ro   
	initrd	/boot/initrd.img-2.6.35-30-generic
}
menuentry 'Linux Mint 10, 2.6.35-30-generic (/dev/sda1) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
	recordfail
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
	echo	'Loading Linux 2.6.35-30-generic ...'
	linux	/boot/vmlinuz-2.6.35-30-generic root=UUID=becc3759-5b33-494f-b1ad-42cfda035866 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.35-30-generic
}
### END /etc/grub.d/10_linux_proxy ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

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

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

### BEGIN /etc/grub.d/30_os-prober_proxy ###
menuentry "LinuxMint GNU/Linux, con Linux 3.2.0-2-486 (on /dev/sdb1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos1)'
	search --no-floppy --fs-uuid --set 3cd8bf6d-d5be-40db-983a-17fdb08a6416
	linux /boot/vmlinuz-3.2.0-2-486 root=UUID=3cd8bf6d-d5be-40db-983a-17fdb08a6416 ro quiet
	initrd /boot/initrd.img-3.2.0-2-486
}
menuentry "LinuxMint GNU/Linux, con Linux 3.2.0-2-486 (modalità ripristino) (on /dev/sdb1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos1)'
	search --no-floppy --fs-uuid --set 3cd8bf6d-d5be-40db-983a-17fdb08a6416
	linux /boot/vmlinuz-3.2.0-2-486 root=UUID=3cd8bf6d-d5be-40db-983a-17fdb08a6416 ro single
	initrd /boot/initrd.img-3.2.0-2-486
}
menuentry "Ubuntu, with Linux 3.2.0-24-generic (on /dev/sdb3)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos3)'
	search --no-floppy --fs-uuid --set 2c9c1cd6-c1c6-4e8c-bd6c-649abc43d422
	linux /boot/vmlinuz-3.2.0-24-generic root=UUID=2c9c1cd6-c1c6-4e8c-bd6c-649abc43d422 ro quiet splash $vt_handoff
	initrd /boot/initrd.img-3.2.0-24-generic
}
menuentry "Ubuntu, with Linux 3.2.0-24-generic (recovery mode) (on /dev/sdb3)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos3)'
	search --no-floppy --fs-uuid --set 2c9c1cd6-c1c6-4e8c-bd6c-649abc43d422
	linux /boot/vmlinuz-3.2.0-24-generic root=UUID=2c9c1cd6-c1c6-4e8c-bd6c-649abc43d422 ro recovery nomodeset
	initrd /boot/initrd.img-3.2.0-24-generic
}
menuentry "Chakra Linux, with Standard-Kernel (on /dev/sdb9)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos9)'
	search --no-floppy --fs-uuid --set add6f2db-81a4-4de4-8a06-8d23989f7c37
	linux /boot/vmlinuz-linux resume=/dev/disk/by-uuid/d4b4cca0-70d5-4811-ba7f-452295b82b3b root=/dev/disk/by-uuid/add6f2db-81a4-4de4-8a06-8d23989f7c37 ro quiet
	initrd /boot/initramfs-linux.img
}
menuentry "Chakra Linux, with Standard-Kernel (recovery mode) (on /dev/sdb9)" {
	insmod part_msdos
Shador wrote:output of ls -l /boot on your Salix system
hoping is this one ...

Code: Select all

fran@lucia-TECRA-S2 ~ $ sudo mount /dev/sdb17 /mnt
[sudo] password for fran: 
fran@lucia-TECRA-S2 ~ $ sudo mount --bind /dev /mnt/dev
fran@lucia-TECRA-S2 ~ $ sudo mount --bind /proc /mnt/proc
fran@lucia-TECRA-S2 ~ $ sudo mount --bind /sys /mnt/sys
fran@lucia-TECRA-S2 ~ $ sudo chroot /mnt
root[/]# ls -l /boot
totale 10172
lrwxrwxrwx  1 root root      20 lug  1 08:07 config -> config-huge-2.6.37.6
-rw-r--r--  1 root root  117019 apr 10  2011 config-huge-2.6.37.6
-rw-r--r--  1 root root    5040 feb 16  2010 diag1.img
-rw-r--r--  1 root root 2320167 lug  1 08:36 initrd.gz
drwxr-xr-x 12 root root    4096 lug  1 08:36 initrd-tree
lrwxrwxrwx  1 root root      37 giu 17 00:45 README.initrd -> /usr/doc/mkinitrd-1.4.6/README.initrd
-rw-r--r--  1 root root  308278 mar 27  2011 salix.bmp
lrwxrwxrwx  1 root root      24 lug  1 08:07 System.map -> System.map-huge-2.6.37.6
-rw-r--r--  1 root root 2124138 apr 10  2011 System.map-huge-2.6.37.6
lrwxrwxrwx  1 root root      21 lug  1 08:07 vmlinuz -> vmlinuz-huge-2.6.37.6
-rw-r--r--  1 root root 5523488 apr 10  2011 vmlinuz-huge-2.6.37.6
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Salix and Grub2

Post by Shador »

Obviously, you dropped the '-o ...' option from the mkinitrd command line. Therefor the initrd can't be picked up by grub because it's impossible to associate it with the right kernel.
Please run this command (with necessary adaptions):

Code: Select all

mkinitrd -c -k 2.6.37.6 -u -m ehci_hcd:uhci_hcd:ohci_hcd:xhci-hcd:usb-storage -w 10 -f ext4 -r <root>  -o /boot/initrd-2.6.37.6
Then regenerate your grub.cfg again.

If it still doesn't work post the same stuff as previously (grub.cfg that time please with the Salix part which you dropped this time + ls -l ...). Be sure to include the exact mkinitrd command line you used additionally.
Image
fran
Posts: 18
Joined: 21. Jun 2012, 17:15

Re: Salix and Grub2

Post by fran »

Hi Shador. I'm really sorry about not being able to fix this stuff and make you lose time :oops: . Anyway:
Shador wrote:post the same stuff as previously

Code: Select all

#
# 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 [ "${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 recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
set locale_dir=($root)/boot/grub/locale
set lang=it
insmod gettext
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=7
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
insmod png
if background_image /boot/grub/linuxmint.png ; then
  set color_normal=white/black
  set color_highlight=white/light-gray
else
  set menu_color_normal=white/black
  set menu_color_highlight=white/light-gray
fi
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux_proxy ###
menuentry 'Linux Mint 10, 2.6.35-30-generic (/dev/sda1)' --class linuxmint --class gnu-linux --class gnu --class os {
	recordfail
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
	linux	/boot/vmlinuz-2.6.35-30-generic root=UUID=becc3759-5b33-494f-b1ad-42cfda035866 ro   
	initrd	/boot/initrd.img-2.6.35-30-generic
}
menuentry 'Linux Mint 10, 2.6.35-30-generic (/dev/sda1) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
	recordfail
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set becc3759-5b33-494f-b1ad-42cfda035866
	echo	'Loading Linux 2.6.35-30-generic ...'
	linux	/boot/vmlinuz-2.6.35-30-generic root=UUID=becc3759-5b33-494f-b1ad-42cfda035866 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.35-30-generic
}
### END /etc/grub.d/10_linux_proxy ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

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

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

### BEGIN /etc/grub.d/30_os-prober_proxy ###
menuentry "LinuxMint GNU/Linux, con Linux 3.2.0-2-486 (on /dev/sdb1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos1)'
	search --no-floppy --fs-uuid --set 3cd8bf6d-d5be-40db-983a-17fdb08a6416
	linux /boot/vmlinuz-3.2.0-2-486 root=UUID=3cd8bf6d-d5be-40db-983a-17fdb08a6416 ro quiet
	initrd /boot/initrd.img-3.2.0-2-486
}
menuentry "LinuxMint GNU/Linux, con Linux 3.2.0-2-486 (modalità ripristino) (on /dev/sdb1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos1)'
	search --no-floppy --fs-uuid --set 3cd8bf6d-d5be-40db-983a-17fdb08a6416
	linux /boot/vmlinuz-3.2.0-2-486 root=UUID=3cd8bf6d-d5be-40db-983a-17fdb08a6416 ro single
	initrd /boot/initrd.img-3.2.0-2-486
}
menuentry "Ubuntu, with Linux 3.2.0-24-generic (on /dev/sdb3)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos3)'
	search --no-floppy --fs-uuid --set 2c9c1cd6-c1c6-4e8c-bd6c-649abc43d422
	linux /boot/vmlinuz-3.2.0-24-generic root=UUID=2c9c1cd6-c1c6-4e8c-bd6c-649abc43d422 ro quiet splash $vt_handoff
	initrd /boot/initrd.img-3.2.0-24-generic
}
menuentry "Ubuntu, with Linux 3.2.0-24-generic (recovery mode) (on /dev/sdb3)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos3)'
	search --no-floppy --fs-uuid --set 2c9c1cd6-c1c6-4e8c-bd6c-649abc43d422
	linux /boot/vmlinuz-3.2.0-24-generic root=UUID=2c9c1cd6-c1c6-4e8c-bd6c-649abc43d422 ro recovery nomodeset
	initrd /boot/initrd.img-3.2.0-24-generic
}
menuentry "Chakra Linux, with Standard-Kernel (on /dev/sdb9)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos9)'
	search --no-floppy --fs-uuid --set add6f2db-81a4-4de4-8a06-8d23989f7c37
	linux /boot/vmlinuz-linux resume=/dev/disk/by-uuid/d4b4cca0-70d5-4811-ba7f-452295b82b3b root=/dev/disk/by-uuid/add6f2db-81a4-4de4-8a06-8d23989f7c37 ro quiet
	initrd /boot/initramfs-linux.img
}
menuentry "Chakra Linux, with Standard-Kernel (recovery mode) (on /dev/sdb9)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos9)'
	search --no-floppy --fs-uuid --set add6f2db-81a4-4de4-8a06-8d23989f7c37
	linux /boot/vmlinuz-linux resume=/dev/disk/by-uuid/d4b4cca0-70d5-4811-ba7f-452295b82b3b root=/dev/disk/by-uuid/add6f2db-81a4-4de4-8a06-8d23989f7c37 ro single
	initrd /boot/initramfs-linux-fallback.img
}
menuentry "Asturix, con Linux 3.0.0-19-generic (on /dev/sdb11)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos11)'
	search --no-floppy --fs-uuid --set c142d2e6-9b70-48bd-8822-407cae1b128c
	linux /boot/vmlinuz-3.0.0-19-generic root=UUID=c142d2e6-9b70-48bd-8822-407cae1b128c ro quiet splash vt.handoff=7
	initrd /boot/initrd.img-3.0.0-19-generic
}
menuentry "Asturix, con Linux 3.0.0-19-generic (modalità ripristino) (on /dev/sdb11)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos11)'
	search --no-floppy --fs-uuid --set c142d2e6-9b70-48bd-8822-407cae1b128c
	linux /boot/vmlinuz-3.0.0-19-generic root=UUID=c142d2e6-9b70-48bd-8822-407cae1b128c ro recovery nomodeset
	initrd /boot/initrd.img-3.0.0-19-generic
}
menuentry "openSUSE 12.1 - 3.1.10-1.9 (on /dev/sdb13)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos13)'
	search --no-floppy --fs-uuid --set 6f9ea862-bad9-4181-b182-11646190772e
	linux /boot/vmlinuz-3.1.10-1.9-default root=/dev/disk/by-label/OpenSuseGn3 resume=/dev/disk/by-id/ata-ST3500320AS_5QM2JXJD-part10 splash=silent quiet showopts
	initrd /boot/initrd-3.1.10-1.9-default
}
menuentry "Failsafe -- openSUSE 12.1 - 3.1.10-1.9 (on /dev/sdb13)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos13)'
	search --no-floppy --fs-uuid --set 6f9ea862-bad9-4181-b182-11646190772e
	linux /boot/vmlinuz-3.1.10-1.9-default root=/dev/disk/by-label/OpenSuseGn3 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe
	initrd /boot/initrd-3.1.10-1.9-default
}
menuentry "Fuduntu 2012 (Punny Name Serious Distro) (on /dev/sdb14)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos14)'
	search --no-floppy --fs-uuid --set a0810cc8-4fbd-4a5d-9178-df2785980447
	linux /boot/vmlinuz-3.4.4-1.fu2012.i686 root=/dev/sdb14
	initrd /boot/initramfs-3.4.4-1.fu2012.i686.img
}
menuentry "Fedora release 17 (Beefy Miracle) (on /dev/sdb15)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos15)'
	search --no-floppy --fs-uuid --set 5f397138-f29a-49b5-9c3e-72c538ce9146
	linux /boot/vmlinuz-3.3.4-5.fc17.i686 root=/dev/sdb15
	initrd /boot/initramfs-3.3.4-5.fc17.i686.img
}
menuentry "Linux Mint 12 32-bit, 3.0.0-13-generic (/dev/sdb16) (on /dev/sdb16)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos16)'
	search --no-floppy --fs-uuid --set 1a4af39e-2c90-4509-a41f-5a4424f9cb6f
	linux /boot/vmlinuz-3.0.0-13-generic root=UUID=1a4af39e-2c90-4509-a41f-5a4424f9cb6f ro quiet splash vt.handoff=7
	initrd /boot/initrd.img-3.0.0-13-generic
}
menuentry "Linux Mint 12 32-bit, 3.0.0-13-generic (/dev/sdb16) -- recovery mode (on /dev/sdb16)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos16)'
	search --no-floppy --fs-uuid --set 1a4af39e-2c90-4509-a41f-5a4424f9cb6f
	linux /boot/vmlinuz-3.0.0-13-generic root=UUID=1a4af39e-2c90-4509-a41f-5a4424f9cb6f ro recovery nomodeset
	initrd /boot/initrd.img-3.0.0-13-generic
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdb17)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos17)'
	search --no-floppy --fs-uuid --set 33951f88-eb1d-421a-a13f-33aa79f7eaaf
	linux /boot/vmlinuz-huge-2.6.37.6 root=/dev/sdb17
}
menuentry "Kubuntu, con Linux 3.2.0-25-generic-pae (on /dev/sdb18)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos18)'
	search --no-floppy --fs-uuid --set 33754e7b-5217-42e3-96e4-bfa1c6deaf40
	linux /boot/vmlinuz-3.2.0-25-generic-pae root=UUID=33754e7b-5217-42e3-96e4-bfa1c6deaf40 ro quiet splash $vt_handoff
	initrd /boot/initrd.img-3.2.0-25-generic-pae
}
menuentry "Kubuntu, con Linux 3.2.0-25-generic-pae (modalità ripristino) (on /dev/sdb18)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos18)'
	search --no-floppy --fs-uuid --set 33754e7b-5217-42e3-96e4-bfa1c6deaf40
	linux /boot/vmlinuz-3.2.0-25-generic-pae root=UUID=33754e7b-5217-42e3-96e4-bfa1c6deaf40 ro recovery nomodeset
	initrd /boot/initrd.img-3.2.0-25-generic-pae
}
menuentry "Arch (on /dev/sdb19)" {
	insmod part_msdos
	insmod ext2
	set root='(hd1,msdos19)'
	search --no-floppy --fs-uuid --set 4978882a-3ea4-4c37-a410-260a5e1ea609
	linux /boot/vmlinuz-linux root=/dev/sdb19
	initrd /boot/initramfs-linux.img
}
### END /etc/grub.d/30_os-prober_proxy ###

### 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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Shador wrote:grub.cfg that time please with the Salix part which you dropped this time + ls -l ...
I'm not really a geek, so I don't understand your request regarding this step
Shador wrote:Be sure to include the exact mkinitrd command line you used additionally.
I just copied and past your example,

Code: Select all

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

backbox@backbox:~$ sudo mount /dev/sdb17 /mnt
backbox@backbox:~$ sudo mount --bind /dev /mnt/dev
backbox@backbox:~$ sudo mount --bind /proc /mnt/proc
backbox@backbox:~$ sudo mount --bind /sys /mnt/sys
backbox@backbox:~$ sudo chroot /mnt
bash-4.1# mkinitrd -c -k 2.6.37.6 -u -m ehci_hcd:uhci_hcd:ohci_hcd:xhci-hcd:usb-storage -w 10 -f ext4 -r <root>  -o /boot/initrd-2.6.37.6
11648 blocks
bash-4.1#
because I've got the same kernel

Code: Select all

root[one‭]‬#‭ ‬uname‭ ‬-r‭ 
2.6.37.6-smp
User avatar
gapan
Salix Wizard
Posts: 6368
Joined: 6. Jun 2009, 17:40

Re: Salix and Grub2

Post by gapan »

Notice the kernel name is "2.6.37.6-smp", not just "2.6.37.6"
Image
Image
fran
Posts: 18
Joined: 21. Jun 2012, 17:15

Re: Salix and Grub2

Post by fran »

gapan wrote:Notice the kernel name is "2.6.37.6-smp", not just "2.6.37.6"
:shock: Thanks gapan. I will try again as soon as possible!
fran
Posts: 18
Joined: 21. Jun 2012, 17:15

Re: Salix and Grub2

Post by fran »

gapan wrote:Notice the kernel name is "2.6.37.6-smp", not just "2.6.37.6"
fran wrote:Thanks gapan. I will try again as soon as possible!
No way!

Code: Select all

backbox@backbox:~$ sudo mount /dev/sdb17 /mnt
backbox@backbox:~$ sudo mount --bind /dev /mnt/dev
backbox@backbox:~$ sudo mount --bind /proc /mnt/proc
backbox@backbox:~$ sudo mount --bind /sys /mnt/sys
backbox@backbox:~$ sudo chroot /mnt
bash-4.1# mkinitrd -c -k 2.6.37.6-smp -u -m ehci_hcd:uhci_hcd:ohci_hcd:xhci-hcd:usb-storage -w 10 -f ext4 -r <root>  -o /boot/initrd-2.6.37.6-smp
10509 blocks
bash-4.1# cd ~
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Salix and Grub2

Post by Shador »

Sorry, but your system is contradicting itself. As that's very unlikely it's probably the output your posting in an inconsistent manner (e.g. from different sources):
fran wrote:-rw-r--r-- 1 root root 5523488 apr 10 2011 vmlinuz-huge-2.6.37.6
fran wrote: linux /boot/vmlinuz-huge-2.6.37.6 root=/dev/sdb17
fran wrote:root[one‭]‬#‭ ‬uname‭ ‬-r‭
2.6.37.6-smp
So what is it that you have? A smp, non-smp, 32-, 64-Bit mixed system? Or did you just randomly install kernel packages?
fran wrote:
Shador wrote:grub.cfg that time please with the Salix part which you dropped this time + ls -l ...
I'm not really a geek, so I don't understand your request regarding this step
You don't need to be a geek to see that the first paste of your grub.cfg is incomplete i.e. you only posted part of that file not it's whole content. Therefor it was almost pointless because the part about Salix in that file was missing and that was my main interest. That's all I was criticizing and I asked you to do it correctly the next time (which you did).
fran wrote:bash-4.1# mkinitrd -c -k 2.6.37.6-smp -u -m ehci_hcd:uhci_hcd:ohci_hcd:xhci-hcd:usb-storage -w 10 -f ext4 -r <root> -o /boot/initrd-2.6.37.6-smp
Do you see this part "<root>"? It's shouting at you I look very meaningful replace me by something less meaningful that really belongs there! I already told you before to replace that with the actual root device and mentioned it again. As your system is inconsistent and contradictory or at least the information you provide, it's hard to give you a this works line. But this might give you a working initrd:

Code: Select all

mkinitrd -c -k 2.6.37.6 -u -m ehci_hcd:uhci_hcd:ohci_hcd:xhci-hcd:usb-storage -w 10 -f ext4 -r /dev/sdb17  -o /boot/initrd-2.6.37.6
Your bootloader should pick that file up too if you recreate the grub.cfg (update-grub/grub-mkconfig .../...). At least as long as your kernel is named vmlinuz-huge-2.6.37.6 and doesn't keep automagically turning into a 2.6.37.6-smp kernel at runtime. :twisted:
Image
fran
Posts: 18
Joined: 21. Jun 2012, 17:15

Re: Salix and Grub2

Post by fran »

Sorry Shador, I do not know where I'm wrong, but the operation failed.
This is the response of mkinitrd

Code: Select all

bash-4.1# mkinitrd -c -k 2.6.37.6 -u -m ehci_hcd:uhci_hcd:ohci_hcd:xhci-hcd:usb-storage -w 10 -f ext4 -r /dev/sdb17  -o /boot/initrd-2.6.37.6
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/host/ehci-hcd.ko added.
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/host/uhci-hcd.ko added.
OK: /lib/modules/2.6.37.6/kernel/drivers/pcmcia/pcmcia_core.ko added.
OK: /lib/modules/2.6.37.6/kernel/drivers/pcmcia/pcmcia.ko added.
OK: /lib/modules/2.6.37.6/kernel/drivers/mmc/core/mmc_core.ko added.
OK: /lib/modules/2.6.37.6/kernel/drivers/ssb/ssb.ko added.
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/host/ohci-hcd.ko added.
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/host/xhci-hcd.ko added.
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/storage/usb-storage.ko added.
11648 blocks
/boot/initrd-2.6.37.6 created.
Be sure to run lilo again if you use it.
I was optimistic when I saw that, but at the restart after updating Grub I still had the usual kernel panic
Please be patient with us newbies ... :D
Post Reply