[Q] boot.img - Galaxy S Advance I9070 Q&A, Help & Troubleshooting

how to assemble and disassemble boot.img on this phone?

Stock jb 4.1 uses kernel.bin.md5, cm uses boot.img
I tried many times but never managed (there's a script somewhere in this section but didn't work either for me)
Why do you want to unpack it?
Sent from Italy using Tapatalk

Toni5830 said:
Stock jb 4.1 uses kernel.bin.md5, cm uses boot.img
I tried many times but never managed (there's a script somewhere in this section but didn't work either for me)
Why do you want to unpack it?
Sent from Italy using Tapatalk
Click to expand...
Click to collapse
I want to insert a file init.rc service service
Code:
shelld /system/xbin/shelld
class main

I fear you need to compile kernel from sources..(I can compile stock kernel but don't know how to compile cm one )
Sent from Italy using Tapatalk

Toni5830 said:
I fear you need to compile kernel from sources..(I can compile stock kernel but don't know how to compile cm one )
Sent from Italy using Tapatalk
Click to expand...
Click to collapse
no I do not need to be collected from source

lolo696 said:
no I do not need to be collected from source
Click to expand...
Click to collapse
It depends how it is compiled. I think Frapeti told that some later versions will have possibiliti to be decompiled. I am not into kernels, not sure how and does this version now can be decompiled. And boot.img is only on CM - on stock we have kernel.bin.md5.

Actually kernel.bin.md5 is the zImage renamed with an md5 checksum. There is boot.img in stock too. Boot.img usually contains the zImage and the ramdisk. But in our device the ramdisk is packed in the zImage, this makes the boot.img un-unpackable. So kernel.bin.md5 (the zImage) can be renamed to boot.img because it's the same. I hope you understood this. I tried to explain in the simplest way

and you can follow any responses to add service init.rc ?
Sent from my GT-I9070 using xda app-developers app

Look at post #5, there's an attached file to unpack kernel, but never worked for me..some say it works
http://forum.xda-developers.com/showthread.php?t=2115337
Sent from Italy using Tapatalk

But in our device the ramdisk is packed in the zImage, this makes the boot.img un-unpackable.
Click to expand...
Click to collapse
Read this from KINGbabasula post.

I'm quite sure I can read -.-
Quoting Cocafe:
#!/bin/bash
# This is an update version of the script found at
# http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
#
# The problem with that script is that the gzip magic number occasionally occur
# naturally, meaning that some non-compressed files get uncompressed.
DEBUG=
TEMP_DIR=/tmp
KERNEL_FILE=kernel
KERNEL_GZIP_FILE=kernel.gz
INITRAMFS_FILE=initramfs.cpio
INITRAMFS_DIR=initramfs_root
# DO NOT MODIFY BELOW THIS LINE
[ -z $1 ] && exit 1 || zImage=$1
[ ! -e $1 ] && exit 1
#GET CURRENT DIR
CURRENT_DIR=`pwd`
function pre_clean()
{
[ -z $DEBUG ] || echo "-D- Function: pre_clean()"
[ -e $INITRAMFS_FILE ] && ( [ -z $DEBUG ] || echo "-D- Deleting $INITRAMFS_FILE"; rm -f $INITRAMFS_FILE )
[ -e $INITRAMFS_DIR ] && ( [ -z $DEBUG ] || echo "-D- Deleting $INITRAMFS_DIR"; rm -rf $INITRAMFS_DIR )
[ -z $DEBUG ] || echo
}
function ungzip_kernel()
{
#========================================================
# find start of gziped kernel object in the zImage file:
#========================================================
[ -z $DEBUG ] || echo "-D- Function: ungzip_kernel()"
pos=`grep -P -a -b -m 1 --only-matching '\x1F\x8B\x08' $zImage | cut -f 1 -d :`
echo "-I- Extracting gzip'd kernel image from file: $zImage (start = $pos)"
if [ ! -z $pos ]; then
dd if=$zImage of=$TEMP_DIR/$KERNEL_GZIP_FILE bs=1 skip=$pos 2>/dev/null >/dev/null
gunzip -qf $TEMP_DIR/$KERNEL_GZIP_FILE
else
echo "-E- Compressed kernel image not found"; exit 1
fi
[ -z $DEBUG ] || echo
}
function search_cpio()
{
#========================================================
# Determine cpio compression type:
#========================================================
[ -z $DEBUG ] || echo "-D- Function: search_cpio()"
for x in gzip bzip lzma none; do
case $x in
bzip)
csig='\x{31}\x{41}\x{59}\x{26}\x{53}\x{59}'
ucmd='bunzip2 -q'
fext='.bz2'
;;
gzip)
csig='\x1F\x8B\x08'
ucmd='gunzip -q'
fext='.gz'
;;
lzma)
csig='\x{5D}\x{00}\x..\x{FF}\x{FF}\x{FF}\x{FF}\x{FF}\x{FF}'
ucmd='unlzma -q'
fext='.lzma'
;;
none)
csig='070701'
ucmd=
fext=
;;
esac
#========================================================================
# Search for compressed cpio archive
#========================================================================
search=`grep -P -a -b -m 1 --only-matching $csig $TEMP_DIR/$KERNEL_FILE | cut -f 1 -d : | head -1`
pos=${search:-0}
if [ ${pos} -gt 0 ]; then
if [ ${pos} -le ${cpio_compressed_start:-0} ] || [ -z $cpio_compressed_start ];then
cpio_compressed_start=$pos
compression_name=$x
compression_signature=$csig
uncompress_cmd=$ucmd
file_ext=$fext
[ -z $DEBUG ] || echo "-D- Checking for compression type: $compression_name | signature: $compression_signature | in file: $TEMP_DIR/$KERNEL_FILE | offset = $pos"
fi
fi
done
[ $compression_name = "bzip" ] && cpio_compressed_start=$((cpio_compressed_start - 4))
echo "-I- CPIO compression type detected = $compression_name | offset = $cpio_compressed_start"
[ -z $DEBUG ] || echo
}
function extract_cpio()
{
[ -z $DEBUG ] || echo "-D- Function: extract_cpio()"
if [ ! $compression_name = "none" ]; then
echo "-I- Extracting $compression_name'd compressed CPIO image from kernel image (offset = $cpio_compressed_start)"
[ -z $DEBUG ] || echo "-D- dd if=$TEMP_DIR/$KERNEL_FILE of=$TEMP_DIR/$INITRAMFS_FILE$file_ext bs=1 skip=$cpio_compressed_start; $uncompress_cmd $TEMP_DIR/$INITRAMFS_FILE$file_ext"
dd if=$TEMP_DIR/$KERNEL_FILE of=$TEMP_DIR/$INITRAMFS_FILE$file_ext bs=1 skip=$cpio_compressed_start 2>/dev/null >/dev/null
$uncompress_cmd -q $TEMP_DIR/$INITRAMFS_FILE$file_ext
else
echo "-I- Extracting non-compressed CPIO image from kernel image (offset = $cpio_compressed_start)"
[ -z $DEBUG ] || echo "-D- dd if=$TEMP_DIR/$KERNEL_FILE of=$TEMP_DIR/${INITRAMFS_FILE}${file_ext} bs=1 skip=$cpio_compressed_start 2>/dev/null >/dev/null"
dd if=$TEMP_DIR/$KERNEL_FILE of=$TEMP_DIR/${INITRAMFS_FILE}${file_ext} bs=1 skip=$cpio_compressed_start 2>/dev/null >/dev/null
fi
[ -z $DEBUG ] || echo
}
function uncompress_cpio()
{
#==========================================================================
# find start and end of the "cpio" initramfs image inside the kernel object:
# ASCII cpio header starts with '070701'
# The end of the cpio archive is marked with an empty file named TRAILER!!!
#==========================================================================
[ -z $DEBUG ] || echo "-D- Function: uncompress_cpio()"
if [ ! $compress_type = "none" ]; then
start=`grep -a -b -m 1 --only-matching '070701' $TEMP_DIR/$INITRAMFS_FILE | head -1 | cut -f 1 -d :`
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' $TEMP_DIR/$INITRAMFS_FILE | head -1 | cut -f 1 -d :`
if [ ! -z $start ] || [ ! -z $end ]; then
#11 bytes = length of TRAILER!!! zero terminated string, fixes premature end of file warning in CPIO
end=$((end + 14))
[ -z $DEBUG ] || echo "-D- Kernel start = $start"
[ -z $DEBUG ] || echo "-D- Kernel end = $end"
count=$((end - start))
if (($count < 0)); then
echo "-E- Couldn't match start/end of the initramfs image."
exit 1
fi
echo "-I- Extracting initramfs image from file: $inputfile (start = $start, end = $end)"
dd if=$TEMP_DIR/$INITRAMFS_FILE of=$CURRENT_DIR/$INITRAMFS_FILE bs=1 skip=$start count=$count 2>/dev/null >/dev/null
INITRAMFS_FILE=$CURRENT_DIR/$INITRAMFS_FILE
else
echo "-E- No CPIO image found in $inputfile."
fi
else
echo "-I- CPIO already uncompressed."
fi
[ -z $DEBUG ] || echo
}
function expand_cpio_archive()
{
[ -z $DEBUG ] || echo "-D- Function: expand_cpio_archive()"
echo "-I- Expanding CPIO archive: $INITRAMFS_FILE to $INITRAMFS_DIR."
if [ -e $TEMP_DIR/$INITRAMFS_FILE ]; then
mkdir $INITRAMFS_DIR
cd $INITRAMFS_DIR
cpio --quiet -i --make-directories --preserve-modification-time --no-absolute-filenames -F $TEMP_DIR/$INITRAMFS_FILE 2>/dev/null
fi
[ -z $DEBUG ] || echo
}
function clean_up()
{
[ -z $DEBUG ] || echo "-D- Deleting $TEMP_DIR/$KERNEL_FILE"; rm -f $TEMP_DIR/$KERNEL_FILE
[ -z $DEBUG ] || echo "-D- Deleting $TEMP_DIR/$INITRAMFS_FILE"; rm -f $TEMP_DIR/$INITRAMFS_FILE
[ -z $DEBUG ] || echo "-D- Deleting $TEMP_DIR/$INITRAMFS_FILE$file_ext"; rm -f $TEMP_DIR/$INITRAMFS_FILE$file_ext
}
reset
pre_clean
ungzip_kernel
search_cpio
extract_cpio
uncompress_cpio
expand_cpio_archive
clean_up
Click to expand...
Click to collapse
Save this QUOTE as a file name unpack_initramfs.sh
Use:
./unpack_initramfs.sh kernel.bin.md5
Click to expand...
Click to collapse
-I- Extracting gzip'd kernel image from file: kernel.bin.md5 (start = 18528)
-I- CPIO compression type detected = none | offset = 219120
-I- Extracting non-compressed CPIO image from kernel image (offset = 219120)
-I- CPIO already uncompressed.
-I- Expanding CPIO archive: initramfs.cpio to initramfs_root.
Click to expand...
Click to collapse
Then you should have stock ramdisk
Click to expand...
Click to collapse
Worked for Cocafe but never worked for me:/ maybe because Cocore-e's compression is now set to lzo
Last 2 things then I'll leave:
1) Frapeti said next cm kernel will be possible to unpack (check dual boot thread)
2) I don't know how to repack it
Sent from Italy using Tapatalk

Toni5830 said:
I'm quite sure I can read -.-
Quoting Cocafe:
Worked for Cocafe but never worked for me:/ maybe because Cocore-e's compression is now set to lzo
Last 2 things then I'll leave:
1) Frapeti said next cm kernel will be possible to unpack (check dual boot thread)
2) I don't know how to repack it
Sent from Italy using Tapatalk
Click to expand...
Click to collapse
I never saw before that script
Here you can find how to unpack and repack a "normal" boot.img with tools for cygwin too https://github.com/KINGbabasula/boot.img-tools

Related

[Q] how to move dalvik-cache to ext in cm7.1.0 RC5 11.05.20?

milestone 1 on cm7 0.08-11.04.24 7.0.1 , i have one ext3 partition on my sdcard, everything was working fine,
but after upgrading to cm7.1.0 RC0 11.05.03 yesterday , i can't move the dalvik-cache to ext partition any longer.
even if i do this
mv /data/dalvik-cache /sddata/dalvik-cache
ln -s /sd-ext/dalvik-cache/ /data/dalvik-cache
next time phone reboots, it delete my link and create dalvik-cache directory in "internal storage" while not on my ext3 partition
when i boot into OR 3.3 , the ext3 partition is mounted as /sddata
if i boot into phone ui, the ext3 partition is mounted as /sd-ext
i tiried linking to both directory , none of them works
anyone knows how to do it ?
[edit] after updating to 7.1.0 RC5 11.05.20, the file update-07app2ext-dalvik.on.ext.zip provided by zeppelin doesn't work , ahhhhh.
You will need to edit the 07app2ext file in /system/etc/init.d
Yep.
I did this yesterday actually since my internal storage was getting too low for my liking.
From github, the earlier 07app2ext:
Code:
#!/system/bin/sh
if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext
fi
if [ "`egrep -q $SD_EXT_DIRECTORY /proc/mounts;echo $?`" != "0" ];
then
echo "$SD_EXT_DIRECTORY not mounted.. skipping a2sd"
exit
fi
for dir in app app-private dalvik-cache;do
if [ "`egrep -q \"/data/${dir}\" /proc/mounts;echo $?`" != "0" ];
then
if [ ! -e "${SD_EXT_DIRECTORY}/${dir}" ];
then
install -m 771 -o 1000 -g 1000 -d ${SD_EXT_DIRECTORY}/${dir}
fi
if [ -L "/data/${dir}" ];
then
rm /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
if [ "${dir}" = "dalvik-cache" ];
then
if [ ! -L "/data/${dir}" ];
then
rm -rf /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
fi
if [ "${dir}" = "app" -o "${dir}" = "app-private" ];
then
for app in `find /data/${dir} -type f -iname "*.apk" -o -iname "*.zip"`;do
mv ${app} ${SD_EXT_DIRECTORY}/${dir}/
done
fi
mount -o bind ${SD_EXT_DIRECTORY}/${dir}/ /data/${dir}
fi
done
chmod 755 /system/etc/init.d/07app2ext
chown -R 0.2000 /system/etc/init.d
sleep 1
I just started using s2e from the market, its working so far
zeppelinrox said:
Yep.
I did this yesterday actually since my internal storage was getting too low for my liking.
From github, the earlier 07app2ext:
Code:
#!/system/bin/sh
if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext
fi
if [ "`egrep -q $SD_EXT_DIRECTORY /proc/mounts;echo $?`" != "0" ];
then
echo "$SD_EXT_DIRECTORY not mounted.. skipping a2sd"
exit
fi
for dir in app app-private dalvik-cache;do
if [ "`egrep -q \"/data/${dir}\" /proc/mounts;echo $?`" != "0" ];
then
if [ ! -e "${SD_EXT_DIRECTORY}/${dir}" ];
then
install -m 771 -o 1000 -g 1000 -d ${SD_EXT_DIRECTORY}/${dir}
fi
if [ -L "/data/${dir}" ];
then
rm /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
if [ "${dir}" = "dalvik-cache" ];
then
if [ ! -L "/data/${dir}" ];
then
rm -rf /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
fi
if [ "${dir}" = "app" -o "${dir}" = "app-private" ];
then
for app in `find /data/${dir} -type f -iname "*.apk" -o -iname "*.zip"`;do
mv ${app} ${SD_EXT_DIRECTORY}/${dir}/
done
fi
mount -o bind ${SD_EXT_DIRECTORY}/${dir}/ /data/${dir}
fi
done
chmod 755 /system/etc/init.d/07app2ext
chown -R 0.2000 /system/etc/init.d
sleep 1
Click to expand...
Click to collapse
It works on MIUI?
I think so.
It's based on CM7, yeah?
If people are using app2ext on MIUI then I'd say yes.
If it has an 07app2ext file, then it's 100% guaranteed.
What I did was I replaced the 07app2ext file in the update zip with the one above so when it gets flashed I don't have to do anything.
It has an 07app2ext file, so a replace with this and my app2ext didnt work anymore...
There is my older app2ext code:
Code:
#!/system/bin/sh
if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext
fi
if [ "`egrep -q $SD_EXT_DIRECTORY /proc/mounts;echo $?`" != "0" ];
then
echo "$SD_EXT_DIRECTORY not mounted.. skipping a2sd"
exit
fi
if [ -L "/data/dalvik-cache" ];
then
rm /data/dalvik-cache
install -m 771 -o 1000 -g 1000 -d /data/dalvik-cache
fi
if [ -e "${SD_EXT_DIRECTORY}/dalvik-cache" ];
then
rm -rf ${SD_EXT_DIRECTORY}/dalvik-cache
fi
for dir in app app-private;do
if [ "`egrep -q \"/data/${dir}\" /proc/mounts;echo $?`" != "0" ];
then
if [ ! -e "${SD_EXT_DIRECTORY}/${dir}" ];
then
install -m 771 -o 1000 -g 1000 -d ${SD_EXT_DIRECTORY}/${dir}
fi
if [ -L "/data/${dir}" ];
then
rm /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
if [ "${dir}" = "app" -o "${dir}" = "app-private" ];
then
for app in `find /data/${dir} -type f -iname "*.apk" -o -iname "*.zip"`;do
mv ${app} ${SD_EXT_DIRECTORY}/${dir}/
done
fi
mount -o bind ${SD_EXT_DIRECTORY}/${dir}/ /data/${dir}
fi
done
ah... sometimes that happens...
If you were to put that in the MIUI update zip and flash it, it will work.
I don't know why that happens.
When it happened to me I couldnt figure it out either since I made sure the permissions stayed the same. Maybe it would work as a standalone flashable zip but I have never made one.
Zeppe, can you send me your 07app2ext and tell me what permissions it have? I have 500 mb in the ext partition but i can load it to maximum 'cause my internal storage get full. Now i have about 80 apps, and only 22mb left in the internal storage.
Attached.
Permissions are the same as other files in ect/init.d
xxx
xox
ooo
But when I did it manually, it didn't work
edit... try the attached update.zip... it just might work
either way, the file is in there.
BAZINGA! lol!! It works!!! Thanks a lot zeppelin!
heh
Sent from my Milestone using Tapatalk
zeppelinrox said:
Attached.
Permissions are the same as other files in ect/init.d
xxx
xox
ooo
But when I did it manually, it didn't work
edit... try the attached update.zip... it just might work
either way, the file is in there.
Click to expand...
Click to collapse
zeppelinrox, can I apply this update on CM7 RC10? Is it safe to do it?
I want to move my dalvik cache to ext2 because my internal storage its almost full (less than 20MB free).
Yes its fine.
It's a mod of an overclock flashable zip so when you flash it, it gives an overclock related message.
You can also replace the app2ext script in the cm7 update with the one in this zip file with 7zip and without extracting the cm7 update.
I just leave it in AOR's update folder tho.
So when I flash a rom, I flash this too
Sent from my Milestone using Tapatalk
Thanks for this script, it works perfectly.
I've applied the update from AOR and after move any app from SD to ext2 and reboot, CM7 moves dalvik cache for that apps to ext2.
Now, I suppose any time I update the ROM then before reboot I need to apply this script again.
Sent from my Milestone using XDA App
Yes as an update would probably overwrite this app2ext script
Sent from my Milestone using Tapatalk

[Mod][Flash] Universal Bootanimation Flash Update.zip - Sense|AOSP|Sprint|HTC|Verizon

