Difference between revisions of "RSB-3720 Ubunut creation by Yocto30 kernel"

From ESS-WIKI
Jump to: navigation, search
Line 24: Line 24:
 
*<span style="font-size:medium;">'''Unpack rootfs.wic'''</span>  
 
*<span style="font-size:medium;">'''Unpack rootfs.wic'''</span>  
  
:<span style="font-size:large;"><code>$sudo bzip2 -d imx-image-full-<span style="color:#9b59b6;">'''${MC}'''</span>-20230814102331.rootfs.wic.bz2</code></span>  
+
:<span style="font-size:large;"><code>$sudo bzip2 -d <span style="color:#9b59b6;">'''${rootfs.wic_IMAGE}.'''</span>bz2</code></span>  
  
 
:[[File:RSB-3720 unpack yocto30 image.png|RTENOTITLE]]  
 
:[[File:RSB-3720 unpack yocto30 image.png|RTENOTITLE]]  
Line 38: Line 38:
 
*<span style="font-size:medium;">'''Mount Yocto image and Ubuntu image Partition2'''</span>  
 
*<span style="font-size:medium;">'''Mount Yocto image and Ubuntu image Partition2'''</span>  
  
:<span style="font-size:large;"><code>$sudo losetup --show -f -P imx-image-full-imx8mprsb3720a1-20230814102331.rootfs.wic</code></span>  
+
:<span style="font-size:large;"><code>$sudo losetup --show -f -P <span style="color:#9b59b6;">'''${rootfs.wic_IMAGE}'''</span></code></span>  
  
 
:<span style="font-size:large;"><span style="font-size:large;"><code>$sudo mount /dev/loop22p2 yocto/rootfs/</code></span></span>  
 
:<span style="font-size:large;"><span style="font-size:large;"><code>$sudo mount /dev/loop22p2 yocto/rootfs/</code></span></span>  
Line 111: Line 111:
 
:<span style="font-size:large;"><code>sudo losetup -d /dev/loop23</code></span>  
 
:<span style="font-size:large;"><code>sudo losetup -d /dev/loop23</code></span>  
  
:[[File:RSB-3720 Ubunut creation by Yocto30 kernel Remove virtual device.png|RTENOTITLE]]
+
:[[File:RSB-3720 Ubunut creation by Yocto30 kernel Remove virtual device.png|RTENOTITLE]]  
  
 +
&nbsp;
  
 +
== '''Flash target image''' ==
  
== '''Flash target image''' ==
+
*<span style="font-size:medium;">'''Creating boot-up on-board flash from built sdcard image'''</span>
 +
 
 +
:<span style="font-size:large;"><code>$ sudo dd if=<span style="color:#9b59b6;">'''${rootfs.wic_IMAGE}'''</span> of=/dev/sde bs=1M conv=fsync</code></span>
 +
 
 +
:[[File:RSB-3720 Ubunut creation by Yocto30 kernel Flash target image.png|RTENOTITLE]]
  
*Creating boot-up on-board flash from built sdcard image
+
== '''Complete''' ==
  
:<span style="font-size:large;"><code>$ sudo dd if=imx-image-full-'''<span style="color:#9b59b6;">${MC}</span>'''-20230814102331.rootfs.wic of=/dev/sde bs=1M conv=fsync</code></span>
+
*'''<span style="font-size:medium;">Pleace insert SDcard to target machine, You can see Ubuntu Desktop on the monitor.</span>'''  
  
:[[File:RSB-3720 Ubunut creation by Yocto30 kernel Flash target image.png|RTENOTITLE]]
+
:[[File:RSB-3720 Ubunut creation by Yocto30 kernel Complete.jpg|RTENOTITLE]]

Revision as of 08:19, 18 August 2023

Prepare Image

  • Build Yocto Linux image with your expected version (e.g. A0386)
You can follow this SOP to build your Yocto image.
RTENOTITLE
  •  Prepare Ubuntu image (e.g. A0362)
RTENOTITLE

Mount image

  • You can find Yocto image in${WORKSPACE}/build/tmp/deplay/image/${MC}, and copy to your ${WORKSPACE}.
$ sudo cp –a imx-image-${MC}-20230816082527.rootfs.wic.bz2 ${WORKSPACE}.
RTENOTITLE
  • Unpack rootfs.wic
$sudo bzip2 -d ${rootfs.wic_IMAGE}.bz2
RTENOTITLE
  • Create folders to mount
$mkdir ubuntu yocto
$mkdir ubuntu/rootfs yocto/rootfs
RTENOTITLE
  • Mount Yocto image and Ubuntu image Partition2
$sudo losetup --show -f -P ${rootfs.wic_IMAGE}
$sudo mount /dev/loop22p2 yocto/rootfs/
$sudo losetup --show -f -P 3720A1AIM30UIVA0362_iMX8MP_4G_2021-11-29.img
$sudo mount /dev/loop23p2 ubuntu/rootfs/
 
RTENOTITLE
 

 

Change rootfs

  • Copy Yocto module to${WORKSPACE}, then you can find Yocto module in rootfs/lib
$ sudo cp -a yocto/rootfs/lib/modules/ /home/adv/
RTENOTITLE
  • Delete under Yocto rootfs all files, and replace to  Ubuntu rootfs
$ sudo rm -rf yocto/rootfs/
$ sudo cd ubuntu/rootfs/
$ sudo cp -a bin boot dev etc home lib media mnt opt proc root run sbin srv swapfile sys tmp usr var ~/yocto/rootfs/
RTENOTITLE
  • Repalce with Yocto module
$ cd ~/yocto/roosfs/lib
$ sudo rm -rf modules/
$ sudo cp -a ~/modules ~/yocto/rootfs/lib/
RTENOTITLE

Analyze dependency file

  • Enter target image root directory
$ sudo chroot rootfs/
RTENOTITLE
  • Analyze file replaced by module dependencies
$ depmod -a 5.4.70-2.3.0/
RTENOTITLE

Umount target image

  • Umount rootfs
$ exit
$ sudo umount ~/yocto/rootfs/
$ sudo umount ~/ubuntu/rootfs/
RTENOTITLE
  • Remove virtual device
sudo losetup -d /dev/loop22
sudo losetup -d /dev/loop23
RTENOTITLE

 

Flash target image

  • Creating boot-up on-board flash from built sdcard image
$ sudo dd if=${rootfs.wic_IMAGE} of=/dev/sde bs=1M conv=fsync
RTENOTITLE

Complete

  • Pleace insert SDcard to target machine, You can see Ubuntu Desktop on the monitor.
RTENOTITLE