Difference between revisions of "How to edit board configurations and definitions in the official Debian Linux"

(How to edit board configurations and definitions in the official Debian Linux?)
(Changing script.bin file without removing the microSD card)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
===How to edit board configurations and definitions in the official Debian Linux? ===
 
===How to edit board configurations and definitions in the official Debian Linux? ===
  
'''Changing script.bin file without removing the microSD card'''
+
====Changing script.bin file without removing the microSD card====
 +
<br>
 +
'''Using bin2fex and fex2bin directly'''
  
The tools for script.bin changing are located in /opt/sunxi-tools directory:
+
The file that contains board definitions is in binary format so we we need to convert it to text first. We use the bin2fex convertor that comes with the image. Type:
 +
 
 +
  <nowiki>bin2fex /boot/script.bin /boot/script.fex</nowiki>
 +
 
 +
Then open the script.fex with text editor, for example:
 +
 
 +
  <nowiki>nano /boot/script.fex</nowiki>
 +
 
 +
Edit the file as you want (pin assignments etc) and save the changes and exit. The different options for the script are explained here: [http://linux-sunxi.org/Fex_Guide SUNXI FEX GUIDE]
 +
 
 +
IMPORTANT! ADJUSTING SCRIPT.BIN WITH IMPROPER VALUES MIGHT BREAK YOUR DEBIAN IMAGE AND IT IS ALWAYS RECOMMENDED TO KEEP A BACK-UP OF YOUR DEFAULT SCRIPT.BIN
 +
 
 +
When done with editing convert the text file back to binary format with fex2bin tool, type:
 +
 
 +
  <nowiki>fex2bin /boot/script.fex /boot/script.bin</nowiki>
 +
 
 +
Finally, reboot the board:
 +
 
 +
  <nowiki>reboot</nowiki>
 +
 
 +
'''Using script (if available)'''
 +
 
 +
Some official releases have tools for script.bin changing, located in /opt/sunxi-tools directory:
  
 
   <nowiki># cd /opt/sunxi-tools</nowiki>
 
   <nowiki># cd /opt/sunxi-tools</nowiki>
Line 9: Line 33:
  
 
This will convert script.bin file from sdcard to script.fex file and the file  will be opened using nano editor.  
 
This will convert script.bin file from sdcard to script.fex file and the file  will be opened using nano editor.  
Now you can change the board modules and parameters, save the changes (CTRL+X; confirm) and exit from nano editor.
+
Now you can change the board modules and parameters, save the changes ("CTRL"+"X"; confirm with "Y") and exit ("CTRL"+"X" again) from nano editor.
  
 
   <nowiki># ./wrscr.sh</nowiki>
 
   <nowiki># ./wrscr.sh</nowiki>
Line 19: Line 43:
 
Reboot the board and the new settings would be enabled.
 
Reboot the board and the new settings would be enabled.
  
'''Changing script.bin file by removing the microSD card'''
+
====Changing script.bin file by removing the microSD card====
 
+
<br>
 
The biggest part of the board configuration might be edited, changed or improved in a file called script.bin
 
The biggest part of the board configuration might be edited, changed or improved in a file called script.bin
  
Line 31: Line 55:
 
IMPORTANT! ADJUSTING SCRIPT.BIN WITH IMPROPER VALUES MIGHT BREAK YOUR DEBIAN IMAGE AND IT IS ALWAYS RECOMMENDED TO KEEP A BACK-UP OF YOUR DEFAULT SCRIPT.BIN
 
IMPORTANT! ADJUSTING SCRIPT.BIN WITH IMPROPER VALUES MIGHT BREAK YOUR DEBIAN IMAGE AND IT IS ALWAYS RECOMMENDED TO KEEP A BACK-UP OF YOUR DEFAULT SCRIPT.BIN
  
To convert back and fort the script.bin you might use different tools. You can find Windows tools here: [https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/fex-bin-convertor-windows SUNXI TOOLS FOR WINDOWS] . For Linux convertors please check the sunxi tools here: [https://github.com/linux-sunxi/sunxi-tools SUNXI TOOLS]
+
To convert back and forth the script.bin you might use different tools. You can find Windows tools here: [https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/fex-bin-convertor-windows SUNXI TOOLS FOR WINDOWS] . For Linux convertors please check the sunxi tools here: [https://github.com/linux-sunxi/sunxi-tools SUNXI TOOLS]
  
Note that it is possible to change the script.bin in a running Debian image in newest releases! More information might be found at the end of the document! Not all releases feature the live method of changing fex to bin so if you board doesn't have it follow the other methods.
+
Note that it is possible to change the script.bin in a running Debian image in newest releases! More information might be found at the top of this wiki article! Not all releases feature the live method of changing fex to bin so if you board doesn't have it follow the offline method.

Latest revision as of 03:43, 8 September 2017

How to edit board configurations and definitions in the official Debian Linux?

Changing script.bin file without removing the microSD card


Using bin2fex and fex2bin directly

The file that contains board definitions is in binary format so we we need to convert it to text first. We use the bin2fex convertor that comes with the image. Type:

 bin2fex /boot/script.bin /boot/script.fex

Then open the script.fex with text editor, for example:

 nano /boot/script.fex

Edit the file as you want (pin assignments etc) and save the changes and exit. The different options for the script are explained here: SUNXI FEX GUIDE

IMPORTANT! ADJUSTING SCRIPT.BIN WITH IMPROPER VALUES MIGHT BREAK YOUR DEBIAN IMAGE AND IT IS ALWAYS RECOMMENDED TO KEEP A BACK-UP OF YOUR DEFAULT SCRIPT.BIN

When done with editing convert the text file back to binary format with fex2bin tool, type:

 fex2bin /boot/script.fex /boot/script.bin

Finally, reboot the board:

 reboot

Using script (if available)

Some official releases have tools for script.bin changing, located in /opt/sunxi-tools directory:

  # cd /opt/sunxi-tools
  # ./chscr.sh

This will convert script.bin file from sdcard to script.fex file and the file will be opened using nano editor. Now you can change the board modules and parameters, save the changes ("CTRL"+"X"; confirm with "Y") and exit ("CTRL"+"X" again) from nano editor.

  # ./wrscr.sh

this will convert script.fex to script.bin and the script.bin file will be written to sdcard.

  reboot

Reboot the board and the new settings would be enabled.

Changing script.bin file by removing the microSD card


The biggest part of the board configuration might be edited, changed or improved in a file called script.bin

The script.bin file can usually be found in the main directory of a microSD card prepared with official Debian image. The folder containing the script can be inspected under both Windows, Linux or Mac.

You can't directly edit binary file so you would need to convert it to text format (it is called fex in this case), then edit the parameters via a text editor and finally switch it back to binary format.

The different options for the script are explained here: SUNXI FEX GUIDE

IMPORTANT! ADJUSTING SCRIPT.BIN WITH IMPROPER VALUES MIGHT BREAK YOUR DEBIAN IMAGE AND IT IS ALWAYS RECOMMENDED TO KEEP A BACK-UP OF YOUR DEFAULT SCRIPT.BIN

To convert back and forth the script.bin you might use different tools. You can find Windows tools here: SUNXI TOOLS FOR WINDOWS . For Linux convertors please check the sunxi tools here: SUNXI TOOLS

Note that it is possible to change the script.bin in a running Debian image in newest releases! More information might be found at the top of this wiki article! Not all releases feature the live method of changing fex to bin so if you board doesn't have it follow the offline method.