Results 1 to 3 of 3

Thread: Choosing to start X during bootup

  1. #1
    Join Date
    May 2006
    Beans
    45

    Question Choosing to start X during bootup

    Hi,

    In the past (before UpStart was used in Ubuntu) I was able to configure multiple boot items in Grub menu to load the same kernel but into different runlevels. I had configured runlevel 3 (I went into /etc/rc3.d/ and removed the symlink to /etc/init.d/gdm) to be w/o GDM, so that if I had chosen it, my box would not boot into X.

    How can I achieve the same effect in Lucid?

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Choosing to start X during bootup

    In order to boot without starting the display manager use the text kernel parameter.


    To create a text mode Grub2 menu entry:

    1. backup the /etc/grub.d/10_linux file:
      Code:
      sudo cp /etc/grub.d/10_linux{,-backup}
      sudo chmod -x /etc/grub.d/10_linux-backup
    2. open it for editing:
      Code:
      gksu gedit /etc/grub.d/10_linux
    3. scroll down to the linux_entry function (line ~64), and edit it to look like this:
      Code:
      ...
      linux_entry ()
      {
        os="$1"
        version="$2"
        recovery="$3"
        args="$4"
      
        if [ "${recovery}" = "text" ]; then
          title="$(gettext_quoted "%s, with Linux %s (text mode)")"
        elif ${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
      ...
    4. scroll down to the end of file and call the function:
      Code:
      ...
        linux_entry "${OS}" "${version}" false \
            "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
            quiet
      
        linux_entry "${OS}" "${version}" "text" \
            "text ${GRUB_CMDLINE_LINUX}"
      
        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
    5. generate a new grub.cfg file:
      Code:
      sudo update-grub
    6. check out the /boot/grub/grub.cfg file and see if the new menu entry is generated.


    If something went wrong, restore the original settings:
    Code:
    sudo cp /etc/grub.d/10_linux{-backup,}
    sudo chmod +x /etc/grub.d/10_linux
    Code:
    sudo update-grub
    Last edited by sisco311; July 13th, 2010 at 05:21 PM.

  3. #3
    Join Date
    May 2006
    Beans
    45

    Re: Choosing to start X during bootup

    Quote Originally Posted by sisco311 View Post
    In order to boot without starting the display manager use the text kernel parameter.
    Thanks!!! You have been of great help!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •