LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2020, 12:19 AM   #1
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Rep: Reputation: Disabled
LineageOS-x86 broke android-x86 GRUB2 on external hdd dual boot


My notebook has an internal HDD with Windows 10 Pro, which I want to leave untouched as far as possible

This question is about installing android-86 on an external HDD

I have a 500 GB laptop internal HDD that I use as an external HDD using a USB connector

The hard disk is partitioned as follows: 50 GB (1), 50 GB (2), 50 GB(3), unallocated

I installed android-x86_64-9.0-rc2.iso in partition (1) and at the end I was told to install GRUB2 which I did, and I was easily able to dual boot the built in windows 10 and android-x86 (by default the computer just booted into Windows 10, I had to go to the BIOS boot menu by pressing F9, which now had two extra options, either boot from the HDD or UEFI boot android-x86, both allowed me to boot up the android-x86)

I then installed LineageOS-x86, cm-x86_64-14.1-r2.iso in partition (2), and at the end it asked me to install GRUB2 which I selected Yes to.

Now it turns out it overwrote the GRUB2 installation from android-x86 in partition (1). All the android-x86 files are still there, I just can't boot into it. The new GRUB2 menu now has boot option for LineageOS only.

How do I add the boot options for android-x86 to the current GRUB menu? Or is it possible to get back the GRUB for android-x86 (since I preferred the looks of that menu) and add LineageOS boot options to that menu instead?

Also, no matter what I do to fix this, I want to keep the Windows installation in my internal HDD untouched. Please give some suggestions on what to do keeping this in mind.

Last edited by mahaju; 02-11-2020 at 01:01 AM.
 
Old 02-11-2020, 07:28 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,566

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Is your windows 10 the default UEFI? Are Android and Lineage(??) also both UEFI? If you wanted to keep the Grub from Android, why would you install Grub of the other OS? I've never before heard of Lineage OS but if it is a current Linux using Grub2, you should be able to run grub-mkconfig on it to update the Grub bootloader and add Android to the boot menu.
 
Old 02-11-2020, 08:03 AM   #3
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,391

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Boot the external drive open a terminal post the output of
sudo parted -l
That is a lower case L and
lsblk -f
 
Old 02-11-2020, 08:35 AM   #4
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Most EFI laptops will allow you to access a boot menu by pressing F12. GRUB from android is not probably not lot or overwritten, it is simply no longer the default, as Lineage's GRUB replaced it as the default.

On boot, try accessing the boot menu, and you will likely find multiple menu entries for GRUB. If it's not properly labelled you may have to try each one to find out which it is.
 
Old 02-12-2020, 05:51 AM   #5
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
Is your windows 10 the default UEFI? Are Android and Lineage(??) also both UEFI? If you wanted to keep the Grub from Android, why would you install Grub of the other OS? I've never before heard of Lineage OS but if it is a current Linux using Grub2, you should be able to run grub-mkconfig on it to update the Grub bootloader and add Android to the boot menu.
(1) Yes it is.
(2) I think so yes.
(3) I guess I didn't really know what I was doing, I assumed it would just add an entry in the existing GRUB menu or something like that
(4) LineageOS was previously known as CynogenMod, a fork of Android Open Source Project, used to make custom ROMs for android phones. The one I am using is the android-x86 (actually x64) version based on Android 7.0
(5) I'm not sure how to do that. I loaded LineageOS again and looked at the options available, but I couldn't find anything that can potentially help me edit GRUB. If you haven't seen it before you can think of the interface as exactly like a smartphone, but on a laptop. It has root access but I don't think it has advanced commands. I have installed the BusyBox app on it so I have access to some Linux commands using a terminal app, but that's it.
 
Old 02-12-2020, 06:55 AM   #6
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
Boot the external drive open a terminal post the output of
sudo parted -l
That is a lower case L and
lsblk -f
I think those commands are not available in this OS. This OS is similar to android-x86 which is similar to a phone's android. I have BusyBox app installed but it says these commands are not present when I try to execute them.

I'm not much experienced in Linux and I don't really know what parted or lsblk do, but from here it looks like fdisk is an equivalent command in BusyBox. This is the output of fdisk. (I couldn't find a way to copy the terminal output as text. I've cropped the pictures to reduce size, if anythings unclear please let me know). I have attached the outputs for the following commands.

fdisk -l
This command said it couldn't open any of my hard disks. Not sure if I had to mount them first by going to settings. Strangely this command works on my rooted smartphone.

df
cat /proc/partitions

From here, I read that these give information similar to lsblk

These are the things currently attached to the laptop:
1 TB internal HDD connected to the SATA port (Partitions as shown by Windows Disk Management: Recovery (OEM Partition), EFI partition, C:, D:, E:, unallocated )

SDCARD (FAT32) in built in SDCARD slot

500 GB internal HDD connected externally through USB (Partitions as shown by Windows: Android-x86, Android-x86 (the one with Lineage OS), Free partition, unallocated (all the allocated partitions are NTFS) )
Attached Thumbnails
Click image for larger version

Name:	fdisk -l.jpg
Views:	101
Size:	147.0 KB
ID:	32513   Click image for larger version

Name:	df.jpg
Views:	72
Size:	193.3 KB
ID:	32514   Click image for larger version

Name:	cat.jpg
Views:	57
Size:	192.4 KB
ID:	32515  
 
Old 02-12-2020, 07:37 AM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,566

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
The first and third images you posted indicate that you have 3 physical drives of some unknown type/size with the first (sda) having6 partitions, the second (sdb) having 3 partitions and from what is shown, the third (sdc) has at least one partition? The second image using the df command shown only windows filesystems on the partitions, 3 ntfs and one vfat. The df command only shows mounted partitions.

The fdisk command requires root to output anything which you did not use. Don't know how you get root on an Android or if it uses sudo?

You stated that you have an EFI windows system and your second image shows a vfat partition which is probably the EFI. I you can boot the Android or Lineage, you might try accessing that partition to see if it contains any boot files for either system. It shows as being mounted at : /storage/FE1A-73C0

From the images you posted, your Android/Lineage are installed on either sdb or sdc and I'm not sure if your output for sdc was cut off in the image you posted as it shows only one partition. Posting the output of fdisk or parted might help. Also, have you tried going specifically to some Android site or forums which must exist?
 
Old 02-17-2020, 01:41 AM   #8
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
The first and third images you posted indicate that you have 3 physical drives of some unknown type/size with the first (sda) having6 partitions, the second (sdb) having 3 partitions and from what is shown, the third (sdc) has at least one partition? The second image using the df command shown only windows filesystems on the partitions, 3 ntfs and one vfat. The df command only shows mounted partitions.

The fdisk command requires root to output anything which you did not use. Don't know how you get root on an Android or if it uses sudo?

You stated that you have an EFI windows system and your second image shows a vfat partition which is probably the EFI. I you can boot the Android or Lineage, you might try accessing that partition to see if it contains any boot files for either system. It shows as being mounted at : /storage/FE1A-73C0

From the images you posted, your Android/Lineage are installed on either sdb or sdc and I'm not sure if your output for sdc was cut off in the image you posted as it shows only one partition. Posting the output of fdisk or parted might help. Also, have you tried going specifically to some Android site or forums which must exist?
Quote:
You stated that you have an EFI windows system and your second image shows a vfat partition which is probably the EFI. I you can boot the Android or Lineage, you might try accessing that partition to see if it contains any boot files for either system. It shows as being mounted at : /storage/FE1A-73C0
I can boot into LineageOS-x86 but I don't think the OS itself has any tools to let me do things like those. I have installed BusyBox so I will need to look more into whether any BusyBox command will let me do something like this

Quote:
Also, have you tried going specifically to some Android site or forums which must exist?
I haven't found any helpful solutions in any other sites I visit. Isn't problem with GRUB booting mainly dealt with in Linux computers? In my case I don't think there is any problem with the linux installation, just with GRUB
 
Old 02-17-2020, 07:00 AM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,566

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
I'm not familiar with Lineage or Android so I'm not sure what is available. The link below gives some information on using root on an Android system. Might give that a read. As you will see if you read it, Android is not Linux but uses a modified version of the kernel and is missing a lot of standard apps.

https://www.androidcentral.com/root

Quote:
Isn't problem with GRUB booting mainly dealt with in Linux computers? In my case I don't think there is any problem with the linux installation, just with GRUB
Grub is a Linux bootloader, correct. Installing Grub is part of the installation of most Linux systems. The problem anyone will have in trying to help in your situation is that you are unable to post any useful details. The information you have posted so far isn't very helpful. What is needed is for you to be able to determine where the EFI partition(s) are and mount them and take a look at them to see what files are there. Do you have only one EFI partition with windows and ANdroid files? or do you also have Lineage files in the EFI partition? or did Lineage overwrite the Android files? or do you have more than one EFI partition?

If you can't get root access on the android, do you have another actual Linux OS on a DVD/USB to use to get that information. It isn't possible really for anyone to provide a solution because we are lacking the most basic information. Obviously, Grub wasn't installed properly but more information is needed.
 
Old 02-17-2020, 06:48 PM   #10
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
I'm not familiar with Lineage or Android so I'm not sure what is available. The link below gives some information on using root on an Android system. Might give that a read. As you will see if you read it, Android is not Linux but uses a modified version of the kernel and is missing a lot of standard apps.

https://www.androidcentral.com/root



Grub is a Linux bootloader, correct. Installing Grub is part of the installation of most Linux systems. The problem anyone will have in trying to help in your situation is that you are unable to post any useful details. The information you have posted so far isn't very helpful. What is needed is for you to be able to determine where the EFI partition(s) are and mount them and take a look at them to see what files are there. Do you have only one EFI partition with windows and ANdroid files? or do you also have Lineage files in the EFI partition? or did Lineage overwrite the Android files? or do you have more than one EFI partition?

If you can't get root access on the android, do you have another actual Linux OS on a DVD/USB to use to get that information. It isn't possible really for anyone to provide a solution because we are lacking the most basic information. Obviously, Grub wasn't installed properly but more information is needed.
Ok thank you I think I am understanding the problem a bit more

I have another live linux that I sometimes use to troubleshoot and using it I have copied all the files off of what I believe is the EFI partition in my internal hard disk with Windows 10. This disk has the following partitions as shown by Windows Disk Management: Recovery (OEM Partition), EFI partition, C:, D:, E:, unallocated

This partition shows up at sda2 in my linux session and has the following files and folders:

E:.
├───boot
│ └───grub
│ ├───fonts
│ ├───theme
│ │ └───icons
│ └───x86_64-efi
└───EFI
├───Android
├───Boot
├───HP
│ ├───BIOS
│ │ ├───Current
│ │ ├───New
│ │ └───Previous
│ └───BIOSUpdate
└───Microsoft
├───Boot
│ ├───bg-BG
│ ├───cs-CZ
│ ├───da-DK
│ ├───de-DE
│ ├───el-GR
│ ├───en-GB
│ ├───en-US
│ ├───es-ES
│ ├───es-MX
│ ├───et-EE
│ ├───fi-FI
│ ├───Fonts
│ ├───fr-CA
│ ├───fr-FR
│ ├───hr-HR
│ ├───hu-HU
│ ├───it-IT
│ ├───ja-JP
│ ├───ko-KR
│ ├───lt-LT
│ ├───lv-LV
│ ├───nb-NO
│ ├───nl-NL
│ ├───pl-PL
│ ├───pt-BR
│ ├───pt-PT
│ ├───qps-ploc
│ ├───Resources
│ │ └───en-US
│ ├───ro-RO
│ ├───ru-RU
│ ├───sk-SK
│ ├───sl-SI
│ ├───sr-Latn-RS
│ ├───sv-SE
│ ├───tr-TR
│ ├───uk-UA
│ ├───zh-CN
│ └───zh-TW
└───Recovery

The root of this partition also contains a file called startup.nsh with the text
Quote:
\efi\Android\BOOTx64.EFI
A lot of the subfolders contain other files which I have not shown here to keep the post shorter, but I can include them if needed

Some possible relevant details are given below:

boot\grub\theme contains png files which look like they are for the background, window borders and buttons for the Android-x86 GRUB menu (the LineageOS boot menu looks more like a DOS menu screen,white text on a black background, while Android-x86 one looks more elaborate)

EFI\Boot contains bootx64.efi which I think is for Windows 10

EFI\Android is what I believe is currently used for LineageOS booting. This folder has android.cfg, bootia32.efi, BOOTx64.EFI, grubx64.efi, initrd.img, kernel and I think this is what is booting into LineageOS. android.cfg is the only text file and has references to Lineage OS.

Last edited by mahaju; 02-17-2020 at 06:49 PM.
 
Old 02-18-2020, 06:12 AM   #11
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,566

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
If I am reading your output correctly, when you access the EFI partition you see Android, Boot, HP and Microsoft. The last 3 are standard directories on an HP computer with a pre-installed UEFI of windows. TWo possibilities come immediately to mind; one, Lineage being based on Android has overwritten the Android files on the EFI partition which is why Lineage boots. Second, Lineage was installed in Legacy mode rather than UEFI mode. If either is the case, you can boot Lineage and update Grub, you need root to do this (see previous post): grub-mkconfig -o /boot/grub/grub.cfg If you can do this watch the output.

When you boot the HP, do you have an option to hit the Esc key then the F9/F10 keys to make changes? If you hit F9, do you see an option to boot from EFI file? If so, do you see anything related to Lineage there?
 
Old 02-21-2020, 02:25 AM   #12
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
If I am reading your output correctly, when you access the EFI partition you see Android, Boot, HP and Microsoft. The last 3 are standard directories on an HP computer with a pre-installed UEFI of windows. TWo possibilities come immediately to mind; one, Lineage being based on Android has overwritten the Android files on the EFI partition which is why Lineage boots. Second, Lineage was installed in Legacy mode rather than UEFI mode. If either is the case, you can boot Lineage and update Grub, you need root to do this (see previous post): grub-mkconfig -o /boot/grub/grub.cfg If you can do this watch the output.

When you boot the HP, do you have an option to hit the Esc key then the F9/F10 keys to make changes? If you hit F9, do you see an option to boot from EFI file? If so, do you see anything related to Lineage there?
As far as I can tell LineageOS does not have the grub-mkconfig command. I have a live SDCard with puppy-linux which I am thinking of using to issue this command over the weekend. Before I do anything like this though, I would like to ask if this is something that might break my current setup for booting Windows 10 in the internal hard drive. If it is, is there any precautions I can take first so that I can recover everything back to the way it is now, in case something goes wrong?
 
Old 02-21-2020, 07:44 AM   #13
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,566

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Quote:
The root of this partition also contains a file called startup.nsh with the text
The above quote is from post 10 and from what I have read doing an online search, it means you have installed Lineage in Legacy mode although I'm not sure that is correct. Android is EFI. If you can't do basic Linux boot commands such as grub-mkconfig, you can manually edit the text file with the menuentries for Lineage and/or Android. When booted into Lineage, look for a /boot/grub/grub.cfg file. Does that exist? If so, manually create an entry for Android. You indicated earlier that you could see all the Anroid files on a partition. If so, go to /boot/grub and file the grub.cfg (or android.cfg?) file and copy one of the menuentries from that file to the grub.cf (or android.cfg) file on the Lineage partition. If you can't get root in Lineage, you can't do it.

It would be useful if you could post the contents of the file you referred to above, the EFI/Android/android.cfg file. Does this file have menuentry lines referencing Lineage? If so, simply use the entries as a template to manually create an entry for ANdroid. Of course, again here you need root privileges in all likelihood to modify this and if you can't do it, it won't work. Or does it simply point to another partition?

No worries about running grub-mkconfig from a live Puppy, it won't damage anything and in fact, won't do anything. If you run the command from Puppy it won't "do" anything because it is a 'live' system and by definition is read-only. You could use Puppy to chroot from the live Puppy to your Lineage/Android but that can get a bit complicated for someone unfamiliar with it. If you want to try it, there are numerous threads here at LQ discussing it and many thousands of sites online.

A major part of the problem is that you are unable to post details which would be required to resolve the problem because your Android/Lineage are pseudo-Linux systems which don't have minimal software required to get that info. If you know which partition you have android installed to you could reinstall Android to that partition and again install Grub. Of course, you then may be unable to boot Lineage, who knows? Good luck.
 
Old 02-21-2020, 12:46 PM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,566

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Post deleted.
 
Old 02-22-2020, 08:26 PM   #15
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
If you know which partition you have android installed to you could reinstall Android to that partition and again install Grub. Of course, you then may be unable to boot Lineage, who knows? Good luck.
Hi
Yes I know which partition I have androidx86 and lineage OS installed in. This is what I meant by 'I can see all the android files' in one my earlier posts. However, the partition with all the android-x86 OS files (data.img, initrd.img, kernel, ramdisk.img, system.img) does not seem to contain anything related to boot (nothing that makes references to grub, efi or anything like that)