Hello World.
Tommy here. This time I have a nifty little trick for you guys.
This took a little creative thinking but I think I got it pretty good. I was chatting with some Team Ramen Noodles guys and someone asked how an AOSP botanimaiton zip can be flashed on a Sense ROM. This was the lightbulb moment
Instructions for dev:
Download from link below.
Place the file "bootanimation.zip" inside the update.zip. I put a placeholder so you would know where to replace it.
Optionally, you can put a sound "android_audio.mp3". If you don't want it, then just leave it out. Not necessary.
When you open it up, you will see two place holder files, "bootanimaion.zip__HERE" and "android_audo.mp3__HERE". You can delete them if you want, but they don't do anything. Just for reference.
Files must be named "bootanimation.zip" and "android_audio.zip", otherwise won't work.
The script "tt_uni_boot" looks for the animation and sound in the rom, and replaces it depending on what it finds.
This works on AOSP, Sense, Sprint, HTC, and Verizion
The update.zip below is what you should use as your base if you want to make your bootanimation universal for all roms.
Also, if anyone wants to flash it as is, it contains this lovely animation:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Original Thread Here for HTC Animation
Universal Bootanimation update.zip v0.0.1 - January 08, 2012
Enjoy!
Please report feedback. I and dean_fx tested it before I posted, but if you want different feature or something like that let me know.
Tommy
edit1.
And in case anyone wants to adapt my script, I am more than happy to share. Just give a little credit
Sharing means caring. And collaborative efforts yield better results.
Code:
#!/system/bin/bash
#tommytomatoe
#universal animation flasher
# creating logfile "lockscreen" on sdcard
log=sdcard/bootanimation.log
touch $log
# mounting system as R/W
busybox mount -o remount,rw /system
echo "/system mounted as R/W" > $log
echo "" >> $log
# doing some checks
# bootanimation locatioon
if busybox [ -e /system/customize/resource/bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/bootanimation.zip
elif busybox [ -e /data/local/bootanimation.zip ]; then
BOOT_ANI=/data/local/bootanimation.zip
elif busybox [ -e /system/media/bootanimation.zip ]; then
BOOT_ANI=/system/media/bootanimation.zip
elif busybox [ -e /system/customize/resource/spc_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/spc_bootanimation.zip
elif busybox [ -e /data/local/spc_bootanimation.zip ]; then
BOOT_ANI=/data/local/spc_bootanimation.zip
elif busybox [ -e /system/media/spc_bootanimation.zip ]; then
BOOT_ANI=/system/media/spc_bootanimation.zip
elif busybox [ -e /system/customize/resource/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/VZW_bootanimation.zip
elif busybox [ -e /data/local/VZW_bootanimation.zip ]; then
BOOT_ANI=/data/local/VZW_bootanimation.zip
elif busybox [ -e /system/media/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/media/VZW_bootanimation.zip
elif busybox [ -e /system/customize/resource/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/hTC_bootanimation.zip
elif busybox [ -e /data/local/hTC_bootanimation.zip ]; then
BOOT_ANI=/data/local/hTC_bootanimation.zip
elif busybox [ -e /system/media/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/media/hTC_bootanimation.zip
else
echo "Bootanimation does not exist" >> $log
exit 1
fi
# bootanimation sound location
if busybox [ -e /system/customize/resource/android_media.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_media.mp3
elif busybox [ -e /data/local/android_media.mp3 ]; then
BOOT_SOUND=/data/local/android_media.mp3
elif busybox [ -e /system/media/android_media.mp3 ]; then
BOOT_SOUND=/system/media/android_media.mp3
elif busybox [ -e /system/customize/resource/android_audio.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_audio.mp3
elif busybox [ -e /data/local/android_audio.mp3 ]; then
BOOT_SOUND=/data/local/android_audio.mp3
elif busybox [ -e /system/media/android_audio.mp3 ]; then
BOOT_SOUND=/system/media/android_audio.mp3
elif busybox [ -e /system/customize/resource/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/customize/resource/SPC_animation_final.mp3
elif busybox [ -e /data/local/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/data/local/SPC_animation_final.mp3
elif busybox [ -e /system/media/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/media/SPC_animation_final.mp3
else
echo "Bootanimation sound does not exist" >> $log
fi
echo "$BOOT_ANI" >> $log
echo "$BOOT_SOUND" >> $log
echo "" >> $log
# moving animation
busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
if busybox [ -e /data/local/tmp/bootanimation.zip ] ; then
buxybox rm -f /data/local/tmp/bootanimation.zip
fi
if busybox [ -e $BOOT_ANI ] ; then
echo "SUCCESS! Bootanimation moved to $BOOT_ANI" >> $log
else
echo "FAILURE! Bootanimation not moved to $BOOT_ANI" >> $log
fi
echo "" >> $log
# moving busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
busybox mv -f /data/local/tmp/android_audio.mp3 $BOOT_SOUND
if busybox [ -e /data/local/tmp/android_audio.mp3 ] ; then
buxybox rm -f /data/local/tmp/android_audio.mp3
fi
if busybox [ -e $BOOT_SOUND ] ; then
echo "SUCCESS! Bootanimation sound moved to $BOOT_SOUND" >> $log
else
echo "FAILURE! Bootanimation sound moved to $BOOT_SOUND" >> $log
fi
echo "" >> #log
echo "Universal Bootanimation Flasher Commencing" >> $log
Sent from my PC36100 using Tapatalk
The bottom of that post was Spanish to me
Sent from my HTC Droid Incredible using xda premium
Alton (Halo 2) said:
The bottom of that post was Spanish to me
Sent from my HTC Droid Incredible using xda premium
Click to expand...
Click to collapse
Lol
Sent from my PC36100 using Tapatalk
7th (#) line you splled location wrong in your script...maybe it still works... I don't know how this stuff works, I just use it
hovercraftdriver said:
7th (#) line you splled location wrong in your script...maybe it still works... I don't know how this stuff works, I just use it
Click to expand...
Click to collapse
Good eye
It isn't affected. In bash and shell the character # ignores all values that appear after it on the same line.
I'll still fix it later
Sent from my PC36100 using Tapatalk
LOL I spelled "spelled" wrong anyway...
hovercraftdriver said:
LOL I spelled "spelled" wrong anyway...
Click to expand...
Click to collapse
Lol. Double fail (you and me)
sent from my HP touchpad
tommytomatoe said:
Hello World.
Tommy here. This time I have a nifty little trick for you guys.
This took a little creative thinking but I think I got it pretty good. I was chatting with some Team Ramen Noodles guys and someone asked how an AOSP botanimaiton zip can be flashed on a Sense ROM. This was the lightbulb moment
Instructions for dev:
Download from link below.
Place the file "bootanimation.zip" inside the update.zip. I put a placeholder so you would know where to replace it.
Optionally, you can put a sound "android_audio.mp3". If you don't want it, then just leave it out. Not necessary.
When you open it up, you will see two place holder files, "bootanimaion.zip__HERE" and "android_audo.mp3__HERE". You can delete them if you want, but they don't do anything. Just for reference.
Files must be named "bootanimation.zip" and "android_audio.zip", otherwise won't work.
The script "tt_uni_boot" looks for the animation and sound in the rom, and replaces it depending on what it finds.
This works on AOSP, Sense, Sprint, HTC, and Verizion
The update.zip below is what you should use as your base if you want to make your bootanimation universal for all roms.
Also, if anyone wants to flash it as is, it contains this lovely animation:
Original Thread Here for HTC Animation
Universal Bootanimation update.zip v0.0.1 - January 08, 2012
Enjoy!
Please report feedback. I and dean_fx tested it before I posted, but if you want different feature or something like that let me know.
Tommy
edit1.
And in case anyone wants to adapt my script, I am more than happy to share. Just give a little credit
Sharing means caring. And collaborative efforts yield better results.
Code:
#!/system/bin/bash
#tommytomatoe
#universal animation flasher
# creating logfile "lockscreen" on sdcard
log=sdcard/bootanimation.log
touch $log
# mounting system as R/W
busybox mount -o remount,rw /system
echo "/system mounted as R/W" > $log
echo "" >> $log
# doing some checks
# bootanimation locatioon
if busybox [ -e /system/customize/resource/bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/bootanimation.zip
elif busybox [ -e /data/local/bootanimation.zip ]; then
BOOT_ANI=/data/local/bootanimation.zip
elif busybox [ -e /system/media/bootanimation.zip ]; then
BOOT_ANI=/system/media/bootanimation.zip
elif busybox [ -e /system/customize/resource/spc_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/spc_bootanimation.zip
elif busybox [ -e /data/local/spc_bootanimation.zip ]; then
BOOT_ANI=/data/local/spc_bootanimation.zip
elif busybox [ -e /system/media/spc_bootanimation.zip ]; then
BOOT_ANI=/system/media/spc_bootanimation.zip
elif busybox [ -e /system/customize/resource/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/VZW_bootanimation.zip
elif busybox [ -e /data/local/VZW_bootanimation.zip ]; then
BOOT_ANI=/data/local/VZW_bootanimation.zip
elif busybox [ -e /system/media/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/media/VZW_bootanimation.zip
elif busybox [ -e /system/customize/resource/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/hTC_bootanimation.zip
elif busybox [ -e /data/local/hTC_bootanimation.zip ]; then
BOOT_ANI=/data/local/hTC_bootanimation.zip
elif busybox [ -e /system/media/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/media/hTC_bootanimation.zip
else
echo "Bootanimation does not exist" >> $log
exit 1
fi
# bootanimation sound location
if busybox [ -e /system/customize/resource/android_media.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_media.mp3
elif busybox [ -e /data/local/android_media.mp3 ]; then
BOOT_SOUND=/data/local/android_media.mp3
elif busybox [ -e /system/media/android_media.mp3 ]; then
BOOT_SOUND=/system/media/android_media.mp3
elif busybox [ -e /system/customize/resource/android_audio.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_audio.mp3
elif busybox [ -e /data/local/android_audio.mp3 ]; then
BOOT_SOUND=/data/local/android_audio.mp3
elif busybox [ -e /system/media/android_audio.mp3 ]; then
BOOT_SOUND=/system/media/android_audio.mp3
elif busybox [ -e /system/customize/resource/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/customize/resource/SPC_animation_final.mp3
elif busybox [ -e /data/local/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/data/local/SPC_animation_final.mp3
elif busybox [ -e /system/media/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/media/SPC_animation_final.mp3
else
echo "Bootanimation sound does not exist" >> $log
fi
echo "$BOOT_ANI" >> $log
echo "$BOOT_SOUND" >> $log
echo "" >> $log
# moving animation
busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
if busybox [ -e /data/local/tmp/bootanimation.zip ] ; then
buxybox rm -f /data/local/tmp/bootanimation.zip
fi
if busybox [ -e $BOOT_ANI ] ; then
echo "SUCCESS! Bootanimation moved to $BOOT_ANI" >> $log
else
echo "FAILURE! Bootanimation not moved to $BOOT_ANI" >> $log
fi
echo "" >> $log
# moving busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
busybox mv -f /data/local/tmp/android_audio.mp3 $BOOT_SOUND
if busybox [ -e /data/local/tmp/android_audio.mp3 ] ; then
buxybox rm -f /data/local/tmp/android_audio.mp3
fi
if busybox [ -e $BOOT_SOUND ] ; then
echo "SUCCESS! Bootanimation sound moved to $BOOT_SOUND" >> $log
else
echo "FAILURE! Bootanimation sound moved to $BOOT_SOUND" >> $log
fi
echo "" >> #log
echo "Universal Bootanimation Flasher Commencing" >> $log
Sent from my PC36100 using Tapatalk
Click to expand...
Click to collapse
tommy that is the exact bootanimation I am trying to change in supermagic preview 0.0.0.6 ..... I've d/l so many boot animations I have lost track. Where in supermagic preview is the original bootanimation script, that I have to replace, and what do I call it's replacement?
Thanks
RascalDoc said:
tommy that is the exact bootanimation I am trying to change in supermagic preview 0.0.0.6 ..... I've d/l so many boot animations I have lost track. Where in supermagic preview is the original bootanimation script, that I have to replace, and what do I call it's replacement?
Thanks
Click to expand...
Click to collapse
Just follow the instructions on the post.
Download this zip.
Download your desired bootanimation.
Rename the bootanimation "bootabimation.zip".
Replace the one inside the zip from me with the one you renamed in the step above.
Put zip in pshoe and flash.
This zip will automatically find the current bootanimation and replace it for you. The one I included in the zip is just a placeholder so you know what to replace.
For future reference in classic it is in /system/customize/resource/spc_bootanimation.zip
Sent from my PC36100 using Tapatalk
Tommy
couldn't find the zip (I did find it later) but I renamed as prescribed the boot animation and placed it where you said to place it and lo and behold .... It Works It Works!!!!!!
Thanks.
Doc W.
RascalDoc said:
couldn't find the zip (I did find it later) but I renamed as prescribed the boot animation and placed it where you said to place it and lo and behold .... It Works It Works!!!!!!
Thanks.
Doc W.
Click to expand...
Click to collapse
Woot woot!!!
Sent from my PC36100 using Tapatalk
i would like to use your animation as an animated background in notification area.
http://forum.xda-developers.com/showthread.php?t=1309130
i will give you credit of course.
synisterwolf said:
i would like to use your animation as an animated background in notification area.
http://forum.xda-developers.com/showthread.php?t=1309130
i will give you credit of course.
Click to expand...
Click to collapse
Go for it!
Sent from my PC36100 using Tapatalk
ermm. The download link is down? I would really like to use your update.zip for my bootanimation(With credits of course). Thanks in advance
Let me find the file on ny computer
Sent from my PG86100 using Tapatalk 2
Dont want to be pushy or anything, but can you find the file?
Sent from my HTC EVO 3D X515m using XDA

Bricked TP revival tip, SEE POST 2

Is anyone aware if there's anybody that will repair a bricked TP?
jlc0312 said:
Did you have the questionmark of death(QOD)? I had QOD before it died completely and jcsullins walkthrough fixed it. jcsullins is a boss dog, he has been walking people through unbricking their touchpads for over a month, and today came out with a do it yourself guide.
http://rootzwiki.com/topic/38786-tpdebrick-v004/
best of luck
Click to expand...
Click to collapse
I did this yesterday and successfully revived my brothers completely dead touchpad. Wanted to post a link but found you already posted. Anyway here is what I learnt and I hope it helps others.
Steps from jsullins procedure:
1) download a ubuntu i386 iso, burn it to a usb drive using pendrivelinux (a windows tool). Make sure you set atleast 1GB for the reusable R/W filesystem (casper filesystem). Note: a virtual instance of ubuntu will NOT work.
2) boot into ubuntu, change your bios settings to allow usb booting if needed
3) follow the guide. the simple steps are
a) download the webosdoctor jar file
b) download the tpdebrick004 zip
c) extract tpdebrick004
d) connect your tochpad via usb and hold the power+home+vol down buttons for 20-30 seconds
e) run the tpdebrick script with the storage size as parameter.
ex: sudo tpdebrick 32
note: if you use a version of ubuntu other than 12.04 you will need to edit ("sudo gedit tpdebrick")the tpdebrick script and change the version check code to look for that version instead of 12.04. i.e change 12.04 to 12.10 or 13.04 (as applicable)
f) the script installs fastboot, dfu-util and other components and then proceeds with the de-bricking process. wait till you see "ALL DONE". If it asks for a root password just keep pressing enter.
4) charge your touchpad for 5-10 hours on the 2A charger. You should see the home button blinking at this point.
Thanks, I will try this when I get the chance.
I've changed the thread title
Would this work if the battery is completely dead. I believe mine is. I get absolutely no response from the touchpad. Tried all the button combinations with two different original chargers and tried trickle charging it. If my battery went below the safe threshold would I have to replace it?
zaq123 said:
Would this work if the battery is completely dead. I believe mine is. I get absolutely no response from the touchpad. Tried all the button combinations with two different original chargers and tried trickle charging it. If my battery went below the safe threshold would I have to replace it?
Click to expand...
Click to collapse
You would need to fully charge using the charging block. If you elect to charge through a PC/Laptop USB it should charge for several days. Using the block only needs 5-6 hours to accomplish the steps. Then a full charge would need to be accomplished using the block.
TonyStark said:
You would need to fully charge using the charging block. If you elect to charge through a PC/Laptop USB it should charge for several days. Using the block only needs 5-6 hours to accomplish the steps. Then a full charge would need to be accomplished using the block.
Click to expand...
Click to collapse
Left it on the charging block for 30 hours still no response and the tpdebrick does not find the device. Is it gone? I read on some posts that if the voltage drops below a certain threshold it wont charge anymore.
zaq123 said:
Left it on the charging block for 30 hours still no response and the tpdebrick does not find the device. Is it gone? I read on some posts that if the voltage drops below a certain threshold it wont charge anymore.
Click to expand...
Click to collapse
Hadn't read that, however I needed to replace my block and usb (new OE). I realized mine wasn't up to par.
zaq123 said:
Left it on the charging block for 30 hours still no response and the tpdebrick does not find the device. Is it gone? I read on some posts that if the voltage drops below a certain threshold it wont charge anymore.
Click to expand...
Click to collapse
Does anything happen if:
1: You hold power and volume up
2: power and home buttons for at least 30 seconds preferably a minute.
3 if you connect to your PC does anything show in device manager or when you right click on the safely remove icon.
sstar said:
Does anything happen if:
1: You hold power and volume up
2: power and home buttons for at least 30 seconds preferably a minute.
3 if you connect to your PC does anything show in device manager or when you right click on the safely remove icon.
Click to expand...
Click to collapse
I get no response doing any of those or any other button combination that has been suggested on different forums. I know the charger is good since i have another touchpad that I use it with. It is an original hp. I ordered a touchstone since some people have has success getting the touchstone to charge it when the regular would not.
Any other suggestions would be appreciated. Thanks
zaq123 said:
Would this work if the battery is completely dead.
Click to expand...
Click to collapse
Yup that's what I wrote
britoso said:
Yup that's what I wrote
Click to expand...
Click to collapse
It doesnt work I get no response. lipo batteries wont charge if they go below a certain voltage for safety reasons. On this battery it is 3.6/37 volts. Unless you use a lipo charger which are dangerous since you can end up with a fire.
Anyways I get no response at all pressing any combination of buttons.
When tpdebrick says to press power + home + vol-down it gives no response.
Any ideas?
zaq123 said:
It doesnt work I get no response. lipo batteries wont charge if they go below a certain voltage for safety reasons. On this battery it is 3.6/37 volts. Unless you use a lipo charger which are dangerous since you can end up with a fire.
Anyways I get no response at all pressing any combination of buttons.
When tpdebrick says to press power + home + vol-down it gives no response.
Any ideas?
Click to expand...
Click to collapse
I'm on the same boat, I did get the "all done" message after running the tpdebrick, im on hour 3 of charging, nothing yet, will post soon, fingers crossed, TP dead for over 3 months now
zaq123 said:
It doesnt work I get no response. lipo batteries wont charge if they go below a certain voltage for safety reasons. On this battery it is 3.6/37 volts. Unless you use a lipo charger which are dangerous since you can end up with a fire.
Anyways I get no response at all pressing any combination of buttons.
When tpdebrick says to press power + home + vol-down it gives no response.
Any ideas?
Click to expand...
Click to collapse
You are plugged in to a usb port and holding the 3 buttons for 20+ seconds right? Maybe you can leave it on the charger for a day first.
The one I fixed was dead for almost a year. the script failed to read the battery level.
britoso said:
You are plugged in to a usb port and holding the 3 buttons for 20+ seconds right? Maybe you can leave it on the charger for a day first.
The one I fixed was dead for almost a year. the script failed to read the battery level.
Click to expand...
Click to collapse
I tried that left it plugged in for almost two days. tried both the hp charger and a trickle charge. Right now I have it on a touchstone maybe that will work.
Tried all the button combinations still hoping.
miroxlava said:
I'm on the same boat, I did get the "all done" message after running the tpdebrick, im on hour 3 of charging, nothing yet, will post soon, fingers crossed, TP dead for over 3 months now
Click to expand...
Click to collapse
#!/bin/sh
###################################
### TPDebrick v004 by jcsullins ###
###################################
check_pgms()
{
local have_other=1
local ok_install=0
local lsb_rel
local lsb_id
local SP
if ! `which perl >/dev/null 2>&1`;
then
echo "perl not found"
echo "Aborting."
exit 1
fi
lsb_rel=`lsb_release --short --release`
lsb_id=`lsb_release --short --id`
if [ -n "$lsb_rel" -a -n "${lsb_id}" -a "${lsb_id}" = "Ubuntu" ];
then
if [ "${lsb_rel}" = "11.04" -o "${lsb_rel}" = "11.10" -o "${lsb_rel}" = "12.04" ];
then
ok_install=1
fi
fi
if ! `which dfu-util >/dev/null 2>&1`;
then
echo "dfu-util not installed"
have_other=0
fi
if ! `which fastboot >/dev/null 2>&1`;
then
echo "fastboot not installed"
have_other=0
fi
if [ $have_other -eq 1 ];
then
return;
fi
if [ $ok_install -eq 0 ];
then
echo "Aborted."
exit 1
fi
if `which software-properties-kde >/dev/null 2>&1`;
then
SP=software-properties-kde
else
SP=software-properties-gtk
fi
echo "Installing dfu-util/fastboot ..."
$SP --enable-component universe
if [ $? -ne 0 ];
then
echo "Enable universe failed."
echo "Aborted."
exit 1
fi
add-apt-repository --yes ppa:nilarimogard/webupd8
if [ $? -ne 0 ];
then
echo "add-apt-repository failed"
echo "Aborted."
exit 1
fi
apt-get update
if [ $? -ne 0 ];
then
echo "apt-get update failed"
echo "Aborted."
exit 1
fi
apt-get --yes install dfu-util
if [ $? -ne 0 ];
then
echo "install dfu-util failed"
echo "Aborted."
exit 1
fi
apt-get --yes install android-tools-fastboot
if [ $? -ne 0 ];
then
echo "install fastboot failed"
echo "Aborted."
exit 1
fi
}
check_files()
{
local chk_list
local need_files=0
local doc_fn
local doc_fn_wifi="webosdoctorp305hstnhwifi.jar"
local doc_fn_3g="webosdoctorp305hstnhatt.jar"
echo "checking doc files ..."
chk_list="sbl1.mbn sbl2.mbn sbl3.mbn rpm.mbn tz.mbn"
chk_list="${chk_list} emmc_appsboot.mbn"
chk_list="${chk_list} bootie-topaz305.bin"
chk_list="${chk_list} PmA6Updater"
chk_list="${chk_list} a6_firmware.txt.00"
for fn in $chk_list
do
if [ ! -r ${fn} ];
then
need_files=1
fi
done
if [ $need_files -eq 0 ];
then
return
fi
if [ -r ../${doc_fn_wifi} ];
then
doc_fn=../${doc_fn_wifi}
fi
if [ -r ../${doc_fn_3g} ];
then
doc_fn=../${doc_fn_3g}
fi
if [ -z "${doc_fn}" ];
then
echo "could not find ../${doc_fn_wifi} or ../${doc_fn_3g}"
echo "Aborted."
exit 1
fi
echo "extracting doc files ..."
unzip -p "${doc_fn}" resources/webOS.tar \
| tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz \
| tar -xzOf - ./boot/boot-genesis.tar.gz \
| tar -xzf -
if [ $? -ne 0 ];
then
echo "failed to extract core bootloaders"
echo "Aborted."
exit 1
fi
unzip -p "${doc_fn}" resources/webOS.tar | \
tar -xOf - ./boot-topaz.bin \
>bootie-topaz305-raw.bin
if [ $? -ne 0 ];
then
echo "failed to extract boot.bin"
echo "Aborted."
exit 1
fi
PRINTF=`which printf 2>/dev/null`
if [ $? -ne 0 ];
then
echo "printf not found."
echo "Aborting."
exit 1
fi
$PRINTF "\x1C\xC3\x01\x00\x00\x00\x80\x40" >bootie-topaz305.bin
cat bootie-topaz305-raw.bin >>bootie-topaz305.bin
$PRINTF "\x18\xDA\x06\x15" >>bootie-topaz305.bin
unzip -p "${doc_fn}" resources/webOS.tar \
| tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz \
| tar -xzOf - ./usr/bin/PmA6Updater \
>PmA6Updater
if [ $? -ne 0 ];
then
echo "failed to extract PmA6Updater"
echo "Aborted."
exit 1
fi
chmod 755 PmA6Updater
unzip -p "${doc_fn}" resources/webOS.tar | tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz | tar -xzOf - ./lib/firmware/a6_firmware.txt.00 >a6_firmware.txt.00
if [ $? -ne 0 ];
then
echo "failed to extract a6_firmware.txt.00"
echo "Aborted."
exit 1
fi
}
check_config_files()
{
local cfgf=$1
echo -n "Checking that config/files are valid... "
if [ \! -r ${cfgf} ];
then
echo "FAILED"
echo "Cannot read config file ${cfgf}"
echo "Aborted."
exit 1
fi
while read fname pos md5
do
if [ "${fname}" = '#' ];
then
continue
fi
if [ \! -r "${fname}" ];
then
echo "FAILED"
echo "Cannot read file ${fname}"
echo "Aborted."
exit 1
fi
if [ "${md5}" = "nocheck" ];
then
continue;
fi
CHK_MD5=`md5sum ${fname} | cut -d' ' -f1`
if [ "${CHK_MD5}" != "${md5}" ];
then
echo "FAILED"
echo "File ${fname} failed check."
echo "Aborted."
exit 1
fi
done <${cfgf}
echo "OK"
}
load_files()
{
local cfgf=$1
while read fname pos md5
do
if [ "${fname}" = '#' ];
then
continue;
fi
echo "Writing file ${fname} ... "
addr=$(($pos * 512))
perl qdload.pl --laddr ${addr} --lfile ${fname}
if [ $? -ne 0 ];
then
echo "Cannot write file ${fname}"
echo "Aborted."
exit 1
fi
done <${cfgf}
echo "Done writing files."
}
check_usbdevs()
{
local tmout="$1"
shift
local dev_ids="$*"
local check_flag=1
while [ $check_flag -eq 1 ];
do
for dev_id in $dev_ids
do
dev_count=`lsusb | cut -d' ' -f6 | grep "^${dev_id}" | wc -l`
if [ $dev_count -gt 0 ];
then
return 0
fi
done
if [ $tmout -le 0 ];
then
check_flag=0
else
sleep 1
tmout=$((tmout - 1))
fi
done
return 1
}
get_usbdev_info()
{
local devid=$1
local field=$2
local filter=$3
if [ $field -eq 1 ];
then
lsusb -vv -d $devid |
while read a b c
do
if [ "x${a}" = "x${filter}" ];
then
echo "${b}"
return
fi
done
else
lsusb -vv -d $devid |
while read a b c
do
if [ "x${a}" = "x${filter}" ];
then
echo "${c}"
return
fi
done
fi
}
check_qdlmode()
{
local devid_qdl="05c6:9008"
local imanfac1="`get_usbdev_info $devid_qdl 1 iManufacturer`"
local imanfac2="`get_usbdev_info $devid_qdl 2 iManufacturer`"
local iprod1="`get_usbdev_info $devid_qdl 1 iProduct`"
local iprod2="`get_usbdev_info $devid_qdl 2 iProduct`"
if [ -z "${imanfac1}" -o -z "${iprod1}" ];
then
return 1
fi
if [ -z "${imanfac2}" -o -z "${iprod2}" ];
then
return 1
fi
if [ "${imanfac1}" != "3" ];
then
return 1
fi
if [ "${imanfac2}" != "Qualcomm, Incorporated" ];
then
return 1
fi
if [ "${iprod1}" != "2" ];
then
return 1
fi
if [ "${iprod2}" != "Qualcomm CDMA Technologies MSM" ];
then
return 1
fi
return 0
}
check_qdlmode2()
{
local devid_qdl="05c6:9008"
local imanfac1="`get_usbdev_info $devid_qdl 1 iManufacturer`"
local imanfac2="`get_usbdev_info $devid_qdl 2 iManufacturer`"
local iprod1="`get_usbdev_info $devid_qdl 1 iProduct`"
local iprod2="`get_usbdev_info $devid_qdl 2 iProduct`"
if [ -z "${imanfac1}" -o -z "${iprod1}" ];
then
return 1
fi
if [ -z "${imanfac2}" -o -z "${iprod2}" ];
then
return 1
fi
if [ "${imanfac1}" != "1" ];
then
return 1
fi
if [ "${imanfac2}" != "Qualcomm CDMA Technologies MSM" ];
then
return 1
fi
if [ "${iprod1}" != "2" ];
then
return 1
fi
if [ "${iprod2}" != "QHSUSB_DLOAD" ];
then
return 1
fi
return 0
}
#####
##### MAIN
#####
devid_qdl="05c6:9008"
if [ $# -ne 1 ];
then
echo "Usage: ${0} 16|32|64"
exit 1
fi
if [ "$1" != "16" -a "$1" != "32" -a "$1" != "64" ];
then
echo "Usage: ${0} 16|32|64"
exit 1
fi
tptype="$1"
if [ `id -u` -ne 0 ];
then
echo "Must run as superuser (i.e. sudo ...)"
echo "Aborting"
exit 1
fi
check_pgms
check_files
devid_qdl="05c6:9008"
devid_dfu="0830:8070"
devid_fastboot="18d1:d00d"
devid_netchip="0525:a4aa"
if `check_usbdevs 0 $devid_qdl`;
then
if ! `check_qdlmode2`;
then
echo "Incorrect QDL mode found."
echo "Please hold Power+Home+VolumeDown for 20-30 secs, then retry."
echo "Aborted."
exit 1
fi
else
echo "Connect Touchpad then hold Power+Home+VolumeDown for 30 seconds ..."
if ! `check_usbdevs 120 $devid_qdl`
then
echo "QDL mode not found"
echo "Aborting."
exit 1
else
echo "Release buttons now"
sleep 5
fi
fi
perl qdload.pl --pfile emmcbld.bin
if [ $? -ne 0 ];
then
echo "load of emmcbld.bin failed"
echo "Aborting."
exit 1
fi
sleep 3
echo "Checking QDL mode..."
if ! `check_qdlmode`;
then
echo "QDL second stage mode not found"
echo "Aborting"
exit 1
fi
load_files tp${tptype}nobootie.cfg
echo "Reseting device..."
perl qdload.pl --lreset
echo "Waiting for fastboot mode..."
if ! `check_usbdevs 60 ${devid_fastboot}`
then
echo "fastboot mode not found"
echo "Aborted."
exit 1
fi
echo "Loading TPToolbox-Headless ..."
fastboot flash bootmem TPToolbox-Headless-v004
if [ $? -ne 0 ];
then
echo "TPToolbox-Headless load failed"
echo "Aborted."
exit 1
fi
echo "Waiting for netchip mode... (may take 3+ mins)"
if ! `check_usbdevs 200 ${devid_netchip}`
then
echo "netchip mode not found"
echo "Aborted."
exit 1
fi
echo "Waiting for ping check... (may take 1-2 mins)"
ccnt=120
ping_ok=0
while [ $ccnt -gt 0 ];
do
ping -c 1 -W 1 192.168.7.7 >/dev/null 2>&1
if [ $? -eq 0 ];
then
ccnt=0
ping_ok=1
fi
ccnt=$(($ccnt - 1))
done
if [ $ping_ok -eq 0 ];
then
echo "ping check failed"
echo "check firewall/networking setup"
echo "access to the 192.68.7.7 host (Touchpad) failed"
echo "Aborted."
exit 1
fi
echo "Checking/updating known_hosts..."
need_khosts=0
if [ ! -r ~root/.ssh/known_hosts ];
then
need_khosts=1
else
chk1=`ssh-keygen -F 192.168.7.7 -f ~root/.ssh/known_hosts | wc -l`
if [ $? -ne 0 ];
then
echo "Failed to check known_hosts"
echo "Aborted."
exit 1
fi
if [ $chk1 -eq 0 ];
then
need_khosts=1
fi
fi
if [ $need_khosts -eq 1 ];
then
mkdir -p ~root/.ssh
cat khosts >>~root/.ssh/known_hosts
fi
echo "Copying A6 files..."
scp -i ssh-key a6_firmware.txt.00 PmA6Updater [email protected]:/tmp
if [ $? -ne 0 ];
then
echo "A6 files copy failed."
echo "Aborted."
exit 1
fi
echo "Copying bootloader files..."
scp -i ssh-key bootie-topaz305.bin emmc_appsboot.mbn [email protected]:/tmp
if [ $? -ne 0 ];
then
echo "bootloader files copy failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Checking A6 firmware..."
ssh -i ssh-key [email protected] /tmp/PmA6Updater -x -d 0 /tmp/a6_firmware.txt.00
## if [ $? -ne 0 ];
## then
## echo "A6 firmware check failed."
## echo "Aborted."
## exit 1
## fi
echo ""
echo "Updating A6 firmware..."
ssh -i ssh-key [email protected] /tmp/PmA6Updater -f -d 0 /tmp/a6_firmware.txt.00
if [ $? -ne 0 ];
then
echo "A6 firmware update failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Capturing DMESG..."
ssh -i ssh-key [email protected] dmesg
if [ $? -ne 0 ];
then
echo "dmesg capture failed"
echo "Aborted."
exit 1
fi
echo ""
echo "Updating bootloader emmc_appsboot..."
ssh -i ssh-key [email protected] dd if=/tmp/emmc_appsboot.mbn of=/dev/mmcblk0p7
if [ $? -ne 0 ];
then
echo "update bootloader emmc_appsboot failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Updating bootloader bootie..."
ssh -i ssh-key [email protected] dd if=/tmp/bootie-topaz305.bin of=/dev/mmcblk0p8
if [ $? -ne 0 ];
then
echo "update bootloader bootie failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Checking battery voltage/percent... "
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
if [ $bperc -gt 5 ];
then
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "ALL DONE."
exit 0
fi
if [ $bperc -gt 0 ];
then
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "Connect touchpad to stock HP AC charger to allow to charge"
echo "ALL DONE."
exit 0
fi
echo ""
echo "Waiting 1 min before checking voltage/percent again (1/2) ..."
sleep 60
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
echo ""
echo "Waiting 1 min before checking voltage/percent again (2/2) ..."
sleep 60
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "Connect Touchpad to stock HP AC charger now"
echo "and allow it to charge for several hours"
echo "ALL DONE."
not working, im running 12.10 and the only way it works is if I gedit tpdebrick 12.10... but how should i type it? sudo gedit tpdebrick 12.10 ./tpdebrick 32 ???
Please wrap [ hide ] and [/ hide ] (with no spacing between hide and brackets) so your post look like this
,,,,,,,,,
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
###################################
### TPDebrick v004 by jcsullins ###
###################################
check_pgms()
{
local have_other=1
local ok_install=0
local lsb_rel
local lsb_id
local SP
if ! `which perl >/dev/null 2>&1`;
then
echo "perl not found"
echo "Aborting."
exit 1
fi
lsb_rel=`lsb_release --short --release`
lsb_id=`lsb_release --short --id`
if [ -n "$lsb_rel" -a -n "${lsb_id}" -a "${lsb_id}" = "Ubuntu" ];
then
if [ "${lsb_rel}" = "11.04" -o "${lsb_rel}" = "11.10" -o "${lsb_rel}" = "12.04" ];
then
ok_install=1
fi
fi
if ! `which dfu-util >/dev/null 2>&1`;
then
echo "dfu-util not installed"
have_other=0
fi
if ! `which fastboot >/dev/null 2>&1`;
then
echo "fastboot not installed"
have_other=0
fi
if [ $have_other -eq 1 ];
then
return;
fi
if [ $ok_install -eq 0 ];
then
echo "Aborted."
exit 1
fi
if `which software-properties-kde >/dev/null 2>&1`;
then
SP=software-properties-kde
else
SP=software-properties-gtk
fi
echo "Installing dfu-util/fastboot ..."
$SP --enable-component universe
if [ $? -ne 0 ];
then
echo "Enable universe failed."
echo "Aborted."
exit 1
fi
add-apt-repository --yes ppa:nilarimogard/webupd8
if [ $? -ne 0 ];
then
echo "add-apt-repository failed"
echo "Aborted."
exit 1
fi
apt-get update
if [ $? -ne 0 ];
then
echo "apt-get update failed"
echo "Aborted."
exit 1
fi
apt-get --yes install dfu-util
if [ $? -ne 0 ];
then
echo "install dfu-util failed"
echo "Aborted."
exit 1
fi
apt-get --yes install android-tools-fastboot
if [ $? -ne 0 ];
then
echo "install fastboot failed"
echo "Aborted."
exit 1
fi
}
check_files()
{
local chk_list
local need_files=0
local doc_fn
local doc_fn_wifi="webosdoctorp305hstnhwifi.jar"
local doc_fn_3g="webosdoctorp305hstnhatt.jar"
echo "checking doc files ..."
chk_list="sbl1.mbn sbl2.mbn sbl3.mbn rpm.mbn tz.mbn"
chk_list="${chk_list} emmc_appsboot.mbn"
chk_list="${chk_list} bootie-topaz305.bin"
chk_list="${chk_list} PmA6Updater"
chk_list="${chk_list} a6_firmware.txt.00"
for fn in $chk_list
do
if [ ! -r ${fn} ];
then
need_files=1
fi
done
if [ $need_files -eq 0 ];
then
return
fi
if [ -r ../${doc_fn_wifi} ];
then
doc_fn=../${doc_fn_wifi}
fi
if [ -r ../${doc_fn_3g} ];
then
doc_fn=../${doc_fn_3g}
fi
if [ -z "${doc_fn}" ];
then
echo "could not find ../${doc_fn_wifi} or ../${doc_fn_3g}"
echo "Aborted."
exit 1
fi
echo "extracting doc files ..."
unzip -p "${doc_fn}" resources/webOS.tar \
| tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz \
| tar -xzOf - ./boot/boot-genesis.tar.gz \
| tar -xzf -
if [ $? -ne 0 ];
then
echo "failed to extract core bootloaders"
echo "Aborted."
exit 1
fi
unzip -p "${doc_fn}" resources/webOS.tar | \
tar -xOf - ./boot-topaz.bin \
>bootie-topaz305-raw.bin
if [ $? -ne 0 ];
then
echo "failed to extract boot.bin"
echo "Aborted."
exit 1
fi
PRINTF=`which printf 2>/dev/null`
if [ $? -ne 0 ];
then
echo "printf not found."
echo "Aborting."
exit 1
fi
$PRINTF "\x1C\xC3\x01\x00\x00\x00\x80\x40" >bootie-topaz305.bin
cat bootie-topaz305-raw.bin >>bootie-topaz305.bin
$PRINTF "\x18\xDA\x06\x15" >>bootie-topaz305.bin
unzip -p "${doc_fn}" resources/webOS.tar \
| tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz \
| tar -xzOf - ./usr/bin/PmA6Updater \
>PmA6Updater
if [ $? -ne 0 ];
then
echo "failed to extract PmA6Updater"
echo "Aborted."
exit 1
fi
chmod 755 PmA6Updater
unzip -p "${doc_fn}" resources/webOS.tar | tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz | tar -xzOf - ./lib/firmware/a6_firmware.txt.00 >a6_firmware.txt.00
if [ $? -ne 0 ];
then
echo "failed to extract a6_firmware.txt.00"
echo "Aborted."
exit 1
fi
}
check_config_files()
{
local cfgf=$1
echo -n "Checking that config/files are valid... "
if [ \! -r ${cfgf} ];
then
echo "FAILED"
echo "Cannot read config file ${cfgf}"
echo "Aborted."
exit 1
fi
while read fname pos md5
do
if [ "${fname}" = '#' ];
then
continue
fi
if [ \! -r "${fname}" ];
then
echo "FAILED"
echo "Cannot read file ${fname}"
echo "Aborted."
exit 1
fi
if [ "${md5}" = "nocheck" ];
then
continue;
fi
CHK_MD5=`md5sum ${fname} | cut -d' ' -f1`
if [ "${CHK_MD5}" != "${md5}" ];
then
echo "FAILED"
echo "File ${fname} failed check."
echo "Aborted."
exit 1
fi
done <${cfgf}
echo "OK"
}
load_files()
{
local cfgf=$1
while read fname pos md5
do
if [ "${fname}" = '#' ];
then
continue;
fi
echo "Writing file ${fname} ... "
addr=$(($pos * 512))
perl qdload.pl --laddr ${addr} --lfile ${fname}
if [ $? -ne 0 ];
then
echo "Cannot write file ${fname}"
echo "Aborted."
exit 1
fi
done <${cfgf}
echo "Done writing files."
}
check_usbdevs()
{
local tmout="$1"
shift
local dev_ids="$*"
local check_flag=1
while [ $check_flag -eq 1 ];
do
for dev_id in $dev_ids
do
dev_count=`lsusb | cut -d' ' -f6 | grep "^${dev_id}" | wc -l`
if [ $dev_count -gt 0 ];
then
return 0
fi
done
if [ $tmout -le 0 ];
then
check_flag=0
else
sleep 1
tmout=$((tmout - 1))
fi
done
return 1
}
get_usbdev_info()
{
local devid=$1
local field=$2
local filter=$3
if [ $field -eq 1 ];
then
lsusb -vv -d $devid |
while read a b c
do
if [ "x${a}" = "x${filter}" ];
then
echo "${b}"
return
fi
done
else
lsusb -vv -d $devid |
while read a b c
do
if [ "x${a}" = "x${filter}" ];
then
echo "${c}"
return
fi
done
fi
}
check_qdlmode()
{
local devid_qdl="05c6:9008"
local imanfac1="`get_usbdev_info $devid_qdl 1 iManufacturer`"
local imanfac2="`get_usbdev_info $devid_qdl 2 iManufacturer`"
local iprod1="`get_usbdev_info $devid_qdl 1 iProduct`"
local iprod2="`get_usbdev_info $devid_qdl 2 iProduct`"
if [ -z "${imanfac1}" -o -z "${iprod1}" ];
then
return 1
fi
if [ -z "${imanfac2}" -o -z "${iprod2}" ];
then
return 1
fi
if [ "${imanfac1}" != "3" ];
then
return 1
fi
if [ "${imanfac2}" != "Qualcomm, Incorporated" ];
then
return 1
fi
if [ "${iprod1}" != "2" ];
then
return 1
fi
if [ "${iprod2}" != "Qualcomm CDMA Technologies MSM" ];
then
return 1
fi
return 0
}
check_qdlmode2()
{
local devid_qdl="05c6:9008"
local imanfac1="`get_usbdev_info $devid_qdl 1 iManufacturer`"
local imanfac2="`get_usbdev_info $devid_qdl 2 iManufacturer`"
local iprod1="`get_usbdev_info $devid_qdl 1 iProduct`"
local iprod2="`get_usbdev_info $devid_qdl 2 iProduct`"
if [ -z "${imanfac1}" -o -z "${iprod1}" ];
then
return 1
fi
if [ -z "${imanfac2}" -o -z "${iprod2}" ];
then
return 1
fi
if [ "${imanfac1}" != "1" ];
then
return 1
fi
if [ "${imanfac2}" != "Qualcomm CDMA Technologies MSM" ];
then
return 1
fi
if [ "${iprod1}" != "2" ];
then
return 1
fi
if [ "${iprod2}" != "QHSUSB_DLOAD" ];
then
return 1
fi
return 0
}
#####
##### MAIN
#####
devid_qdl="05c6:9008"
if [ $# -ne 1 ];
then
echo "Usage: ${0} 16|32|64"
exit 1
fi
if [ "$1" != "16" -a "$1" != "32" -a "$1" != "64" ];
then
echo "Usage: ${0} 16|32|64"
exit 1
fi
tptype="$1"
if [ `id -u` -ne 0 ];
then
echo "Must run as superuser (i.e. sudo ...)"
echo "Aborting"
exit 1
fi
check_pgms
check_files
devid_qdl="05c6:9008"
devid_dfu="0830:8070"
devid_fastboot="18d1:d00d"
devid_netchip="0525:a4aa"
if `check_usbdevs 0 $devid_qdl`;
then
if ! `check_qdlmode2`;
then
echo "Incorrect QDL mode found."
echo "Please hold Power+Home+VolumeDown for 20-30 secs, then retry."
echo "Aborted."
exit 1
fi
else
echo "Connect Touchpad then hold Power+Home+VolumeDown for 30 seconds ..."
if ! `check_usbdevs 120 $devid_qdl`
then
echo "QDL mode not found"
echo "Aborting."
exit 1
else
echo "Release buttons now"
sleep 5
fi
fi
perl qdload.pl --pfile emmcbld.bin
if [ $? -ne 0 ];
then
echo "load of emmcbld.bin failed"
echo "Aborting."
exit 1
fi
sleep 3
echo "Checking QDL mode..."
if ! `check_qdlmode`;
then
echo "QDL second stage mode not found"
echo "Aborting"
exit 1
fi
load_files tp${tptype}nobootie.cfg
echo "Reseting device..."
perl qdload.pl --lreset
echo "Waiting for fastboot mode..."
if ! `check_usbdevs 60 ${devid_fastboot}`
then
echo "fastboot mode not found"
echo "Aborted."
exit 1
fi
echo "Loading TPToolbox-Headless ..."
fastboot flash bootmem TPToolbox-Headless-v004
if [ $? -ne 0 ];
then
echo "TPToolbox-Headless load failed"
echo "Aborted."
exit 1
fi
echo "Waiting for netchip mode... (may take 3+ mins)"
if ! `check_usbdevs 200 ${devid_netchip}`
then
echo "netchip mode not found"
echo "Aborted."
exit 1
fi
echo "Waiting for ping check... (may take 1-2 mins)"
ccnt=120
ping_ok=0
while [ $ccnt -gt 0 ];
do
ping -c 1 -W 1 192.168.7.7 >/dev/null 2>&1
if [ $? -eq 0 ];
then
ccnt=0
ping_ok=1
fi
ccnt=$(($ccnt - 1))
done
if [ $ping_ok -eq 0 ];
then
echo "ping check failed"
echo "check firewall/networking setup"
echo "access to the 192.68.7.7 host (Touchpad) failed"
echo "Aborted."
exit 1
fi
echo "Checking/updating known_hosts..."
need_khosts=0
if [ ! -r ~root/.ssh/known_hosts ];
then
need_khosts=1
else
chk1=`ssh-keygen -F 192.168.7.7 -f ~root/.ssh/known_hosts | wc -l`
if [ $? -ne 0 ];
then
echo "Failed to check known_hosts"
echo "Aborted."
exit 1
fi
if [ $chk1 -eq 0 ];
then
need_khosts=1
fi
fi
if [ $need_khosts -eq 1 ];
then
mkdir -p ~root/.ssh
cat khosts >>~root/.ssh/known_hosts
fi
echo "Copying A6 files..."
scp -i ssh-key a6_firmware.txt.00 PmA6Updater [email protected]:/tmp
if [ $? -ne 0 ];
then
echo "A6 files copy failed."
echo "Aborted."
exit 1
fi
echo "Copying bootloader files..."
scp -i ssh-key bootie-topaz305.bin emmc_appsboot.mbn [email protected]:/tmp
if [ $? -ne 0 ];
then
echo "bootloader files copy failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Checking A6 firmware..."
ssh -i ssh-key [email protected] /tmp/PmA6Updater -x -d 0 /tmp/a6_firmware.txt.00
## if [ $? -ne 0 ];
## then
## echo "A6 firmware check failed."
## echo "Aborted."
## exit 1
## fi
echo ""
echo "Updating A6 firmware..."
ssh -i ssh-key [email protected] /tmp/PmA6Updater -f -d 0 /tmp/a6_firmware.txt.00
if [ $? -ne 0 ];
then
echo "A6 firmware update failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Capturing DMESG..."
ssh -i ssh-key [email protected] dmesg
if [ $? -ne 0 ];
then
echo "dmesg capture failed"
echo "Aborted."
exit 1
fi
echo ""
echo "Updating bootloader emmc_appsboot..."
ssh -i ssh-key [email protected] dd if=/tmp/emmc_appsboot.mbn of=/dev/mmcblk0p7
if [ $? -ne 0 ];
then
echo "update bootloader emmc_appsboot failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Updating bootloader bootie..."
ssh -i ssh-key [email protected] dd if=/tmp/bootie-topaz305.bin of=/dev/mmcblk0p8
if [ $? -ne 0 ];
then
echo "update bootloader bootie failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Checking battery voltage/percent... "
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
if [ $bperc -gt 5 ];
then
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "ALL DONE."
exit 0
fi
if [ $bperc -gt 0 ];
then
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "Connect touchpad to stock HP AC charger to allow to charge"
echo "ALL DONE."
exit 0
fi
echo ""
echo "Waiting 1 min before checking voltage/percent again (1/2) ..."
sleep 60
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
echo ""
echo "Waiting 1 min before checking voltage/percent again (2/2) ..."
sleep 60
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "Connect Touchpad to stock HP AC charger now"
echo "and allow it to charge for several hours"
echo "ALL DONE."
not working, im running 12.10 and the only way it works is if I gedit tpdebrick 12.10... but how should i type it? sudo gedit tpdebrick 12.10 ./tpdebrick 32 ???
Thank you.
signs of life !!!!!!!!!!!
miroxlava said:
#!/bin/sh
###################################
### TPDebrick v004 by jcsullins ###
###################################
check_pgms()
{
local have_other=1
local ok_install=0
local lsb_rel
local lsb_id
local SP
if ! `which perl >/dev/null 2>&1`;
then
echo "perl not found"
echo "Aborting."
exit 1
fi
lsb_rel=`lsb_release --short --release`
lsb_id=`lsb_release --short --id`
if [ -n "$lsb_rel" -a -n "${lsb_id}" -a "${lsb_id}" = "Ubuntu" ];
then
if [ "${lsb_rel}" = "11.04" -o "${lsb_rel}" = "11.10" -o "${lsb_rel}" = "12.04" ];
then
ok_install=1
fi
fi
if ! `which dfu-util >/dev/null 2>&1`;
then
echo "dfu-util not installed"
have_other=0
fi
if ! `which fastboot >/dev/null 2>&1`;
then
echo "fastboot not installed"
have_other=0
fi
if [ $have_other -eq 1 ];
then
return;
fi
if [ $ok_install -eq 0 ];
then
echo "Aborted."
exit 1
fi
if `which software-properties-kde >/dev/null 2>&1`;
then
SP=software-properties-kde
else
SP=software-properties-gtk
fi
echo "Installing dfu-util/fastboot ..."
$SP --enable-component universe
if [ $? -ne 0 ];
then
echo "Enable universe failed."
echo "Aborted."
exit 1
fi
add-apt-repository --yes ppa:nilarimogard/webupd8
if [ $? -ne 0 ];
then
echo "add-apt-repository failed"
echo "Aborted."
exit 1
fi
apt-get update
if [ $? -ne 0 ];
then
echo "apt-get update failed"
echo "Aborted."
exit 1
fi
apt-get --yes install dfu-util
if [ $? -ne 0 ];
then
echo "install dfu-util failed"
echo "Aborted."
exit 1
fi
apt-get --yes install android-tools-fastboot
if [ $? -ne 0 ];
then
echo "install fastboot failed"
echo "Aborted."
exit 1
fi
}
check_files()
{
local chk_list
local need_files=0
local doc_fn
local doc_fn_wifi="webosdoctorp305hstnhwifi.jar"
local doc_fn_3g="webosdoctorp305hstnhatt.jar"
echo "checking doc files ..."
chk_list="sbl1.mbn sbl2.mbn sbl3.mbn rpm.mbn tz.mbn"
chk_list="${chk_list} emmc_appsboot.mbn"
chk_list="${chk_list} bootie-topaz305.bin"
chk_list="${chk_list} PmA6Updater"
chk_list="${chk_list} a6_firmware.txt.00"
for fn in $chk_list
do
if [ ! -r ${fn} ];
then
need_files=1
fi
done
if [ $need_files -eq 0 ];
then
return
fi
if [ -r ../${doc_fn_wifi} ];
then
doc_fn=../${doc_fn_wifi}
fi
if [ -r ../${doc_fn_3g} ];
then
doc_fn=../${doc_fn_3g}
fi
if [ -z "${doc_fn}" ];
then
echo "could not find ../${doc_fn_wifi} or ../${doc_fn_3g}"
echo "Aborted."
exit 1
fi
echo "extracting doc files ..."
unzip -p "${doc_fn}" resources/webOS.tar \
| tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz \
| tar -xzOf - ./boot/boot-genesis.tar.gz \
| tar -xzf -
if [ $? -ne 0 ];
then
echo "failed to extract core bootloaders"
echo "Aborted."
exit 1
fi
unzip -p "${doc_fn}" resources/webOS.tar | \
tar -xOf - ./boot-topaz.bin \
>bootie-topaz305-raw.bin
if [ $? -ne 0 ];
then
echo "failed to extract boot.bin"
echo "Aborted."
exit 1
fi
PRINTF=`which printf 2>/dev/null`
if [ $? -ne 0 ];
then
echo "printf not found."
echo "Aborting."
exit 1
fi
$PRINTF "\x1C\xC3\x01\x00\x00\x00\x80\x40" >bootie-topaz305.bin
cat bootie-topaz305-raw.bin >>bootie-topaz305.bin
$PRINTF "\x18\xDA\x06\x15" >>bootie-topaz305.bin
unzip -p "${doc_fn}" resources/webOS.tar \
| tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz \
| tar -xzOf - ./usr/bin/PmA6Updater \
>PmA6Updater
if [ $? -ne 0 ];
then
echo "failed to extract PmA6Updater"
echo "Aborted."
exit 1
fi
chmod 755 PmA6Updater
unzip -p "${doc_fn}" resources/webOS.tar | tar -xOf - ./nova-cust-image-topaz.rootfs.tar.gz | tar -xzOf - ./lib/firmware/a6_firmware.txt.00 >a6_firmware.txt.00
if [ $? -ne 0 ];
then
echo "failed to extract a6_firmware.txt.00"
echo "Aborted."
exit 1
fi
}
check_config_files()
{
local cfgf=$1
echo -n "Checking that config/files are valid... "
if [ \! -r ${cfgf} ];
then
echo "FAILED"
echo "Cannot read config file ${cfgf}"
echo "Aborted."
exit 1
fi
while read fname pos md5
do
if [ "${fname}" = '#' ];
then
continue
fi
if [ \! -r "${fname}" ];
then
echo "FAILED"
echo "Cannot read file ${fname}"
echo "Aborted."
exit 1
fi
if [ "${md5}" = "nocheck" ];
then
continue;
fi
CHK_MD5=`md5sum ${fname} | cut -d' ' -f1`
if [ "${CHK_MD5}" != "${md5}" ];
then
echo "FAILED"
echo "File ${fname} failed check."
echo "Aborted."
exit 1
fi
done <${cfgf}
echo "OK"
}
load_files()
{
local cfgf=$1
while read fname pos md5
do
if [ "${fname}" = '#' ];
then
continue;
fi
echo "Writing file ${fname} ... "
addr=$(($pos * 512))
perl qdload.pl --laddr ${addr} --lfile ${fname}
if [ $? -ne 0 ];
then
echo "Cannot write file ${fname}"
echo "Aborted."
exit 1
fi
done <${cfgf}
echo "Done writing files."
}
check_usbdevs()
{
local tmout="$1"
shift
local dev_ids="$*"
local check_flag=1
while [ $check_flag -eq 1 ];
do
for dev_id in $dev_ids
do
dev_count=`lsusb | cut -d' ' -f6 | grep "^${dev_id}" | wc -l`
if [ $dev_count -gt 0 ];
then
return 0
fi
done
if [ $tmout -le 0 ];
then
check_flag=0
else
sleep 1
tmout=$((tmout - 1))
fi
done
return 1
}
get_usbdev_info()
{
local devid=$1
local field=$2
local filter=$3
if [ $field -eq 1 ];
then
lsusb -vv -d $devid |
while read a b c
do
if [ "x${a}" = "x${filter}" ];
then
echo "${b}"
return
fi
done
else
lsusb -vv -d $devid |
while read a b c
do
if [ "x${a}" = "x${filter}" ];
then
echo "${c}"
return
fi
done
fi
}
check_qdlmode()
{
local devid_qdl="05c6:9008"
local imanfac1="`get_usbdev_info $devid_qdl 1 iManufacturer`"
local imanfac2="`get_usbdev_info $devid_qdl 2 iManufacturer`"
local iprod1="`get_usbdev_info $devid_qdl 1 iProduct`"
local iprod2="`get_usbdev_info $devid_qdl 2 iProduct`"
if [ -z "${imanfac1}" -o -z "${iprod1}" ];
then
return 1
fi
if [ -z "${imanfac2}" -o -z "${iprod2}" ];
then
return 1
fi
if [ "${imanfac1}" != "3" ];
then
return 1
fi
if [ "${imanfac2}" != "Qualcomm, Incorporated" ];
then
return 1
fi
if [ "${iprod1}" != "2" ];
then
return 1
fi
if [ "${iprod2}" != "Qualcomm CDMA Technologies MSM" ];
then
return 1
fi
return 0
}
check_qdlmode2()
{
local devid_qdl="05c6:9008"
local imanfac1="`get_usbdev_info $devid_qdl 1 iManufacturer`"
local imanfac2="`get_usbdev_info $devid_qdl 2 iManufacturer`"
local iprod1="`get_usbdev_info $devid_qdl 1 iProduct`"
local iprod2="`get_usbdev_info $devid_qdl 2 iProduct`"
if [ -z "${imanfac1}" -o -z "${iprod1}" ];
then
return 1
fi
if [ -z "${imanfac2}" -o -z "${iprod2}" ];
then
return 1
fi
if [ "${imanfac1}" != "1" ];
then
return 1
fi
if [ "${imanfac2}" != "Qualcomm CDMA Technologies MSM" ];
then
return 1
fi
if [ "${iprod1}" != "2" ];
then
return 1
fi
if [ "${iprod2}" != "QHSUSB_DLOAD" ];
then
return 1
fi
return 0
}
#####
##### MAIN
#####
devid_qdl="05c6:9008"
if [ $# -ne 1 ];
then
echo "Usage: ${0} 16|32|64"
exit 1
fi
if [ "$1" != "16" -a "$1" != "32" -a "$1" != "64" ];
then
echo "Usage: ${0} 16|32|64"
exit 1
fi
tptype="$1"
if [ `id -u` -ne 0 ];
then
echo "Must run as superuser (i.e. sudo ...)"
echo "Aborting"
exit 1
fi
check_pgms
check_files
devid_qdl="05c6:9008"
devid_dfu="0830:8070"
devid_fastboot="18d1:d00d"
devid_netchip="0525:a4aa"
if `check_usbdevs 0 $devid_qdl`;
then
if ! `check_qdlmode2`;
then
echo "Incorrect QDL mode found."
echo "Please hold Power+Home+VolumeDown for 20-30 secs, then retry."
echo "Aborted."
exit 1
fi
else
echo "Connect Touchpad then hold Power+Home+VolumeDown for 30 seconds ..."
if ! `check_usbdevs 120 $devid_qdl`
then
echo "QDL mode not found"
echo "Aborting."
exit 1
else
echo "Release buttons now"
sleep 5
fi
fi
perl qdload.pl --pfile emmcbld.bin
if [ $? -ne 0 ];
then
echo "load of emmcbld.bin failed"
echo "Aborting."
exit 1
fi
sleep 3
echo "Checking QDL mode..."
if ! `check_qdlmode`;
then
echo "QDL second stage mode not found"
echo "Aborting"
exit 1
fi
load_files tp${tptype}nobootie.cfg
echo "Reseting device..."
perl qdload.pl --lreset
echo "Waiting for fastboot mode..."
if ! `check_usbdevs 60 ${devid_fastboot}`
then
echo "fastboot mode not found"
echo "Aborted."
exit 1
fi
echo "Loading TPToolbox-Headless ..."
fastboot flash bootmem TPToolbox-Headless-v004
if [ $? -ne 0 ];
then
echo "TPToolbox-Headless load failed"
echo "Aborted."
exit 1
fi
echo "Waiting for netchip mode... (may take 3+ mins)"
if ! `check_usbdevs 200 ${devid_netchip}`
then
echo "netchip mode not found"
echo "Aborted."
exit 1
fi
echo "Waiting for ping check... (may take 1-2 mins)"
ccnt=120
ping_ok=0
while [ $ccnt -gt 0 ];
do
ping -c 1 -W 1 192.168.7.7 >/dev/null 2>&1
if [ $? -eq 0 ];
then
ccnt=0
ping_ok=1
fi
ccnt=$(($ccnt - 1))
done
if [ $ping_ok -eq 0 ];
then
echo "ping check failed"
echo "check firewall/networking setup"
echo "access to the 192.68.7.7 host (Touchpad) failed"
echo "Aborted."
exit 1
fi
echo "Checking/updating known_hosts..."
need_khosts=0
if [ ! -r ~root/.ssh/known_hosts ];
then
need_khosts=1
else
chk1=`ssh-keygen -F 192.168.7.7 -f ~root/.ssh/known_hosts | wc -l`
if [ $? -ne 0 ];
then
echo "Failed to check known_hosts"
echo "Aborted."
exit 1
fi
if [ $chk1 -eq 0 ];
then
need_khosts=1
fi
fi
if [ $need_khosts -eq 1 ];
then
mkdir -p ~root/.ssh
cat khosts >>~root/.ssh/known_hosts
fi
echo "Copying A6 files..."
scp -i ssh-key a6_firmware.txt.00 PmA6Updater [email protected]:/tmp
if [ $? -ne 0 ];
then
echo "A6 files copy failed."
echo "Aborted."
exit 1
fi
echo "Copying bootloader files..."
scp -i ssh-key bootie-topaz305.bin emmc_appsboot.mbn [email protected]:/tmp
if [ $? -ne 0 ];
then
echo "bootloader files copy failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Checking A6 firmware..."
ssh -i ssh-key [email protected] /tmp/PmA6Updater -x -d 0 /tmp/a6_firmware.txt.00
## if [ $? -ne 0 ];
## then
## echo "A6 firmware check failed."
## echo "Aborted."
## exit 1
## fi
echo ""
echo "Updating A6 firmware..."
ssh -i ssh-key [email protected] /tmp/PmA6Updater -f -d 0 /tmp/a6_firmware.txt.00
if [ $? -ne 0 ];
then
echo "A6 firmware update failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Capturing DMESG..."
ssh -i ssh-key [email protected] dmesg
if [ $? -ne 0 ];
then
echo "dmesg capture failed"
echo "Aborted."
exit 1
fi
echo ""
echo "Updating bootloader emmc_appsboot..."
ssh -i ssh-key [email protected] dd if=/tmp/emmc_appsboot.mbn of=/dev/mmcblk0p7
if [ $? -ne 0 ];
then
echo "update bootloader emmc_appsboot failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Updating bootloader bootie..."
ssh -i ssh-key [email protected] dd if=/tmp/bootie-topaz305.bin of=/dev/mmcblk0p8
if [ $? -ne 0 ];
then
echo "update bootloader bootie failed."
echo "Aborted."
exit 1
fi
echo ""
echo "Checking battery voltage/percent... "
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
if [ $bperc -gt 5 ];
then
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "ALL DONE."
exit 0
fi
if [ $bperc -gt 0 ];
then
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "Connect touchpad to stock HP AC charger to allow to charge"
echo "ALL DONE."
exit 0
fi
echo ""
echo "Waiting 1 min before checking voltage/percent again (1/2) ..."
sleep 60
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
echo ""
echo "Waiting 1 min before checking voltage/percent again (2/2) ..."
sleep 60
bvolt=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getvoltage`
if [ $? -ne 0 ];
then
echo "getvoltage failed"
echo "Aborted."
exit 1
fi
bperc=`ssh -i ssh-key [email protected] cat /sys/devices/i2c-3/3-0031/getpercent`
if [ $? -ne 0 ];
then
echo "getpercent failed"
echo "Aborted."
exit 1
fi
echo "Battery Voltage=${bvolt} Percent=${bperc}"
echo "Rebooting Touchpad ..."
ssh -i ssh-key [email protected] "(sleep 1;/sbin/reboot -f) &"
echo "Connect Touchpad to stock HP AC charger now"
echo "and allow it to charge for several hours"
echo "ALL DONE."
not working, im running 12.10 and the only way it works is if I gedit tpdebrick 12.10... but how should i type it? sudo gedit tpdebrick 12.10 ./tpdebrick 32 ???
Click to expand...
Click to collapse
booted into ubuntu 12.04 cd, script worked, home button lit up, now on charger, will post results tomorrow.... im happy again (i think):laugh:
It's aliiiivvvveeeee!!!!!!
miroxlava said:
booted into ubuntu 12.04 cd, script worked, home button lit up, now on charger, will post results tomorrow.... im happy again (i think):laugh:
Click to expand...
Click to collapse
i couldnt get it to work with ubuntu 12.10 usb, but with one try on 12.04 CD.... my TP was up and running this morning, I felt like a kid on Xmas!!!
ThanX JC!!!!!!:good:
britoso said:
You are plugged in to a usb port and holding the 3 buttons for 20+ seconds right? Maybe you can leave it on the charger for a day first.
The one I fixed was dead for almost a year. the script failed to read the battery level.
Click to expand...
Click to collapse
Question: Where does the script read the battery level?
hi-phile said:
Question: Where does the script read the battery level?
Click to expand...
Click to collapse
will have to check the script for that.

Build script for 'Nightlies'

Hi guys,
just shameless ripped from the jenkins build script from the wiki and adapted it to our build environment, for 1 device:
build.sh
Code:
#!/bin/bash
export USE_CCACHE=1
################# Your device here:
DEVICE=n7100
################################
cd ~/android/omni
. build/envsetup.sh
repo sync -j4
rm -rf out/target
brunch $DEVICE
make it executeable:
Code:
chmod +x build.sh
Pretty simple, but works for my private nightlies - and maybe as a cron job.
TODO / IDEAS:
Checking if build did work (exit codes? checking for if zip exists?)
Moving the flashable ZIP to a safe (public?) place
purging old builds (tmpwatch?)
check for changes before building
notify on finished builds (notify my android?)
check for changes before building
notify on finished builds (notify my android?)
cb5264 said:
Hi guys,
just shameless ripped from the jenkins build script from the wiki and adapted it to our build environment, for 1 device:
build.sh
Code:
#!/bin/bash
export USE_CCACHE=1
Click to expand...
Click to collapse
This is incomplete. It could be good enough for Jerkins™, but for your desktop rig it should be
Code:
export USE_CCACHE=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G <---- whatever you can spare, I use 50Gbs
cb5264 said:
repo sync -j4
Click to expand...
Click to collapse
Also unnecessary, because the default is -j4.
Code:
repo sync
would suffice.
Keep in mind that we don't have nightlies ready yet as none of the devices are ready yet (nightly builds for us are meant to be stable) but we will have some ready soon
Sent from my SM-N900T using XDA Premium 4 mobile app
Regarding ccache, why should we need to set up the ccache size every compile?
It's a set once value...
Gesendet von meinem GT-N7100 mit Tapatalk
You dont need to. You might add a 'ccache -s' afterwards though - to see how useful ccache was for the build.
If you build OmniROM (when its ready), for yourself, you will want to cherry-pick changes from the Gerrit review, or add changes of your own, to make your build different from that on Jenkins. So it might be better not to have 'repo sync' in your script -- that will wipe out all your changes.
HippyTed said:
You dont need to. You might add a 'ccache -s' afterwards though - to see how useful ccache was for the build.
If you build OmniROM (when its ready), for yourself, you will want to cherry-pick changes from the Gerrit review, or add changes of your own, to make your build different from that on Jenkins. So it might be better not to have 'repo sync' in your script -- that will wipe out all your changes.
Click to expand...
Click to collapse
regarding ccache, as far as I know data that needs to be computed more than once but doesn't change is put into a cache so it will be generated once and then read from the cache, in that case if I delete the cache every time i lose the advantage of a cache...
regarding cherry picks, I would put the cherry picks after the repo sync command to have the best of both worlds (updated core and cherry picks)
regards
Steven
NemesisRE said:
regarding ccache, as far as I know data that needs to be computed more than once but doesn't change is put into a cache so it will be generated once and then read from the cache, in that case if I delete the cache every time i lose the advantage of a cache...
Click to expand...
Click to collapse
Check man pages for ccache - '-C' clears it, '-z' zeroes stats, '-s' shows stats.
regarding cherry picks, I would put the cherry picks after the repo sync command to have the best of both worlds (updated core and cherry picks)
Click to expand...
Click to collapse
Ok.
HippyTed said:
Check man pages for ccache - '-C' clears it, '-z' zeroes stats, '-s' shows stats.
Ok.
Click to expand...
Click to collapse
this doesn't disprove my assertion...
NemesisRE said:
this doesn't disprove my assertion...
Click to expand...
Click to collapse
True. Maybe I misunderstood your reason for making the assertion.
HippyTed said:
True. Maybe I misunderstood your reason for making the assertion.
Click to expand...
Click to collapse
I think so ^^ the reason was to say that rebuilding the cache on every run would be dumb
cb5264 said:
Hi guys,
just shameless ripped from the jenkins build script from the wiki and adapted it to our build environment, for 1 device:
build.sh
Code:
rm -rf out/target
brunch $DEVICE
Click to expand...
Click to collapse
for personal use I don't remove the /out folder but maybe once every few weeks. You're essentially doing a make clobber but leaving your out/host folder so that's good but, even so, it isn't necessary to flush out the target folder every time unless your compiling is pooping out. I suppose it depends whether you're making it a cron job in which case I'd do what you're doing.
---------- Post added at 12:16 AM ---------- Previous post was at 12:14 AM ----------
... what I do think would be nice is to set up a delta update mechanism like cyandelta so we could update on mobile data without killing our data plans.
cd omni
rm -rf out
repo sync -j 16
time brunch n7100
that's what I use
Seems I have the most Advances
Code:
#!/bin/bash
cd ~/
clear
export USE_CCACHE=1
export CCACHE_DIR=~/.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G
DATE=$(date -u +%Y%m%d)
OMNIBUILDTODEL=`expr $DATE - 5`
DEVICE=$*
. build/envsetup.sh
rm -f out/target/product/$DEVICE/obj/KERNEL_OBJ/.version
rm -f out/target/product/$DEVICE/system/build.prop
rm -f out/target/product/$DEVICE/system/app/*.odex
rm -f out/target/product/$DEVICE/omni*.zip
rm -f out/target/product/$DEVICE/omni*.zip.md5sum
rm -f out/target/product/$DEVICE/system/framework/*.odex
brunch omni_$DEVICE-userdebug -j12
sftp {-p PORT#} {USER-NAME}@xxx.xxx.xxx.xxx << EOF
cd /var/www/mithun46/hammerhead/omni/
put out/target/product/$DEVICE/omni-4.4-$DATE-$DEVICE-HOMEMADE.zip
put out/target/product/$DEVICE/omni-4.4-$DATE-$DEVICE-HOMEMADE.zip.md5sum
rm omni-4.4-$OMNIBUILDTODEL-$DEVICE-HOMEMADE.zip
rm omni-4.4-$OMNIBUILDTODEL-$DEVICE-HOMEMADE.zip.md5sum
EOF
This:
Uses 50 gigs of ccache
Uploads to my personal server [zip+md5]
Deletes 5 days old builds and their md5sum
This is not clean builds [i clean manually] [is kinda clean though]
Is in the smallest form possible
mithun46 said:
#!/bin/{SHELL}
...
sftp {-p PORT#} {USER-NAME}@xxx.xxx.xxx.xxx
cd /var/www/{what/should/possibly/be/an/obscured/path/to}/omni/
Click to expand...
Click to collapse
You also just provided me with:
1) Verification of an operable {SHELL} compatible shell.
2) Your server's IP.
3) A good indicator that your server accepts SSH AND SFTP connections at the port {PORT#}.
4) Verification that your SSH server accepts "{USER-NAME}" logins.
5) Pretty solid evidence of, and possibly even an otherwise inaccessible path on, a web server
Please edit your post. Ive already made my post as vague as possible without failing to make my point, i hope.
Also, please consider SSH's known_hosts or at the least shell aliases/functions so you don't have to hardcode IP addresses and user-names in random shell scripts.
-Mike
* While it's possible that... EDIT: *REDACTED* no problem, Mithun. I said it for myself as much as I did you; nobody likes a botnet. Well, maybe very few like a botnet.
mithun46 said:
Code:
...
sftp {-p PORT#} {USER-NAME}@xxx.xxx.xxx.xxx << EOF
cd /var/www/mithun46/hammerhead/omni/
put out/target/product/$DEVICE/omni-4.4-$DATE-$DEVICE-HOMEMADE.zip
put out/target/product/$DEVICE/omni-4.4-$DATE-$DEVICE-HOMEMADE.zip.md5sum
rm omni-4.4-$OMNIBUILDTODEL-$DEVICE-HOMEMADE.zip
rm omni-4.4-$OMNIBUILDTODEL-$DEVICE-HOMEMADE.zip.md5sum
EOF
[/LIST]
Click to expand...
Click to collapse
That part got a disturbing 'issue' imho - it doesn't check for a build being successful. I'd work that out with an if-clause checking if the file exists...
cb5264 said:
That part got a disturbing 'issue' imho - it doesn't check for a build being successful. I'd work that out with an if-clause checking if the file exists...
Click to expand...
Click to collapse
If no file exists it shows errors while trying to upload the file in sftp
This is my try, it´s not perfect and for the most people too much... but it`s mine ^^
https://gist.github.com/NemesisRE/7518954
EDIT: Will update the gist until i think it is all ok, but the code here will stay as it is
Code:
#!/bin/bash
##################################################
#
# vim: ai ts=4 sw=4 noet sts=4 ft=sh
#
# Copyright 2013, Steven Koeberich ([email protected])
#
# Title: dinner.sh
# Author: Steven "NemesisRE" Koeberich
# Date: 20131117
# Version: 1.1
# Description: Builds Roms automatically
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License at (http://www.gnu.org/licenses/) for
# more details.
#set -e #do not enable otherwise brunch will fail
#set -x
#For compatibility set Language to en_US.UTF8 and timezone to UTC
export LANGUAGE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export TZ="/usr/share/zoneinfo/UTC"
#Make us of CCACHE
export USE_CCACHE=1
# Define global variables
REPO_DIR="${HOME}/android/omni"
MAIL_BIN=$(which mail)
LOG_DIR="${HOME}/logs"
SHOW_VERBOSE="> /dev/null 2>&1"
CONVERT_TO_HTML="| ansi2html" # install package kbtin to use this feature
#Set initial exitcodes
SYNC_REPO_EXIT_CODE="0"
GET_BREAKFAST_VARIABLES_EXIT_CODE="0"
BRUNCH_DEVICE_EXIT_CODE="0"
MOVE_BUILD_EXIT_CODE="0"
RUN_COMMAND_EXIT_CODE="0"
CLEAN_OLD_BUILDS_EXIT_CODE="0"
SEND_MAIL_EXIT_CODE="0"
# This variables can be overwritten by command line parameters
MAIL='' # set this if you want always an email
ADMIN_MAIL='' # set this if you want always an email (with logs)
TARGET_DIR='' # set this if you want always move your build to the given directorie
CLEANUP_OLDER_THEN="" # set this if you want always automatic cleanup
DOWNLOAD_LINK='' # set this if you want always a download link
RUN_COMMAND='' # set this if you want always run a command after a build was successful
BUILD_FOR_DEVICE="" # set this if you want always build for the given device/s
#Source envsetup
. ${REPO_DIR}/build/envsetup.sh > /dev/null 2>&1
######################
#
# function _usage
#
#
function _usage() {
echo $"Usage: ${0} [-n \"[email protected]\"] [-t \'/var/www/awsome-download-dir\'] [-r \'scp \$\{OUTPUT_FILE\} example.com:\' ][-l \"http://example.com/download/omnirom\"] [-c 7] [-v] [-- i9300 mako ]"
cat<<EOF
Options:
-n Send notification to given Mail-Adress
-t Move files into given Directorie
-r Run command on successful build
-l If you choose a target dir you may want put
a download link into the mail message
-c Cleanup builds older then N days
-v Verbose Output
-h See this Message
EOF
}
function _e_notice () {
echo -e "NOTICE: ${1}"
}
function _e_warning () {
echo -e "WARNING:Something went wrong ${1} (${2})"
}
function _e_error () {
echo -e "ERROR: ${1}"
}
function _check_prerequisites () {
if [ ! -x $(which ansi2html) ]; then
CONVERT_TO_HTML=""
fi
if [ ${TARGET_DIR} ]; then
TARGET_DIR=$(echo "${TARGET_DIR}"|sed 's/\/$//g')
fi
if [ ${LOG_DIR} ]; then
LOG_DIR=$(echo "${LOG_DIR}"|sed 's/\/$//g')
fi
if [ -z ${BUILD_FOR_DEVICE} ]; then
echo "ERROR: No Device given! Stopping..."
_usage
exit 1
fi
if [ ! -d ${LOG_DIR} ]; then
mkdir -p ${LOG_DIR}
fi
}
function _sync_repo () {
_e_notice "Running repo sync..."
eval "repo sync ${SHOW_VERBOSE}"
SYNC_REPO_EXIT_CODE=$?
if [ ${SYNC_REPO_EXIT_CODE} != 0 ]; then
_e_warning "while doing repo sync" "${SYNC_REPO_EXIT_CODE}"
fi
}
function _get_breakfast_variables () {
for VARIABLE in `breakfast ${DEVICE} | sed -e 's/^=.*//' -e 's/[ ^I]*$//' -e '/^$/ d'`; do
eval ${VARIABLE}
done
GET_BREAKFAST_VARIABLES_EXIT_CODE=$?
if [ ${GET_BREAKFAST_VARIABLES_EXIT_CODE} != 0 ]; then
_e_warning "while getting breakfast variables" "${GET_BREAKFAST_VARIABLES_EXIT_CODE}"
fi
}
function _brunch_device () {
_e_notice "Running brunch for ${DEVICE} with version ${PLATFORM_VERSION} ..."
eval "brunch ${DEVICE} 2>&1 | tee ${LOG_DIR}/brunch_${DEVICE}.log ${SHOW_VERBOSE}"
BRUNCH_DEVICE_EXIT_CODE=$?
BRUNCH_RUN_TIME=$(tail ${LOG_DIR}/brunch_${DEVICE}.log | grep "real" | awk '{print $2}')
if [ ${BRUNCH_DEVICE_EXIT_CODE} != 0 ]; then
_e_warning "while brunch the ${DEVICE}, see logfile for more information" "${BRUNCH_DEVICE_EXIT_CODE}"
fi
}
function _move_build () {
_e_notice "Moving files to target directory..."
mv ${OUTPUT_FILE}* ${TARGET_DIR}/
MOVE_BUILD_EXIT_CODE=$?
if [ ${MOVE_BUILD_EXIT_CODE} != 0 ]; then
_e_warning "while moving the build" "${MOVE_BUILD_EXIT_CODE}"
fi
}
function _run_command () {
_e_notice "Run command..."
eval ${RUN_COMMAND}
RUN_COMMAND_EXIT_CODE=$?
if [ ${RUN_COMMAND_EXIT_CODE} != 0 ]; then
_e_warning "while running your command" "${RUN_COMMAND_EXIT_CODE}"
fi
}
function _clean_old_builds () {
_e_notice "Running cleanup of old builds..."
if [ ${TARGET_DIR} ]; then
CLEANED_FILES=$(find ${TARGET_DIR}/ -name "omni-${PLATFORM_VERSION}-*-${DEVICE}-HOMEMADE.zip*" -type f -mtime +${CLEANUP_OLDER_THEN}d -delete)
else
CLEANED_FILES=$(find `dirname ${OUTPUT_FILE}` -name "omni-${PLATFORM_VERSION}-*-${DEVICE}-HOMEMADE.zip*" -type f -mtime +${CLEANUP_OLDER_THEN}d -delete)
fi
CLEAN_OLD_BUILDS_EXIT_CODE=$?
if [ ! ${CLEANED_FILES} ]; then
CLEANED_FILES="Nothing to clean up."
fi
_e_notice "${CLEANED_FILES}"
if [ ${CLEAN_OLD_BUILDS_EXIT_CODE} != 0 ]; then
_e_warning "while cleaning builds" "${CLEAN_OLD_BUILDS_EXIT_CODE}"
fi
}
function _send_mail () {
_e_notice "Sending status mail..."
MAIL_MESSAGE="Build Status:\n\n"
ADMIN_MAIL_MESSAGE=""
if ${BUILD_SUCCESSFUL}; then
MAIL_MESSAGE+="Build for ${DEVICE} was successfull finished after ${BRUNCH_RUN_TIME}\n"
if [ ${DOWNLOAD_LINK} ]; then
MAIL_MESSAGE+="You can download your Build at ${DOWNLOAD_LINK}\n\n"
fi
if [ ${CLEANED_FILES} ]; then
ADMIN_MAIL_MESSAGE+="Removed the following files:\n"
ADMIN_MAIL_MESSAGE+=${CLEANED_FILES}
fi
else
MAIL_MESSAGE+="Build was not successfull ran ${BRUNCH_RUN_TIME}.\n\n"
ADMIN_MAIL_MESSAGE+="Logfile:"
ADMIN_MAIL_MESSAGE+=$(cat ${HOME}/brunch_${DEVICE}.log ${CONVERT_TO_HTML})
fi
if [ ${MAIL} ]; then
echo -e "${MAIL_MESSAGE}" | ${MAIL_BIN} -s "Finished dinner." "${MAIL}"
fi
if [ ${ADMIN_MAIL} ]; then
echo -e "${MAIL_MESSAGE}${ADMIN_MAIL_MESSAGE}" | ${MAIL_BIN} -s "Finished dinner." "${ADMIN_MAIL}"
fi
SEND_MAIL_EXIT_CODE=$?
if [ ${SEND_MAIL_EXIT_CODE} != 0 ]; then
_e_warning "while sending E-Mail" "${SEND_MAIL_EXIT_CODE}"
fi
}
function _check_build () {
OUT_FILE_SECONDS_SINCE_CREATION=$(/bin/date -d "now - $( /usr/bin/stat -c "%Y" ${OUTPUT_FILE} ) seconds" +%s)
if [ -f ${OUTPUT_FILE} ] && [ "${OUT_FILE_SECONDS_SINCE_CREATION}" -lt "120" ] ; then
BUILD_SUCCESSFUL=true
else
BUILD_SUCCESSFUL=false
fi
}
######################
#
# function _main
#
#
function _main() {
_check_prerequisites
cd ${REPO_DIR}
_sync_repo
for DEVICE in ${BUILD_FOR_DEVICE}; do
_get_breakfast_variables
_brunch_device
OUTPUT_FILE="${OUT_DIR}/target/product/${DEVICE}/omni-${PLATFORM_VERSION}-$(date +%Y%m%d)-${DEVICE}-HOMEMADE.zip"
_check_build
if ${BUILD_SUCCESSFUL} && [ ${TARGET_DIR} ]; then
eval TARGET_DIR=${TARGET_DIR}
_move_build
fi
if ${BUILD_SUCCESSFUL} && [ ${CLEANUP_OLDER_THEN} ]; then
_clean_old_builds
fi
if [ ${MAIL} ] || [ ${ADMIN_MAIL} ]; then
eval MAIL=${MAIL}
eval ADMIN_MAIL=${ADMIN_MAIL}
_send_mail
fi
done
OVERALL_EXIT_CODE=$((${SYNC_REPO_EXIT_CODE}+${GET_BREAKFAST_VARIABLES_EXIT_CODE}+${BRUNCH_DEVICE_EXIT_CODE}+${MOVE_BUILD_EXIT_CODE}+${CLEAN_OLD_BUILDS_EXIT_CODE}+${SEND_MAIL_EXIT_CODE}))
if ! ${BUILD_SUCCESSFUL} && [ ${OVERALL_EXIT_CODE} -gt 0 ]; then
_e_warning "buildcheck failed and Overall exit code is higher then 0 will exit with 1" "${OVERALL_EXIT_CODE}"
exit 1
elif ${BUILD_SUCCESSFUL} && [ ${OVERALL_EXIT_CODE} -gt 0 ]; then
_e_warning "buildcheck was successful but Overall exit code is higher then 0 will exit with 1" "${OVERALL_EXIT_CODE}"
exit 1
else
_e_notice "All jobs finished successfully."
fi
}
## Parameter handling
while getopts ":n:t:l:c:vh" opt; do
case ${opt} in
"n")
MAIL='${OPTARG}'
;;
"t")
TARGET_DIR='${OPTARG}'
;;
"r")
RUN_COMMAND='${OPTARG}'
;;
"l")
DOWNLOAD_LINK='${OPTARG}'
;;
"c")
CLEANUP_OLDER_THEN="${OPTARG}"
;;
"v")
SHOW_VERBOSE=""
;;
"h")
_usage
exit 0
;;
\?)
echo "Invalid option: -${OPTARG}"
_usage
exit 1
;;
:)
echo "Option -${OPTARG} requires an argument."
_usage
exit 1
;;
esac
done
shift $((${OPTIND}-1))
if [ ${@} ]; then
BUILD_FOR_DEVICE=${@}
fi
_main
exit 0
Cheers
Steven
No more gist
The script is now called Dinner, more information at http://forum.xda-developers.com/showthread.php?t=2690995

Addon.d script for Xposed NOUGAT to survive dirty flashes

The script has been adapted for CM13: https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
Since many things have been changed to get Xposed working on Nougat I guess this script has to be adapted again.
Please share if you find something
Thank you.
I second this. The addon.d script was a godsend in the good 'ol days
Something as this?:
Code:
#!/sbin/sh
#
#
# /system/addon.d/81-Xposed.sh
# During a LineageOS 14.1 upgrade, this script backs up Xposed framework files.
# /system is formatted and reinstalled, then the files are restored.
# Based on Xposed "flash-script.sh" script and https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
export C=/sdcard/xposed_backupdir-1234
backup_file() {
if [ -e "$1" ]; then
if [ ! -L "$1" ]; then
local F="${1##*/}"
local D="${1%/*}"
mkdir -p "$C/$D"
cp -dp "$1" "$C/$D/$F"
else
ui_print "Skipping symbolic link $1"
fi
else
ui_print "NE: $1"
fi
}
restore_file() {
local FILE="${1##*/}"
local DIR="${1%/*}"
if [ -e "$C/$DIR/$FILE" ]; then
if [ "$FILE" == "xposed.prop" ] || [ "$FILE" == "XposedBridge.jar" ]; then
restore_nobackup "/$DIR/$FILE" 0 0 0644
elif [ "$FILE" == "app_process64_xposed" ] || [ "$FILE" == "app_process32_xposed" ]; then
restore_and_link "/$DIR/${FILE%_xposed}" 0 2000 0755 u:object_r:zygote_exec:s0
elif [ "$FILE" == "dex2oat" ] || [ "$FILE" == "patchoat" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755 u:object_r:dex2oat_exec:s0
elif [ "$FILE" == "oatdump" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755
else
restore_overwrite "/$DIR/$FILE" 0 0 0644
fi
else
ui_print "NE: $C/$DIR/$FILE"
fi
}
cp_perm() {
cp -f "$1" "$2" || exit 1
set_perm "$2" $3 $4 $5 $6
}
set_perm() {
chown $2:$3 "$1" || exit 1
chmod $4 "$1" || exit 1
if [ "$5" ]; then
chcon $5 "$1" 2>/dev/null
else
chcon 'u:object_r:system_file:s0' "$1" 2>/dev/null
fi
}
restore_nobackup() {
cp_perm "$C/$1" "$1" $2 $3 $4 $5
}
restore_and_link() {
TARGET="${1}"
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f "$C/$XPOSED" ]; then
return
fi
cp_perm "$C/$XPOSED" "$XPOSED" $2 $3 $4 $5
if [ ! -f "$BACKUP" ]; then
mv "$TARGET" "$BACKUP" || exit 1
ln -s "$XPOSED" "$TARGET" || exit 1
chcon -h 'u:object_r:system_file:s0' "$TARGET" 2>/dev/null
fi
}
restore_overwrite() {
TARGET=$1
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f "$TARGET" ]; then
touch "$NO_ORIG" || exit 1
set_perm "$NO_ORIG" 0 0 600
elif [ -f "$BACKUP" ]; then
rm -f "$TARGET"
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" ] && [ ! -f "$NO_ORIG" ]; then
mv "$TARGET" "$BACKUP" || exit 1
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm "$C/$TARGET" "$TARGET" $2 $3 $4 $5
}
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
list_files() {
cat <<EOF
/system/xposed.prop
/system/framework/XposedBridge.jar
# For 32bits
/system/bin/app_process32_xposed
/system/bin/dex2oat
/system/bin/oatdump
/system/bin/patchoat
/system/lib/libart.so
/system/lib/libart-compiler.so
/system/lib/libart-disassembler.so
/system/lib/libsigchain.so
/system/lib/libxposed_art.so
# For 64bits
/system/bin/app_process64_xposed 64bit
/system/lib64/libart.so 64bit
/system/lib64/libart-compiler.so 64bit
/system/lib64/libart-disassembler.so 64bit
/system/lib64/libsigchain.so 64bit
/system/lib64/libxposed_art.so 64bit
EOF
}
OSA="32bit"
OUTFD=`ps | grep -v grep | grep -oE "update(.*)" | cut -d" " -f3`
API=$(sed -n "s/^ro.build.version.sdk=//p" /system/build.prop | head -n 1)
ABILONG=$(sed -n "s/^ro.product.cpu.abi=//p" /system/build.prop | head -n 1)
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ] || [ "$ABILONG" = "x86_64" ]; then OSA="64bit"; fi;
fi
case "$1" in
backup)
ui_print "Starting to backup Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
backup_file "$FILE"
fi
done
ui_print "Ending to backup Xposed"
;;
restore)
ui_print "Starting to restore Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
restore_file "$FILE"
fi
done
if [ "$API" -ge "22" ]; then
find /system /vendor -type f -name '*.odex.gz' 2>/dev/null | while read f; do mv "$f" "$f.xposed"; done
fi
rm -rf "${C:?}/"
ui_print "Ending to restore Xposed"
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
MariferC said:
Something as this?:
Code:
#!/sbin/sh
#
#
# /system/addon.d/81-Xposed.sh
# During a LineageOS 14.1 upgrade, this script backs up Xposed framework files.
# /system is formatted and reinstalled, then the files are restored.
# Based on Xposed "flash-script.sh" script and https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
export C=/sdcard/xposed_backupdir-1234
backup_file() {
if [ -e "$1" ]; then
if [ ! -L "$1" ]; then
local F="${1##*/}"
local D="${1%/*}"
mkdir -p "$C/$D"
cp -dp "$1" "$C/$D/$F"
else
ui_print "Skipping symbolic link $1"
fi
else
ui_print "NE: $1"
fi
}
restore_file() {
local FILE="${1##*/}"
local DIR="${1%/*}"
if [ -e "$C/$DIR/$FILE" ]; then
if [ "$FILE" == "xposed.prop" ] || [ "$FILE" == "XposedBridge.jar" ]; then
restore_nobackup "/$DIR/$FILE" 0 0 0644
elif [ "$FILE" == "app_process64_xposed" ] || [ "$FILE" == "app_process32_xposed" ]; then
restore_and_link "/$DIR/${FILE%_xposed}" 0 2000 0755 u:object_r:zygote_exec:s0
elif [ "$FILE" == "dex2oat" ] || [ "$FILE" == "patchoat" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755 u:object_r:dex2oat_exec:s0
elif [ "$FILE" == "oatdump" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755
else
restore_overwrite "/$DIR/$FILE" 0 0 0644
fi
else
ui_print "NE: $C/$DIR/$FILE"
fi
}
cp_perm() {
cp -f "$1" "$2" || exit 1
set_perm "$2" $3 $4 $5 $6
}
set_perm() {
chown $2:$3 "$1" || exit 1
chmod $4 "$1" || exit 1
if [ "$5" ]; then
chcon $5 "$1" 2>/dev/null
else
chcon 'u:object_r:system_file:s0' "$1" 2>/dev/null
fi
}
restore_nobackup() {
cp_perm "$C/$1" "$1" $2 $3 $4 $5
}
restore_and_link() {
TARGET="${1}"
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f "$C/$XPOSED" ]; then
return
fi
cp_perm "$C/$XPOSED" "$XPOSED" $2 $3 $4 $5
if [ ! -f "$BACKUP" ]; then
mv "$TARGET" "$BACKUP" || exit 1
ln -s "$XPOSED" "$TARGET" || exit 1
chcon -h 'u:object_r:system_file:s0' "$TARGET" 2>/dev/null
fi
}
restore_overwrite() {
TARGET=$1
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f "$TARGET" ]; then
touch "$NO_ORIG" || exit 1
set_perm "$NO_ORIG" 0 0 600
elif [ -f "$BACKUP" ]; then
rm -f "$TARGET"
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" ] && [ ! -f "$NO_ORIG" ]; then
mv "$TARGET" "$BACKUP" || exit 1
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm "$C/$TARGET" "$TARGET" $2 $3 $4 $5
}
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
list_files() {
cat <<EOF
/system/xposed.prop
/system/framework/XposedBridge.jar
# For 32bits
/system/bin/app_process32_xposed
/system/bin/dex2oat
/system/bin/oatdump
/system/bin/patchoat
/system/lib/libart.so
/system/lib/libart-compiler.so
/system/lib/libart-disassembler.so
/system/lib/libsigchain.so
/system/lib/libxposed_art.so
# For 64bits
/system/bin/app_process64_xposed 64bit
/system/lib64/libart.so 64bit
/system/lib64/libart-compiler.so 64bit
/system/lib64/libart-disassembler.so 64bit
/system/lib64/libsigchain.so 64bit
/system/lib64/libxposed_art.so 64bit
EOF
}
OSA="32bit"
OUTFD=`ps | grep -v grep | grep -oE "update(.*)" | cut -d" " -f3`
API=$(sed -n "s/^ro.build.version.sdk=//p" /system/build.prop | head -n 1)
ABILONG=$(sed -n "s/^ro.product.cpu.abi=//p" /system/build.prop | head -n 1)
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ] || [ "$ABILONG" = "x86_64" ]; then OSA="64bit"; fi;
fi
case "$1" in
backup)
ui_print "Starting to backup Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
backup_file "$FILE"
fi
done
ui_print "Ending to backup Xposed"
;;
restore)
ui_print "Starting to restore Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
restore_file "$FILE"
fi
done
if [ "$API" -ge "22" ]; then
find /system /vendor -type f -name '*.odex.gz' 2>/dev/null | while read f; do mv "$f" "$f.xposed"; done
fi
rm -rf "${C:?}/"
ui_print "Ending to restore Xposed"
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
Click to expand...
Click to collapse
Did you create it? Did you try it on Nougat?
Anyway my custom ROM is no longer updated for Nougat. Hopefully it will work on Oreo.
OSheden said:
Did you create it? Did you try it on Nougat?
Anyway my custom ROM is no longer updated for Nougat. Hopefully it will work on Oreo.
Click to expand...
Click to collapse
Yes I've created it.
Yes I've tested on Nougat (LineageOS 14.1) on a Xiaomi Mi4 and a Moto G 2014, and it works.

Categories

Resources