RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Table of Contents
...
Tip | ||
---|---|---|
| ||
This page is dedicated for switching the images (broadband to video) specifically for techsummit-2019 |
1. Flash the BB Broadband image in SD card2. Use Gparted to get the ext3 partitions extended to 2GB
3. Right Click on un-allocated -> New -> type 2GB in the field "New size"
4. Right click on un-allocated partition -> New -> add [Remaining all size]
5. Apply all operations -> Apply
6. Video image should be present in the host machine
7. sudo sh extract.sh <video-image file>
Code Block | ||
---|---|---|
| ||
mkdir -p extblock
fdisk -u -l $1 > extblock/sector.txt
linux_sector=`tail -2 extblock/sector.txt | tr -s ' ' | cut -d'*' -f2 | cut -d' ' -f2 | head -n1`
linux_offset=$((linux_sector*512))
rootfs_sector=`tail -2 extblock/sector.txt | tr -s ' ' | cut -d'*' -f2 | cut -d' ' -f2 | tail -1`
rootfs_offset=$((rootfs_sector*512))
mkdir -p extblock/linux_data
mkdir -p extblock/rootfs_data
mkdir -p extblock/vlinux_backup_data
mkdir -p extblock/vrootfs_backup_data
#sudo mount /dev/mmcblk0p1 extblock/bank0_linux
#--------------------------------------------------------------------------------------------------
# Loop mount + Extract kernel and bootload data of Downloaded image to storage area
#--------------------------------------------------------------------------------------------------
sudo mount -o loop,offset=$linux_offset $1 extblock/linux_data
cp -R extblock/linux_data/* extblock/vlinux_backup_data/
sudo umount extblock/linux_data
rm -rf extblock/linux_data
#--------------------------------------------------------------------------------------------------
# Loop mount + Extract rootfs data of Downloaded image to storage area
#--------------------------------------------------------------------------------------------------
sudo mount -o loop,offset=$rootfs_offset $1 extblock/rootfs_data
cp -R extblock/rootfs_data/* extblock/vrootfs_backup_data
sudo umount extblock/rootfs_data
rm -rf extblock/rootfs_data
|
Code Block | ||||
---|---|---|---|---|
| ||||
sudo dd if=<RPIimage-sdimg> of=</dev/sdc> bs=4M
Example: sudo dd if=rdk-generic-hybrid-refapp-thunder-image_default_20190829072513.rootfs.rpi-sdimg of=/dev/sdc bs=4M |
2. Resizing and partition creation
3. Keep RDK-Video image in the host machine
4. Extracting the RDK-Video image into the extblock directory
Code Block | ||||
---|---|---|---|---|
| ||||
sudo sh extract.sh <video-image file>
| ||||
Code Block | ||||
| ||||
For ex. sudo sh extract.sh rdk-generic-hybrid-refapp-thunder-image_default_20190924125426.rootfs.rpi-sdimg |
...
After executing the above script, Linux kernel and RootFS of RDK-Video image would be present in the extblock directory
5. To Copy the RDK-Video image in Partition-P4
Code Block | ||||
---|---|---|---|---|
| ||||
For ex. mkdir videomnt sudo mount /dev/sdb4 videomnt In above command, storage partition 4 will get mounted to videomnt directory |
...
...
Code Block | ||||
---|---|---|---|---|
| ||||
sudo cp -r /extblock/v* videomnt/ |
116. Copy the vrootfs backup data into ext4 (sudo cp -r vrootfs_backup_data/* /media/amrita/884ff16f-00b3-4b8e-b634-8dfc93e9bdb8) to ensure partittion 4 partition 4 storage bank, to ensure it will acts as video bank as well
Code Block | ||||
---|---|---|---|---|
| ||||
sudo cp -r /extblock/vrootfs_backup_data/* videomnt/ |
12. Copy the bank_broadband_image.switch file to partition 4 as below
Code Block | ||
---|---|---|
| ||
sudo cp bank_broadband_image.switch videomnt/lib/rdk/ |
13. 7. Unmount videomnt directory as below
Code Block | ||||
---|---|---|---|---|
| ||||
sudo umount videomnt |
14. Now copy broadband multi boot change scripts to broadband image as below
Code Block | ||
---|---|---|
| ||
#For ex.
mkdir bbmnt
sudo mount /dev/sdb4 bbmnt
#In above command, storage partition 2 will get mounted to bbmnt directory
# Now copy the broad band change scripts from host to broadband image rootfs in partition2 (/dev/sdb2) mounted to bbmnt as below
sudo cp rpi_sw_install1.sh rpi_sw_install.sh swupdate_utility.sh bank_image_switch.sh bank_video_switch.sh imageFlasher.sh bbmnt/lib/rdk/
# Now unmount the bbmnt
sudo umount bbmnt |
812. Now Boot up the SD card in RPI-> it should come up with BB image in partition (P2)
9. Log into the R-Pi from Host PC execute the below command
ssh 13. ssh root@<RPI-Board IP>
1410. To load the video image which is present in the storage execute the script bank_video_switch.sh
Code Block | ||||
---|---|---|---|---|
| ||||
root@RaspberryPi-Gateway:/lib/rdk# sh bank_video_switch.sh |
15. It 11. R-Pi should boot up with video image
16. Now this image can be switch back to broadband image by executing following script
...
title | video data extract |
---|
. Ensure that the ethernet connection is available for R-Pi.
NOTE:
Ensure that while mounting the SD card in host machine it may have different device names like /dev/sdc * and /dev/sdd * . Please check host machine accordingly while using device name.
...