All booting related files are in sda2 (which is the EFI partition of my internal hdd [the internal hdd contains Windows 10, I am trying out the android OS's in an external hdd]). I am assuming that I should have a corresponding folder for /EFI/Android (which currently boots Lineage) for android-x86 for this to work. For EFI/Android/android.cfg I can see that it needs EFI/Android/grub64.efi which I suppose is the thing that actually loads Lineage OS from the external hdd. I am assuming I need a corresponding grub64.efi for the Android-x86. I am guessing that both Android-x86 and LineageOS installers make the same EFI/Android folder (Android-x86 and LineageOS are derived from the same source, they are like different versions of the same OS), so probably LineageOS, that I installed after Android-x86, completely overwrote the EFI/Android folder, so since I don't have the grub64.efi for the Android-x86 now, so I'm guessing there's really no easy way to boot Android-x86 by just adding entries to grub configuration files.

It turns out the live Puppy linux does not have the grub-mkconfig command either (I have an old version, Puppy Slacko 5.6, I don't know if it exits in a newer one) so I couldn't find out what that command does.

Puppy Linux has a tool called Grub4Dos which will install a file to show grub menu on the MBR of a disk disk, and ifthe Live I boot through that hard disk it shows me a list, which I can edit to add various OS's that I may have in my partition. A long time ago I had used this to choose between booting Live puppy from the SDCard or booting my HDD's Windows (I don't whether it was Windows XP or Windows 7). I don't remember all the details of how to configure a menu entry for Grub4Dos, but I remember it wasn't easy and involved lots of internet searches and asking in the Puppy forums. Is it possible to use Grub4Dos tool to get a general OS select menu on my external HDD, then add entries to this menu manually as I as more OS's in other partitions of my external HDD? Or is this tool too old to work with EFI based OS's? If it is, is there a modern alternative for it?

The contents of the current grub cfg files are below, if you'd like to see them. sda2 is the EFI partition on my internal HDD.

sda2/boot/grub/x86_64-efi/grub.cfg:

Quote:
set timeout=5
set debug_mode="(DEBUG mode)"
set kdir=/efi/Android
set src=SRC=/cm-x86-14.1-r3

source $cmdpath/android.cfg
sda2/EFI/Android/android.cfg:
Quote:
# $1 Kernel dir
# $2 Title
# $3... Kernel cmdline
function add_boot_entry {
menuentry "$2" "$@" --class android-x86 {
savedefault
set root=$android
if [ ! -e $2/kernel ]; then
search --no-floppy --set root -f $2/kernel
fi
set kd=$2
shift 3
linux $kd/kernel root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug $src $@
initrd $kd/initrd.img
}
}

# $1 Title
# $2... Kernel cmdline
function add_entry {
set title="LineageOS 14.1-r3 $1"
shift 1
add_boot_entry "$kdir" "$title" "$@"
}

# $1 EFI to chainload
# $2 OS name
# $3 Class
function add_os_if_exists {
# Is there a better way to find ESP?
for d in hd0,gpt1 hd0,gpt2 hd1,gpt1 hd1,gpt2 hd0,msdos1 hd0,msdos2 hd1,msdos1 hd1,msdos2; do
if [ "($d)$1" != "$cmdpath/$bootefi" -a -e ($d)$1 ]; then
menuentry "$2 at $d ->" "$d" "$1" --class "$3" {
savedefault
set root=$2
chainloader ($root)$3
}
break
fi
done
}

function savedefault {
if [ -s $prefix/grubenv -a "$chosen" != "$default" ]; then
set default="$chosen"
save_env default
fi
}

if [ -s $prefix/grubenv ]; then
load_env
fi

if [ "$grub_cpu" = "i386" ]; then
set bootefi=bootia32.efi
set grub=grubia32
else
set bootefi=BOOTx64.EFI
set grub=grubx64
fi

if [ -z "$src" -a -n "$isofile" ]; then
set src=iso-scan/filename=$isofile
fi

search --no-floppy --set android -f $kdir/kernel
export android bootefi grub kdir live src

# Create main menu
add_entry "$live" quiet
add_entry "$debug_mode" DEBUG=2
if [ -s ($android)$kdir/install.img ]; then
add_entry "Installation" INSTALL=1
fi

submenu "Advanced options -> " {
add_entry "$live - No Setup Wizard" quiet SETUPWIZARD=0
add_entry "$live - No Hardware Acceleration" quiet nomodeset HWACCEL=0
if [ -s ($android)$kdir/install.img ]; then
add_entry "Auto Install to specified harddisk" AUTO_INSTALL=0
add_entry "Auto Update" AUTO_INSTALL=update
fi
add_os_if_exists /EFI/BOOT/$bootefi "UEFI OS"
add_os_if_exists /EFI/BOOT/fallback.efi "UEFI Fallback"
if [ "$grub_cpu" != "i386" ]; then
add_os_if_exists /EFI/BOOT/fallback_x64.efi "UEFI Fallback"
menuentry "Reboot" { reboot }
menuentry "Poweroff" { halt }
menuentry "UEFI BIOS Setup" { fwsetup }
fi
}

# Add other OSes boot loaders if exist
add_os_if_exists /EFI/fedora/${grub}.efi Fedora fedora
add_os_if_exists /EFI/centos/${grub}.efi CentOS centos
add_os_if_exists /EFI/ubuntu/${grub}.efi Ubuntu ubuntu
add_os_if_exists /EFI/debian/${grub}.efi Debian debian
add_os_if_exists /EFI/linuxmint/${grub}.efi "Linux Mint" linuxmint
add_os_if_exists /EFI/Microsoft/Boot/bootmgfw.efi Windows windows

for d in $cmdpath $prefix; do
if [ -f $d/custom.cfg ]; then
source $d/custom.cfg
fi
done

Last edited by mahaju; 02-22-2020 at 08:36 PM.
 
  


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
Is there syncing software like jpilot, but for LineageOS phones (Android phones)? mark_alfred Linux - Software 20 05-05-2019 12:55 PM
LXer: You Can Now Install LineageOS on Your Raspberry Pi 3, Based on Android 8.1 Oreo LXer Syndicated Linux News 0 03-03-2018 10:33 PM
[SOLVED] How to install a universal grub2 to a usb having android x86 lineageos ? irajeevankumar Linux - Newbie 6 02-06-2018 07:13 AM
LXer: How to Replace CyanogenMod with LineageOS on Your Android Device LXer Syndicated Linux News 0 03-23-2017 07:45 AM
Dual boot XP(internal IDE HDD) Debian(external USB-IDE HDD) using boot.ini PolarDog Linux - Laptop and Netbook 2 07-01-2005 09:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:36 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