Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 31/05/2011, à 23:35

cauchy

Personnalisation de Grub

Bonsoir, mon p'tit-gars (et moi) s'est installé une Ubuntu 10.10 sur une clé usb de 16 Gb, et moi je me suis rajouté une Arch Linux à coté, le problème c'est qu'Arch plantait au boot, le grub étant celui d'Ubuntu (je n'ai pas installé celui d'Arch).
En allant fouiller les entrées de Grub, il apparaissait :

menuentry "Arch Linux [/boot/vmlinuz26] (on /dev/sdb7)" {
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos6)'
    search --no-floppy --fs-uuid --set a98525a3-ca2c-45f3-8228-4a4e1e4488ac
    linux /vmlinuz26 root=/dev/sda3 ro
    initrd /kernel26.img
}
### END /etc/grub.d/30_os-prober ###

j'ai donc rajouté dans  le fichier /etc/grub.d/40_custom d'Ubuntu10.10

#!/bin/sh
exec tail -n +3 $0
# 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.

menuentry "Arch Linux celle qui boote [/boot/vmlinuz26] (on /dev/sdb7)" { 
    insmod part_msdos 
    insmod ext2 
    set root='(/dev/sdb,msdos7)' 
    search --no-floppy --fs-uuid --set a98525a3-ca2c-45f3-8228-4a4e1e4488ac 
    linux /vmlinuz26 root=/dev/sdb7 ro 
    initrd /kernel26.img 
}

et cela fonctionne très bien.

Ma question est alors : comment (ou bien est -il possible de) faire << disparaître >>  l'entrée d'Arch qui ne boote pas (la première donc) qui apparaît dans le fichier /boot/grub/grub.cfg (généré automatiquement )?


S. Lejoly
Acer AspireOne 9' sous Ubuntu 32bits 10.04, Artic MC001E sous Mint 14 64bits , AMD Duron 1,4 GHz sous Debian Squeeze, Compaq AMD K6 533 MHz sous Asri éducation (Toutou linux) et Mac OS X 6.7 sur MacBook intel.

Hors ligne

#2 Le 01/06/2011, à 01:07

J5012

Re : Personnalisation de Grub

normalement un update-grub aurait du deja le faire disparaitre, a moins que sa definition n'apparaisse ailleurs (et donc les lignes de config arch ne sont pas issues d'une detection)

que dit : ls /etc/grub.d -l

Dernière modification par J5012 (Le 01/06/2011, à 01:16)

Hors ligne

#3 Le 01/06/2011, à 09:31

cauchy

Re : Personnalisation de Grub

Merci de cette réponse prompte,

J5012 a écrit :

normalement un update-grub aurait du deja le faire disparaitre, a moins que sa definition n'apparaisse ailleurs (et donc les lignes de config arch ne sont pas issues d'une detection)

c'est bien ce que je pensais aussi.

J5012 a écrit :

ls /etc/grub.d -l

