[SOLVED] Problem with Image : Debian Jessie 3.4.103

Started by LittleScarabee, June 14, 2016, 10:48:40 PM

Previous topic - Next topic

LittleScarabee

Dear All,

I downloaded this image : https://www.olimex.com/wiki/images/4/46/A20-lime2_mainline_uboot_GMAC_master_sunxi_kernel_3.4.103_jessie_NAND_rel_5.torrent
After many boot I identified that address mac for my network it's dynamic.

I cannot change this parameters because I cannot find :
- theses files : chscr.sh and wrscr.sh
- this directory : /opt/sunxi-tools

Can you give me the link to download these files please ? Or link for another debian version please ?

Thanks for your help

igorpec

linux for ARM development boards
www.armbian.com

LittleScarabee

Thanks.
I have already tester this distribution > but in this image I cannot find tools needed to modify the fed file.
That why I want to use the official distribution, but probably it's a "bug" in the last release of "Debian Jessie 3.4.103" ?!

LittleScarabee

#3
Hi

I just download the last release from Olimex : Jessie 3.4.103 release 6 > these files stil not available.
Can you say me in which version I can find these files : chscr.sh and wrscr.sh ?

At this time with this release I can have these information's for my battery on startup :

root@A20-OLinuXino:~# dmesg | grep axp
[    2.430661] axp_mfd 0-0034: AXP (CHIP ID: 0x41) detected
[    2.441813] axp_mfd 0-0034: AXP internal temperature monitoring enabled
[    2.516429] axp20_ldo1: 1300 mV
[    2.524912] axp20_ldo2: 1800 <--> 3300 mV at 3000 mV
[    2.535042] axp20_ldo3: 700 <--> 3500 mV at 2800 mV
[    2.547791] axp20_ldo4: 1250 <--> 3300 mV at 2800 mV
[    2.558203] axp20_buck2: 700 <--> 2275 mV at 1450 mV
[    2.591757] axp20_buck3: 700 <--> 3500 mV at 1250 mV
[    2.601667] axp20_ldoio0: 1800 <--> 3300 mV at 2800 mV
[    2.616475] input: axp20-supplyer as /devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/input/input0
[    2.645785] axp20_ldo2: Failed to create debugfs directory
[    2.908621] axp20_buck2: Failed to create debugfs directory
[    3.062756] axp20_buck3: incomplete constraints, leaving on
[    3.073221] axp20_buck2: incomplete constraints, leaving on
[    3.083494] axp20_ldo4: incomplete constraints, leaving on
[    3.093733] axp20_ldo3: incomplete constraints, leaving on
[    3.103918] axp20_ldo2: incomplete constraints, leaving on


My goal it's to specify amperage of my battery and have a static mac address

EDIT (06/27/16) : IP Address fixed by update this file /etc/network/interfaces and by adding this value :

auto eth0
iface eth0 inet dhcp
hwaddress ether ADDRESS_MAC_EXPECTED
...


Thanks for all

LubOlimex

Hey,

I'm not sure if the chscr.sh and the wrscr.sh are available in the Jessie releases. Yet, I'm sure that the tools needed for converting fex to bin and bin to fex are present. Of course, this complicates the procedure.

So how do edit the configuration - there are two approaches - either use SD card reader and edit it on another machine or you can do it on the board using bin2fex and fex2bin tools. First convert the bin to fex. Then open the newly created fex with a text editor and edit the values. Save the changes. Then convert the fex file back to bin. Then replace the old script and place the new one. The shell scripts (chscr.sh and wrscr.sh) did exactly that.

Yet, if you want to use the easier method from the older release it should be pretty easy to use the old scripts. I will paste the original shell scripts below, you can still use it (the only thing you might need to change the location of fex2bin and bin2fex executable):

chscr.sh

#!/bin/sh
mount /dev/mmcblk0p1 /mnt
cp /mnt/script.bin /opt/sunxi-tools
/opt/sunxi-tools/bin2fex /opt/sunxi-tools/script.bin > /opt/sunxi-tools/script.$
nano /opt/sunxi-tools/script.fex


wrscr.sh

#!/bin/sh
mount /dev/mmcblk0p1 /mnt
/opt/sunxi-tools/fex2bin /opt/sunxi-tools/script.fex > /opt/sunxi-tools/script.$
cp /opt/sunxi-tools/script.bin /mnt/script.bin
sync
umount /dev/mmcblk0p1


I will try to include updated scripts in the next official release of the Jessie images.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

LittleScarabee

Hi

Thanks Lub.

My goal it's to try to update this file without remove my SD. So after many search in Internet today ...I cannot install correctly sunxi-tools, I'm not sure that the commande "make" works as expected, I dont't how I can check that.

I tried this link : http://linux-sunxi.org/Sunxi-tools#fexc_and_wrappers referenced here : http://linux-sunxi.org/Fex_Guide (chapter FEX Description).

I'm testing this tutorial : https://github.com/linux-sunxi/sunxi-tools
I'll keep you informed

LittleScarabee

#6
Hi Lub,

Its works !!!
In summary I followed these instructions :

Step 1 :

apt-get install libusb-1.0-0-dev ntp -y


Step 2 : EDIT: 06/29/2016 (adding more commands)

dpkg-reconfigure tzdata
apt-get install gcc make mlton-runtime-arm-linux-gnueabihf -y
apt-get install build-essential git debootstrap u-boot-tools device-tree-compiler -y


Step 3 :

cd /opt
git clone https://github.com/linux-sunxi/sunxi-tools


Step 4 :

cd sunxi-tools/
make


Step 5, I've got this result :

root@LUIGI:/opt/sunxi-tools# make
cc -g -O0 -Wall -Wextra  -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/  -o sunxi-fexc fexc.c script.c script_uboot.c script_bin.c script_fex.c
cc -g -O0 -Wall -Wextra  -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/  -o sunxi-bootinfo bootinfo.c
cc -g -O0 -Wall -Wextra  -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ `pkg-config --cflags libusb-1.0`  -o sunxi-fel fel.c progress.c  `pkg-config --libs libusb-1.0`
cc -g -O0 -Wall -Wextra  -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -c -o nand-part-main.o nand-part-main.c
cc -g -O0 -Wall -Wextra  -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -c -o nand-part-a10.o nand-part.c -D A10
cc -g -O0 -Wall -Wextra  -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -c -o nand-part-a20.o nand-part.c -D A20
cc  -o sunxi-nand-part nand-part-main.o nand-part-a10.o nand-part-a20.o
ln -nsf sunxi-fexc bin2fex
ln -nsf sunxi-fexc fex2bin
cc -g -O0 -Wall -Wextra  -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/  -o sunxi-pio pio.c


I created two script in this folder.
Note : two mistakes on your script, see below :
/opt/sunxi-tools/bin2fex /opt/sunxi-tools/script.bin > /opt/sunxi-tools/script.fex instead of /opt/sunxi-tools/bin2fex /opt/sunxi-tools/script.bin > /opt/sunxi-tools/script.$
>> Now I'm able to update my configuration file. thanks a lot  :D

Why is it necessary to run this commande on your script ?
"mount /dev/mmcblk0p1 /mnt"
Is it possible to do not use this command ?

Thanks

LubOlimex

Glad you are making progress! I believe the partition with the file was not mounted by default. It might be mouted by default in the newer releases. If the scripts work without it - leave the mount command out.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

LittleScarabee

Hi

Yes its works !
I think it will better to have this tools already include in the last release.

Last Questions :
1 / Before create a new post : how can I extend the file system ? (resize2FS doesn't work)
2 / Is it possible to open the thread dedicated to the release ? my request it's to have the network interface eth0 enable by default and in DHCP.

nabbal

Quote from: LittleScarabee on June 29, 2016, 12:57:12 PM
1 / Before create a new post : how can I extend the file system ? (resize2FS doesn't work)
Being root:
/root/resize_sd.sh /dev/mmcblk0 2

LittleScarabee


LittleScarabee

#11
I updated my post to add more commands line on step 2.
I think, it can help somebody else.

See below my script :

chscr.sh

#!/bin/sh
cp /boot/script.bin /opt/sunxi-tools
/opt/sunxi-tools/bin2fex /opt/sunxi-tools/script.bin > /opt/sunxi-tools/script.fex
vim /opt/sunxi-tools/script.fex


wrscr.sh

#!/bin/sh
/opt/sunxi-tools/fex2bin /opt/sunxi-tools/script.fex > /opt/sunxi-tools/script.bin
cp /opt/sunxi-tools/script.bin /boot/script.bin
sync