This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PROCEDURE TO FLASH eMMC
#8
(11-01-2018, 02:26 PM)Radioman Wrote: I'm thinking I can overwrite the TOS with the new ELAR OS, is that correct?

Yes, you're correct. The variation is to change the content of the second partition, AKA rootfs. But it takes some care that the extlinux.conf in the first partition must point to the rootfs partition. For TinkerOS is omitted, because the u-boot has it set as default. So check carefully the append statement.

If we look at the ELAR partition scheme, we'll find that is the same as linaro one (TinkerOS). The first partition is vfat of few tenth of  Mb, and contains the files for booting, later is mounted on /boot.

If you'll plan such switch, then you need to understand which partition you should copy. That is a bit trickier than simply copy the whole image.
First we need to see the image partition scheme
Code:
$ sudo fdisk -l TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img      ## after unrar-ed
Disk TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img: 2.9 GiB, 3038773248 bytes, 5935104 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: 0x00f43486

Device                                              Boot  Start     End Sectors  Size Id Type
TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img1 *      8192  212991  204800  100M  c W95
TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img2      212992 5935103 5722112  2.7G 83 Linux

$ dmesg |tail                        ## find which is the kernel name when the SD card is plugged in
[ 5850.123697] sd 6:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 5850.124769] sd 6:0:0:0: [sdc] No Caching mode page found
[ 5850.124778] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 5850.130022]  sdc: sdc1 sdc2 sdc3
[ 5850.134126] sd 6:0:0:0: [sdc] Attached SCSI removable disk

$ sudo fdisk -l  /dev/sdc                         ## check the partition scheme
Disk /dev/sdc: 14.6 GiB, 15665725440 bytes, 30597120 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: 0x58bc1052

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sdc1           8192   139263   131072   64M  c W95 FAT32 (LBA)
/dev/sdc2         139264  6283263  6144000    3G 83 Linux
/dev/sdc3       10117120 30597119 20480000  9.8G 83 Linux

Then from those details we'll understand where to start to skip the unnecessary blocks. In particular where the first sector of rootfs starts.
So for the case we may give the command
Code:
$ sudo dd if=TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img of=/dev/sdc bs=512 seek=212992 skip=139264
seek means where to start reading and skip where to start writing.
But it must check that the host partition is big enough 5722112 < 6144000. Later just try it out. Don't try to modify the partition prior a new reboot, because the system needs to expand the partition to the maximum.

A second approach would be to format the linaro rootfs and then write the ElarOS onto the partition.
Code:
$ sudo su                                       ## be a master :-)
# mkfs.ext4 /dev/sdc2                              ## new format
# mkdir /tmp/dest_root                            ## destination mount point
# mkdir /tmp/src_root                               ## source mount point
# mount <path_to_file>/TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img /tmp/src_root -o loop,offset=104M
# rsync -axHAWXS --numeric-ids --info=progress2 /tmp/src_root /tmp/dest_root
# umount /tmp/dest_root
# umount /tmp/src_root
# e2label /dev/sdc2 <rootfs_partition_name>

Before to start it up, care must be taken to modify the extlinux.conf and set the new rootfs pointer. So  by the help of gparted (the simplest way) set a name to the partitions (unless done). Later browse the plugged TBS and open the extlinux.conf for editing (as administrator), that should reside in the smaller partition.
if there's a statement root=<something> or none, then we need to modify to root=LABEL=<rootfs_partition_name>

A side note, I used to set a second partition for /home, so the system may change but my data won't disappear along the system.
Light blue words might be a link. Have you try to click on them? Big Grin
[-] The following 1 user Likes Im4Tinker's post:
  • Dawnvibe
Reply


Messages In This Thread
PROCEDURE TO FLASH eMMC - by Rjp663 - 06-22-2018, 10:21 PM
RE: PROCEDURE TO FLASH eMMC - by Robertspark - 06-23-2018, 01:48 AM
RE: PROCEDURE TO FLASH eMMC - by Radioman - 10-31-2018, 03:37 PM
RE: PROCEDURE TO FLASH eMMC - by Jimbo128 - 02-24-2020, 02:27 AM
RE: PROCEDURE TO FLASH eMMC - by igorpec - 02-24-2020, 08:14 AM
RE: PROCEDURE TO FLASH eMMC - by Dawnvibe - 03-24-2020, 01:47 PM
RE: PROCEDURE TO FLASH eMMC - by mas9l4ever - 09-23-2018, 12:44 PM
RE: PROCEDURE TO FLASH eMMC - by whysguy52 - 02-25-2019, 05:57 AM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 09-23-2018, 03:34 PM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 11-01-2018, 07:15 AM
RE: PROCEDURE TO FLASH eMMC - by Radioman - 11-01-2018, 02:26 PM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 11-02-2018, 05:27 AM
RE: PROCEDURE TO FLASH eMMC - by Radioman - 11-02-2018, 10:00 PM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 11-03-2018, 09:26 AM
RE: PROCEDURE TO FLASH eMMC - by Radioman - 11-03-2018, 12:41 PM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 11-03-2018, 05:12 PM
RE: PROCEDURE TO FLASH eMMC - by lobo - 11-03-2018, 01:03 PM
RE: PROCEDURE TO FLASH eMMC - by Dawnvibe - 03-24-2020, 07:03 AM
RE: PROCEDURE TO FLASH eMMC - by jschwart - 11-02-2018, 09:10 PM
RE: PROCEDURE TO FLASH eMMC - by igorpec - 11-03-2018, 06:10 AM
RE: PROCEDURE TO FLASH eMMC - by jschwart - 11-03-2018, 12:13 PM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 11-04-2018, 06:12 AM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 11-04-2018, 02:00 PM
RE: PROCEDURE TO FLASH eMMC - by Radioman - 11-10-2018, 03:02 AM
RE: PROCEDURE TO FLASH eMMC - by Grulle - 11-04-2018, 07:37 PM
RE: PROCEDURE TO FLASH eMMC - by jschwart - 11-10-2018, 01:27 PM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 11-10-2018, 04:34 PM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 02-25-2019, 09:55 AM
RE: PROCEDURE TO FLASH eMMC - by ugur78tr - 03-27-2019, 06:00 AM
RE: PROCEDURE TO FLASH eMMC - by Im4Tinker - 03-28-2019, 06:10 AM
RE: PROCEDURE TO FLASH eMMC - by jschwart - 05-03-2020, 07:53 AM
RE: PROCEDURE TO FLASH eMMC - by turbo_negro - 01-26-2021, 01:13 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)