me donne  les fichiers classiques :
00_header, 05_debian_theme, 10_linux, 20_linux_xen, 20_memtest86+, 30_os_prober, 40_custom (que j'ai modifié comme dit au dessus), 41_custom et le README. (?)


S. Lejoly
Acer AspireOne 9' sous Ubuntu 32bits 10.04, Artic MC001E sous Mint 14 64bits , AMD Duron 1,4 GHz sous Debian Squeeze, Compaq AMD K6 533 MHz sous Asri éducation (Toutou linux) et Mac OS X 6.7 sur MacBook intel.

Hors ligne

#4 Le 06/06/2011, à 06:52

J5012

Re : Personnalisation de Grub

20_linux_xen et 41_custom ne sont pas dans une config par defaut...

edites les et vois si l'un d'eux commente arch ? je pencherais plutot pour 41_custom

Hors ligne

#5 Le 06/06/2011, à 14:02

cauchy

Re : Personnalisation de Grub

Merci de la réponse (mais " Aujourd'hui à 05:52 " est-ce bien raisonnable !)
j'envoie des copies des fichiers concernés :

'/etc/grub.d/20_linux_xen' 

#! /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=/usr
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
. ${libdir}/grub/grub-mkconfig_lib

export TEXTDOMAIN=grub
export TEXTDOMAINDIR=${prefix}/share/locale

CLASS="--class gnu-linux --class gnu --class os --class xen"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
  /dev/loop/*|/dev/loop[0-9])
    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
    # We can't cope with devices loop-mounted from files here.
    case ${GRUB_DEVICE} in
      /dev/*) ;;
      *) exit 0 ;;
    esac
  ;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
    || uses_abstraction "${GRUB_DEVICE}" lvm; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

linux_entry ()
{
  os="$1"
  version="$2"
  xen_version="$3"
  recovery="$4"
  args="$5"
  xen_args="$6"
  if ${recovery} ; then
    title="$(gettext_quoted "%s, with Linux %s and XEN %s (recovery mode)")"
  else
    title="$(gettext_quoted "%s, with Linux %s and XEN %s")"
  fi
  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" "${xen_version}"
  save_default_entry | sed -e "s/^/\t/"

  if [ -z "${prepare_boot_cache}" ]; then
    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
  fi
  printf '%s\n' "${prepare_boot_cache}"
  cat << EOF
    echo    '$(printf "$(gettext_quoted "Loading Linux %s ...")" ${version})'
    multiboot    ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
    module    ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
EOF
  if test -n "${initrd}" ; then
    cat << EOF
    echo    '$(gettext_quoted "Loading initial ramdisk ...")'
    module    ${rel_dirname}/${initrd}
EOF
  fi
  cat << EOF
}
EOF
}

linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
        basename=$(basename $i)
    version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
        if grub_file_is_not_garbage "$i" && grep -qx "CONFIG_XEN_DOM0=y" /boot/config-${version} 2> /dev/null ; then echo -n "$i " ; fi
      done`
xen_list=`for i in /boot/xen*; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`
prepare_boot_cache=

while [ "x${xen_list}" != "x" ] ; do
    list="${linux_list}"
    current_xen=`version_find_latest $xen_list`
    xen_basename=`basename ${current_xen}`
    xen_dirname=`dirname ${current_xen}`
    rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
    xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
    while [ "x$list" != "x" ] ; do
    linux=`version_find_latest $list`
    echo "Found linux image: $linux" >&2
    basename=`basename $linux`
    dirname=`dirname $linux`
    rel_dirname=`make_system_path_relative_to_its_root $dirname`
    version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
    alt_version=`echo $version | sed -e "s,\.old$,,g"`
    linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"

    initrd=
    for i in "initrd.img-${version}" "initrd-${version}.img" \
        "initrd-${version}" "initrd.img-${alt_version}" \
        "initrd-${alt_version}.img" "initrd-${alt_version}"; do
        if test -e "${dirname}/${i}" ; then
        initrd="$i"
        break
        fi
    done
    if test -n "${initrd}" ; then
        echo "Found initrd image: ${dirname}/${initrd}" >&2
    else
    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
        linux_root_device_thisversion=${GRUB_DEVICE}
    fi

    linux_entry "${OS}" "${version}" "${xen_version}" false \
        "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
    if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
        linux_entry "${OS}" "${version}" "${xen_version}" true \
        "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"
    fi

    list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
    done
    xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
done

et

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'/etc/grub.d/41_custom'

#!/bin/sh
cat <<EOF
if [ -f  \$prefix/custom.cfg ]; then
  source \$prefix/custom.cfg;
fi
EOF

pour rappel :

'/etc/grub.d/40_custom'


#!/bin/sh
exec tail -n +3 $0
# 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.
menuentry "Arch Linux qui boote ! [/boot/vmlinuz26] (on /dev/sdb7)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sdb,msdos7)'
    search --no-floppy --fs-uuid --set a98525a3-ca2c-45f3-8228-4a4e1e4488ac
    linux /vmlinuz26 root=/dev/sdb7 ro
    initrd /kernel26.img
}

et d'autres

'/etc/grub.d/30_os-prober'

#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009  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=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib

. ${libdir}/grub/grub-mkconfig_lib

found_other_os=

make_timeout () {
  if [ "x${found_other_os}" = "x" ] ; then
    if [ "x${1}" != "x" ] ; then
      if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
    verbose=
      else
    verbose=" --verbose"
      fi

      if [ "x${1}" = "x0" ] ; then
    cat <<EOF
if [ "x\${timeout}" != "x-1" ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep$verbose --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
EOF
      else
    cat << EOF
if [ "x\${timeout}" != "x-1" ]; then
  if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
    set timeout=0
  fi
fi
EOF
      fi
    fi
  fi
}

adjust_timeout () {
  if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
    cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
EOF
    make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
    echo else
    make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
    echo fi
  else
    make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
  fi
}

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
  adjust_timeout
  exit 0
fi

if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
  # missing os-prober and/or linux-boot-prober
  adjust_timeout
  exit 0
fi

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
  # empty os-prober output, nothing doing
  adjust_timeout
  exit 0
fi

osx_entry() {
        cat << EOF
menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" {
EOF
    save_default_entry | sed -e "s/^/\t/"
    prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
    cat << EOF
        load_video
        set do_resume=0
        if [ /var/vm/sleepimage -nt10 / ]; then
           if xnu_resume /var/vm/sleepimage; then
             set do_resume=1
           fi
        fi
        if [ \$do_resume = 0 ]; then
           xnu_uuid ${OSXUUID} uuid
           if [ -f /Extra/DSDT.aml ]; then
              acpi -e /Extra/DSDT.aml
           fi
           $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
           if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
              xnu_mkext /System/Library/Extensions.mkext
           else
              xnu_kextdir /System/Library/Extensions
           fi
           if [ -f /Extra/Extensions.mkext ]; then
              xnu_mkext /Extra/Extensions.mkext
           fi
           if [ -d /Extra/Extensions ]; then
              xnu_kextdir /Extra/Extensions
           fi
           if [ -f /Extra/devprop.bin ]; then
              xnu_devprop_load /Extra/devprop.bin
           fi
           if [ -f /Extra/splash.jpg ]; then
              insmod jpeg
              xnu_splash /Extra/splash.jpg
           fi
           if [ -f /Extra/splash.png ]; then
              insmod png
              xnu_splash /Extra/splash.png
           fi
           if [ -f /Extra/splash.tga ]; then
              insmod tga
              xnu_splash /Extra/splash.tga
           fi
        fi
}
EOF
}

for OS in ${OSPROBED} ; do
  DEVICE="`echo ${OS} | cut -d ':' -f 1`"
  LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
  LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
  BOOT="`echo ${OS} | cut -d ':' -f 4`"

  if [ -z "${LONGNAME}" ] ; then
    LONGNAME="${LABEL}"
  fi

  echo "Found ${LONGNAME} on ${DEVICE}" >&2
  found_other_os=1

  case ${BOOT} in
    chain)

      cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
      save_default_entry | sed -e "s/^/\t/"
      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

      case ${LONGNAME} in
    Windows\ Vista*|Windows\ 7*)
    ;;
    *)
      cat << EOF
    drivemap -s (hd0) \${root}
EOF
    ;;
      esac

      cat <<EOF
    chainloader +1
}
EOF
    ;;
    linux)
      LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
      prepare_boot_cache=

      for LINUX in ${LINUXPROBED} ; do
        LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
        LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
        LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
        LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
        LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
        LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"

        if [ -z "${LLABEL}" ] ; then
          LLABEL="${LONGNAME}"
        fi

    if [ "${LROOT}" != "${LBOOT}" ]; then
      LKERNEL="${LKERNEL#/boot}"
      LINITRD="${LINITRD#/boot}"
    fi

        cat << EOF
menuentry "${LLABEL} (on ${DEVICE})" {
EOF
    save_default_entry | sed -e "s/^/\t/"
    if [ -z "${prepare_boot_cache}" ]; then
      prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
    fi
    printf '%s\n' "${prepare_boot_cache}"
    cat <<  EOF
    linux ${LKERNEL} ${LPARAMS}
EOF
        if [ -n "${LINITRD}" ] ; then
          cat << EOF
    initrd ${LINITRD}
EOF
        fi
        cat << EOF
}
EOF
      done
    ;;
    macosx)
      OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`"
      osx_entry xnu_kernel 32
      osx_entry xnu_kernel64 64
    ;;
    hurd)
      cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
      save_default_entry | sed -e "s/^/\t/"
      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
      grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
      mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
      grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
      case "${grub_fs}" in
    *fs)    hurd_fs="${grub_fs}" ;;
    *)    hurd_fs="${grub_fs}fs" ;;
      esac
      cat << EOF
    multiboot /boot/gnumach.gz root=device:${mach_device}
    module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
            --multiboot-command-line='\${kernel-command-line}' \\
            --host-priv-port='\${host-port}' \\
            --device-master-port='\${device-port}' \\
            --exec-server-task='\${exec-task}' -T typed '\${root}' \\
            '\$(task-create)' '\$(task-resume)'
    module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
EOF
    ;;
    *)
      echo "  ${LONGNAME} is not yet supported by grub-mkconfig." >&2
    ;;
  esac
done

adjust_timeout
'/etc/grub.d/10_linux' 

#! /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=/usr
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
. ${libdir}/grub/grub-mkconfig_lib

export TEXTDOMAIN=grub
export TEXTDOMAINDIR=${prefix}/share/locale

CLASS="--class gnu-linux --class gnu --class os"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR}"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
  /dev/loop/*|/dev/loop[0-9])
    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
    # We can't cope with devices loop-mounted from files here.
    case ${GRUB_DEVICE} in
      /dev/*) ;;
      *) exit 0 ;;
    esac
  ;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
    || uses_abstraction "${GRUB_DEVICE}" lvm; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

# add crashkernel option if we have the required tools
if [ -x "/usr/bin/makedumpfile" ] && [ -x "/sbin/kexec" ]; then
    GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M"
fi

linux_entry ()
{
  os="$1"
  version="$2"
  recovery="$3"
  args="$4"
  if ${recovery} ; then
    title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
  else
    title="$(gettext_quoted "%s, with Linux %s")"
  fi
  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}"
  cat << EOF
    recordfail
EOF
  save_default_entry | sed -e "s/^/\t/"

  # Use ELILO's generic "efifb" when it's known to be available.
  # FIXME: We need an interface to select vesafb in case efifb can't be used.
  if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ]; then
      cat << EOF
    set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
EOF
  fi

  if [ -z "${prepare_boot_cache}" ]; then
    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
  fi
  printf '%s\n' "${prepare_boot_cache}"
  if [ "x$5" != "xquiet" ]; then
    cat << EOF
    echo    '$(printf "$(gettext_quoted "Loading Linux %s ...")" ${version})'
EOF
  fi
  cat << EOF
    linux    ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
  if [ "x$5" != "xquiet" ]; then
    cat << EOF
    echo    '$(gettext_quoted "Loading initial ramdisk ...")'
EOF
  fi
  if test -n "${initrd}" ; then
    cat << EOF
    initrd    ${rel_dirname}/${initrd}
EOF
  fi
  cat << EOF
}
EOF
}

list=`for i in /boot/vmlinu[zx]-* /vmlinu[zx]-* ; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`
prepare_boot_cache=

while [ "x$list" != "x" ] ; do
  linux=`version_find_latest $list`
  echo "Found linux image: $linux" >&2
  basename=`basename $linux`
  dirname=`dirname $linux`
  rel_dirname=`make_system_path_relative_to_its_root $dirname`
  version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
  alt_version=`echo $version | sed -e "s,\.old$,,g"`
  linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"

  initrd=
  for i in "initrd.img-${version}" "initrd-${version}.img" \
       "initrd-${version}" "initramfs-${version}.img" \
       "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
       "initrd-${alt_version}" "initramfs-${alt_version}.img"; do
    if test -e "${dirname}/${i}" ; then
      initrd="$i"
      break
    fi
  done
  if test -n "${initrd}" ; then
    echo "Found initrd image: ${dirname}/${initrd}" >&2
  else
    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
    linux_root_device_thisversion=${GRUB_DEVICE}
  fi

  linux_entry "${OS}" "${version}" false \
      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
      quiet
  if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
    linux_entry "${OS}" "${version}" true \
    "single ${GRUB_CMDLINE_LINUX}"
  fi

  list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done
'/etc/default/grub' 

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_LINUX_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Là dedans je ne vois pas trop !


S. Lejoly
Acer AspireOne 9' sous Ubuntu 32bits 10.04, Artic MC001E sous Mint 14 64bits , AMD Duron 1,4 GHz sous Debian Squeeze, Compaq AMD K6 533 MHz sous Asri éducation (Toutou linux) et Mac OS X 6.7 sur MacBook intel.

Hors ligne

#6 Le 07/06/2011, à 21:17

J5012

Re : Personnalisation de Grub

41 custom n'existe pas chez moi (pas modifie de grub)... je ne sais pas ce qu'il fait a part inclure un eventuel fichier custom.cfg

mais c'est de toute evidence 40_custom qui enregistre arch

menuentry "Arch Linux qui boote ! [/boot/vmlinuz26] (on /dev/sdb7)" {
    insmod part_msdos
    insmod ext2
    set root='(/dev/sdb,msdos7)'
    search --no-floppy --fs-uuid --set a98525a3-ca2c-45f3-8228-4a4e1e4488ac
    linux /vmlinuz26 root=/dev/sdb7 ro
    initrd /kernel26.img
}

soit tu supprimes ces lignes, soit tu met un diese devant chaque...
apres tu fais un update-grub

Hors ligne

#7 Le 07/06/2011, à 22:33

cauchy

Re : Personnalisation de Grub

Ah bah non, parce que le 40_custom justement il est custom ! C'est moi qui ai rajouté l'entrée << Arch qui boote >> avec le

set root='(/dev/sdb,msdos7)'

car (si j'ai bien compris) c'est dans ce type de fichier que l'on fait notre petite tambouille, et l'on ne touche pas (si j'ai bien compris) à celle qui est détectée automatiquement - qui ne boote pas - décrite dans /etc/grub.d/30_os-prober avec un mauvais :

set root='(hd1,msdos6)'

(voir mon message du  31/05/2011, à 22:35) le problème c'est qu'au lancement je vois donc :

Arch Linux [/boot/vmlinuz26] (on /dev/sdb7) (celle qui vient du 30_os-prober)

et :

Arch Linux celle qui boote [/boot/vmlinuz26] (on /dev/sdb7) (celle qui vient du 40_custom)

et comme c'est << la mienne >> qui démarre et pas celle du 30_os-prober, j'aurais voulu savoir comme faire disparaître celle du 30_os-prober ?


S. Lejoly
Acer AspireOne 9' sous Ubuntu 32bits 10.04, Artic MC001E sous Mint 14 64bits , AMD Duron 1,4 GHz sous Debian Squeeze, Compaq AMD K6 533 MHz sous Asri éducation (Toutou linux) et Mac OS X 6.7 sur MacBook intel.

Hors ligne

#8 Le 07/06/2011, à 22:56

Compte anonymisé

Re : Personnalisation de Grub

Salut

Il suffit d'ajouter en fin de fichier /etc/default/grub la ligne suivante :
GRUB_DISABLE_OS_PROBER=true

Puis tu valides par un :
sudo  update-grub

@+

#9 Le 07/06/2011, à 23:09

cauchy

Re : Personnalisation de Grub

Merci, je le fais dès que je peux.


S. Lejoly
Acer AspireOne 9' sous Ubuntu 32bits 10.04, Artic MC001E sous Mint 14 64bits , AMD Duron 1,4 GHz sous Debian Squeeze, Compaq AMD K6 533 MHz sous Asri éducation (Toutou linux) et Mac OS X 6.7 sur MacBook intel.

Hors ligne

#10 Le 08/06/2011, à 10:08

J5012

Re : Personnalisation de Grub

30_os-prober est justement la detection automatique ! si t'en n'a pas besoin tu peux la desactiver mais c'est ce script qui est utilise lors des install d'autres os...

donc on revient a 41_custom mais dedans il n'y a pas grand chose (bizarre) a moins de savoir ce qu'est ce $prefix ?? ce qui situerait le custom.cfg ...

Hors ligne

#11 Le 08/06/2011, à 11:49

cauchy

Re : Personnalisation de Grub

Je vais regretter le /boot /grub/menu.lst !


S. Lejoly
Acer AspireOne 9' sous Ubuntu 32bits 10.04, Artic MC001E sous Mint 14 64bits , AMD Duron 1,4 GHz sous Debian Squeeze, Compaq AMD K6 533 MHz sous Asri éducation (Toutou linux) et Mac OS X 6.7 sur MacBook intel.

Hors ligne