You are not logged in.

#1 2011-08-13 16:26:50

jesseFrey
Member
From: Boulder CO
Registered: 2011-07-22
Posts: 24

Adding grub menu entries with a package

I built a package that installs a gparted live image to the hard disk and then adds it to the grub menu and causes it to boot from ram. this way you can repartition your hard disk without any external media. The one problem is that I don't like is the way it gets added to the grub menu.
I install the following file as /etc/grub.d/50_gparted_live:

#!/bin/sh
exec tail -n +3 $0
#gparted live menu entry
menuentry "Gparted Live" {
    linux (hd0,1)/vmlinuz-gparted boot=live config union=aufs noswap noprompt ip=frommedia live-media-path=/ bootfrom=/dev/sda1 toram=gparted.squashfs
    initrd (hd0,1)/gparted.img
    boot
}

This works but it seems that it won't work if the partitions are set-up differently. I looked at the other scripts in /etc/grub.d/ and got confused. can someone help me or at least point me in the right direction?
thanks

Offline

#2 2011-08-13 18:50:12

skodabenz
Banned
From: Tamilnadu, India
Registered: 2010-04-11
Posts: 382

Re: Adding grub menu entries with a package

Try

#!/bin/sh
exec tail -n +3 $0
#gparted live menu entry
menuentry "Gparted Live" {
    search --file --no-floppy --set=root /vmlinuz-gparted
    linux /vmlinuz-gparted boot=live config union=aufs noswap noprompt ip=frommedia live-media-path=/ bootfrom=/dev/sda1 toram=gparted.squashfs
    initrd /gparted.img
}

As for

bootfrom=/dev/sda1

I don't know how to detect that. And no need for "boot" at the end though.


My new forum user/nick name is "the.ridikulus.rat" .

Offline

#3 2011-08-13 20:12:45

jesseFrey
Member
From: Boulder CO
Registered: 2011-07-22
Posts: 24

Re: Adding grub menu entries with a package

I guess I may not have been to clear the code I posted works fine. I would just like to know the proper way to do things so that it would work if, say,I installed it on a system where the partitions were set-up differently.
also I noticed that grub now detects  (I had named it gparted-vmlinuz earlier) the image and tries to create an entry for it but the entry does not work. Is there some way to change the parameters for a single entry?

Offline

Board footer

Powered by FluxBB