Hi,
My first post into this forum
So, I have installed Plasma active on my Archos 80 G9 with 250G Hard disk using this guide :
h tt p:/ /share.basyskom.com/plasma-active/archos_gen9.h t m l
Then, I installed it on my 1.6 G data partition, but it wasn't working well .. so I checked the disk space remaining in it and it was near zero.
My question now,
at the bottom of the plasma active installation guide you can see "Setup a Android™ and Plasma Active dual Boot System" , where the plasma active files can be put on the SD card and this was possible by just changing the zimage file
1- is there any sde zimage and initramfs.cpio.lzo that can boot from the hard disk ? ( Dynamic multiboot menu says it can but it doesn't at all )
2- Is there any guide on how to create/edit zimage file ?
Thanks ..
regards,
Mostafa
shalkam said:
Hi,
My first post into this forum
So, I have installed Plasma active on my Archos 80 G9 with 250G Hard disk using this guide :
h tt p:/ /share.basyskom.com/plasma-active/archos_gen9.h t m l
Then, I installed it on my 1.6 G data partition, but it wasn't working well .. so I checked the disk space remaining in it and it was near zero.
My question now,
at the bottom of the plasma active installation guide you can see "Setup a Android™ and Plasma Active dual Boot System" , where the plasma active files can be put on the SD card and this was possible by just changing the zimage file
1- is there any sde zimage and initramfs.cpio.lzo that can boot from the hard disk ? ( Dynamic multiboot menu says it can but it doesn't at all )
2- Is there any guide on how to create/edit zimage file ?
Thanks ..
regards,
Mostafa
Click to expand...
Click to collapse
Hi There
You'll find a rough guide to unpacking and repacking here here
Hope that helps!
trevd said:
Hi There
You'll find a rough guide to unpacking and repacking here here
Hope that helps!
Click to expand...
Click to collapse
Thanks for your post!! Finally I have been able to make some progress after googling around for a couple of weeks
I went through the guide you posted and it turned out to be very helpful ..
I ended up with the file -> new_initrd.lzo
and I have been able to edit the init file
Code:
#!/bin/sh
# kr's init script.
if [ -e /etc/debug_build ] ; then
debug=1
verbose=1
enable_adb=1
#set -x
else
debug=0
verbose=0
enable_adb=0
fi
# source init_lib
. /etc/scripts/init_lib.sh
# source recovery_lib
. /etc/scripts/recovery_lib.sh
if [ -e /etc/scripts/platform_lib.sh ] ; then
. /etc/scripts/platform_lib.sh
fi
# archosboxes
ACAT=/bin/acat
ADBD=/bin/adbd
ADEV=/bin/adev
AOSPARSER=/bin/aosparser
AUI=/bin/aui
AUID=/bin/auid
AUTODIM=/bin/autodim
CREATE_SYSID=/bin/create_sysid
FB_WRITE=/bin/fb_write
FLASH_PARTITION_ERASE=/bin/flash_partition_erase
FSCK_EXT3_PARSER=/bin/fsck.ext3_parser
GET_INFO=/bin/get_info
KD_FLASHER=/bin/kd_flasher
KX_CHECKER=/bin/kx_checker
MKFSEXT3_PARSER=/bin/mkfs.ext3_parser
REBOOT_INTO=/bin/reboot_into
RFBI_REFRESH=/bin/rfbi_refresh
USB_TS_CALIB=/bin/usb_ts_calib
FSCK_EXT3=/sbin/e2fsck.static
FSCK_VFAT=/sbin/dosfsck.static
# busybox
CAT=/bin/cat
CHMOD=/bin/chmod
DD=/bin/dd
INSMOD=/sbin/insmod
LOSETUP=/sbin/losetup
MKDIR=/bin/mkdir
MOUNT=/bin/mount
RM=/bin/rm
RMMOD=/sbin/rmmod
TOUCH=/bin/touch
UMOUNT=/bin/umount
ZCAT=/bin/zcat
AAS_PRESENT=0
# Prepare filesystem
mount_pseudo_fs
ln -s /proc/mounts /etc/mtab
# Get board and product information
PRODUCT_NAME=`$GET_INFO p`
PRODUCT_REVISION=`$GET_INFO r`
PRODUCT_PK=`$GET_INFO P`
AOS_FILENAME=`$GET_INFO f`
AOS_EXTENSION="aos"
log "recovery get_info - PRODUCT $PRODUCT_NAME ($PRODUCT_REVISION) - AOSFILENAME $AOS_FILENAME"
$ADEV -d
platform_init
wait_block_devices rawfs
mount_p rawfs
display_banner $PRODUCT_NAME $PRODUCT_REVISION
$KX_CHECKER -f /mnt/rawfs/init
ki_status=$?
$KX_CHECKER -m -f /mnt/rawfs/custom
kd_status=$?
umount_p rawfs
auid_start $PRODUCT_NAME $PRODUCT_REVISION
$AUI -c message -T "Archos $PRODUCT_NAME" -a centered -t "~ Hello world ~"
wait_block_devices storage
if [ "$ki_status" = "0" ] && [ "$kd_status" = "0" ] ; then
recovery_cmd="boot_menu"
else
recovery_cmd="-"
fi
if [ $enable_adb -eq 1 ] ; then
$ADBD
fi
# enter recovery app main loop :
# check for automatic tasks and process, or ask user what to do
#
# if manual or auto task fail, recovery_loop will try to repair
# (for $COUNTER times) and reloop...
#
COUNTER=4
while [ $COUNTER -gt 0 ]; do
# check for automatic update to perform.
# repair disk silently if AAS present. (double update case)
mount_p storage
aas_fullfilename=`get_mount_info p storage`"/firmware_$AOS_FILENAME.aas"
if [ -e $aas_fullfilename ] ; then
recovery_cmd="flash_aas $aas_fullfilename"
fi
umount_p storage
do_recovery_loop $recovery_cmd
result=$?
case "$result" in
$RECOVERY_RECOVERED)
log "recovery recovered system ($COUNTER)"
;;
$RECOVERY_DONE)
COUNTER=4
;;
$RECOVERY_FINISH)
log "recovery_loop go reboot"
COUNTER=0
;;
$RECOVERY_FINISH_HALT)
log "recovery_loop go shutdown"
COUNTER=0
;;
$RECOVERY_FINISH_NO_NOTIFICATION)
log "recovery_loop go reboot"
COUNTER=0
;;
*)
log "recovery_loop failed go reboot"
if [ $debug -eq 1 ] ; then
# give debug informations
COUNTER=0
else
COUNTER=0
fi
;;
esac
recovery_cmd="-"
let COUNTER-=1
done
case "$result" in
"$RECOVERY_FINISH_NO_NOTIFICATION")
log_and_reboot "reboot"
;;
"$RECOVERY_FINISH_HALT")
aui_message "Device will now halt."
log_and_shutdown "shutdown"
;;
*)
aui_message "Device will now reboot."
log_and_reboot "reboot"
;;
esac
# EOF
all the changes that I made are
Code:
$AUI -c message -T "Archos $PRODUCT_NAME" -a centered -t "~ Hello world ~"
just added "hello world" instead of "starting..." just for now.
So what I need to know is :
1- how to use the "new_initrd.lzo" file should I get renamed to "initramfs.cpio.lzo" and create an empty file called zimage then do the "Flash Kernel and Initramfs"
2- I guess the guide was made before sde was released for archos g9, so do I need to keep all the coding for the recovery menu or just keep the code for mounting the hard disk and loading the system/image ?
3- could you post an example code of how to mount the hard disk and boot from there if you can ?
Thanks
I renamed the files and it worked just fine, So everything is clear for me now.
and if you have any examples of the "init" file coding, the would be the happy ending for me
shalkam said:
Thanks for your post!! Finally I have been able to make some progress after googling around for a couple of weeks
I went through the guide you posted and it turned out to be very helpful ..
I ended up with the file -> new_initrd.lzo and I have been able to edit the init file
...
So what I need to know is :
1- how to use the "new_initrd.lzo" file should I get renamed to "initramfs.cpio.lzo" and create an empty file called zimage then do the "Flash Kernel and Initramfs"
2- I guess the guide was made before sde was released for archos g9, so do I need to keep all the coding for the recovery menu or just keep the code for mounting the hard disk and loading the system/image ?
3- could you post an example code of how to mount the hard disk and boot from there if you can ?
Click to expand...
Click to collapse
Hi
1. To use the initramfs you need a kernel Image as well, look at posts in the development section, there's quite a few kernel variants, ( overclocked etc ), you're best off sticking with the 3.0.8 kernel, folks have experienced some problems with archos' latest release.
You then need to hold volume down while powering on to get into the maintenance mode, from there it's "recovery menu"/"developer edition menu"/"flash kernel and initramfs" this will mount a device on you PC which you copy the initramfs.cpio.lzo and zImage.
2. "We" pretty much had an unofficial sde from day one thanks to some reverse engineering and I can only assume knowledge gained from the previous generation of archos tablets. you don't really need to keep the recovery code but it's probably easier to leave it. It might be worth your while repacking a MultiBoot initramfs.cpio to suit your needs It should be just a case of getting it to look on your hard drive for images instead of/as well as the Internal SD.
3. the mount_p calls take care of mounting partitions, It's a function defined in one of the scripts in the etc/scripts directory in your initramfs, The file you're probably after editing however is etc/mountpoints.
Like I say have a good look around the development section, especially at some of the earlier posts, there's only four pages but some good knowledge and useful info to be had!
trevd said:
It might be worth your while repacking a MultiBoot initramfs.cpio to suit your needs It should be just a case of getting it to look on your hard drive for images instead of/as well as the Internal SD.
Click to expand...
Click to collapse
I repaced the MultiBoot initramfs.cpio and did the following :-
before
Code:
#Build boot menu string
MENULIST="\`$AUI -C \"0x000000,0xdbdac9\" -c select -T \"Archos $PRODUCT_NAME - Multi Boot Menu $BOOTVER\" -a centered -C \"0x000000,0xf1f0dd\" -t \"Please select an image :\" "
IMGLOC1="/data/media/"
IMGLOC2="/data/local/"
after :
Code:
mount_p storage_A80H
#Build boot menu string
MENULIST="\`$AUI -C \"0x000000,0xdbdac9\" -c select -T \"Archos $PRODUCT_NAME - Multi Boot Menu $BOOTVER\" -a centered -C \"0x000000,0xf1f0dd\" -t \"Please select an image :\" "
IMGLOC1="/data/media/"
IMGLOC2="/mnt/storage/
and it worked loaded all the .ext4 files in /mnt/storage/ .
the file for icsblue worked but the file for ubuntu from this topic ->http://forum.xda-developers.com/showthread.php?t=1392167
didn't work
anyway you can find a shell script for unpacking-editing-packing attached to make things easier if anyone wants to edit these files instead of the "rough guide to unpacking and repacking"
Well the script should be working, it is 'ettin.sh' now. To get VNC to work on separate device just change 'eth0' to 'wlan0' or whatever other interface you know how to configure, like usb maybe, in the 'init.sh' script that resides in ~/ on the images you can download from http://linuxonandroid.org/downloads/. Cool. If anyone can help with the usb configuring that would be cool.
Also on the different roms your storage might be different so just change that to what suites your environment,
BAD NEWS, After my first launch and exiting the VNC on my laptop (Ubuntu) My phones home button and a few other functions stopped working, a reboot remounts the root and system partitions and it goes back to normal essentially, I haven't noticed any adverse affects after the reboot.
Good luck.
EDIT: If you can't help me, you probably shouldn't attempt any of this.
I want to connect to backtrack over usb from Ubuntu on my laptop instead of from my phone. Is there a good way of doing this?
The thing is, I didn't chroot, I mounted the image, copied the contents of '/etc/*' and '/sbin/*' to the '*/etc' '*/sbin' dirs of the mounted image. and then mounted it's (the image's) contents to Androids rootfs '/' then I set up a little script to set up the environment and execute '/bin/bash -i init.sh' and again reset PATH to include /system/*.
Then in the init.sh script I want to set up a way to 'vnc' through' usb to backt4acks desktop. How would I do this?
EDIT: I started this script blelow, its not complete, feel free to use it however you like.
If anyone is good with bash I need help with loops in Bash or shell, ksh, or ash. So if you change it at all share those changes here. I haven't tested any of the loops, I wrote this here and need to do some reading on shell scripting, peace out.
Just NOTE that I would not execute this script yet, it is NOT YET COMPLETE.
I will be making minor changes as I learn and test things out, Also this was inspired by the autobootscrip (sp?) that the Linux on Android Installer app uses.
mintberrycrunch revision
I need a little help with the mounting part, "is there anybody out there?"
EDIT: Maybe escape '\' characters...
Maybe this will work? 'if [ ! -d "/$d" -a "$d" \!= "dev" -o "$d \!= "mnt" ]; then ' I want it to test whether the directory does not already exists in / and if it is not named dev or named mnt then mount it. Do you think this is a decent way to do it? Any suggestions?
Sorry, I still haven't tested this script yet, so if you brave and see any changes that will make it work I am not resposible. But it is getting close to when I will run it for the first time. The difference between this and the one I wrote for Kali is this should be a one stop shop so to speak for getting into a non chroot enviroment where you can access Bt's tools from Android directly. Apperently about a year ago someone was trying something similar called "debian installer" or something, I haven't tried it out so maybe that actually works, idk, I am happy with this.
LOL
LMFAO!
I just realized I don't think I needed to worry about testing if the variable $d was named 'dev' or 'mnt' because they should get skipped by already being mounted. If not I guess if it works as is, may be extra precaution.
Done! Almost ;{)-
Uhmm.... hope you can see the screenshot...
its over wifi though, I had to edit the init.sh script just eth0 to wlan0 in 2 lines, duh! where is eth0 on phone?
Check out the filesystem
Bada bing, bada doom, dare ya goes`a for ya.
V-0.021
This should support args, if your using different image or location such as external sdcard or want to mount to a different location
Notes: 'ettin.sh' [/IMAGE/LOCATION] [IMAGENAME] [MOUNT/POINT]'
1) Don't add a trailing forward slash for image location, the first argument. Doing so may conflict with the script.
2) Don't add suffix to image name ( second argument), the script uses a wild card period wild card syntax to account for .iso, .raw, or .img aswell as version numbers, so if its backtrack-v-r5.img all you need is 'backtrack'.
3) Default mount is "/data/local/mnt"
for example:
Code:
ettin.sh /storage/extSdCard/ubuntufolder ubuntu /mnt/myLinux
That ^^^ will use a ubuntu image on the external sdcard and mount it to a folder called "myLinux" within the "/mnt" directory.
The script below...
Code:
#!/system/bin/sh
# ettin.sh v-0.021, "Two heads are better than one."
# Written by 'Edge-Case' @ 'forum.xda-developers.com'
# This version is attempting to use symbolic linking to correct some issues.
## The purpose of ettin.sh is to merge a Linux system with Android
## hopefully allowing both systems to run in synch with each other.
## It is probably best to be ran on devices with multi-core processors.
##"""Notes on Backtrack and Kali Linux Distributions:
##"""1) Postgresql needs to be configured in order for metasploit to connect to
##""" the database. This might be possible within the script. Perhaps
##""" it is simply a matter of configuring SSH? I don't know.
##"""2) The Kernel needs to be patched to allow for packet injection and
##""" monitor mode for an external 'wi-fi' card as the factory hardware
##""" does not support monitor mode, at least on Samsung Galaxy SIII.
#########
# Prep ##
#########
mount -wo remount systemfs /system
mount -wo remount rootfs /
imloc=${1:-"/storage/sdcard0/backtrack"}
imname=${2:-"backtrack"}
subset=${3:-"/data/local/mnt"}
#Check for root!
if [ ! -d "$subset" ]; then mkdir "$subset"; fi
busybox mount -wo loop ${imloc}*/${imname}*.* ${subset}
check_mnt="`echo $?`"
if [ ${check_mnt} != 0 ]; then echo "Something is wrong with mounting, check the situation!" && exit; fi
##################################################
# Copy contents of special directories to image ##
##################################################
if [ ! -f "${imloc}/success.txt" ] ; then cp -ai /sbin/* ${subset}/sbin && echo "Files have been copied on `date`." > ${imloc}/success.txt; fi
if [ -e "/root/*" ]; then cp ai /root/* ${subset}/root; fi
######################################################
# Make directories needed and mount the file-system ##
######################################################
cd ${subset}
for d in `ls` ; do if [ ! -d "/${d}" ] ; then mkdir /${d} && busybox mount --rbind ${subset}/${d} /${d} ; fi ; done
busybox mount --rbind ${subset}/root /root
busybox mount --rbind ${subset}/sbin /sbin
busybox cp -rspi ${subset}/etc/* /etc # We'll try making symbolic links from the image to Android's /etc instead.
# Add any directories as needed.
###############################
# be safe before we continue ##
###############################
mount -ro remount systemfs /system
mount -ro remount rootfs /
######################################
# continue building the environment ##
######################################
export PATH="/system/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/system/xbin:/usr/games"
export TERM=linux
export HOME="/root"
#################################
# further down the rabbit hole ##
#################################
/bin/bash -i ~/init.sh
Pretty happy with it now, so far. Touch FIXED
Well, I am tethered from my phone to my laptop, running ubuntu, this is how I am on the internet, so my phone is doing that...
I ran 'ettin.sh /storage/sdcard0/ubuntu ubuntu' using V-0.022 and only had two files that needed overwriting.
The touch is working....check
adb is working...check
Everything is mounted ...check
Apps like browser and dsploit are working on the phone as usual...check
'apt-get update && apt-get upgrade'....check (over adb, no chroot, as [email protected] using bin/bash)
'which nmap' .....check ("
[email protected]:~# which nmap
/usr/bin/nmap
")
Well **** ya'll looks like this might work... I am now going to consider modifying a stock rom to support users and login that meshes with debian and its "shadow" file etc etc, also I need to work out permissions and enviroment variables...
I'm happy...
Also for pentesting distro's "modifying Android kernel" tutorials would be nice, anybody able to point me to one?
The trick is to install Chrome OS first, shrink the Chrome OS main partition, and install Linux and Remix in their own partitions.
Download Chrome OS from here and install it as directed. It will destroy everything else on the disk, and make a large partition for data storage, and another 11 partitions for whoknows what.
Boot Linux with a live USB stick or CD. Shrink the first, large partition using parted. I started out with a 450GB partition that I shrunk to 180. Make 5 new partitions using fdisk or whatever you like for partitioning. I made a 250 MB partition for Linux boot, a 120GB partition for Linux /, a 120GB partition for Linux /home, an 8GB partition for Linux swap, and a 30GB partition for Remix. Use your own judgment.
Install Linux in the Linux partitions. I use Gentoo, but you can use whatever you like.
Boot up linux.
Install Remix OS in the last partition:
Download the zip file from this thread. Unzip the file; it contains an installer for Windoze(<somethingorother>.exe), and an .iso file. Make a temporary directory
Code:
mkdir /mnt/tmp
and mount the iso in it:
Code:
mount -o loop <name_of_iso>.iso /mnt/tmp
Format the Remix partition, mount it, and copy the files in the iso to the Remix partition (in my case it is /dev/sda17):
Code:
mkfs.ext4 /dev/sda17
mkdir /mnt/remix
mount -t auto /dev/sda17 /mnt/remix
cd /mnt/tmp
find . -xdev -depth -print | cpio -puvdm /mnt/remix
Make a grub menu entry for Remix OS in /etc/grub.d/40_custom:
Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "REMIXOS Resident Mode" --class android-x86 {
insmod part_gpt
search --file --no-floppy --set=root /system.img
set root=(hd0,17)
linux /kernel initrd=/initrd.img quiet root=/dev/ram0 androidboot.hardware=remix_x86
androidboot.selinux=permissive quiet SRC= DATA=/ CREATE_DATA_IMG=0
## VGA=791
video=uvesa DPI=96 UVESA_MODE=1280x800
initrd /initrd.img
}
You may need a different VGA= or MODE= depending on your monitor.
Make a data directory. For some reason it doesn't get created automatically:
Code:
mkdir /mnt/remix/data
Assuming grub is installed, make the grub menu and finish up.
Code:
mount /boot
grub2-mkconfig -o /boot/grub/grub.cfg
umount /boot
umount /mnt/tmp
umount /mnt/remix
rmdir /mnt/remix
When you reboot, you will see two entries for Chrome OS, generally listed as "Unknown Linux Distribution". Either one will work to boot Chrome.
Follow the directions in the Remix thread listed above on how to enable the Google Play store on Remix.
Took me a lot of trial and error. Hopefully it will be easier for you.
what do you mean it destroy everything on disk
deepakhope said:
what do you mean it destroy everything on disk
Click to expand...
Click to collapse
If you run the installer that comes with it, it will wipe out anything that was on the disk before. There's no way to install it and leave what was there before untouched. That's why you need to install Chrome OS first.
pixbuf said:
If you run the installer that comes with it, it will wipe out anything that was on the disk before. There's no way to install it and leave what was there before untouched. That's why you need to install Chrome OS first.
Click to expand...
Click to collapse
That's what held me off trying ChromeOS; can you at least select to install to an external drive with it?
Just a couple points from OP;
1. You probably should be saying CloudReady (open-source version of ChromiumOS) rather than saying ChromeOS; as that is a hardware-specific closed source OS.
2. There's a bit of redundancy in your grub:
Code:
menuentry "REMIXOS Resident Mode" --class android-x86 {
insmod part_gpt
[color=red][b]search --file --no-floppy --set=root /system.img
set root=(hd0,17)[/b][/color]
linux /kernel initrd=/initrd.img quiet root=/dev/ram0 androidboot.hardware=remix_x86
androidboot.selinux=permissive quiet SRC= DATA=/ CREATE_DATA_IMG=0
}
Those two lines are doing the same thing - removing the first one might result in a faster boot (probably non-noticable); removing the second should make the whole entry partition no. independent.
How could I add windows 10 to the mix here?
Institute chromium, followed by Linux and then windows and finally restore grub?
My first attemp trying to compile and build AOSP (and any android source). In the middle of the process, it seems that it just stopped however my four CPUs still at 100% usage for the process. Also there is a "Failed" message some minutes before the part of where it is stuck so maybe it must be because of that.
[ 88% 31300/35388] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack
FAILED: out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack
/bin/bash -c "(rm -f out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack ) && (rm -rf out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc ) && (mkdir -p out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/ ) && (mkdir -p out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc ) && (rm -f out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) && (touch out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) && (if [ -d "out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/src" ]; then find out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/src -name '*.java' >> out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list; fi ) && (tr ' ' '\\n' < out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list | build/tools/normalize_path.py | sort -u > out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq ) && (if [ -s out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq ] ; then export tmpEcjArg="@out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq"; else export tmpEcjArg=""; fi; JACK_VERSION=4.31.CANDIDATE out/host/linux-x86/bin/jack @build/core/jack-default.args -g -D jack.java.source.version=1.7 --classpath out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/classes.jack -D jack.import.resource.policy=keep-first -D jack.import.type.policy=keep-first -D jack.android.min-api-level=21 --output-jack out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack \$tmpEcjArg || ( rm -f out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack ; exit 41 ) ) && (rm -f out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) && (mv out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc.java-source-list )"
Connection to the Jack server timeout, retrying with debug
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8076 (#0)
* found 1 certificates in /home/fabio/.jack-server/server.pem
* found 704 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* Operation timed out after 0 milliseconds with 0 out of 0 bytes received
* Closing connection 0
[ 88% 31302/35388] target Strip (mini debug info): healthd (out/target/product/generic/obj/EXECUTABLES/healthd_intermediates/healthd)
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-nm: out/target/product/generic/symbols/sbin/healthd: no symbols
[ 88% 31304/35388] target Strip (mini debug info): init (out/target/product/generic/obj/EXECUTABLES/init_intermediates/init)
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-nm: out/target/product/generic/symbols/init: no symbols
[ 88% 31306/35388] target Java: telephony-common (out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes)
Click to expand...
Click to collapse
There is more than 1 hour that it is at this [ 88% 31306/35388] target Java: telephony-common part. I don't know if it is still building or not. What should I do? Wait? Kill the process and restart? does this FAILED message that showed up some minutes before has to do with it or is just a warning? Thanks
When it happens to me it's because jack-server ran out of memory and stopped. You can google the interwebs like I did but I'll put it all here..
Edit your .bashrc (sudo nano ~/.bashrc) and add this to the end:
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx6g"
While the interwebs said 4g is fine, I found it wasn't fine when building 8.1 AOSP, so I gave it 6g and never had a problem.
Save and exit. You can reboot to make it effective or tell Jack to stop and start again:
jack-admin kill-server
jack-admin start-server
..and then try again. My build machine is an Ubuntu 18.04 LTS Hyper-V VM. It took several tries to get the environment right, I failed to build dozens of times and rebuilt the VM a few times before I got it where I could build properly. Mostly, my problems revolved around:
Use Microsoft's "Hyper-V Quick Start" to get Ubuntu 18.04 LTS started. Just do it. Stop thinking your manual attempt is better than Microsoft's automated tool. I could have saved two days' time and 3 broken VMs if I just used it from the start instead of thinking I could follow a guide, which turned out to be a dozen guides, only to find out MS had it down to 3 clicks. All I did was waste a ton of time.
Disable Hyper-V Dynamic RAM - just set RAM to 8GB
Do everything from one or more remote SSH command shell(s); invoking the GUI eats up 2+GB RAM. Top/ntop/glances are your friends.
Don't touch the Ubuntu VHDX, create a separate VHDX for AOSP, and mount it /aosp (this made life SO much easier)
Insufficient hard drive space - for AOSP 8.1 (for Sony) I needed 140GB to repo sync & build, so I set the AOSP VHDX for to 200GB on an HDD.
8GB of RAM isn't enough (is enough?), BUT - You don't need that much more, maybe 4GB, the memory demand is extremely incremental and there's no need to be concerned about paging/thrashing. Therefore it was easier to build an 8GB fully-committed VHDX on SSD, formatted & permanently mounted (sudo swapon /dev/sdc - noting the name of your swap drive may vary) .
I manually disabled the built-in 1GB swap file (sudo nano /etc/fstab, and # out the 'swapfile') which was on the Ubuntu VHDX. Noting at no point during the build process did it exceed using 11GB total of memory between RAM & SWAP.
Adding repetitive variables "exports" to ~/.bashrc to save time, and also remembering to reboot or "sudo source ~/.bashrc" before issuing further commands.
There's a bug with Google's repo tool on 18.04 (as of Oct 2018), so in .bashrc you need to specify "export LC_ALL=C"
placeholder
I will try & summarise all my works to install Linux distros on USB's or using crouton on Chromebooks...
Make sure you are in developer mode...
1. crouton
Download crouton in ~/Downloads
Useful command in Chrome/Chromium OS to install crouton Linux distro ubuntu xenial with xfce & xiwi in Acer Chromebook C720P
in a ctrl-alt-t shell -
shell
sudo sh ~/Downloads/crouton -r xenial -t xfce,xiwi,touch,extension
After running the command, one should get the following message (generally)
Here's some tips:
Audio from the chroot will now be forwarded to CRAS (Chromium OS audio server),
through an ALSA plugin.
Future Chromium OS upgrades may break compatibility with the installed version
of CRAS. Should this happen, simply update your chroot.
You already have the Chromium OS extension installed, so you're good to go!
You can open your running chroot desktops by clicking on the extension icon.
Once in a crouton window, press fullscreen or the "switch window" key to switch
back to Chromium OS.
You can launch individual apps in crouton windows by using the "xiwi" command
in the chroot shell. Use startxiwi to launch directly from the host shell.
Use the startxiwi parameter -b to run in the background.
Example: sudo startxiwi -b xterm
You can start Xfce via the startxfce4 host command: sudo startxfce4
Unmounting /mnt/stateful_partition/crouton/chroots/xenial...
Sending SIGTERM to processes under /mnt/stateful_partition/crouton/chroots/xenial...
Done! You can enter the chroot using enter-chroot.
( to use xiwi, you need to install the crouton extension from the Google Web Store).
Not re-inventing the wheel, head on for further info to:
Complete Crouton Installation Guide (Linux on any Chromebook):
https://www.codedonut.com/chromebook/install-crouton-chromebook/
& the dev's crouton's github:
https://github.com/dnschneid/crouton
In case the crouton chroot is already installed without xiwi,
To update an installation with xiwi, apply:
sudo sh ~/Downloads/crouton -n xenial -t xfce,xiwi,touch,extension -u
Notes:
cons -
with crouton one is stuck with the Chrome OS host Linux Kernel , which for Acer CB C720P is Kernel v3.8
it is a chroot environment, so new Ubunture features such as snap packaging cannot be used.
pros -
xiwi allows running Linux apps in separate windows
share of the clipboard & ~/Downloads folder between host & guest
one does not leave the Chrome OS environment
it is like the new crostini feature they are pushing on Kernel 3.18 & above
I think crostini is crouton in Italian
Chromebrew
All I have to say about skycocker's chromebrew -
For a full arsenal of Linux commands at your fingertips in a crosh shell, install Chromebrew package manager on Chromebook or Chrome OS -
requisites: developer mode enabled.
https://github.com/skycocker/chromebrew …
curl -Ls http://git.io/vddgY | bash
crew <command> [-k|--keep] <package1> ...]
Note -
sad but true, I installed chromebrew to get access to the nano text editor - as I have never made the effort to master vi/vim despite using Linux since 1995...
Tails Linux distro with Tor privacy
Tails is an operating system based on Linux & the Tor anonymity project.
It's easy to install on a USB, & very portable as it can boot off MBR & EFI partitions.
It's only available for x86 & x86_64 computers, though they are looking into porting it to Arm.
I got it on a USB following instructions in the developers website: https://tails.boum.org/
Tor browser on any computer, Linux, Mac, Windows, Android.
1. relevant to Chromebooks or hacked with Android & Play Store - Orbot / Orfox:
Tor anonymising solution is now available on Play Store - the Tor proxy is called Orbot & a web browser was compiled to run with it based on mozilla firefox called Orfox.
The set Orbot / Orfox are available to download for free from the Play Store -
I won't describe any of it -
Initially before it was on Play Store, it could be downloaded from the devs group who ported it to Android it: https://guardianproject.info/apps/orbot/
It was also made available through an open source Android Store: F-Droid - https://guardianproject.info/fdroid/
F-Droid is a great source for free open source alternative Android software - it works seamlessly through the Android platform or within proprietary Android based like Amazon Fire.
2. For other x86 platforms like Windows, Linux, Mac...
all is in here: https://www.torproject.org/
F-Droid - a great open source software repository for Android applications
Great way to complement Amazon Appstore, or Android Play Store is F-Droid -
a software repository for Android applications, similar to Google Play store.
The main repository, hosted by the project, contains only apps that are free and open-source software.
https://f-droid.org/en/
https://twitter.com/inabster/status/956226183477317633
F-Droid have a repository for a Tor powered solution on Android platform worthy to those concerned about privacy Orbot is the open source app, & Orfox is the associated Tor Mozilla based (Firefox fork) browser - https://guardianproject.info/apps/orbot/ https://guardianproject.info/apps/orfox/
https://twitter.com/inabster/status/956229034169520130
Ubuntu on Chromebook from USB.
Seabios emulates an mbr boot, so allows booting to mbr using Ctrl-L
Ubuntu then installs as normal to mbr using a Ubuntu livecd.
It might be possible to install Ubuntu so it boots using Ctrl-U. I did not look into it.
Arch Linux on Chromebook & Asus Chromebit CS10
Arch Linux on Asus Chromebit CS10 -
Full instructions here:
https://archlinuxarm.org/platforms/armv7/rockchip/asus-chromebit-cs10
Mainline Kernel
The installation above will use the ChromeOS 3.14 kernel. The mainline kernel can be used instead, though some hardware may not be working yet. Two options are available to switch to the mainline kernel:
Replace kernel packages after installation
Install linux-armv7 packages, replacing the linux-veyron package, and the firmware-veyron package:
pacman -S linux-armv7 linux-armv7-chromebook firmware-veyron
Type y and hit enter when prompted to flash the kernel to the kernel partition.
Remove the veyron-libgl and xf86-video-armsoc-rockchip packages. Mali is not supported in mainline.
pacman -R veyron-libgl xf86-video-armsoc-rockchip
Reboot.
Perform a new installation with the above steps using the armv7-chromebook tarball:
http://os.archlinuxarm.org/os/ArchLinuxARM-armv7-chromebook-latest.tar.gz
Install the firmware-veyron package, or copy it to the drive for later installation for wifi support.
pacman -S firmware-veyron
Arch Linux on Chromebook -
Easiest instructions to install Arch Linux on a USB of Chromebook in BIOS legacy mode here:
https://gist.github.com/alphazo/3285090
https://twitter.com/inabster/status/692098848391610372
General consideration on Linux installs with uefi - notes to self
These are notes to myself to link up to - I have posted them on @twitter - but nice to have them ready for copy & paste.
Not related to Chromebooks generally, unless one uses Ctrl-U which is an uefi boot... I did not dabble in it...
Two important config files to get a successful Arch Linux or Ubuntu boot are:
grub.cfg
fstab
fstab is in /etc/
/etc/fstab
& tells the OS where relevant partitions are
... TBC
Linux Kernel related building commands for reference...
Build Ubuntu Kernel
sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc
clone git kernel for source in home user folder ~/kernel
cd kernel
cp /boot/config-$(uname -r) .config
make menuconfig
sudo make -j 4 && sudo make modules_install -j 4 && sudo make install -j 4
sudo update-initramfs -c -k 4.xx.xx
sudo update-grub .../...
also
build kernel headers from source with: (at root of kernel directory) -
sudo make headers_install INSTALL_HDR_PATH=/usr/include
Arch Linux 4.19-LTS & 5.0.8 nasty bug
Testing Arch Linux on Chromebook
Arch Linux 4.19-LTS & 5.0.8 nasty bug
but for those using Arch Linux, avoid kernel 4.19-LTS & 5.0.8 like the plague,
both damage Arch Linux by disabling usb input devices, trackpad, mouse, keybooard, touch...
I had to put my rant somewhere, it damaged a 3 year Arch Linux USB stick for me
Since I am here, might as well post for reference my experience with getting a new USB loaded with Arch Linux
not doing it from scratch, too much effort...
found this - quite good too, Live USB persistent -
Arch Linux USB OS https://sourceforge.net/projects/arch-linux-usb-os/ …
It saves the trouble of building Arch Linux OS from scratch.
Uses Kernel 5.0.5 -
Linux robot 5.0.5-arch1-1-ARCH #1 SMP PREEMPT Wed Mar 27 17:53:10 UTC 2019 x86_64 GNU/Linux
if allowed to upgrade to 5.0.8 will bork the input, so only upgrade to 5.0.7 maximum (linux-rt), which I built through aur.
upgrading through aur to linux-rt 5.0.7
$ uname -a
Linux robot 5.0.7-rt5-1-rt #1 SMP PREEMPT RT Mon Apr 22 14:42:29 CEST 2019 x86_64 GNU/Linux
to get to boot with this kernel needs to replace linux with linux-rt in loader settings.
to stop kernel from upgrading -
ArchLinux is updated to the newest version with the command:
pacman -Syu
To stop it from updating the kernel (until they get their **** together) add
IgnorePkg = linux linux-headers
into /etc/pacman.conf
stuff / thingies
[email protected] ~ $ cd /run/archiso/bootmnt
[email protected] bootmnt $ ls
arch EFI loader
[email protected] bootmnt $ ls arch/boot
amd-ucode.img grub intel-ucode.img intel_ucode.LICENSE x86_64
[email protected] bootmnt $ ls arch/boot/x86_64/
initramfs-linux.img initramfs-linux-rt.img vmlinuz-linux vmlinuz-linux-rt
notes -
original shipped linux version is 5.0.5
upgraded linux version though aur is linux-rt 5.0.7
so needed to copy vmlinuz-linux-rt & initramfs-linux-rt.img to /run/archiso/bootmnt/arch/boot/x86_64/
cannot be done from a running instance, so had to boot from another live usb to copy it over from
[email protected] bootmnt $ ls /boot
amd-ucode.img initramfs-linux-rt-fallback.img syslinux
grub initramfs-linux-rt.img vmlinuz-linux
initramfs-linux.img intel-ucode.img vmlinuz-linux-rt
to automate replace loading linux with linux-rt, modify
/run/archiso/bootmnt/loader/entries/
[email protected] entries $ ls
Archlinux.conf Archlinux-terminal.conf uefi-shell-v2-x86_64.conf
Archlinux-copytoram.conf uefi-shell-v1-x86_64.conf
example
Archlinux.conf original
title Arch Linux UEFI
linux /arch/boot/x86_64/vmlinuz-linux
initrd /arch/boot/intel-ucode.img
initrd /arch/boot/amd-ucode.img
initrd /arch/boot/x86_64/initramfs-linux.img
options archisobasedir=arch archisolabel=USB-BOOT cow_label=usb-save loglevel=3
change to:
title Arch Linux UEFI
linux /arch/boot/x86_64/vmlinuz-linux-rt
initrd /arch/boot/intel-ucode.img
initrd /arch/boot/amd-ucode.img
initrd /arch/boot/x86_64/initramfs-linux-rt.img
options archisobasedir=arch archisolabel=USB-BOOT cow_label=usb-save loglevel=3
to be able to modify bootloader files
do above from a separate linux usb (mine is Ubuntu 18.04)
$ mkdir efi
$ sudo mount /dev/sdb1 efi
$ cd efi
$ ls
arch EFI loader
... etc as above.
News - Arch Linux released Kernel 5.0.9 - still has the nasty bug - do not upgrade, if you did, downgrade by installing the downgrade script from aur...
How to downgrade a Linux kernel...
https://arcolinux.com/how-to-downgrade-a-linux-kernel/
Borking my 3 year arch linux USB was a blessing in disguise, made me look for a persistent USB alternative...
the one described above boots Acer Chromebook C720P well, it works great, with kernels 5.0.5 & 5.0.7 -
I tested it on the modded full ROM MrChromebox firmware, but believe it will work as well in Seabios legacy mode.
notes to myself
Linux pot-pourri commands from my notes, for reference
these are copy & paste commands which I need put into one place, here...
I will rearrange them later with context where to be used...
placeholder...
Chromebook: Updating xenial to bionic w/ crouton:
$ sudo enter-chroot -n xenial
(xenial)[email protected]:~$ sudo apt-get install update-manager-core python-apt
(xenial)[email protected]:~$ sudo do-release-upgrade
$ sudo sh ~/Downloads/crouton -n xenial -u
$ sudo edit-chroot xenial -m bionic
Creating a dev environment in all Chrome OS x86 or arm:
shell
sudo dev_install
Creating a Visual Studio environment in arm:
shell
sudo su -
. <( curl -s https://code.headmelted.com/installers/chromebook.sh … )
Creating a Ubuntu chroot & X-Windows environment:
sudo sh ~/Downloads/crouton -t xfce -r xenial
If using rEFInd as bootloader, a useful command to get entries at boot in the UEFI menu is:
$ sudo efibootmgr -c -g -d /dev/sda -p 1 -w -L "rEFInd" -l '\EFI\refind\refind_x64.efi'
replace /dev/sda by /dev/sdx x=b,c... in other cases.
To check install is correct, issue:
$ [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD]
Sometimes needed
1.:
$ sudo apt-get install --reinstall efibootmgr
$ sudo grub-install /dev/sda
$ sudo apt-get install --reinstall grub-efi
$ sudo grub-install /boot/efi
$ sudo grub-install --target=i386-efi /dev/sda1 --efi-directory=/boot/efi/ --boot-directory=/boot
2.:
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
then again:
$ sudo apt-get -y install --reinstall grub-efi-ia32 grub-efi-ia32-bin
@ubuntu 18.04.1 works with efi on @bbenTech Intel Compute Stick (ICS) cherrytrail clone & with mbr (seabios legacy) on @Acer Chromebook C720P.
Managed to get it to boot w/ efi 32bit bootlader - but I had to get into GUI 1st & bypass the initramfs emergency mode - what was needed was correct UUID of EFI partition in /etc/fstab - then boot through grub manually...
UUID=XXXX-XXXX /boot/efi vfat umask=0077 0 1
When in grub, issue
set root=(hd0,gpt2)
configfile (hd0,gpt1)/efi/ubuntu/grub.cfg
(grub.cfg must have the UUID of (hd0,gpt2) in my case of /dev/sdb2
use
sudo blkid /dev/sdX to find UUID's)
that boots into Ubuntu 18.04
open terminal...
When in the GUI
in terminal issue:
sudo apt-get update
sudo apt-get -y install --reinstall grub-efi-ia32 grub-efi-ia32-bin
reboot
Notes:
Arch Linux
$ sudo grub-install --target=i386-efi /dev/sda2 --efi-directory=/boot/efi/ --boot-directory=/boot
$ sudo efibootmgr -c -g -d /dev/sda -p 2 -w -L "Arch" -l '\EFI\EFI\arch\grubia32.efi'
then:
$ sudo grub-mkconfig -o /boot/EFI/EFI/arch/grub.cfg
$ sudo mkinitcpio -p linux
from http://www.rodsbooks.com/efi-bootloaders/installation.html#alternative-naming
Arch Linux mainline kernel
$ sudo mount -o remount,size=6G,noatime /tmp
$ yaourt linux-mainline
more crouton / crostini stuff
Latest crostini kernel is 4.19.16 -
for lolz I installed mplayer, mpv & gnome-mpv (all Linux video players)
they do load videos from crostini, but with no sound (this is using cyan & eve v73) -
of course video works great in crouton Linux distros... or in Android with VLC etc...
RFC - Any idea how to get sound working through crostini?
of course this is not needed as within Android or crouton with say Ubuntu bionic, sound is perfectly fine
just fooling around crostini
from - https://forum.xda-developers.com/showpost.php?p=79527257&postcount=215
crouton bionic sound issues -
add following to /etc/pulse/daemon.conf -
default-sample-rate = 48000
default-fragments = 5
default-fragment-size-msec = 2
Access audio hardware directly (ALSA, JACK)
add yourself to the hwaudio group.
sudo usermod -a -G hwaudio "$USER"
Log out and log back in.
Test:
$ groups
slee2 hwaudio video sudo plugdev audio input
Stop CRAS
Make sure you've stopped CRAS, or else it will hold on to your audio device. In either ChromeOS or your chroot, run
$ sudo initctl stop cras
You might also need this to control audio -
$ alsamixer -c 0
from - https://github.com/dnschneid/crouton/wiki/Access-audio-hardware-directly-(ALSA,-JACK)
& https://github.com/dnschneid/crouton/wiki/Audio
Reinstall GRUB to the EFI partition using chroot
Notes to self-
sudo mount /dev/sdXXX /mnt
sudo mount /dev/sdXX /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdX
update-grub
Note : sdX = disk | sdXX = efi partition | sdXXX = system partition
To identify the partitions use GParted, the tool is included in the installation medium.
After having run the commands GRUB will be installed in the separate EFI partition.
Deploying, bootloading OSes such as Ubuntu manually
I like to initially install an OS to a 16/32 GB USB 3.0 stick, then dd it to a bigger SSD of I am happy with it, follows some notes on how it is done...
In previous post, I described how to fix an efi booting, but there is a caveat, one needs to know where & how to modify settings of efi bootlader, & /etc/fstab that tells the OS where to find partitions to load itself (bootstrap)...
These are some successful partition settings I had to deal with -
1. efi/mbr mix
$ sudo fdisk -l
Disk /dev/sdb: 465.8 GiB, 500107861504 bytes, 976773167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: ***
Device Start End Sectors Size Type
/dev/sdb1 2048 411647 409600 200M EFI System
/dev/sdb2 411648 210208767 209797120 100G Microsoft basic data
/dev/sdb3 210415616 337403903 126988288 60.6G Linux filesystem
/dev/sdb4 337403904 430872575 93468672 44.6G Linux filesystem
/dev/sdb5 430872576 435066879 4194304 2G Linux swap
/dev/sdb6 435066880 624490495 189423616 90.3G Microsoft basic data
/dev/sdb7 624490496 976766975 352276480 168G Microsoft basic data
/dev/sdb8 210208768 210415615 206848 101M BIOS boot
Partition table entries are not in disk order.
/dev/sdb8 is BIOS boot invoked by bios_grub flag in gparted manage flags partition editor
/dev/sdb1 is efi partition flagged as boot, esp & legacy_boot in gparted manage flags partition editor
$ sudo fdisk -l
Disk /dev/sdc: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: xxx
Device Start End Sectors Size Type
/dev/sdc1 2048 206847 204800 100M BIOS boot
/dev/sdc2 206848 135235583 135028736 64.4G Linux filesystem
/dev/sdc3 135235584 286480383 151244800 72.1G Linux filesystem
/dev/sdc4 286480384 599062527 312582144 149.1G Microsoft basic data
/dev/sdc5 599062528 599984127 921600 450M Windows recovery environment
/dev/sdc6 599984128 1007575039 407590912 194.4G Microsoft basic data
/dev/sdc7 1007575040 1949327359 941752320 449.1G Microsoft basic data
/dev/sdc8 1949329408 1953103871 3774464 1.8G Linux swap
/dev/sdc9 1953105920 1953519615 413696 202M EFI System
/dev/sdc1 is BIOS boot invoked by bios_grub flag in gparted manage flags partition editor
/dev/sdc9 is efi partition flagged as boot, esp & legacy_boot in gparted manage flags partition editor
2. pure mbr / no BIOS boot - using Windows boot loader & easyBCD 3.2 to load Linux/Ubuntu
$ sudo fdisk -l
Disk /dev/sdc: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x767e7d2d
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 472768511 472766464 225.4G 7 HPFS/NTFS/exFAT
/dev/sdc2 472768512 1422079999 949311488 452.7G 7 HPFS/NTFS/exFAT
/dev/sdc3 1422080221 1479591932 57511712 27.4G 83 Linux
/dev/sdc4 1479591933 1953523711 473931779 226G f W95 Ext'd (LBA)
/dev/sdc5 1479591936 1949331455 469739520 224G 83 Linux
/dev/sdc6 1949333504 1953523711 4190208 2G 82 Linux swap / Solaris
3. pure mbr (just Ubuntu, nothing else)
$ sudo fdisk -l
Disk /dev/sdc: 14.6 GiB, 15693664256 bytes, 30651688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2BB06DCE-2D30-4778-94BD-2FD214CD3C3B
Device Start End Sectors Size Type
/dev/sdc1 2048 206847 204800 100M BIOS boot
/dev/sdc2 206848 28555263 28348416 13.5G Linux filesystem
/dev/sdc3 28555264 30650367 2095104 1023M Linux swap
In 3. this is what to expect when you install Ubuntu to mbr, it will ask you to also create a BIOS boot partition of at least 1 MB - I chose here 100 MB to safeguard for future change, it's kind of a blob with core image for booting...
4. pure efi (just Ubuntu & EFI partition, nothing else)
$ sudo fdisk -l
Disk /dev/sdc: 29.3 GiB, 31406948352 bytes, 61341696 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0B9FB340-99D5-03A3-D0EC-E74275E6E800
Device Start End Sectors Size Type
/dev/sdc1 2048 411647 409600 200M EFI System
/dev/sdc2 411648 58195967 57784320 27.6G Linux filesystem
/dev/sdc3 58195968 61335551 3139584 1.5G Microsoft basic data
in 4. I prep a disk with the three partitions EFI, ROOT & SWAP Assign the flags for the EFI partition as as boot, esp & legacy_boot in gparted, then use an install dvd/usb disk to install by assigning the correct partitions...
3 & 4 I use to deploy, if it's just them, I just dd to a bigger disk,
if not, I use the ROOT to dd to a partition in a target partition in a bigger disk that is already populated with say Windows or OS X, or any other,
care has then to be taken not to disturb the initial order,
so ROOT for Ubuntu should be put at the end of the original installations, etc.
In the next post I will take an example & walk through it...
efi/mbr partitions in pictures
1. efi/mbr mix
https://forum.xda-developers.com/attachment.php?attachmentid=4779410&stc=1&d=1560960108
https://forum.xda-developers.com/attachment.php?attachmentid=4779411&stc=1&d=1560960108
2. pure mbr / no BIOS boot - using Windows boot loader & easyBCD 3.2 to load Linux/Ubuntu
https://forum.xda-developers.com/attachment.php?attachmentid=4779413&stc=1&d=1560960108
3. pure mbr (just Ubuntu, nothing else)
https://forum.xda-developers.com/attachment.php?attachmentid=4779412&stc=1&d=1560960108
4. pure efi (just Ubuntu & EFI partition, nothing else)
https://forum.xda-developers.com/attachment.php?attachmentid=4779414&stc=1&d=1560960108
pictures in @twitter feeds -
https://twitter.com/inabster/status/1141482400112926723
https://twitter.com/inabster/status/1141482980151615488
RFC - how do we get the pictures to appear in the posts?
Bootloading examples
Method in post #13 required to have both the efi & bios boot partitions present
https://forum.xda-developers.com/showpost.php?p=79742668&postcount=13
This is a set piece for
Device Start End Sectors Size Type
/dev/sdb1 2048 411647 409600 200M EFI System
/dev/sdb2 411648 210208767 209797120 100G Microsoft basic data
/dev/sdb3 210415616 337403903 126988288 60.6G Linux filesystem
/dev/sdb4 337403904 430872575 93468672 44.6G Linux filesystem
/dev/sdb5 430872576 435066879 4194304 2G Linux swap
/dev/sdb6 435066880 624490495 189423616 90.3G Microsoft basic data
/dev/sdb7 624490496 976766975 352276480 168G Microsoft basic data
/dev/sdb8 210208768 210415615 206848 101M BIOS boot
sudo mount /dev/sdb3 /mnt
sudo mount /dev/sdb1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdb
update-grub
2nd example -
Device Start End Sectors Size Type
/dev/sdc1 2048 206847 204800 100M BIOS boot
/dev/sdc2 206848 135235583 135028736 64.4G Linux filesystem
/dev/sdc3 135235584 286480383 151244800 72.1G Linux filesystem
/dev/sdc4 286480384 599062527 312582144 149.1G Microsoft basic data
/dev/sdc5 599062528 599984127 921600 450M Windows recovery environment
/dev/sdc6 599984128 1007575039 407590912 194.4G Microsoft basic data
/dev/sdc7 1007575040 1949327359 941752320 449.1G Microsoft basic data
/dev/sdc8 1949329408 1953103871 3774464 1.8G Linux swap
/dev/sdc9 1953105920 1953519615 413696 202M EFI System
sudo mount /dev/sdc3 /mnt
sudo mount /dev/sdc9 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdc
update-grub
out of chroot, these commands are also useful:
sudo efibootmgr -c -g -d /dev/sdc -p 9 -w -L "ubuntu" -l '\EFI\refind\refind_x64.efi' #efi partition /dev/sdc9
sudo grub-install /boot/efi # this after having mounted in /etc/fstab /dev/sdc9 in /boot/efi
sudo efibootmgr -c -g -d /dev/sdb -p 1 -w -L "ubuntu" -l '\EFI\refind\refind_x64.efi' #efi partition /dev/sdb1
sudo grub-install --target=x86_64-efi /dev/sdb3 --efi-directory=/boot/efi/ --boot-directory=/boot
sudo grub-install --target=x86_64-efi /dev/sdc3 --efi-directory=/boot/efi/ --boot-directory=/boot
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo update-grub
To check install is correct, issue:
$ [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD]
Two important config files to get a successful Arch Linux or Ubuntu boot are:
grub.cfg
fstab
fstab is in /etc/
/etc/fstab
grub.cfg can be found in /boot/grub & mounted efi partition /boot/efi in /boot/efi/EFI/ubuntu
grub.cfg can be used in a grub command line as follows:
set root=(hd0,gpt2)
configfile (hd0,gpt1)/efi/ubuntu/grub.cfg
(grub.cfg must have the UUID of (hd0,gpt2) in my case of /dev/sdb2
use
sudo blkid /dev/sdX to find UUID's)
or
configfile (hd0,gpt2)/boot/grub/grub.cfg
grub.cfg, fstab examples...
First
Disk /dev/sdb: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 807AFD80-12D5-03A5-60BF-1E60B544E900
Device Start End Sectors Size Type
/dev/sdb1 2048 206847 204800 100M BIOS boot
/dev/sdb2 206848 135235583 135028736 64.4G Linux filesystem
/dev/sdb3 135235584 286480383 151244800 72.1G Linux filesystem
/dev/sdb4 286480384 599062527 312582144 149.1G Microsoft basic data
/dev/sdb5 599062528 599984127 921600 450M Windows recovery environment
/dev/sdb6 599984128 1007575039 407590912 194.4G Microsoft basic data
/dev/sdb7 1007575040 1949327359 941752320 449.1G Microsoft basic data
/dev/sdb8 1949329408 1953103871 3774464 1.8G Linux swap
/dev/sdb9 1953105920 1953519615 413696 202M EFI System
$ sudo blkid /dev/sdb9
/dev/sdb9: LABEL="UEFI" UUID="B07A-6430" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="f7ffc8f0-896a-01d2-78e0-eb63b544e900"
$ sudo blkid /dev/sdb3
/dev/sdb3: LABEL="UBUNTU16" UUID="8082d3f4-ec43-4310-af55-934b67078f05" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="c0428fd0-896a-01d2-e843-2160b544e900"
$ sudo blkid /dev/sdb8
/dev/sdb8: TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="0000e5a5-f7e0-c5fd-6ae9-f2754acb0100"
$ nano /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdc3 during installation
UUID=6e69ee53-1a57-4cb5-b46f-f0f079fdf666 / ext4
# /boot/efi was on /dev/sda2 during installation
UUID=B07A-6430 /boot/efi vfat defaults 0 1
# swap was on /dev/sdc1 during installation
UUID=0000e5a5-f7e0-c5fd-6ae9-f2754acb0100 none swap sw $
$ nano /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 3fcb8592-bcc3-cf01-3048-8592bcc3cf01 root hd1,gpt3
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Second
Disk /dev/sda: 465.8 GiB, 500107861504 bytes, 976773167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: 4CACF8A0-B3A8-039F-283E-2B13EAECE700
Device Start End Sectors Size Type
/dev/sda1 2048 411647 409600 200M EFI System
/dev/sda2 411648 210208767 209797120 100G Microsoft basic data
/dev/sda3 210415616 337403903 126988288 60.6G Linux filesystem
/dev/sda4 337403904 430872575 93468672 44.6G Linux filesystem
/dev/sda5 430872576 435066879 4194304 2G Linux swap
/dev/sda6 435066880 624490495 189423616 90.3G Microsoft basic data
/dev/sda7 624490496 976766975 352276480 168G Microsoft basic data
/dev/sda8 210208768 210415615 206848 101M BIOS boot
Partition table entries are not in disk order.
$ sudo blkid /dev/sda1
/dev/sda1: LABEL="EFI" UUID="4579-67B0" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="42f7ecf0-d3b5-01d0-78f6-7ba1da69e800"
$ sudo blkid /dev/sda3
/dev/sda3: LABEL="UBUNTU18" UUID="6e69ee53-1a57-4cb5-b46f-f0f079fdf666" TYPE="ext4" PARTUUID="99b3c3d8-2c44-488b-a130-fefb68abbe5d"
$ sudo blkid /dev/sda5
/dev/sda5: UUID="93471658-7099-45fc-ac61-75e09b4bf08f" TYPE="swap" PARTUUID="fdb07319-debf-4394-9e71-27b3bca2a9ac"
$ nano /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdc3 during installation
UUID=6e69ee53-1a57-4cb5-b46f-f0f079fdf666 / ext4
# /boot/efi was on /dev/sda2 during installation
UUID=4579-67B0 /boot/efi vfat defaults 0 1
# swap was on /dev/sdc1 during installation
UUID=93471658-7099-45fc-ac61-75e09b4bf08f none swap sw
$ nano /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 6e69ee53-1a57-4cb5-b46f-f0f079fdf666 root hd1,gpt3
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Looking at the above examples, you can tease out where identifiers need be, usually the commands listed on previous posts would look after that, but sometimes they do not, so you need to amend / correct grub.cfg & fstab manually...
I hope this helps
Fixing Windows 10 EFI boot
In multi boot situations installing Ubuntu, one sometimes loses UEFI settings booting Windows 10 - here are some ways to repair / recover...
Resource needed - relevant boot install usb/dvd for Windows 10.
Use diskpart to repair uefi from troubleshooting repair command prompt.