Jump to content

Burn to eMMc automatically on TV Box


Skull Sherbet

Recommended Posts

HI I’ve looked through the whole internet looking on how to burn to eMMc without any external help (monitor or ssh). I want to put an sd card in for it to burn to the emmc automatically. I thought of adding a script in the local or in the /etc/init.d that goes like this: sudo dd if= of … and then when it boots from the sd card it will clone its contents to the emmc.

Any help on how someone goes about doing this woud be great.

Link to comment
Share on other sites

1 hour ago, Micael Illos said:

to burn to the emmc automatically

On how many devices should this work,  a larger quantity or just a few?

How would you ensure, that the burning process was successful without SSH?

 

Link to comment
Share on other sites

In my opinion, your choice is not a great solution, either because putting a script in /etc/init.d does not automatically triggers it and also because you would end up cloning a system which is half-started.

 

If you can boot from sdcard - and guessing from your question, you can - just boot from sdcard and put the .img file on the sdcard itself. Once booted, use dd to write the .img file on the internal emmc device.

 

Otherwise you may be able to use some other tools and external USB to PC cables, but this depends on the platform and chip vendor. For example, Rockchip has the tools to do this.

Link to comment
Share on other sites

2 hours ago, Micael Illos said:

HI I’ve looked through the whole internet looking on how to burn to eMMc without any external help (monitor or ssh). I want to put an sd card in for it to burn to the emmc automatically. I thought of adding a script in the local or in the /etc/init.d that goes like this: sudo dd if= of … and then when it boots from the sd card it will clone its contents to the emmc.

Any help on how someone goes about doing this woud be great.

Writing an image with the dd command to eMMC (internal non-removable memory) is a very bad solution. Not use it. You can only use DD to create and restore an exact copy of eMMC content (which was correctly generated earlier in the appropriate ways). Installation of the system in eMMC should only be performed by commands that are intended for creating partitions and the file system, and for working with files correctly.

Link to comment
Share on other sites

1 hour ago, Tido said:

On how many devices should this work,  a larger quantity or just a few?

How would you ensure, that the burning process was successful without SSH?

 

On a few.

And then I will ssh into each one individually.

My goal is to be able to burn straight to the eMMc without ssh or use of a monitor.

 

 

Quote

In my opinion, your choice is not a great solution, either because putting a script in /etc/init.d does not automatically triggers it and also because you would end up cloning a system which is half-started.

 

If you can boot from sdcard - and guessing from your question, you can - just boot from sdcard and put the .img file on the sdcard itself. Once booted, use dd to write the .img file on the internal emmc device.

 

Otherwise you may be able to use some other tools and external USB to PC cables, but this depends on the platform and chip vendor. For example, Rockchip has the tools to do this.

 

The problem with that is that I want an already setup linux OS on the board.

If I just burn an img file then when I boot from the eMMc it will require setup.

And I have my own application on the sd card and I want to clone it with the OS.

 

Rockwell has tools that let me burn straight to the eMMc?

 

Quote

Writing an image with the dd command to eMMC (internal non-removable memory) is a very bad solution. Not use it. You can only use DD to create and restore an exact copy of eMMC content (which was correctly generated earlier in the appropriate ways). Installation of the system in eMMC should only be performed by commands that are intended for creating partitions and the file system, and for working with files correctly.

Could you elaborate on which commands?

 

Thanks for all the replies

Edited by Micael Illos
Only lets be post once
Link to comment
Share on other sites

13 hours ago, Micael Illos said:

The problem with that is that I want an already setup linux OS on the board.

If I just burn an img file then when I boot from the eMMc it will require setup.

And I have my own application on the sd card and I want to clone it with the OS.

You need a minimum of strategy then.

 

The easier way I could think of is burn the pristine image to an sdcard, boot the system and made the necessary changes you are comfortable with, read back the sdcard and you get your already setup image which can be distributed back. But this is a very very rough solution and I would not recommend it. At last you get an image which is set up with the partitions sized for the particular sdcard (armbian resizes itself during first boot to fill the entire media) and also requires manual steps to replicate the same behaviour when you want to create a new image.

 

A nicer solution would be using the armbian user patches and user scripts to create a systemd service which automatically starts at boot. Probably you want it to run in MultiUser target, which is the last step of system initialization. The systemd service in turn runs your script/application. You need to master systemd a bit, but creating a basic systemd service/module is quite easy. Debugging can require some challenge though (systemctl status, journalctl are good friends here).

 

This chapter of the armbian documentation may be useful to you, once you write your scripts and patches and put them in the right directories, you can use the armbian build system to produce auto-setupping images.

 

Rockchip (not rockwell) has some command line and GUI tools to write images from a PC directly to eMMC of tvboxes via USB cable, but this is not always straightforward. Other vendors probably have tools too, but I'm not aware of.

Link to comment
Share on other sites

21 hours ago, Micael Illos said:

Could you elaborate on which commands?

If you do not have a lot of hardware, there is no point in wasting time on complex manipulations to create your image and other unnecessary steps. For your use case, everything is trivial. Start the system on the SD card. Perform basic settings on the SD card that are common to all instances of TV boxes. Launch the installation on TV box (please note that each platform uses its own version of the installation script). After installing the system in eMMC, immediately from the system running from the SD card, mount the EMMC root partition and perform a personal configuration for a specific instance of the TV box (for example, creating a new user, changing passwords, setting a static IP address, MAC, system name, etc.). Using this configured SD card on the other TV boxes, connect via SSH, install system to eMMC, mount eMMC, and perform a personal configuration. If you want, you can even execute (chroot) to the eMMC system installed and perform additional settings directly from it, run programs or utilities for a specific system).

Link to comment
Share on other sites

  • Werner locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines