LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 05-29-2016, 09:06 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Any known way to use lilo to boot Android?


That's basically the question. The Android installer (Android 4.4.2) writes a grub.cfg which is this:
Code:
default=0
timeout=6
splashimage=/grub/android-x86.xpm.gz
root (hd0,6)

title Android-x86 4.4-r2
	kernel /android-4.4-r2/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 SRC=/android-4.4-r2
	initrd /android-4.4-r2/initrd.img
Perhaps this can be "translated" into a lilo.conf file. I reckon this is a difficult question, as nowadays nobody seems to be using lilo.
 
Old 05-29-2016, 09:50 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,665
Blog Entries: 19

Rep: Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490
LILO stands for "Linux Loader" and that's a good description of what it is. It can only boot Linux. Well, that's not quite true; lilo comes with a chainloader which it can also boot, and which can then boot early versions of Windows, but nobody uses those now. Lilo can't boot a modern NTFS-based Windows and I doubt if it could boot Android either.

GRUB stands for "Grand Unified Bootloader" and again, it's a good description. Grub can boot just about anything. That's why everybody uses it now. Personally I hate grub because it's so complicated. I use lilo whenever I can; it's just as good as grub on a pure Linux system and much easier to understand. But grub wins hands down on a mixed (multiboot) system.

It's not true that nobody uses lilo. Crux uses it and Slackware was using it too when I last looked.
 
Old 05-29-2016, 07:45 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
[GO TO the final paragraph where the real question is if you like.]

I tried Didier's link to no avail. Then I went on reading the grub info file. And this is what I've done, having been rewarded by success.

(a) I installed Android 4.4.2 in partition 7. Mount it on /media.
(b) I created a small partition[, partition 8. Mount it on /mnt/boot.
(c) > mkdir /mnt/boot/android-4.4-r2
> cp /media/android-4.4-r2/* /mnt/boot/android-4.4-r2
> cp -r /media/grub /mnt/boot
(d) Crear /mnt/boot/grub/grub.cfg con vim con el siguiente contenido:

default=0
timeout=6

menuentry "Android KitKat" {
set root='(hd0, 7)'
linux /android-4.4-r2/kernel quiet root=/dev/ram0
androidboot.hardware=android_x86 SRC=/android-4.4-r2
initrd /android-4.4-r2/initrd.img
}

hd0 is sda, hd1 is sdb and so on. 7 is the 7th partition.

(e) > grub-install --boot-directory=/mnt/boot /dev/sda
(f) Reboot
(g) End of procedure.

You can choose to let the OS installer to create a grub.cfg to
see how it looks. It's pretty much like that listed above,
but it had (hd0, 6) instead of (hd0, 7) [????]

I wanted to make it simple, so I did not installed slackware.

Now, I guess the grub.cfg file for Slackware 14.1 won't be much different but, just in case, I would like somebody to guide me in the process if you don't mind. The lilo.conf I use is (essentially):
Code:
boot = /dev/sda
image = /boot/vmlinuz
  initrd = /boot/initrd.gz
  root = /dev/sda5
  label = 14-32
  read-only  # Partitions should be mounted read-only for checking
 
Old 05-30-2016, 08:17 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,557

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
The Grub entry in your initial post is in the format used by Grub Legacy while the entry in your last post is in Grub2 Format. They are not interchangeable. Your comment about "(hd0,6) instead of (hd0,7) is one difference between Grub Legacy and Grub2. Grub Legacy counts drives and partitions from zero while Grub2 counts drives from zero and partitions from one. So in Grub Legacy, sda7 is equal to (hd0,6) and in Grub to it is equal to (hd0,7).

I'm not sure what your question is, but if you want to boot Slackware on sda5 from the Grub2 in Android, the entry below should chainload to Slackware. Not enough info to give a direct boot entry.

Quote:
menuentry 'CHAINLOAD Slackware' {
insmod ext2
set root=(hd0,5)
chainloader +1
}
Quote:
Lilo can't boot a modern NTFS-based Windows and I doubt if it could boot Android either.
I installed the 32bit version (non-UEFI) of windows 10 several weeks ago and put the entry below in lilo.conf on Slackware which chainloaded to boot windows 10.

Quote:
other = /dev/sda3
label = windows-10
 
Old 05-30-2016, 01:50 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Two things, then: can't Android be booted by LILO? Consider 4.4.2 is a deprecated version, I mean, perhaps it not being so modern, it can. One, and the other: in case it can't, I gave the exact entry I have in lilo.conf to boot Slackware. Anything else you need (I'd like to boot Slackware directly from the initial bootloader)?

Last edited by stf92; 05-30-2016 at 01:52 PM.
 
Old 05-31-2016, 01:51 AM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I see no problem with booting android using lilo -what's getting booted is linux, after all.
 
Old 05-31-2016, 04:04 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
That is exactly what I thought. The grub.cfg is
Code:
#menuentry "Android KitKat" {
#    set root='(hd0, 7)'
#    linux /android-4.4-r2/kernel quiet root=/dev/ram0
#    androidboot.hardware=android_x86 SRC=/android-4.4-r2
#    initrd /android-4.4-r2/initrd.img
#    }
I translated it, for lilo, in the following way:
Code:
image = /mnt/android-4.4-r2/kernel
  append="quiet root=/dev/ram0 androidboot.hardware=android_x86 SRC=/mnt/android-4.4-r2"
  initrd = /mnt/android-4.4-r2/initrd.img
  root= /dev/sda7
  label = "Android KitKat"
  read-only
However, after the CPU begins running the kernel, it says "Detecting Android ......." and fills the screen with periods and never ends. I must be doing something wrong.

Last edited by stf92; 05-31-2016 at 07:19 PM.
 
Old 05-31-2016, 08:03 PM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,557

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
The link below to another post here at LQ has an entry in lilo.conf to boot Ubuntu which, according to the post, does boot.

http://www.linuxquestions.org/questi...ubuntu-613632/

I downloaded and isntalled Android and tried to boot with an entry similar to this post and got the same result you did. I reinstalled it and installed Grub Legacy on Android and ran lilo again from Slackware. I got a message in the lilo output indicating the boot sector had a problem (didn't write it down so don't remember it exactly). The basics of it was that Grub was not installed correctly. Since Android by default uses Grub Legacy, I reinstalled Grub Legacy from another Linux system and then put the entry below in lilo.conf, re-ran lilo and booted it sucessfully from the Slackware Lilo boot menu. The problem I had was that Android did not install Grub correctly.

Code:
other = /dev/sdb10
label = android
The entry above is basically a chainload entry and a bootloader needs to be in the correct place on the partition for it to work. I would expect your entry or something similar to work and don't really know why it didn't.
 
Old 05-31-2016, 09:15 PM   #9
Hungry ghost
Senior Member
 
Registered: Dec 2004
Posts: 1,222

Rep: Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667
In case this helps, this is the custom file (for grub) I used to boot Android-x86 when I had it installed on my PC (it worked fine in my case):

Code:
menuentry "Android 4.4" {
set root=(hd0,6)
search --fs-uuid --set 26775fde-d522-4dd8-8d40-933b10c083a3
linux /android-4.4-r2/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 SRC=/android-4.4-r2 DATA= video=-16
initrd /android-4.4-r2/initrd.img
}
Maybe you need to use lilo's equivalent to the "search" command above and use the partition's UUID?
 
Old 06-03-2016, 02:56 PM   #10
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by yancek View Post
The entry above is basically a chainload entry and a bootloader needs to be in the correct place on the partition for it to work.
I remember that DOS had, in the first sector of each partition, a set of data belonging to the partition, the Bios Parameter Table, and executable code. This, then, would be a bootloader? And when you put boot=/dev/sdaN in lilo.conf, that would put the lilo bootloader in the first sector of partition N?

I installed Android in partition 7 and told it to install the Grub bootloader. I suppose it put it in the first disk sector. Anyways it wrote a menu.lst. Then I booted in linux, and mounted /dev/sda7 on /mnt/boot, with menu.lst renamed to grub.cfg and issued the following command:
Code:
root@server:~# grub-install --boot-directory=/mnt/boot /dev/sda7
/usr/sbin/grub-bios-setup: warning: File system `ext2' doesn't support embedding.
/usr/sbin/grub-bios-setup: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-bios-setup: error: will not proceed with blocklists.
root@server:~#
Then I repeated the procedure but telling Android to format in ext3. I thought I had an ext3 fs now but to my surprise I found I still had ext2. Well, this I should ask in an Android forum, but my proceeding, puting /dev/sda7 instead of /dev/sda in the grub-install command line was right, isn't it?

Last edited by stf92; 06-03-2016 at 03:01 PM.
 
Old 06-03-2016, 04:54 PM   #11
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,557

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Installing a bootloader to a partition installs some code to a specific location/sector of the partition.

Quote:
And when you put boot=/dev/sdaN in lilo.conf, that would put the lilo bootloader in the first sector of partition
That tells you where the Lilo code is, the partition. An explanation of the parameters for Lilo at the link below.

http://www.control-escape.com/linux/lilo-cfg.html

The image line in Lilo should tell the Lilo bootloader on your Slackware partition where to look (which partition) for the kernel on the android partition.

I'm not sure why you changed the name of the menu.lst file to grub.cfg? menu.lst or grub.conf are the default names for the Grub Legacy boot menu file, what you see on-screen when you boot. grub.cfg does the same for Grub2.

If you installed Grub in Android, did you try booting with the lilo entry I suggested above, the 'other' entry? If Grub installed to your android partition, it should chainload from Lilo.

Quote:
other = /dev/sda7
label = android
Quote:
root@server:~# grub-install --boot-directory=/mnt/boot /dev/sda7
In order for the command above to be successful, you would first need to create a boot directory in Android which it does not do in a default install. Mounting android at /mnt/boot you would then need the path to be: /mnt/boot/android-4.4-r2/boot

Are you now trying to install Grub2 to the Android partition and forgetting about booting it from Lilo?

The Grub2 entries I have on various distributions all have the 'insmod ext2' entry even though the filesystems are ext4 so I wouldn't worry about it.

Android installs Grub Legacy by default and you are trying to install Grub2 so you need to decide which to use, either should work but Grub Legacy is simpler to install. Good luck with it.

Last edited by yancek; 06-03-2016 at 05:04 PM.
 
Old 06-05-2016, 10:35 AM   #12
patrick295767
Member
 
Registered: Feb 2006
Distribution: FreeBSD, Linux, Slackware, LFS, Gparted
Posts: 664

Rep: Reputation: 138Reputation: 138
why not using Syslinux?
 
Old 06-05-2016, 05:44 PM   #13
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Well, a friend of mine, who does not know anything about computers, has Android 4.4.2 on it's tablet. I wanted to install that OS in my notebook to get familiar with it and be able to help my friend. So, anotther OS won't do.
 
Old 06-05-2016, 06:51 PM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,557

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Quote:
I wanted to install that OS in my notebook to get familiar with it and be able to help my friend. So, anotther OS won't do.
If you are referring to the suggestion above to use 'Syslinux', it is another bootloader and not an operating system. Syslinux is used on most CD/DVD and installation media to boot them.

If you have the default Grub Legacy installed to the boot sector of the android partition, the 'other' entry I posted above should work. At least it worked on my system.
 
Old 06-06-2016, 06:57 PM   #15
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
So the installer when it runs the grub program writes the bootloader not to the MBR but to the same partition I chose?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LILO ERROR #1 - Lilo boot loader not installing in VectorLinux 7.0 Light edition. Vexe VectorLinux 4 02-09-2013 09:41 AM
Lilo lost, Install disk failing to restore Lilo on dual boot? Dobie Linux - Newbie 2 05-05-2004 05:00 PM
I install Slackware on small HDD with LILO, can't boot LILO? kleptophobiac Slackware 4 08-10-2003 04:50 PM
lilo and openmosix was just installed and was added to lilo boot menu but.. kublador Linux - Software 0 06-18-2003 01:59 AM
Made a bootdisk with RedHat 7.1 to boot: Gave me SYSLINUX, not LILO:Want to use LILO Colonel Panic Linux - Software 0 08-17-2001 06:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 06:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration