Jump to content

Le Potato - writing armbian to eMMC


Tido

Recommended Posts

I got it !!!

It is like this: ctrl + alt + del  on the keyboard attached to the Potato = reboot.  On the Desktop PC I have the Serial-Connector with 'screen' running and within 'screen' you have to hit  SPACE  :D

'help' output:

Spoiler

gxl_p212_v1#'help'
?       - alias for 'help'
aml_sysrecovery- Burning with amlogic format package from partition sysrecovery
amlmmc  - AMLMMC sub system
amlnf   - aml nand sub-system
amlnf_test- AMLPHYNAND sub-system
autoscr - run script from memory
base    - print or set address offset
bcb     - bcb
bmp     - manipulate BMP image data
booti   - boot arm64 Linux Image image from memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
cbusreg - cbus register read/write
chipid  - print chipid and cpuversion
clkmsr  - measure PLL clock
cmp     - memory compare
cp      - memory copy
crc32   - checksum calculation
cvbs    - CVBS sub-system
dcache  - enable or disable data cache
defenv_reserv- reserve some specified envs after defaulting env
dhcp    - boot image via network using DHCP/TFTP protocol
echo    - echo args to console
efuse   - efuse read/write data commands
efuse_user- efuse user space read write ops
emmc    - EMMC sub system
env     - environment handling commands
exit    - exit script
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
ext4size- determine a file's size
false   - do nothing, unsuccessfully
fastboot- use USB Fastboot protocol
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatsize - determine a file's size
fdt     - flattened device tree utility commands
forceupdate- forceupdate
get_rebootmode- get reboot mode
get_valid_slot- get_valid_slot
go      - start application at address 'addr'
gpio    - query and control gpio pins
hdmitx  - HDMITX sub-system
help    - print command description/usage

i2c     - I2C sub-system
icache  - enable or disable instruction cache
imgread - Read the image from internal flash with actual size
itest   - return true/false on integer compare
jtagoff - disable jtag
jtagon  - enable jtag
keyman  - Unify key ops interfaces based dts cfg
keyunify- key unify sub-system
loop    - infinite loop on address range
macreg  - ethernet mac register read/write/dump
md      - memory display
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mw      - memory write (fill)
mwm     - mw mask function
nm      - memory modify (constant address)
open_scp_log- print SCP messgage
osd     - osd sub-system
phyreg  - ethernet phy register read/write/dump
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
query   - SoC query commands
rarpboot- boot image via network using RARP/TFTP protocol
read_temp- cpu temp-system
reboot  - set reboot mode and reboot system
reset   - Perform RESET of the CPU
rsvmem  - reserve memory
run     - run commands in an environment variable
saradc  - saradc sub-system
saradc_12bit- saradc sub-system
saveenv - save environment variables to persistent storage
sdc_burn- Burning with amlogic format package in sdmmc
sdc_update- Burning a partition with image file in sdmmc card
set_trim_base- cpu temp-system
set_usb_boot- set usb boot mode
setenv  - set environment variables
showvar - print local hushshell variables
silent  - silent
sleep   - delay execution for some time
store   - STORE sub-system
systemoff- system off
temp_triming- cpu temp-system
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
true    - do nothing, successfully
unpackimg- un pack logo image into pictures
update  - Enter v2 usbburning mode
usb     - USB sub-system
usb_burn- Burning with amlogic format package in usb
usb_update- Burning a partition with image file in usb host
usbboot - boot from USB device
version - print monitor, compiler and linker version
vout    - VOUT sub-system
vpp     - vpp sub-system
vpu     - vpu sub-system
wipeisb - wipeisb
write_trim- cpu temp-system
write_version- cpu temp-system

 

 

printenv:

Spoiler

gxl_p212_v1#'printenv'
EnableSelinux=enforcing
active_slot=_a
aml_dt=gxl_p212_2g
baudrate=115200
bcb_cmd=get_valid_slot;
bootargs=rootfstype=ramfs init=/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0
xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 androidboot.se
linux=enforcing logo=osd1,loaded,0x3d800000,576cvbs maxcpus=4 vout=576cvbs,enable hdmimode=720p60hz
 cvbsmode=576cvbs hdmitx= cvbsdrv=0 androidboot.firstboot=0 jtag=apao androidboot.hardware=amlogic 
androidboot.slot_suffix=_a
bootcmd=run storeboot
bootdelay=1 
bootup_offset=0x10d81e0
bootup_size=0x3f4c8
cmdline_keys=if keyman init 0x1234; then if keyman read usid ${loadaddr} str; then setenv bootargs 
${bootargs} androidboot.serialno=${usid};setenv serial ${usid};fi;if keyman read mac ${loadaddr} st
r; then setenv bootargs ${bootargs} mac=${mac} androidboot.mac=${mac};fi;if keyman read deviceid ${
loadaddr} str; then setenv bootargs ${bootargs} androidboot.deviceid=${deviceid};fi;fi;
colorattribute=rgb,8bit
cvbs_drv=0  
cvbsmode=576cvbs
display_bpp=16
display_color_bg=0
display_color_fg=0xffff
display_color_index=16
display_height=576
display_layer=osd1
display_width=720
dtb_mem_addr=0x1000000
ethact=dwmac.c9410000
ethaddr=8e:8f:cc:aa:b5:0c
factory_reset_poweroff_protect=echo wipe_data=${wipe_data}; echo wipe_cache=${wipe_cache};if test $
{wipe_data} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcar
d;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi; if test ${wipe_cac
he} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if 
usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi;
fb_addr=0x3d800000
fb_height=1080
fb_width=1920
fdt_high=0x20000000
firstboot=0 
gatewayip=10.18.9.1
hdmimode=720p60hz
hostname=arm_gxbb
init_display=osd open;osd clear;imgread pic logo bootup $loadaddr;bmp display $bootup_offset;bmp scale
initargs=rootfstype=ramfs init=/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 
ipaddr=10.18.9.97
is.bestmode=false
jtag=apao
loadaddr=1080000
maxcpus=4
netmask=255.255.255.0
outputmode=576cvbs
preboot=run bcb_cmd; run factory_reset_poweroff_protect;run upgrade_check;run init_display;run storeargs;run upgrade_key;run switch_bootmode;
reboot_mode=normal
recovery_from_flash=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if itest ${upgrade_step} == 3; then if ext4load mmc 1:2 ${dtb_mem_addr} /recovery/dtb.img; then echo cache dtb.img loaded; fi;if ext4load mmc 1:2 ${loadaddr} /recovery/recovery.img; then echo cache recovery.img loaded; wipeisb; bootm ${loadaddr}; fi;else fi;if imgread kernel ${recovery_part} ${loadaddr} ${recovery_offset}; then wipeisb; bootm ${loadaddr}; fi;
recovery_from_sdcard=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if fatload mmc 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload mmc 0 ${loadaddr} recovery.img; then if fatload mmc 0 ${dtb_mem_addr} dtb.img; then echo sd dtb.img loaded; fi;wipeisb; bootm ${loadaddr};fi;
recovery_from_udisk=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if fatload usb 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload usb 0 ${loadaddr} recovery.img; then if fatload usb 0 ${dtb_mem_addr} dtb.img; then echo udisk dtb.img loaded; fi;wipeisb; bootm ${loadaddr};fi;
recovery_offset=0
recovery_part=recovery
sdc_burning=sdc_burn ${sdcburncfg}
sdcburncfg=aml_sdc_burn.ini
serverip=10.18.9.113
stderr=serial
stdin=serial
stdout=serial
storeargs=setenv bootargs ${initargs} androidboot.selinux=${EnableSelinux} logo=${display_layer},loaded,${fb_addr},${outputmode} maxcpus=${maxcpus} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=${cvbsmode} hdmitx=${cecconfig} cvbsdrv=${cvbs_drv} androidboot.firstboot=${firstboot} jtag=${jtag}; setenv bootargs ${bootargs} androidboot.hardware=amlogic;run cmdline_keys;setenv bootargs ${bootargs} androidboot.slot_suffix=${active_slot};
storeboot=if imgread kernel boot ${loadaddr}; then bootm ${loadaddr}; fi;run update;
switch_bootmode=get_rebootmode;if test ${reboot_mode} = factory_reset; then run recovery_from_flash;else if test ${reboot_mode} = update; then run update;else if test ${reboot_mode} = cold_boot; then fi;fi;fi;
try_auto_burn=update 700 750;
update=run usb_burning; run sdc_burning; if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;
upgrade_check=echo upgrade_step=${upgrade_step}; if itest ${upgrade_step} == 3; then run init_display; run storeargs; run update;else fi;
upgrade_key=if gpio input GPIOAO_2; then echo detect upgrade key; sleep 3;if gpio input GPIOAO_2; then run update; fi;fi;
upgrade_step=2
usb_burning=update 1000
wipe_cache=successful
wipe_data=successful

Environment size: 5192/65532 bytes

 

 

Link to comment
Share on other sites

Judging from the conclusion of the command "printenv" on your Board uses a standard u-boot, which can use a universal multiload. You can try to activate multi-boot with Android (as it is on all TV boxes) ? And then show the output of the "printenv" command again.

Link to comment
Share on other sites

I went to: https://yadi.sk/d/pHxaRAs-tZiei  downloaded: Armbian_5.37_S9xxx_Ubuntu_xenial_3.14.79_mate_20180209.img.xz

Did the Update&Backup in Android - but reboot did not work.
 

There are two directories on BOOT:

  • dtb
  • dtb-3.14.79-amlogics905x

Which is the right one?

 

With UART connected, I watch the boot process - it stops at:

Spoiler

U-Boot 2015.01-g2def270 (Mar 28 2017 - 02:34:05)

DRAM:  2 GiB
Relocation Offset is: 76eba000
register usb cfg[0][1] = 0000000077f5c578
[CANVAS]canvas init
vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters
vpu: clk_level = 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
vpp: vpp_init
boot_device_flag : 1
Nand PHY Ver:1.01.001.0006 (c) 2013 Amlogic Inc.
init bus_cycle=6, bus_timing=7, system=5.0ns
reset failed
get_chip_type and ret:fffffffe
get_chip_type and ret:fffffffe
chip detect failed and ret:fffffffe
nandphy_init failed and ret=0xfffffff1
MMC:   aml_priv->desc_buf = 0x0000000073eba6b0
aml_priv->desc_buf = 0x0000000073ebc9d0
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
dtb magic 5f4c4d41
      Amlogic multi-dtb tool
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 2 dtbs.
        aml_dt soc: gxl platform: p212 variant: 2g
        dtb 0 soc: gxl   plat: p212   vari: 1g
        dtb 1 soc: gxl   plat: p212   vari: 2g
      Find match dtb: 1
start dts,buffer=0000000073ebf200,dt_addr=0000000073eca200
      Amlogic multi-dtb tool
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 2 dtbs.
        aml_dt soc: gxl platform: p212 variant: 2g
        dtb 0 soc: gxl   plat: p212   vari: 1g
        dtb 1 soc: gxl   plat: p212   vari: 2g
      Find match dtb: 1
parts: 10
00:      logo   0000000002000000 1
01:  recovery   0000000002000000 1
02:       rsv   0000000000800000 1
03:       tee   0000000000800000 1
04:     crypt   0000000002000000 1
05:      misc   0000000002000000 1
06:      boot   0000000002000000 1
07:    system   0000000080000000 1
08:     cache   0000000020000000 2
09:      data   ffffffffffffffff 4
_check_ptbl_mbr()-815: MBR is OK!
init_part() 278: PART_TYPE_DOS
eMMC/TSD partition table have been checked OK!
check pattern success
mmc env offset: 0x27400000
In:    serial
Out:   serial
Err:   serial
reboot_mode=cold_boot
hpd_state=1
[720p60hz] is invalid for cvbs.
set hdmitx VIC = 4
config HPLL = 2970000
HPLL: 0xc000027b
config HPLL done
j = 2  vid_clk_div = 1
hdmitx phy setting done
hdmitx: set enc for VIC: 4
rx version is 1.4 or below  div=10
hdmtix: set audio
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-918: calc 76cdaf17, store 76cdaf17
_verify_dtb_checksum()-918: calc 76cdaf17, store 76cdaf17
dtb_read()-1040: total valid 2
dtb_read()-1107: do nothing
      Amlogic multi-dtb tool
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 2 dtbs.
        aml_dt soc: gxl platform: p212 variant: 2g
        dtb 0 soc: gxl   plat: p212   vari: 1g
        dtb 1 soc: gxl   plat: p212   vari: 2g
      Find match dtb: 1
Net:   dwmac.c9410000amlkey_init() enter!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0

Start read misc partition datas!
info->attemp_times = 0
info->active_slot = 0
info->slot_info[0].bootable = 1
info->slot_info[0].online = 1
info->slot_info[1].bootable = 0
info->slot_info[1].online = 0
info->attemp_times = 0
attemp_times = 0
active slot = 0
wipe_data=successful
wipe_cache=successful
upgrade_step=0
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0x7f851000
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0x7f851000
[CANVAS]addr=0x7f851000 width=3840, height=2160
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0
[KM]Error:f[key_manage_query_size]L507:key[usid] not programed yet
[KM]Error:f[key_manage_query_size]L507:key[mac] not programed yet
[KM]Error:f[key_manage_query_size]L507:key[deviceid] not programed yet
gpio: pin GPIOAO_2 (gpio 102) value is 1
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0
(Re)start USB...
USB0:   USB3.0 XHCI init start
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 1 **
** Bad device usb 2 **
** Bad device usb 3 **
card in
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
Device: SDIO Port B
Manufacturer ID: 1b
OEM: 534d
Name: BB2MW
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29.8 GiB
mmc clock: 40000000
Bus Width: 4-bit
reading s905_autoscript
1641 bytes read in 19 ms (84 KiB/s)
## Executing script at 01020000
** Bad device usb 0 **
** Bad device usb 1 **
** Bad device usb 2 **
** Bad device usb 3 **
reading uInitrd
5914452 bytes read in 409 ms (13.8 MiB/s)
reading zImage
13440256 bytes read in 797 ms (16.1 MiB/s)
reading dtb.img
** Unable to read file dtb.img **
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
dtb_read_shortcut()-976: short cut in...
      Amlogic multi-dtb tool
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 2 dtbs.
        aml_dt soc: gxl platform: p212 variant: 2g
        dtb 0 soc: gxl   plat: p212   vari: 1g
        dtb 1 soc: gxl   plat: p212   vari: 2g
      Find match dtb: 1
[rsvmem] get fdtaddr NULL!
rsvmem - reserve memory

Usage:
rsvmem check                   - check reserved memory
rsvmem dump                    - dump reserved memory

rsvmem check failed
## Loading init Ramdisk from Legacy Image at 13000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    5914388 Bytes = 5.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
load dtb from 0x1000000 ......
      Amlogic multi-dtb tool
      Single dtb detected
## Flattened Device Tree blob at 01000000
   Booting using the fdt blob at 0x1000000
Host not halted after 16000 microseconds.
   Loading Ramdisk to 73903000, end 73ea6f14 ... OK
   Loading Device Tree to 000000001fff2000, end 000000001ffff306 ... OK
fdt_instaboot: no instaboot image

Starting kernel ...

uboot time: 8103038 us
domain-128 init dvfs: 4

here it got stuck

 

 

Link to comment
Share on other sites

42 minutes ago, Tido said:

reading dtb.img

** Unable to read file dtb.img **

I see the multiload has been activated. You can use both types of media - SD, and USB. Add dtb (named " dt.img") to the root of the FAT partition of the SD card. You can use files from any directory - they duplicate each other. I recommend to use images from that directory. This is the latest version.

 

https://yadi.sk/d/IUSraO7-3SGPXs

 

The version number of the kernel 3.14.79 does not mean that it is better 3.14.29. For S905X it is better to use Armbian 5.41 version

Link to comment
Share on other sites

2 hours ago, balbes150 said:

Add dtb (named " dt.img") to the root of the FAT partition of the SD card.

 

I think I have done that, can you see the line in white - but it doesn't find it. I have tried several s905x dtb types.

 

dtb_le_potatp.png.f51f06ff38ab3f2d5d0def9b370eb970.png

Link to comment
Share on other sites

Alright, I guess I have to rename the DTB inside the directory it already is:

dtb

dtb-3.14.79-amlogics905x

 

it finds it now, but still doesn't boot:

Bus Width: 4-bit
reading s905_autoscript
1641 bytes read in 19 ms (84 KiB/s)
## Executing script at 01020000
** Bad device usb 0 **
** Bad device usb 1 **
** Bad device usb 2 **
** Bad device usb 3 **
reading uInitrd
5914452 bytes read in 409 ms (13.8 MiB/s)
reading zImage
13440256 bytes read in 798 ms (16.1 MiB/s)
reading dtb.img
33053 bytes read in 11 ms (2.9 MiB/s)
[rsvmem] get fdtaddr NULL!
rsvmem - reserve memory

Usage:
rsvmem check                   - check reserved memory
rsvmem dump                    - dump reserved memory

rsvmem check failed
## Loading init Ramdisk from Legacy Image at 13000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    5914388 Bytes = 5.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
load dtb from 0x1000000 ......
      Amlogic multi-dtb tool
      Single dtb detected
## Flattened Device Tree blob at 01000000
   Booting using the fdt blob at 0x1000000
Host not halted after 16000 microseconds.
   Loading Ramdisk to 73903000, end 73ea6f14 ... OK
   Loading Device Tree to 000000001fff4000, end 000000001ffff11c ... OK
fdt_instaboot: no instaboot image

Starting kernel ...

uboot time: 8060499 us
domain-128 init dvfs: 4

 

Link to comment
Share on other sites

Forget about the version of the image 3.14.79 - it for version S905 (not S905X).

Use those images to which I gave a link. The first run will run WITHOUT dtb file. If the system stops at

 

"Starting kernel ...

uboot time: 8060499 us
domain-128 init dvfs: 4"

 

Add the dtb file. Start with kvim_multios.dtb

If it does not work, try other p212 files

Link to comment
Share on other sites

Hi Balbes,

 

I was too lazy to wait to burn 4,3GB yesterday and just tried all the DTB files. However, this morning I have burned: Armbian_5.41_S9xxx_Ubuntu_xenial_3.14.29_mate_20180216.img

I have chosen this DTB: gxl_p212_1g.dtb (it was the first with p212)

 

In opposite to your instructions I have renamed the file in the folder dtb/ - in your instructions it says: copy them to root directory  |  which is wrong I think.

 

Last but not least, it runs :-)  Thank you for your help.

 

Changing to 1280x720 doesn't work it stays at 1920x1080.

Shall I do some checks  kvim_multios.dtb  versus  gxl_p212_1g.dtb ?

 

Edit:  Wow there is also: gxl_p212_2g_lepotato.dtb

Edited by Tido
le Potat
Link to comment
Share on other sites

If you did not copy the "dtb.img", this is equivalent to the absence of dtb. And script launch s905_autoscript used (automatically) the dtb, that there is in eMMC. :)

If you want to use other dtb (from /dtb) you must copy the file "dtb.img " in the root of the first partition (FAT).

 

Switching to 720p works. You must follow the instructions accurately. :)

There are only two screen resolutions of 1080 and 720.

Link to comment
Share on other sites

I rename "kvim2_multios.dtb" to dtb.img, copy to root folder of FAT partition but it doesn't boot:

uboot time: 8131401 us
domain-0 init dvfs: 4
domain-1 init dvfs: 4

 

It doesn't boot with  gxl_p212_1g_lepotato.dtb

 


Jeee, reading your comment over at: VIM1 S905X MultiOS_3in1 (Android+Libreelec+Linux) install to eMMC

Is see there is a  kvim and kvim2 

 

Now it runs :rolleyes:

Edited by Tido
kvim
Link to comment
Share on other sites

Some more details on the storage:

root@amlogic:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            757M     0  757M   0% /dev
tmpfs           174M  9.9M  164M   6% /run
/dev/mmcblk1p2   29G  3.1G   26G  11% /
tmpfs           868M     0  868M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           868M     0  868M   0% /sys/fs/cgroup
tmpfs           868M  4.0K  868M   1% /tmp
/dev/mmcblk1p1  128M   54M   74M  43% /boot
log2ram          50M  3.7M   47M   8% /var/log
tmpfs           174M     0  174M   0% /run/user/107
tmpfs           174M     0  174M   0% /run/user/0

 

fdisk -l

Spoiler

root@amlogic:~# fdisk -l
Disk /dev/mmcblk0: 14.6 GiB, 15634268160 bytes, 30535680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device          Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1             0     8191     8192    4M 83 Linux
/dev/mmcblk0p2         73728   204799   131072   64M 83 Linux
/dev/mmcblk0p3        221184  1269759  1048576  512M 83 Linux
/dev/mmcblk0p4       1269760 25800703 24530944 11.7G  5 Extended
/dev/mmcblk0p5       1286144  1302527    16384    8M 83 Linux
/dev/mmcblk0p6       1318912  1384447    65536   32M 83 Linux
/dev/mmcblk0p7       1400832  1466367    65536   32M 83 Linux
/dev/mmcblk0p8       1482752  1499135    16384    8M 83 Linux
/dev/mmcblk0p9       1515520  1531903    16384    8M 83 Linux
/dev/mmcblk0p10      1548288  1613823    65536   32M 83 Linux
/dev/mmcblk0p11      1630208  1695743    65536   32M 83 Linux
/dev/mmcblk0p12      1712128  1777663    65536   32M 83 Linux
/dev/mmcblk0p13      1794048  5988351  4194304    2G 83 Linux
/dev/mmcblk0p14      6004736 30535679 24530944 11.7G 83 Linux


Disk /dev/mmcblk0rpmb: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk1: 29.8 GiB, 32026656768 bytes, 62552064 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8ec54659

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk1p1        8192   270335   262144  128M  e W95 FAT16 (LBA)
/dev/mmcblk1p2      270336 61926527 61656192 29.4G 83 Linux


Disk /dev/zram0: 216.9 MiB, 227463168 bytes, 55533 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram1: 216.9 MiB, 227463168 bytes, 55533 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram2: 216.9 MiB, 227463168 bytes, 55533 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram3: 216.9 MiB, 227463168 bytes, 55533 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

 

 

Link to comment
Share on other sites

10 hours ago, Tido said:

Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 0 8191 8192 4M 83 Linux /dev/mmcblk0p2 73728 204799 131072 64M 83 Linux /dev/mmcblk0p3 221184 1269759 1048576 512M 83 Linux /dev/mmcblk0p4 1269760 25800703 24530944 11.7G 5 Extended /dev/mmcblk0p5 1286144 1302527 16384 8M 83 Linux /dev/mmcblk0p6 1318912 1384447 65536 32M 83 Linux /dev/mmcblk0p7 1400832 1466367 65536 32M 83 Linux /dev/mmcblk0p8 1482752 1499135 16384 8M 83 Linux /dev/mmcblk0p9 1515520 1531903 16384 8M 83 Linux /dev/mmcblk0p10 1548288 1613823 65536 32M 83 Linux /dev/mmcblk0p11 1630208 1695743 65536 32M 83 Linux /dev/mmcblk0p12 1712128 1777663 65536 32M 83 Linux /dev/mmcblk0p13 1794048 5988351 4194304 2G 83 Linux /dev/mmcblk0p14 6004736 30535679 24530944 11.7G 83 Linux

That's almost what I need, but not enough partition names.

Copy the entire system startup log from UART (from the start of u-boot), I will find myself in it the information I need.

Link to comment
Share on other sites

