LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-22-2021, 12:36 PM   #1
pedropt
Member
 
Registered: Aug 2014
Distribution: Devuan
Posts: 345

Rep: Reputation: Disabled
Export grub entry from treusted grub android to grub pc


Hi everyone i am having an issue trying to add my android hdd boot to grub-pc config file where i have my linux and windows .
Sadly osprober does not catch android installation on other disk , if i want to launch android from that disk i have to boot computer from that hdd other wise it will not work .

The current config on trusted grub menu in android hdd is :
Quote:
default=0
timeout=6
splashimage=/grub/android-x86.xpm.gz
root (hd0,0)

title Android-x86 7.1-r5
kernel /android-7.1-r5/kernel quiet root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug SRC=/android-7.1-r5
initrd /android-7.1-r5/initrd.img

title Android-x86 7.1-r5 (Debug mode)
kernel /android-7.1-r5/kernel root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug DEBUG=2 SRC=/android-7.1-r5
initrd /android-7.1-r5/initrd.img

title Android-x86 7.1-r5 (Debug nomodeset)
kernel /android-7.1-r5/kernel nomodeset root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug DEBUG=2 SRC=/android-7.1-r5
initrd /android-7.1-r5/initrd.img

title Android-x86 7.1-r5 (Debug video=LVDS-1:d)
kernel /android-7.1-r5/kernel video=LVDS-1:d root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug DEBUG=2 SRC=/android-7.1-r5
initrd /android-7.1-r5/initrd.img
however

in my grub-pc i have :

Quote:
.... more entries above

menuentry 'Kali GNU/Linux, with Linux 5.6.0-kali1-amd64 (recovery mode)' --class kali --class gnu-linux --class gnu >
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd4,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd4,msdos5 --hint-efi=hd4,msdos5 --hint-baremetal=ahci>
else
search --no-floppy --fs-uuid --set=root 31365657-7bbe-4808-98aa-2ee71f8d377b
fi
echo 'Loading Linux 5.6.0-kali1-amd64 ...'
linux /boot/vmlinuz-5.6.0-kali1-amd64 root=UUID=31365657-7bbe-4808-98aa-2ee71f8d377b ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.6.0-kali1-amd64
}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-0CAB802F0A7DDDAC' {
insmod part_msdos
insmod ntfs
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1>
else
search --no-floppy --fs-uuid --set=root 0CAB802F0A7DDDAC
fi
parttool ${root} hidden-
chainloader +1
}

My question is , how to i export the startup line from trusted grub to grub-pc and make it boot to android , copy and paste does not work , i have tried grub customizer without sucess .

Any idea ?
Thanks
 
Old 11-22-2021, 12:45 PM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,678

Rep: Reputation: Disabled
Of course, copy and paste doesn't work. The grub menu on Android HDD is in GRUB Legacy format, while your grub-pc is GRUB 2. See grub-menulst2cfg.

Last edited by shruggy; 11-22-2021 at 12:50 PM.
 
Old 11-22-2021, 01:11 PM   #3
pedropt
Member
 
Registered: Aug 2014
Distribution: Devuan
Posts: 345

Original Poster
Rep: Reputation: Disabled
thanks for the tip however i am stuck because there are many unsupported and needed lines to run the android .
Quote:
set root='(hd0,1)'; set legacy_hdbias='0'

menuentry 'Android-x86 7.1-r5' {
# Unsupported legacy command: kernel /android-7.1-r5/kernel quiet root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug SRC=/android-7.1-r5

# Unsupported legacy command: initrd /android-7.1-r5/initrd.img


}

menuentry 'Android-x86 7.1-r5 (Debug mode)' {
# Unsupported legacy command: kernel /android-7.1-r5/kernel root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug DEBUG=2 SRC=/android-7.1-r5

# Unsupported legacy command: initrd /android-7.1-r5/initrd.img


}

menuentry 'Android-x86 7.1-r5 (Debug nomodeset)' {
# Unsupported legacy command: kernel /android-7.1-r5/kernel nomodeset root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug DEBUG=2 SRC=/android-7.1-r5

# Unsupported legacy command: initrd /android-7.1-r5/initrd.img


}

menuentry 'Android-x86 7.1-r5 (Debug video=LVDS-1:d)' {
# Unsupported legacy command: kernel /android-7.1-r5/kernel video=LVDS-1:d root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug DEBUG=2 SRC=/android-7.1-r5

# Unsupported legacy command: initrd /android-7.1-r5/initrd.img


}
However even if i install grub-legacy and remove grub-pc , pasting the lines also does not work .

The grub on android hdd is the trusted grub 1.1.5
https://sourceforge.net/projects/tru...tedGRUB-1.1.5/

I tried to install it here and was unable because i got error "gcc unable to compile executables" despite that i tried multiples versions of gcc and always got the same error .

Last edited by pedropt; 11-22-2021 at 01:15 PM.
 
Old 11-22-2021, 02:18 PM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,396

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
It will be along the lines of this:

Code:
menuentry 'Android-x86 7.1-r5'{
set root=(hd1,1)
linux /android-7.1-r5/kernel quiet root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug SRC=/android-7.1-r5
initrd /android-7.1-r5/initrd.img
}
added to /etc/grub.d/40_custom and rerun update-grub.
may have to change hd1 in the 'set root=" line to something else if the android disk isn't the second drive. grub2 counts drives from 0 and partitions from 1.

The other option is dhainloading
Code:
menuentry 'Android-x86 7.1-r5'{
set root=(hd1)
chainloader +1
}

Last edited by colorpurple21859; 11-22-2021 at 02:25 PM.
 
1 members found this post helpful.
Old 11-22-2021, 03:04 PM   #5
pedropt
Member
 
Registered: Aug 2014
Distribution: Devuan
Posts: 345

Original Poster
Rep: Reputation: Disabled
Thank you colorpurple21859 , i got it working .
in my case the hdd was sda and 1st partition , so the output for /etc/grub.d/40_custom was :

Quote:
menuentry "Android X86 7.1 r5"{
set root='(hd0,1)'
linux /android-7.1-r5/kernel quiet root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug SRC=/android-7.1-r5
initrd /android-7.1-r5/initrd.img
}
Thanks a lot for the help , alone i would never get it working .
 
Old 11-22-2021, 03:14 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,396

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
glad to help
 
  


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
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
[SOLVED] fstab or export options needed to write to an nfs mounted ntfs export chief427 Linux - General 2 07-21-2011 07:07 AM
why should we export COMPTOP and what does !export do ? shaiva Linux - Newbie 5 11-03-2009 03:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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