How to edit the System Configuration

From wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "If someone want to add gpio pin or uart without compile the source code.The sunxi-tools can help you. Android At first You may need fex2bin and bin2fex: $ git clone git://gi...")
 
Line 1: Line 1:
 
If someone want to add gpio pin or uart without compile the source code.The sunxi-tools can help you.
 
If someone want to add gpio pin or uart without compile the source code.The sunxi-tools can help you.
Android
+
 
 +
==Android==
  
 
At first You may need fex2bin and bin2fex:
 
At first You may need fex2bin and bin2fex:
  
$ git clone git://github.com/linux-sunxi/sunxi-tools.git
+
git clone git://github.com/linux-sunxi/sunxi-tools.git
$ cd sunxi-tools
+
cd sunxi-tools
$ make
+
make
$ With the using of ls, you can find the fex2bin and bin2fex.
+
With the using of ls, you can find the fex2bin and bin2fex.
  
 
Second copy the script.bin from Android OS:
 
Second copy the script.bin from Android OS:
  
$ adb shell
+
adb shell
$ mkdir /mnt/tmp
+
mkdir /mnt/tmp
$ mount -t vfat /dev/block/nanda /mnt/tmp
+
mount -t vfat /dev/block/nanda /mnt/tmp
$ exit
+
exit
$ adb pull /mnt/tmp/script.bin  
+
adb pull /mnt/tmp/script.bin  
  
 
Note : Attention it's different from Linux.
 
Note : Attention it's different from Linux.
Line 21: Line 22:
 
Then convert the script.bin to script.fex:
 
Then convert the script.bin to script.fex:
  
$ chmod 777 script.bin
+
chmod 777 script.bin
$ ./bin2fex script.bin > ./script.fex
+
./bin2fex script.bin > ./script.fex
$ gedit script.fex
+
gedit script.fex
  
 
Now, you can edit the script.fex. Don't forget saving the file when you leave it.
 
Now, you can edit the script.fex. Don't forget saving the file when you leave it.
Line 36: Line 37:
  
 
It will restart the CB. The new script.bin will come into effect.
 
It will restart the CB. The new script.bin will come into effect.
Linux
+
 
 +
 
 +
==Linux==
  
 
You can edit the script.bin directly
 
You can edit the script.bin directly

Revision as of 06:48, 22 October 2015

If someone want to add gpio pin or uart without compile the source code.The sunxi-tools can help you.

Android

At first You may need fex2bin and bin2fex:

git clone git://github.com/linux-sunxi/sunxi-tools.git
cd sunxi-tools
make
With the using of ls, you can find the fex2bin and bin2fex.

Second copy the script.bin from Android OS:

adb shell
mkdir /mnt/tmp
mount -t vfat /dev/block/nanda /mnt/tmp
exit
adb pull /mnt/tmp/script.bin 

Note : Attention it's different from Linux.

Then convert the script.bin to script.fex:

chmod 777 script.bin
./bin2fex script.bin > ./script.fex
gedit script.fex

Now, you can edit the script.fex. Don't forget saving the file when you leave it.

Finally,convert the script.fex to script.bin and push it back to the CB

$ ./fex2bin script.fex > ./script.bin $ adb push script.bin /mnt/tmp $ adb shell $ umount /mnt/tmp $ reboot

It will restart the CB. The new script.bin will come into effect.


Linux

You can edit the script.bin directly Firstly, you must connect network and install compilation Tools:

$ git clone git://github.com/linux-sunxi/sunxi-tools.git $ cd sunxi-tools $ make

With the using of ls, you can find the files: fex2bin and bin2fex.

Copy the script.bin.(boot from sdcard):

$ mkdir /mnt/mmcp1 $ mount /dev/mmcblk0p1 /mnt/mmcp1 (the script.bin is in /dev/nanda if you boot from nand ) $ cp /mnt/mmcp1/script.bin ./

Convert the script.bin to script.fex:

$ chmod 777 script.bin $ ./bin2fex script.bin > ./script.fex $ vi script.fex

Now, you can edit the script.fex.Don't forget saving the file when you leave it.

Convert the script.fex to script.bin and push it back.

$ ./fex2bin script.fex > ./script.bin $cp ./script.bin /mnt/mmcp1/ $umount /mnt/mmcp1 $reboot

It will restart the CB. The new script.bin will come into effect.

Note:When the script.bin is invalid.You must enter the u-boot command line and input

$setenv boot_normal fatload nand 0 43000000 script.bin\;boota 40007800 $saveenv $reset

Personal tools