Find the answer to your Linux question:
Results 1 to 2 of 2
My sister just bought a new laptop and now she wants me to set it up for her as stable as possible, but she doesn't want to use Linux (anything ...
  1. #1
    Just Joined!
    Join Date
    Nov 2008
    Posts
    25

    Editing GRUB startup to make Suse start a different script on boot

    My sister just bought a new laptop and now she wants me to set it up for her as stable as possible, but she doesn't want to use Linux (anything new in computers scares her).

    So I'm currently doing a clean OEM install of Windows 7, making sure that she has a "program files" partition and a data partition. Nothing at all hard or fancy about that, but now...

    My sister can be a true disaster when it comes to computers, so whenever she starts browsing the internet, you can be sure that after one or more months she'll crash the whole damn thing and I get pulled in to fix stuff for her. That's why I was thinking about a different approach.

    I was thinking about making a 3rd partition on her disk, one that is about 10GB bigger than her "program files" partition, and install Suse 11 on it. I would use Suse in text mode and only to execute a dd to make an image of her "program files" partition and store it on the Suse partition. Now, whenever she has her laptop crashing or when she wants to install new important software (which fortunately doesn't happen a lot), she can use dd to put the image back.

    All of this, still not a big problem, except, I already explained, my sis is kinda scared of computers, so trying to explain the concepts of dd to her would freak her out and forcing her to type the command is sure to trash the laptop even sooner.

    This is why I came up with the following:

    After installing Windows 7 and OpenSUSE, making sure all partitions are in order, I wist to create two scripts, one which creates the image and then reboots and another that restores the image and reboots. I would then like to set up GRUB to start Windows by default, but I would like to add two options for Suse, for each script one that executes that exact script.

    Does anyone know how I can make this happen?

  2. #2
    Just Joined!
    Join Date
    Nov 2008
    Posts
    25
    Got it:

    In /boot/grub/menu.lst on the kernel line, add a [var]=[value] at the end.

    After that, call your script in /etc/init.d/boot.local.

    In your script, request the value of [var] like this:

    c=$(cat /proc/cmdline)
    c="${c##*[var]=}"

    using different values in different Grub menu items allows you to run different scripts for each option.

Posting Permissions

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