Using android terminal app
flash_image lk /sdcard/lk.img
(assuming that lk.img is on the root of the sd card)
I don't know why, but this didn't work for me. No error it just did nothing.
I've been using the build in terminal of twrp-recovery.
Here are the steps:
Boot into twrp-recovery (assuming you already have it instead of cwm)
hit "Advanced"
hit "Terminal Command"
navigate to /system/bin
hit "Select"
type:
flash_image lk /sdcard/lk.img (assuming that lk.img is on the root of the sd card)
hit enter on the keyboard
With 1.5.1.0, did anyone notice the first boot logo fading into what looks like a blank screen before the second logo (logo.rle from initrd) is displayed?
Swyped from my HTC HD2 using XDA Premium
You missunderstood me, the menu was ok in v1.5.0.8 but in the latest v1.5.1.0 it's messed because the order was distroyed - could it be because, after manually restoring partitions (sboot, tboot), returned the previous size of recovery and tboot (6MB) and then all previously installed ROMs and recoveries became available without flashing which I just run?Did you use v1.5.0.9? I believe that in v1.5.1.0 it is fixedictimai said:I've just flashed the new version through nbh (without recovery), reset settings beforehand, and the menu is indeed "squeezed" in the top left corner in the way menu items are overwritten one upon another - completely unintelligible. Must flash back to 1.5.0.8 which behaved well...
One more question please, is it possible to back up installed NAND ROM and after resetting, flashing new cLK, then restore this NAND into boot, system (where else?)?
This question is because I've got problems to arrange back previous partitions and their sizes in such way that all their content could be used again without reflashing... (Is it achievable at all between new cLK installs? I tried to manually restore partitons layout but after it just one 'boot' kernel succeeded, and others: sboot, tboot, recovery failed. Whats more after flashed recovery anew then this mess with menu occured. Has the menu anything to do with partitions layout?)
Thanks for the feedback! When you referred to the order of the partitions I finally got your issue. Changed the way it loops through ptable(partitions layout) and I hope it's finally fixed now. Will upload it later for you all to test.You missunderstood me, the menu was ok in v1.5.0.8 but in the latest v1.5.1.0 it's messed because the order was ...
...Has the menu anything to do with partitions layout?
I don't see a problem in any of the above.One more question please, is it possible to back up installed NAND ROM and after resetting, flashing new cLK, then restore this NAND into boot, system (where else?)?
if(flash-file == LE0IMG.nbh) {
//All settings are reset because the area which holds that info
//is overwritten by the default ones, so one more step is required
Manually_set_all_your_partitions_settings_to_your_previous_choice();
} else if(flash-file == lk.img){
//All settings are left untouched because the area which holds that info
//is NOT overwritten, so there is no need to set any partitions's settings
return;
}
if( (installation==messed_up)
|| (user_wants_to_restore_NANDROID_Backup==TRUE) ) {
Restore_NANDROID_Backup();
} else {
Enjoy_the_best_phone_ever_made(;));
}
Maybe that's probably because the partition table you created is not the same as before.I tried to manually restore partitons layout but after it just one 'boot' kernel succeeded, and others: sboot, tboot, recovery failed. Whats more after flashed recovery anew then this mess with menu occured.
...
userdata:0
sboot:4
tboot:3
vboot:5
cache:5
...
userdata:0
vboot:5
tboot:5
sboot:5
cache:5
It's been uploaded at my [mediafire folder].
#!/sbin/sh
# flash_xboot.sh
#####################################################################
# Script arguments reference: #
# #
# 1 <== The name of the boot partition to update [OBLIGATORY]#
# {boot, sboot, tboot, vboot, wboot, xboot, yboot , zboot}#
# 2 <== The name of the Rom [OPTIONAL] #
# {IF NOT given, startup.txt will be used to get it} #
# 3 <== Force procedure if Rom is pre-installed [OPTIONAL] #
# {force} #
#####################################################################
# Script return reference : #
# #
# 0 <== No errors #
# 1 <== Rom already installed OR Tool's error #
# 2 <== File(s) not found #
#####################################################################
# Print messages function
OUTFD=$(ps | grep -v "grep" | grep -o -E "update_binary(.*)" | cut -d " " -f 3)
ui_print() {
if [ "$OUTFD" = "" ]; then
echo "${1}"
else
echo "ui_print ${1} " 1>&$OUTFD
echo "ui_print " 1>&$OUTFD
fi
}
# Forgot first argument ?
if [ "$1" = "" ]; then
ui_print "Usage: flash_xboot [arg1] [arg2] [arg3]"
ui_print " 1)boot-partition's name(required)"
ui_print " one of {boot,sboot,tboot,vboot,"
ui_print " wboot,xboot,yboot,zboot}"
ui_print " 2)rom's name(optional)"
ui_print " 3)-force(optional)"
ui_print " to force installation,if the same"
ui_print " Rom was previously installed"
exit 1
fi
# Set mkbootimg base arg
base=0x11800000
# Set mkbootimg output arg
output=/sdcard/$1.img
# Set remaining mkbootimg args
cmd="nand_boot=0 rel_path=NativeSD"
zImg=zImage
rdisk=initrd.gz
#####################################################################
# NativeSD dir structure reference: #
# #
#/sdcard/NativeSD/$Rom <== Contains the kernel #
# we want for mkbootimg #
# / #
# zImage #
# initrd.gz #
#/sdcard/NativeSD #
# / #
# zImage <== Copied from the $Rom folder #
# for magldr or haret #
# initrd.gz <== Copied from the $Rom folder #
# for magldr or haret #
# startup.txt <== Contains the cmdline arg #
# we want for mkbootimg #
#####################################################################
# This script will add: #
# .cLK_entries<== File to keep track of #
# which Rom is installed and #
# at which boot partition #
#####################################################################
# Objectives :
# The dir with the startup.txt is '/sdcard/NativeSD'
# The dir with the Rom's kernel is '/sdcard/NativeSD/$Rom'
# which we'll have to find from 'startup.txt' later
# Check if everything is in place, otherwise exit
if [ ! -d "/sdcard/NativeSD" ]; then
ui_print "NativeSD directory not found"
exit 2
fi
if [ ! -f "/sdcard/NativeSD/initrd.gz" ]; then
ui_print "NativeSD ramdisk not found"
exit 2
fi
if [ ! -f "/sdcard/NativeSD/zImage" ]; then
ui_print "NativeSD kernel not found"
exit 2
fi
if [ ! -f "/sdcard/NativeSD/startup.txt" ]; then
ui_print "NativeSD startup.txt not found"
exit 2
fi
# Responsible for a correct cmdline in startup.txt should be
# either the Rom that was installed (by extracting the right
# startup.txt in NativeSD folder) or the application 'NativeSDBoot'
# (by replacing the "relpath" in startup.txt with the new Rom's name)
# No Rom name was given - We will find it using startup.txt
if [ "$2" = "-force" ] || [ "$2" = "" ]; then
# Get the cmdline from startup.txt
cd /sdcard/NativeSD
sed -rn '
/^$/ {
d
}
/#.*/ {
d
}
/[ ^I]*$/ {
s/[ ^I]*$//
}
/set cmdline/ {
s/set cmdline //
P
q
}
}
' "startup.txt" > commandline
# Set mkbootimg cmdline arg
cmd=`sed -e 's/\"/nand_boot=0 /' -e 's/\"\r//g' "commandline"`
Rom=`sed -e 's/\"rel_path=//' -e 's/\"\r//g' "commandline"`
if [ "$cmd" != "" ]; then
# Set remaining mkbootimg args
zImg=`sed -e 's/\"rel_path=//g' -e 's/\"\r/\/zImage/g' "commandline"`
rdisk=`sed -e 's/\"rel_path=//g' -e 's/\"\r/\/initrd\.gz/g' "commandline"`
else
ui_print "Attention: Using NativeSD contents"
cmd="nand_boot=0 rel_path=NativeSD"
fi
# Clean up
rm -rf commandline
# Rom name was given
else
if [ "$2" != "-force" ]; then
Rom=$2
# Set mkbootimg cmdline arg
cmd="nand_boot=0 rel_path=$Rom"
# Set remaining mkbootimg args
zImg=$Rom/zImage
rdisk=$Rom/initrd.gz
fi
fi
ui_print "cmdline: $cmd"
ui_print "kernel: $zImg"
ui_print "ramdisk: $rdisk"
# From this point we have got a Rom name
# and we can do some checks :
# 1)Check if the Rom's kernel exists
if [ ! -f "$zImg" ]; then
ui_print "Kernel not found"
exit 2
fi
if [ ! -f "$rdisk" ]; then
ui_print "Ramdisk not found"
exit 2
fi
# 2)Check if it was previously installed
if [ -f "/sdcard/NativeSD/.cLK_entries" ]; then
if grep -Fxq "$Rom" "/sdcard/NativeSD/.cLK_entries"
then
# Rom entry was found
ui_print "Rom already installed"
if [ "$2" = "-force" ] || [ "$3" = "-force" ]; then
# Delete the line with the previous entry
ui_print "Forced removal of previous entry from list"
sed -i '/'${Rom}'/d' "/sdcard/NativeSD/.cLK_entries"
else
# If we do not force installation exit
ui_print "Aborted"
exit 1
fi
fi;
fi
# Write the partition and the Rom name
# to a file called .cLK_entries so that
# we use it as reference to keep track
# of the Roms that have been installed
# In case we want to reinstall the same Rom,
# we should have passed '-force' arg to this script
echo "$1=$Rom" >> /sdcard/NativeSD/.cLK_entries
# Make an image file from zImage and initrd.gz
# with the correct command line arg
# in order to be flashed later
if [ "`which mkbootimg`" ]; then
chmod 0777 "`which mkbootimg`"
`which mkbootimg` --kernel /sdcard/NativeSD/$zImg \
--ramdisk /sdcard/NativeSD/$rdisk \
--cmdline "$cmd" \
--base $base \
--output $output
[ $? -eq 0 ] || exit 1
ui_print "$Rom's kernel created"
else
ui_print "mkbootimg was not found"
exit 2
fi
# Flash the output image to the boot partition entered as 1st arg
if [ "`which flash_image`" ]; then
chmod 0777 "`which flash_image`"
`which flash_image` $1 $output
[ $? -eq 0 ] || exit 1
ui_print "$Rom's kernel installed to /$1 partition"
else
ui_print "flash_image was not found"
exit 2
fi
ui_print "All operations completed"
exit 0
Somehow, I had the wrong impression that the startup.txt includes a different "rel_path=..." for every different Rom... I must have mixed up thisFor all the roms startup.txt has the same name,because it is the same for all roms.It writes rel_path=NativeSD so we cant take from it the different name of the rom.
So it is something like this?The new nativesd multiboot app with support for clk sboot it has a rom_name.txt to recognise the rom the user runs and then write to sboot partition the rel_path= by using this name.So i think for tboot,vboot partitions we need a script that reads a txt file in which will be the correct rom name
Running CYANX => /sdcard/NativeSD/CYANX.txt
With 1.5.1.0, did anyone notice the first boot logo fading into what looks like a blank screen before the second logo (logo.rle from initrd) is displayed?
Swyped from my HTC HD2 using XDA Premium
Inside the folder NativeSD the app creates a file called rom_name.txt which contains only the name of the rom.For example it writes only Cyanx or cm9ight.Every time we use the app to change to another rom the file rom_name.txt will contain the name of the rom we switched.This also helps when we press delete in the app to hide the rom we running and prevent us of deleting it.This works for magldrSomehow, I had the wrong impression that the startup.txt includes a different "rel_path=..." for every different Rom... I must have mixed up this
with what applied in the old SD Roms. Thanks for the clarification.
So it is something like this?
And is it an empty text file or it contains the name of the 'boot' partition(in this case sboot)?Code:Running CYANX => /sdcard/NativeSD/CYANX.txt
It is intended to do so before loading any kernel or recovery. I will add that info to the change log too.Horizontal black bars appear and the image 'fades out'. I thought (or hoped) it was an intentional feature and that I just missed the post saying it had been implemented.
I tested booting 'without filling bad block table at startup' and THEN format - [OK]kokotas Format nand is not working properly with 1.5.1.1
also bad blocks are not alocated.
edit: after reboot bad blocks showed in info...
Thanks again for making it clear. I will eventually try this app even if it was made for MAGLDR users and then adjusted for clk.Inside the folder NativeSD the app creates a file called rom_name.txt which contains only the name of the rom.For example it writes only Cyanx or cm9ight.Every time we use the app to change to another rom the file rom_name.txt will contain the name of the rom we switched.This also helps when we press delete in the app to hide the rom we running and prevent us of deleting it.This works for magldr
if you want install the app from here http://xdaforums.com/showpost.php?p=31798651&postcount=832 to see the logic that works
This is ok! Rechecked the code, even did a format (an excuse to try another Rom except for my daily one) and all went well.Me said:I didn't test booting 'without filling bad block table at start up', THEN select fill BBT @ STARTUP and THEN format without rebooting [?] <=DO NOT TRY IT UNTILL I CHECK!
It is intended to do so before loading any kernel or recovery. I will add that info to the change log too.
"recovery:5"
"misc:1"
"boot:5"
"userdata:0"
"system:150"
"cache:5"
And we want to change it to:1."recovery"
2."misc"
3."boot"
4."userdata"
5."system"
6."cache"
1."recovery"
2."misc"
3."boot"
4."cache"
5."system"
6."userdata"
"recovery:5"
"misc:1"
"boot:5"
"system:150"
"userdata:0"
"cache:5"
[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
fastboot oem part-resize name:size:b
where size is in blocks
i.e. fastboot oem part-resize misc:9:b => will resize 'misc' part to 9 blocks
fastboot oem part-add name:size:b
where size is in blocks
i.e. fastboot oem part-add misc:8:b => will add 'misc' part with size 8 blocks (= 1MB)
[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
fastboot flash lk lk.img
nbgen -b:lk.bin -o:lk.img
[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
supported_boot_partitions[] =
{
{"boot",},
{"sboot"},
{"tboot"},
{"vboot"}, //no uboot :D
{"wboot"},
{"xboot"},
{"yboot"},
{"zboot"},
{""},
};
'fastboot oem key 8' ==> KEY_VOLUMEUP
'fastboot oem key 2' ==> KEY_VOLUMEDOWN
'fastboot oem key 5' ==> KEY_SEND
'fastboot oem key 0' ==> KEY_BACK
[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] (a)CWM Recovery Touch Beta 8 Release Candidate 1 Or (b)TWRP 2.2.2.0 with new zImage (patched tytung's latest GB-kernel)
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] Extended TWRP 2.4.1.0.r1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] Extended TWRP 2.4.1.0.r1
[U]ExtRom:[/U] Disabled
RAMDISK_ADDR := "(BASE_ADDR+0x01000000)"
SCRATCH_ADDR := "(BASE_ADDR+0x02000000)"
[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] Extended TWRP 2.4.1.0.r2
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=8,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] Extended TWRP 2.4.4.0.r1
[U]ExtRom:[/U] Disabled
[U]Default partition table:[/U] recovery=8,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] Extended TWRP 2.5.0.3
[U]ExtRom:[/U] Disabled
The following tools are provided here, for linux(ubuntu 64bit binaries), windows and mac:
Q: What is cLK?