WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Grub2 Config For Dummies (share with Ubuntu)  (Read 4646 times)

Offline rms46

  • Jr. Member
  • **
  • Posts: 60
    • Rahmat M. Samik-Ibrahim
Grub2 Config For Dummies (share with Ubuntu)
« on: January 13, 2013, 04:54:26 AM »
To Whom It May Concern

I am looking for a step-by-step tutorial/article/URL on how to install/share TCL with Ubuntu. The closest one is http://wiki.tinycorelinux.net/wiki:install_wo_optical_grub2

1) I've installed TCL into /dev/sda4:/tce/boot
--- /tce/boot/vmlinuz
--- /tce/boot/4.7.0/core.gz
--- /tce/boot/4.7.2/core.gz
--- /tce/boot/extlinux/

2) Is there anything that I should change in ubuntu:/etc/default/grub ?

3) What should I write in ubuntu:/etc/grub.d/40_custom ?
menuentry "TCL" {
   set root=(hd0,msdos4)
   linux /tce/boot/vmlinuz tce=sda4 opt=sda4 waitusb=5 showapps syslog quiet
   initrd /tce/boot/4.7.2/core.gz
}


Before I proceed, I just want to be sure, that this is not a graveyard mistake.
Thank you for any clues.



This following is ROT13 -- Guvf sbyybjvat vf EBG13

Offline beroje

  • Full Member
  • ***
  • Posts: 130
Re: Grub2 Config For Dummies (share with Ubuntu)
« Reply #1 on: January 13, 2013, 07:59:19 AM »
menuentry "Core32" {
set root='(/dev/sda,msdos6)'
linux (hd0,msdos6)/core32/boot/vmlinuz quiet tce=sda6/core32/tce
initrd (hd0,msdos6)/core32/boot/core.gz
}

aus9

  • Guest
Re: Grub2 Config For Dummies (share with Ubuntu)
« Reply #2 on: January 13, 2013, 10:19:02 AM »
Hi

as I wrote that howto I will expand on your circumstances....assuming you are 32 bit but thats for you to adjust. So try this instead

Ubuntu's 40_custom edit with root powers for simple style (1) with a twist in names and folders
Quote
menuentry "TC on sda4" {
set root=(hd0,msdos4)
linux /vmlinuz tce=sda4 opt=sda4 waitusb=5
initrd /473.gz
}
Now lets look at the files
You may need to say what your Ubuntu /etc/fstab is for sda4 but I will assume its non-essential. No need to give it a boot folder when Ubuntu already has one.

therefore download core.gz and vmlinuz and place that at the root of /dev/sda4 but with a rename so that if your fstab said it was

UUID="ugly string" /data blah blah  0 0.....(where ugly string = /dev/sda4)

then
Code: [Select]
ls /data
---> 473.gz vmlinuz
(next)
sudo update-grub

reboot and TC will create the folders opt and tce at your /data so when your reboot back to Ubuntu you see
473.gz vmlinuz opt tce

2) Now if you have followed all that, I cheat.
http://tinycorelinux.net/4.x/x86/release/distribution_files/

download either the 32 bit or 64 kernel and rename it vmlinuz
download either the 32 bit or 64 bit core and rename it 473.gz

You will notice that as TC is under development roberts puts out a new core every so often.

So you can have 40_custom with a core called 472.gz for the last one and 473.gz for the recent one

3) If still not confused use e2label in Ubuntu to create a label name for sda4 then your grub becomes
assuming you used
Code: [Select]
sudo e2label /dev/sda4 part4
sudo e2label /dev/sda4
(to check it landed)


Quote
menuentry "TC on sda4" {
set root=(hd0,msdos4)
linux /vmlinuz tce=LABEL=part4 opt=LABEL=part4 waitusb=5
initrd /473.gz
}

if you have no usb devices like usb mouse/kb you can remove that bootcode waitusb=5

