Advertisement
bigrushdog

linux bible for scott

May 2nd, 2011
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 8.50 KB | None | 0 0
  1. KERNEL COMMANDS
  2.  
  3. cp arch/arm/configs/tiamat_defconfig ./.config
  4. export CCOMPILER=${HOME}/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
  5. make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig
  6. make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
  7.  
  8. cp arch/arm/configs/tiamat_defconfig ./.config
  9. export CCOMPILER=${HOME}/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
  10. make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
  11.  
  12.  
  13. BUILD CLOCKWORK RECOVERY IN CM REPO
  14.  
  15. make clobber
  16. . build/envsetup.sh
  17. make -j4 otatools
  18. lunch full_stingray-eng
  19. build/tools/device/mkvendor.sh motorola stingray /home/bigrushdog/android/system/device/motorola/stingray/boot.img
  20. lunch full_stingray-eng
  21. make -j4 recoveryimage
  22.  
  23. ---- Made recovery image -------- out/target/product/xoom/recovery.img
  24.  
  25. make clobber (to clean up and start over)
  26.  
  27. 9a35354a06e01d37035c4eaaacd2ee67
  28.  
  29. HOW TO USE GIT
  30.  
  31. REMOTES
  32.  
  33. git remote add coolbho https://github.com/coolbho3k/Xoom-OC.git
  34. git remote add cyber https://github.com/cybertronic/Xoom-OC.git
  35. git remote add kcrudup https://github.com/kcrudup/Xoom-OC-CP.git
  36. git remote add tegra git://android.git.kernel.org/kernel/tegra.git
  37. git remote add common git://android.git.kernel.org/kernel/common.git
  38. git remote add aufs http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git
  39.  
  40. CLONE REPO
  41. git clone https://bigrushdog@github.com/Tiamat-AOSP/Xoom-OC.git
  42.  
  43. CREATE NEW BRANCH
  44. git checkout -b bigrushdog-exp
  45.  
  46. CHANGE BRANCH
  47. git checkout bigrushdog-exp
  48.  
  49. VIEW ALL BRANCHES
  50. git branch -a
  51.  
  52. ADD REMOTE SOURCE
  53. git remote add cyber https://cyber@github.com/Tiamat-AOSP/Xoom-OC.git
  54.  
  55. REMOVE REMOTE BRANCH
  56. git push origin :cybertronic-android-tegra-2.6.36-honeycomb
  57.  
  58. REMOVE LOCAL BRANCH
  59. git brand -D local_branch
  60.  
  61. STAGE REMOTE FOR CHERRYPICKING
  62. git fetch cyber
  63.  
  64. PULL REMOTE BRANCH
  65. git checkout cyber (change to desired local branch)
  66. git pull cyber cyber-branch (pull into desired branch)
  67.  
  68. CHERRYPICK A COMMIT
  69. git cherry-pick <commit tag>
  70.  
  71. FIX PULL ERRORS
  72. >>>>>>>>>>>>>>>>>>>>>>>>>>>
  73. HEAD
  74. then some code      THIS IS BEFORE PULL, DELETE
  75. then
  76. =================
  77. some more code      THIS IS AFTER PULL, KEEP
  78. <<<<<<<<<<<<<<<<<<<<<
  79.  
  80. COMMIT
  81. git checkout desired-branch
  82. git add 'drop file here'
  83. git commit -m 'commit message here'
  84. git push origin desired-remote-branch
  85.  
  86. MERGE PULL REQUEST
  87. git checkout -b cybertronic-android-tegra-2.6.36-honeycomb android-tegra-2.6.36-honeycomb
  88. git pull https://github.com/cybertronic/Xoom-OC.git android-tegra-2.6.36-honeycomb
  89. git checkout android-tegra-2.6.36-honeycomb
  90. git merge cybertronic-android-tegra-2.6.36-honeycomb
  91. git push origin android-tegra-2.6.36-honeycomb
  92.  
  93. GIT STASH
  94.  
  95. Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
  96.  
  97. The modifications stashed away by this command can be listed with git stash list, inspected with git stash show, and restored (potentially on top of a different commit) with git stash apply. Calling git stash without any arguments is equivalent to git stash save. A stash is by default listed as "WIP on branchname …", but you can give a more descriptive message on the command line when you create one.
  98.  
  99.  
  100. MASS STORAGE INTENT
  101.  
  102. am start -n com.android.systemui/.usb.UsbStorageActivity
  103.  
  104.  
  105. APKTOOL
  106.  
  107. apktool d -f -t <tag> app.apk app.apk-decoded
  108. apktool b app.apk-decoded
  109. apktool if framework-res.apk <tag>
  110.  
  111.  
  112. SYNC AND BUILD CM REPO
  113.  
  114. cd ~/android/system/
  115. repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
  116. cd ~/android/system/
  117. repo sync
  118.  
  119. cd ~/android/system/device/htc/supersonic/
  120. ./extract-files.sh
  121.  
  122. cd ~/android/system/vendor/cyanogen/
  123. ./get-rommanager
  124.  
  125. cd ~/android/system
  126. cp ./vendor/cyanogen/products/cyanogen_supersonic.mk ./buildspec.mk
  127. . build/envsetup.sh
  128. lunch cyanogen_supersonic-eng
  129.  
  130. make -j`grep 'processor' /proc/cpuinfo | wc -l` otapackage
  131.  
  132. ~/android/system/out/target/product/supersonic/update.cm-XXXXX-signed.zip
  133.  
  134.  
  135. SYNC WITH HONEYCOMB AOSP
  136.  
  137. repo init -u git://android.git.kernel.org/platform/manifest.git -m 3.0-base.xml
  138. repo forall -p -c git checkout android-3.0_r1.3
  139. . build/envsetup.sh; lunch 1; make
  140.  
  141.  
  142. CREATE PATCH WITH DIFF
  143.  
  144. diff -Nur a/drivers/bluetooth b/drivers/bluetooth > patch-bt.32
  145. patch -p1 < ~/usr/src/patch-2.6.24-viafb
  146.  
  147.  
  148. BATCH FIND AND PUSH MODULES BUT COULD BE USED FOR ANYTHING
  149.  
  150. for file in `ls system/lib/modules/*.ko`
  151. do
  152.     adb push $file /system/lib/modules/
  153. done
  154.  
  155. cd system/lib/modules ; ls -1 *.ko |awk '{print "adb push " $1 " /system/lib/modules/" }' |sh
  156.  
  157. XOOM DATA AND BLOCK MANIPULATION
  158.  
  159. COPY IMAGES
  160. cat /dev/block/mmcblk0p4 > /data/media/external/misc5.img
  161. cat /dev/block/platform/sdhci-tegra.3/by-name/boot > /data/media/external/boot.img
  162. cat /dev/block/platform/sdhci-tegra.3/by-name/system > /data/media/external/system.img
  163. cat /dev/block/platform/sdhci-tegra.3/by-name/userdata > /data/media/external/userdata.img
  164. cat /dev/block/platform/sdhci-tegra.3/by-name/recovery > /data/media/external/recovery.img
  165. cat /dev/block/platform/sdhci-tegra.3/by-name/logo > /sdcard/logo.img
  166.  
  167. FLASH IMAGES
  168. ./fastboot flash boot boot.img
  169. ./fastboot flash system system.img
  170. ./fastboot flash recovery recovery.img
  171. ./fastboot flash userdata userdata.img
  172. ./fastboot erase cacheB
  173.  
  174. MOUNT FROM SHELL
  175. mount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/recovery mnt/recovery
  176. mount -r -w -t vfat /dev/block/platform/sdhci-tegra.2/mmcblk0p1 mnt/external
  177.  
  178. ALTERNATE COPY IMAGE
  179. dd if=/dev/block/platform/sdhci-tegra.3/by-name/boot of=/data/boot.img
  180. dd if=/dev/block/platform/sdhci-tegra.3/by-name/logo of=/sdcard/external/logo.img
  181.  
  182.  
  183. LARGE BLOCK ON DEALING WITH SBF:  NEED TO SORT
  184.  
  185. convert image for splash image
  186.  
  187. #!/bin/bash
  188.  
  189. sudo apt-get install imagemagick
  190.  
  191. convert -size 1280x800 xc:black logo.bmp
  192. dd of=tmp.bmp if=logo.bmp bs=1 count=54
  193. dd of=tmp.bmp if=logo.img bs=1 count=3072000 conv=notrunc oflag=append
  194. convert -flip tmp.bmp logo.bmp
  195. rm tmp.bmp
  196.  
  197.  
  198. chmod +x sbf_flash
  199. ./sbf_flash filename.sbf
  200. The output looks something like this -
  201. SBF FLASH 0.01 (mbm)
  202.  
  203. === hack.sbf ===
  204. 00: RDL03 0x80500000-0x8054CFFF FE66 AP
  205. 01:  CG35 0xC0680000-0xC08E37FF ABCB AP
  206. 02:  CG47 0xC0A00000-0xC0D5C7FF 02C0 AP
  207.  
  208. Droid found.
  209.  >> uploading RDL03
  210. Uploading: 100% OK
  211.  >> verifying ramloader
  212.  -- OK
  213.  >> executing ramloader
  214. Droid (ramloader) found.
  215.  >> sending erase
  216.  >> uploading CG35
  217. Uploading: 100% OK
  218.  >> uploading CG47
  219. Uploading: 100% OK
  220.  >> verifying CG35
  221.  -- OK
  222.  >> verifying CG47
  223.  -- OK
  224.  >> rebooting
  225.  
  226.  
  227. I found a guide for the E2, the E6 and A1200 are identical except for the different code groups, which was posted on your forum I b
  228. elieve. Well heres the guide(for the E2 but its applicable to the E6)
  229.  
  230. Use SBFTool for parsing:
  231.  
  232. 1. The cg34.smg is picture, ringtone, power up off image, and so on icons
  233. 2. The cg37.smg is secure setup ( notice that has 0x1000's FF head file, delete it first when modding). It's important because the flexbit in it
  234. 3. The cg39.smg is boot logo(not the poweron image,but before it)
  235. 4. The cg41.smg is usr/language , so we change fonts here
  236. 5. The cg42.smg /usr/setup , some setup config files
  237. 6. The cg43.smg / , main file system, the bin, lib, the SYSqtapp ( 0x1000 FF head file)
  238. 7. Beside cg39.smg, the other cg34 cg37 cg41 cg42 cg43 are cramfs file systems, you can mount -o -loop the smg in linux(root)
  239.  
  240. # tar zcvf xxx.tar.gz mountedsmgfolder
  241. # tar zxvf xxx.tar.gz -C targeteditfolder
  242.  
  243. so you can mod the files in target edit folder then
  244.  
  245. # mkfs.cramfs targeteditfolder/xxx cg##.smg
  246.  
  247. so you made a new cg##.smg yourself
  248. You can overwrite the smg content in sbf, be carefull the 0X1000 ff head file, and the origin size of smg , plast FF to your new smg to make the size the same
  249. Make the sbf this way will failed when flash finished ( but it works, it really flashed into your phone), because there're checksums in the position 0x300 ~ , 2 block the end of each line
  250. Use checksum.exe to see the checksums( if you got the value EC FA, it should write as FA EC, it must be the opsite of checksum.exe value)
  251. Overwite the checksums, flash will be perfectly finished"
  252.  
  253. sudo apt-get install cramfsprogs fusecram
  254. mkdir /tmp/image
  255. fusecram /path/to/cramfs_image /tmp/image
  256.  
  257.  
  258.  
  259. mount -o loop ~/olyfr_u4_1.5.2_signed_olpsattspe_p012_hwolympus_1g_1ffCG57.smg /mnt/atrix
  260.  
  261.  
  262.  
  263. sort +3 -5 '/home/bigrushdog/Desktop/public_sort.xml' > new_sort.xml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement