How to edit the System Configuration

From wiki
(Difference between revisions)
Jump to: navigation, search
Line 44: Line 44:
 
Firstly, you must connect network and install compilation Tools:
 
Firstly, you must connect network and install compilation Tools:
  
$ 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 files: fex2bin and bin2fex.
 
With the using of ls, you can find the files: fex2bin and bin2fex.
Line 52: Line 52:
 
Copy the script.bin.(boot from sdcard):
 
Copy the script.bin.(boot from sdcard):
  
$ mkdir /mnt/mmcp1
+
mkdir /mnt/mmcp1
$ mount /dev/mmcblk0p1 /mnt/mmcp1  (the script.bin is in /dev/nanda if you boot from nand )
+
mount /dev/mmcblk0p1 /mnt/mmcp1  (the script.bin is in /dev/nanda if you boot from nand )
$ cp /mnt/mmcp1/script.bin ./
+
cp /mnt/mmcp1/script.bin ./
  
 
Convert the script.bin to script.fex:
 
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
$ vi script.fex
+
vi 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 66: Line 66:
 
Convert the script.fex to script.bin and push it back.
 
Convert the script.fex to script.bin and push it back.
  
$ ./fex2bin script.fex > ./script.bin
+
./fex2bin script.fex > ./script.bin
$cp ./script.bin /mnt/mmcp1/
+
cp ./script.bin /mnt/mmcp1/
$umount /mnt/mmcp1
+
umount /mnt/mmcp1
$reboot
+
reboot
  
 
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.
Line 75: Line 75:
 
Note:When the script.bin is invalid.You must enter the u-boot command line and input
 
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
+
setenv boot_normal fatload nand 0 43000000 script.bin\;boota 40007800
$saveenv
+
saveenv
$reset
+
reset

Revision as of 06:49, 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