...
3. Keep RDK-Video image in the host machine
4. Extracting the RDK-Video image into the extblock directory
sudo sh extract.sh <video-image file>
Code Block |
---|
|
code | title | video data extract.sh |
---|
|
mkdirsudo -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 |
---|
|
sh extract.sh <video-image file>
For ex. sudo sh extract.sh rdk-generic-hybrid-refapp-thunder-image_default_20190924125426.rootfs.rpi-sdimg |
...
- Create mount directory and execute mount for the partition 4
Code Block |
---|
language | bash |
---|
title | video data extract |
---|
|
For ex.
mkdir videomnt
sudo mount /dev/sdb4 videomnt
In above command, storage partition 4 will get mounted to videomnt directory |
- Copy the RDK-Video image which is present in the extblock
Code Block |
---|
language | bash |
---|
title | video data extract |
---|
|
sudo cp -r extblock/v* videomnt/ |
6. Copy the vrootfs backup data into partition 4 storage bank, to ensure it will acts as video bank as well
Code Block |
---|
language | bash |
---|
title | video data extract |
---|
|
sudo cp -r extblock/vrootfs_backup_data/* videomnt/ |
...
7. Copy the bank_broadband_switch.sh file to partition 4 as below
Code Block |
---|
language | bash |
---|
title | video data extract |
---|
|
sudo cp bank_broadband_switch.sh videomnt/lib/rdk/ |
...
8. Unmount videomnt directory as below
Code Block |
---|
language | bash |
---|
title | video data extract |
---|
|
sudo umount videomnt |
...
Place the script files rpi_sw_install1.sh rpi_sw_install.sh swupdate_utility.sh bank_image_switch.sh bank_video_switch.sh imageFlasher.sh in /lib/rdk path of broadband image by following the below scripts
Code Block |
---|
language | bash |
---|
title | video data extract |
---|
|
#For ex.
mkdir -p 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 |
...
12. To load the video image which is present in the storage execute the script bank_video_switch.sh
Code Block |
---|
language | bash |
---|
title | video data extract |
---|
|
root@RaspberryPi-Gateway:/lib/rdk# sh bank_video_switch.sh |
...
14. Now this image can be switch back to broadband image by executing following script
Code Block |
---|
language | bash |
---|
title | video data extract |
---|
|
sh /lib/rdk/bank_broadband_switch.sh |
...