I wrote that there is not enough information about the sections.  Now I see everything I need. And judging from this information, you can try using the installation script in emc (/root/install.sh). Please note that this script should be used only when starting the system from external media WITHOUT adding "kvim_multios.dtb " file. Pay attention, file " kvim_multios.dtb " has a different partition structure and will not work with your u-boot. If you try to use the installation script together with the wrong dtb.img, you will get a brick (you will need to re-write all firmware to eMMC).

 

Log Android line 225-237

 

Log Armbian line 626-638

Link to comment
Share on other sites

echo "*******************************************"
echo " copy OS to eMMC parted DATA"
echo "*******************************************"

 

I have SDcard 32Gb  and eMMC 16GB. Do I have to shrink the partition on SDcard ?

 

  1. SDcard, rename dtb.img to dtb.img.old
  2. insert SDcard in Potato
  3. boot the Potato - it will use the dtb from Android eMMC, but boot into armbian
  4. I start installation script from  eMMC  or  SDcard ?

 

Spoiler

#!/bin/sh

echo "Start copy system for DATA partition."

mkdir -p /ddbr
chmod 777 /ddbr

VER=`uname -r`

IMAGE_KERNEL="/boot/zImage"
IMAGE_INITRD="/boot/initrd.img-$VER"
PART_ROOT="/dev/data"
DIR_INSTALL="/ddbr/install"
IMAGE_DTB="/boot/dtb.img"


if [ ! -f $IMAGE_KERNEL ] ; then
    echo "Not KERNEL.  STOP install !!!"
    return
fi

if [ ! -f $IMAGE_INITRD ] ; then
    echo "Not INITRD.  STOP install !!!"
    return
fi


echo "Formatting DATA partition..."
umount -f $PART_ROOT
mke2fs -F -q -t ext4 -m 0 $PART_ROOT
e2fsck -n $PART_ROOT
echo "done."

echo "Copying ROOTFS."

if [ -d $DIR_INSTALL ] ; then
    rm -rf $DIR_INSTALL
fi

mkdir -p $DIR_INSTALL
mount -o rw $PART_ROOT $DIR_INSTALL

cd /
echo "Copy BIN"
tar -cf - bin | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy BOOT"
#mkdir -p $DIR_INSTALL/boot
tar -cf - boot | (cd $DIR_INSTALL; tar -xpf -)
echo "Create DEV"
mkdir -p $DIR_INSTALL/dev
#tar -cf - dev | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy ETC"
tar -cf - etc | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy HOME"
tar -cf - home | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy LIB"
tar -cf - lib | (cd $DIR_INSTALL; tar -xpf -)
echo "Create MEDIA"
mkdir -p $DIR_INSTALL/media
#tar -cf - media | (cd $DIR_INSTALL; tar -xpf -)
echo "Create MNT"
mkdir -p $DIR_INSTALL/mnt
#tar -cf - mnt | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy OPT"
tar -cf - opt | (cd $DIR_INSTALL; tar -xpf -)
echo "Create PROC"
mkdir -p $DIR_INSTALL/proc
echo "Copy ROOT"
tar -cf - root | (cd $DIR_INSTALL; tar -xpf -)
echo "Create RUN"
mkdir -p $DIR_INSTALL/run
echo "Copy SBIN"
tar -cf - sbin | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy SELINUX"
tar -cf - selinux | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy SRV"
tar -cf - srv | (cd $DIR_INSTALL; tar -xpf -)
echo "Create SYS"
mkdir -p $DIR_INSTALL/sys
echo "Create TMP"
mkdir -p $DIR_INSTALL/tmp
echo "Copy USR"
tar -cf - usr | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy VAR"
tar -cf - var | (cd $DIR_INSTALL; tar -xpf -)

echo "Copy fstab"

rm $DIR_INSTALL/etc/fstab
cp -a /root/fstab $DIR_INSTALL/etc
#cp -a /boot/hdmi.sh $DIR_INSTALL/boot

rm $DIR_INSTALL/root/install.sh
rm $DIR_INSTALL/root/fstab
rm $DIR_INSTALL/usr/bin/ddbr
rm $DIR_INSTALL/usr/bin/ddbr_backup_nand
rm $DIR_INSTALL/usr/bin/ddbr_restore_nand

cd /
sync

umount $DIR_INSTALL

echo "*******************************************"
echo "Done copy ROOTFS"
echo "*******************************************"

echo "Writing new kernel image..."

mkdir -p $DIR_INSTALL/aboot
cd $DIR_INSTALL/aboot
dd if=/dev/boot of=boot.backup.img
abootimg -i /dev/boot > aboot.txt
abootimg -x /dev/boot
abootimg -u /dev/boot -k $IMAGE_KERNEL
abootimg -u /dev/boot -r $IMAGE_INITRD

echo "done."