4) As we did not unpack the iso, when you boot TC you will get not a X windows but a console so we need some files for reboot

Code: [Select]
tce-load -iw flwm_topside Xlibs Xprogs Xvesa

reboot into TC and hopefully you now have a graphical system you can now work with?

YMMV

5) Also be aware you can not use chown or chmod recursively with in Ubuntu on your sda4 partition as TC needs this structure

opt/ root:staff
tce/ tc:staff
If you have a persistent home.....home/ root:root
....................................................home/tc  tc:staff

good luck

« Last Edit: January 13, 2013, 10:24:15 AM by aus9 »

Offline rms46

  • Jr. Member
  • **
  • Posts: 60
    • Rahmat M. Samik-Ibrahim
Re: Grub2 Config For Dummies (share with Ubuntu)
« Reply #3 on: January 13, 2013, 11:03:16 AM »
Thank you very much for all clues and suggestions!
TCL was already installed into /dev/sda4 which I use
as /home in Ubuntu. Therefore, the "tce" folder was
/home/tce from Ubuntu's point of view. I was not sure
what to do next, since I have never modified "grub2"
before.

I made some minor modification, i.e. adding core.gz
version 4.7.3. Thus, file /etc/grub.d/40_custom becomes:

menuentry "TCL 4.7.3" {
   set root='hd0,msdos4'
   linux /tce/boot/vmlinuz tce=sda4 opt=sda4 showapps syslog quiet
   initrd /tce/boot/4.7.3/core.gz
}


And then, I run:

# update-grub

I guess that the name "4.7.3/core.gz" is not a good idea.
In future, I will replace it with "core-4.7.3.gz".

Again, thanks for all help.

Rahmat.


This following is ROT13 -- Guvf sbyybjvat vf EBG13

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Grub2 Config For Dummies (share with Ubuntu)
« Reply #4 on: January 13, 2013, 03:35:27 PM »
perhaps a look at my grub2 config file may help you,

see http://forum.tinycorelinux.net/index.php/topic,14613.0.html

notice I don't use the "set root=" declaration in grub2 (I think that's outdated), don't know if this makes a difference but I use LABEL's instead which provides a tremendous amount of portability. 

running "update-grub" is intended for use in grub legacy, it does not exist or obviously work in Grub2 (afaik), for Grub2 you need "grub2-mkconfig -o /boot/grub2/grub.cfg" or better still just create one manually and most importantly *Make a Backup of a working config file*  ;)
« Last Edit: January 13, 2013, 04:18:07 PM by coreplayer2 »

Offline rms46

  • Jr. Member
  • **
  • Posts: 60
    • Rahmat M. Samik-Ibrahim
Re: Grub2 Config For Dummies (share with Ubuntu)
« Reply #5 on: January 14, 2013, 02:09:01 AM »
Thank you very much for the example/URL.

notice I don't use the "set root=" declaration in grub2 (I think that's outdated),

Well, I was just copying from what was in /boot/grub/grub.cfg

running "update-grub" is intended for use in grub legacy

According to "man update-grub" in Ubuntu:
Quote
update-grub  is a stub for running grub-mkconfig -o /boot/grub/grub.cfg to generate a grub2 config file.
This following is ROT13 -- Guvf sbyybjvat vf EBG13

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Grub2 Config For Dummies (share with Ubuntu)
« Reply #6 on: January 14, 2013, 05:15:34 AM »
Am just saying, you might not need to run update grub is all consider i have never used that method and yet my system have some wild configurations.

Don't let me mislead you, each to their own technique and each project is always different to some degree.  I prefer an initial compile + install then manually edit/create a cfg file forever more.  Come to think about it I've only ever compiled Grub2  maybe only a couple times whilst the original install has been copied to similar architecture yet have made many new cfg files maybe a 100 times or so (manually), YMMV


Good luck with your project
 

« Last Edit: January 14, 2013, 05:23:52 AM by coreplayer2 »