Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 24 May 2015, 21:40
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
grub2 minimal configuration entry THIS IS UNRELIABLE
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
gerry

Joined: 26 Jul 2007
Posts: 971
Location: England

PostPosted: Thu 27 Nov 2014, 13:32    Post_subject:  grub2 minimal configuration entry THIS IS UNRELIABLE  

EDIT: sorry folks- the wind changed direction, or something, and it stopped working.
EDIT2: Silly me- I'd been trying some other ideas, and forgotten the final "update-grub". Working again now.

EDIT3: DON'T DO IT. This is unreliable, Grub needs more than this.

I run Mint 17, Debian 7.7, and Slacko 5.7 on my Thinkpad T60 laptop.
The bootloader is GRUB2, residing in Mint ('cos that's the latest long term support version, and will stay for years). The grub2 autofind function is a bit snooty, and refuses to find Puppy- so an entry in /etc/grub.d/40_custom has to be created.

I read lots of topics in lots of forums, and lots of grub2 configuration manuals, but could not understand most of what they said had to go into the configuration file- mainly because they were all different.

Eventually, I realised that all grub2 needs to be told is where to find the vmlinuz and initrd.gz files. Everything else was either default values or it could work it out.

My Puppy is a frugal install. Initially, I had all files installed directly into the partition.

Puppy is on the first and only hard drive, in partition 6. To edit /etc/grub.d/40_custom you can either use the distro where it resides, but you have to use sudo or become root. It's easier to use Puppy to mount the (in my case Mint) partition, and then edit /etc/grub.d/40_custom file using Puppy.

Note that when you edit this file you must not touch what is there already- just add your own lines below that. So here's my first go:

menuentry "Slacko" {
linux (hd0,6)/vmlinuz
initrd (hd0,6)/initrd.gz
}

Simple, isn't it? That really is (in my case!) all the information that is needed.

After doing this and saving the file, you need to boot your major distro, and open a root terminal, and do:
#update-grub

then reboot, and you should see Puppy at the bottom of the menu list. Click on that, and Puppy should boot.

If you want to put several Puppies in sub-folders, the entry becomes:

menuentry "Slacko57" {
linux (hd0,6)/slacko57/vmlinuz
initrd (hd0,6)/slacko57/initrd.gz
}

for a Slacko in a folder named slacko57.

Gerry

Edited_time_total
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4026
Location: Kiel,Germany

PostPosted: Mon 15 Dec 2014, 14:28    Post_subject:  

Grub is special

Version 2 even supports gettext to localize text

Does anyone know if Grub2 handles kezyzyzyzyboard layouts ?


Grub1 has setkey but that is almost useless

Code:
setkey y F10
setkey z F9
setkey z y


and voila there is z on z, y, F10 and F9 -- four times z - but no y anywhere

Laughing

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send_private_message 
gerry

Joined: 26 Jul 2007
Posts: 971
Location: England

PostPosted: Wed 17 Dec 2014, 11:42    Post_subject:  

This minimal configuration turns out to be unreliable; Sometimes it works, sometimes it doesn't.

In the end I did as I was advised, and installed GRUB4DOS. Much better idea.

Gerry
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4026
Location: Kiel,Germany

PostPosted: Wed 24 Dec 2014, 17:50    Post_subject:  

Be aware that most commands now have to be insmod.
Even
Code:
insmod help

is needed in the grub2 shell to be able to use the help command .

And Grub2-2.02 supports more commands than Grub2-1.98 .

Don't mix their modules . Always delete everyting in /boot/grub/*.mod , before installing grub2 after up/downgrade .

Code:
insmod menuentry
menuentry "Some LNXLNX" {
insmod linux
insmod initrd
insmod ext2
insmod set
set root='(hd0,6)'

linux /boot/vmlinuz-distro-version
initrd /boot/initrd-distro-version
}

Laughing
root is two things now : A command like in old Grub1 and a variable set by "set"


Grub2 has the ability to boot a complete iso like
Code:
menuentry "Iso Mount" {
insmod loop
losetup (loop0) (hd0,1)/Puppy/puppy.iso
linux (loop0)/vmlinuz
initrd (loop0)/initrd.gz
}

But Puppy's initrd is not configured to search for ISO files Crying or Very sad

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send_private_message 
Ted Dog


Joined: 13 Sep 2005
Posts: 3223
Location: Heart of Texas

PostPosted: Thu 25 Dec 2014, 00:50    Post_subject:  

cool iso mount it will help me organize my collection of Fatdog64. You unpack those and everything has the exact same name as the version before very confusing. Wink
Back to top
View user's profile Send_private_message 
bobc

Joined: 14 May 2014
Posts: 77

PostPosted: Wed 28 Jan 2015, 15:45    Post_subject:  

Gerry, your syntax looks like its not for grub2. It looks like for grub-legacy or maybe grub4dos (I only used that once), but maybe grub2 accepts that syntax also, I wouldn't know.

I am certainly no expert, learned a lot by screwing up many times.

I prefer grub2 because it finds most operating systems that I have.

I will never try grub or grub4dos again. Puppy package manager has a grub2 package available. I have installed it and have it working on my full install of Slacko 5.7.0. As part of the install it also installed the os-prober package. Once the package is installed:

if I want to change grub defaults, they are in the file /etc/defaults/grub.

then if I need to manually add other operating systems to the boot menu, I need to modify /etc/grub.d/40_custom.

then I run the install. my boot drive is sda. it installs the boot loader to /dev/sda and points it back to running this operating system and its grub configuration by default

grub-install --recheck /dev/sda

then I run

update-grub

to rebuild the configuration.

then I close everything and select reboot from the main menu. This operating system should be listed first.

I like karl's ideas Smile It would be neat to be able to boot from an iso file.

My opinion is that grub2's worst problem is how it fails to correctly identify different systems on the grub menu, and either mis-identifies them or says they are unknown. I am surprised there is no standard place to look for text to identify any particular operating system.

I have found with Slackware based distros that if I create a file

/etc/slackware-version

On my Slackware 14.1 partition the file says "Slackware 14.1"

I can put a descriptive line in it like "Slacko-5.7.0 14.0" and that will get used in the generated grub2 boot menu along with the name of the partition.

This worked for Slacko and Slackel and Salix

Its a shame it doesn't use the label of the partition because I always put the description I would want to see there.

I don't know if this would work for any other distros or not. For example, in a debian based distro a file

/etc/debian-version

looks like it might work similar to the slackware one above, but in this case the file existed and had "7.2" in it, so I changed it to "7.2 antiX-13.2"

This worked for antiX

What I don't know is if it will affect anything else, that I can't say, since you will note that different distros use this method in different ways.

PS: Arch linux has a file /etc/arch-release and Manjaro which is an Arch derivative has a file /etc/manjaro-release.

I did find that if someone upgrades an OS it may check or want to update these version or release files, so I'd be extra careful changing the file if it already exists, because it would likely cause potentially major problems if the os is looking for it and using it.

The code I found this in is called 90linux-distro in the os-prober package of debian.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0635s ][ Queries: 11 (0.0030s) ][ GZIP on ]