if [ -f $IMAGE_DTB ] ; then
#    abootimg -u /dev/boot -s $IMAGE_DTB
    echo "Writing new dtb ..."
    dd if="$IMAGE_DTB" of="/dev/dtb" bs=262144 status=none && sync
    echo "done."
fi

echo "Write env bootargs"
/usr/sbin/fw_setenv initargs "root=/dev/data rootflags=data=writeback rw console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.repair=yes net.ifnames=0 mac=\${mac}"

echo "*******************************************"
echo "Complete copy OS to eMMC parted DATA"
echo "*******************************************"

 

 

Link to comment
Share on other sites

Before running the installation script, BE sure to check the command "sudo fw_printenv" (from The armbian system running from the SD card). Only if you get the output of variables from u-boot, you can proceed to the installation.

 

The script performs a "smart" copy (copied the required files and directories). Therefore, it does not matter what size of the external media. It is important that the size of the data on an external drive was smaller than the size of eMMC (/dev/data). The size of the data can be roughly estimated by the "df -h" command. If the user data is smaller than the /dev/data partition on the eMMC, you can perform the installation (run the script /root/install.sh). Yes, you understood correctly. Rename " db.img" the system was not used. Start the Arabian system from external media. Open terminal and execute from the SD card on behalf of the root user, the script "/root/install.sh" .

Link to comment
Share on other sites

It says about  androidboot.selinux, sounds good :-)

root@amlogic:~# fw_printenv
EnableSelinux=enforcing
active_slot=_a
aml_dt=gxl_p212_2g
baudrate=115200
bcb_cmd=get_valid_slot;
bootargs=rootfstype=ramfs init=/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 androidboot.selinux=enforcing logo=osd1,loaded,0x3d800000,720p60hz maxcpus=4 vout=720p60hz,enable hdmimode=720p60hz cvbsmode=576cvbs hdmitx= cvbsdrv=0 androidboot.firstboot=0 jtag=apao androidboot.hardware=amlogic androidboot.slot_suffix=_a aml_dt=gxl_p212_2g recovery_part={recovery_part} recovery_offset={recovery_offset}
bootcmd=run start_autoscript; run storeboot;
bootdelay=1
bootfromnand=0
bootup_offset=0x10d81e0
bootup_size=0x3f4c8

 

root@amlogic:~# ll
total 44
drwx------  6 root root 4096 Feb 25 17:17 ./
drwxr-xr-x 22 root root 4096 Feb 16 14:10 ../
-rw-------  1 root root  149 Feb 25 21:05 .bash_history
-rw-r--r--  1 root root 3106 Oct 22  2015 .bashrc
drwx------  2 root root 4096 Feb 16 14:11 .cache/
drwx------  5 root root 4096 Feb 25 08:08 .config/
drwx------  3 root root 4096 Feb 16 14:13 .local/
drwxr-xr-x  2 root root 4096 Feb 25 17:17 .nano/
-rw-r--r--  1 root root  148 Aug 17  2015 .profile
-rwxr-xr-x  1 root root  216 Feb 16 14:13 fstab*
-rwxr-xr-x  1 root root 3216 Feb 16 14:13 install.sh*
root@amlogic:~# 
root@amlogic:~# ./install.sh 

 

to copy /usr takes some time..

Spoiler

 


Start copy system for DATA partition.
Formatting DATA partition...
umount: /dev/data: not mounted
/dev/data contains a ext4 file system
	last mounted on /data on Thu Jan  1 00:00:13 2015
e2fsck 1.42.13 (17-May-2015)
/dev/data: clean, 11/767040 files, 88402/3066368 blocks
done.
Copying ROOTFS.
Copy BIN
Copy BOOT
Create DEV
Copy ETC
Copy HOME
Copy LIB
Create MEDIA
Create MNT
Copy OPT
Create PROC
Copy ROOT
Create RUN
Copy SBIN
Copy SELINUX
Copy SRV
Create SYS
Create TMP
Copy USR
Copy VAR
Copy fstab
*******************************************
Done copy ROOTFS
*******************************************
Writing new kernel image...
65536+0 records in
65536+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 0.639604 s, 52.5 MB/s
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
reading kernel from /boot/zImage
Writing Boot Image /dev/boot
reading ramdisk from /boot/initrd.img-3.14.29
Writing Boot Image /dev/boot
done.
Write env bootargs
*******************************************
Complete copy OS to eMMC parted DATA
*******************************************

 

and now ?

 

