Build a boot-time image

                $ repo init -u https://code.rdkcentral.com/r/manifests -m rdkb-raspberrypi.xml -b morty

                $ repo sync -j4 --no-clone-bundle

                $ source meta-cmf-raspberrypi/setup-environment

   Select  raspberrypi-rdk-boot-time-broadband.conf

                $ bitbake rdk-generic-broadband-boot-image

     After the build is completed , flash  *.rootfs.rpi-sdimg from the path build-raspberrypi-rdk-boot-time-broadband/tmp/deploy/images/raspberrypi-rdk-boot-time-broadband/

                $ sudo dd if=*.rootfs.rpi-sdimg


Extend the size of rootfs

             Extend the size of rootfs to 420 MB not more than that. So that newly created partition could occupy the dedicated space.

To extend the size use gparted on your linux PC.

  $ sudo gparted

On the UI

  1) Select ext3 partition and click on resize


                     

 2)  Resize the New-size (MB) attribute to 420 M and click on resize

                    

Place the sd-card on rpi board slot .


On Virtual Machine(VM)


Create a file named boot-info.txt on the path ~/ (/mnt/home) at your VM.

      Note: Do not change the name of the file or change the location  , Create it as it is mentioned above.

In your boot-info.txt place the following info

     $ vi ~/boot-info.txt

Credentials:cm5hcmF5YW5hbjpDb21jYXN0==  (Encoded base 64 rdk.wiki.central credential)

Imagepath:/mnt/home/rdkb/daily-build/build-raspberrypi-rdk-boot-time-broadband/tmp/deploy/images/raspberrypi-rdk-boot-time-broadband  (The path where our rootfs resides after bitbake)
Sourcepath:/mnt/home/rdkb/boot-time/test1 (Path where your rootfs tar will be present on your VM)

      → Use this link to convert Encoded Credential https://www.base64encode.org  (Enter your Credential in the following format username:password)

     → Make sure the Sourcepath directory is present, if not create it using mkdir -p /mnt/home/rdkb/boot-time/test1

 

Here is  a sample boot-info.txt

Credentials:cm5hcmF5YW5hbjpDb21jYtre0MTIzIQ==
Sourcepath:/mnt/home/rdkb/rajkumar-A/test1
Imagepath:/mnt/home/rdkb/daily-build/build-raspberrypi-rdk-boot-time-broadband/tmp/deploy/images/raspberrypi-rdk-boot-time-broadband

  Create ~/repo.sh with following content

#!/bin/sh
RUNAT="Wednesday:12:00"

source=$(cat ~/boot-info.txt | grep Sourcepath | cut -d ":" -f2)
echo $source

imagepath=$(cat ~/boot-info.txt | grep Imagepath | cut -d ":" -f2)
echo $imagepath

while [ 1 ]
do
    DATE=`/bin/date +%A:%H:%M`
    if [ $DATE. = $RUNAT. ]
    then
        rm -rf daily-build
        mkdir daily-build
        cd daily-build
        repo init -u https://code.rdkcentral.com/r/manifests -m rdkb-raspberrypi.xml -b morty
        repo sync -j4 --no-clone-bundle
       MACHINE=raspberrypi-rdk-boot-time-broadband source meta-cmf-raspberrypi/setup-environment
       cd build-raspberrypi-rdk-boot-time-broadband
       bitbake rdk-generic-broadband-boot-image -f
   fi


        if [ -f  ${imagepath}/*.rootfs.tar.bz2 ]
        then
        echo " Build is been initiated and completed "
            cp ${imagepath}/*.rootfs.tar.bz2 ${source}
        sleep 10
                stat ${source}/*.rootfs.tar.bz2 | grep "Size" | cut -d " " -f4 > ${source}/filesize.txt
        sleep 30
        rm ${imagepath}/*.rootfs.tar.bz2    
        fi

                   

Change mode and run the script

              $ chmod 777 ~/repo.sh

Execute the script with .(dot)

              $  .  repo.sh &

As mentioned on the script it initiates the build at "Wednesday:12:00" , It could be changed.


On Board

 Once Board is up and running scp key-file into image /home/root/

Rename the VM key-file  to keyfile , as the script on image uses it.

     $ mv "key-file" keyfile

Copy the key-file to kernel partition for further rootfs flash

     $ mount /dev/mmblk0p1 /mnt

     $ cp /home/root/keyfile /mnt

Now Keep the VM details on kernel partition

     $ vi /mnt/vm-info.txt

Add the below information 

     Port:22 (Remove 22 and your VM port Number, if there is no port number make it 22 )

     Machine:rdkb (Remove rdkb and enter your VM name)

     ip:96.118.156.223 (Remove the ip and add your VM ip )

     $ umount /mnt

 Reboot the image

      $ reboot


Once the build is completed on VM it will be copied and boot -time info uploaded on the following page RDK-B Boot time data plot.



  • No labels