root@amlogic:~# df -Tha --total
Filesystem     Type             Size  Used Avail Use% Mounted on
sysfs          sysfs               0     0     0    - /sys
proc           proc                0     0     0    - /proc
udev           devtmpfs         757M     0  757M   0% /dev
devpts         devpts              0     0     0    - /dev/pts
tmpfs          tmpfs            174M  9.9M  164M   6% /run
/dev/mmcblk1p2 ext4              29G  2.9G   26G  10% /
securityfs     securityfs          0     0     0    - /sys/kernel/security
tmpfs          tmpfs            868M     0  868M   0% /dev/shm
tmpfs          tmpfs            5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs            868M     0  868M   0% /sys/fs/cgroup
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/systemd
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/cpuset
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/blkio
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/memory
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/cpu,cpuacct
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/devices
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/perf_event
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/freezer
systemd-1      autofs              0     0     0    - /proc/sys/fs/binfmt_misc
debugfs        debugfs             0     0     0    - /sys/kernel/debug
hugetlbfs      hugetlbfs           0     0     0    - /dev/hugepages
mqueue         mqueue              0     0     0    - /dev/mqueue
configfs       configfs            0     0     0    - /sys/kernel/config
fusectl        fusectl             0     0     0    - /sys/fs/fuse/connections
tmpfs          tmpfs            868M  4.0K  868M   1% /tmp
/dev/mmcblk1p1 vfat             128M   54M   74M  43% /boot
/dev/mmcblk1p2 ext4              29G  2.9G   26G  10% /var/log.hdd
log2ram        tmpfs             50M  4.4M   46M   9% /var/log
tmpfs          tmpfs            174M     0  174M   0% /run/user/107
gvfsd-fuse     fuse.gvfsd-fuse  0.0K  0.0K  0.0K    - /run/user/107/gvfs
tmpfs          tmpfs            174M     0  174M   0% /run/user/0
total          -                 62G  5.7G   56G  10% -

 

Edited by Tido
added df -Tha --total
Link to comment
Share on other sites

shutdown, removed the SDcard.  Boot with eMMC:

Welcome to ARMBIAN 5.41 user-built Ubuntu 16.04.4 LTS 3.14.29   
System load:   1.40 0.40 0.14   Up time:       1 min
Memory usage:  11 % of 1735MB   IP:            192.168.11.11
CPU temp:      47°C             
Usage of /:    26% of 12G       

[ General system configuration (beta): armbian-config ]


root@amlogic:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            757M     0  757M   0% /dev
tmpfs           174M  9.9M  164M   6% /run
/dev/data        12G  3.0G  8.5G  26% /
tmpfs           868M  424K  868M   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           868M     0  868M   0% /sys/fs/cgroup
tmpfs           868M  4.0K  868M   1% /tmp
log2ram          50M  4.7M   46M  10% /var/log
tmpfs           174M     0  174M   0% /run/user/107
tmpfs           174M     0  174M   0% /run/user/0
tmpfs           174M  4.0K  174M   1% /run/user/1000
root@amlogic:~# lsmod
Module                  Size  Used by
bnep                   11404  2
hci_uart               21837  1
bluetooth             251912  7 bnep,hci_uart
6lowpan_iphc            5983  1 bluetooth
zram                    8953  4
aml_nftl_dev           95108  0


root@amlogic:~# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME         FSTYPE   SIZE MOUNTPOINT LABEL
zram0               216.9M [SWAP]     
zram1               216.9M [SWAP]     
zram2               216.9M [SWAP]     
zram3               216.9M [SWAP]     
mmcblk0rpmb             4M            
mmcblk0boot0            4M            
mmcblk0boot1            4M            
mmcblk0              14.6G           

 

root@amlogic:~# armbianmonitor -u
System diagnosis information will now be uploaded to http://ix.io/PXx
 

Link to comment
Share on other sites

I confirm, Armbian runs fine from eMMC.

I ran this command before I started install.sh:  sudo apt autoremove && sudo apt autoclean && sudo apt clean

 

If you look at lsmod, Le Potato doesn't have Bluetooth or WiFi. Can I blacklist some of the modules ?

Link to comment
Share on other sites

looks like this

root@amlogic:/etc# modprobe dhd
modprobe: ERROR: could not insert 'dhd': No such device
root@amlogic:/etc# 
root@amlogic:/etc# modprobe wifi_dummy 
root@amlogic:/etc# 
root@amlogic:/etc# lsmod
Module                  Size  Used by
wifi_dummy               806  0
cfg80211              415017  0
bnep                   11404  2
hci_uart               21837  1
bluetooth             251912  7 bnep,hci_uart
6lowpan_iphc            5983  1 bluetooth
zram                    8953  4
aml_nftl_dev           95108  0

 

Link to comment
Share on other sites

I recovered the system by re-inserting the usb stick, rebooting from it and running ./install.sh

Here are some important questions:

1- is it not possible to edit fstab once the system is running from FLASH?

2- How to automatically run the modprobe wifi_dummy command so that the wifi works on bootup?

3- is it possible to run apt-get update && apt-get upgrade && apt-get dist-upgrade while running from NAND?

4- can the swap partition be moved to the external USB diskdrive?

5- is there an easy way to let the system install all new software (like lamp) on the USB drive

 

Thanks again! At least i am still alive.. hardly breathing thoug

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines