Skip to content

namccart/chroot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assumptions, Requirements and Preliminary Steps:

    *  The chroot project for GNU Radio assumes you've already installed the GNU Radio SDK.

        * For background information on the GNU Radio SDK, visit 
          http://gnuradio.org/redmine/projects/gnuradio/wiki/Embedded/2

        * To download the sdk, visit
          http://gnuradio.org/data/sdk/armv7hf
           
    *  To follow these instructions, you'll need root on your device.  It may be possible to perform equivalent steps without root, but we're not trying to be heroes, here.  We're trying to establish an environment for developing and testing code as quickly as possible.

Installing the GNU Radio SDK filesystem on your device:

    *  In the chroot project, go to host_scripts.

    *  The create_img.sh script creates a linux disc image file from the SDK.  You later you will mount this disc image on your device.

        *  >./create_img.sh

        *  (You will need sudo access... this is for mounting your disc image file in order to populate it with files from the SDK.)

        * input arguments summary:

            *  img size... This the size of the filesystem... the SDK is between 2 and 5 GB at this time.

            *  location of the sdk... This is the full path of the target system portion of the SDK. This is a subdirectory inside the SDK - for example this would be <path-to-SDK>/sysroots/armv7at2-vfp-neon-oe-linux-gnueabi/

        *  This operation takes between 3 and 5 minutes on a reasonable laptop.  It's okay.  You'll perform this step only as often as you need to update your SDK.

        *  The command generates sdk.img.tar.gz in the host_scripts directory.
 
    *  Create a directory to store your sdk and other files... you'll need a lot of space. Generally, this should be on the (real or emulated) sdcard.  Here's a sequence of plausible commands.

        *  on the device...

            *  >cd /sdcard
            *  >mkdir gnuradio
            *  >su
            *  #chmod 777 gnuradio

		* Note: Some stock images of Android, i.e. Android 5.0.1 use multiple filesystems, some of which may not support symbolic links (the 2013 Nexus 7 is an example). Verify that the gnuradio directory resides in an ext4 or similar file system by using the "mount" command. The /data directory should be a good candidate in most systems. 

    *  Now, transfer the archived disc image file to your device... You could do this via scp, adb, sshfs or any number of other tools.  We assume for the purposes of this README the device is running an Android OS, the host is connected via usb, and we use adb for communications with the device.

        *  on the host... 

            *  >adb push sdk.img.tar.gz /sdcard/gnuradio

        *  ...and this operation takes another 5 or so minutes over usb 2.0.

    *  Create a directory in device system memory (/data is a good choice).

        *  on the device...

            *  >cd /data
            *  >mkdir sdk
            *  >su
            *  #chmod 777 sdk   
     
    *  Transfer the device_scripts and busybox to the device.
        
        *  on the host...

            *  >adb push device_scripts /data/sdk/device_scripts
            *  >adb push busybox /data/sdk
            *  >adb shell
            *  >su
            *  #chmod 766 busybox
            *  #chmod 777 device_scripts 

    *  Unpack your SDK disc image file.
        
        *  on the device...

             *  cd /sdcard/gnuradio
             *  >/data/sdk/busybox tar xf sdk.img.tar.gz

        *  ...and this operation takes another 5 or so minutes.

Using the GNU Radio SDK filesystem:
    
    *  SDK-PyBOMBS interaction (another README) discusses the creation of a sandbox for code developed on top of the SDK.  We'll assume the sandbox is on the host at <path-to-pybombs>/target.tar.gz.  For iterative development, use PyBOMBS to cross compile projects, package them into the sandbox, and move the sandbox to to device (unpack it).  The chroot scripts will mount the sandbox into the chroot environment.  Use PyBOMBS to insert a chroot-appropriate setup_env.sh

        *  on the host...

            *  >adb push <path-to-pybombs>/target.tar.gz /sdcard/gnuradio

    *  The scripts in device_scripts help you establish a context so that you repeatedly can install new sandboxes, mount, chroot into, and unmount the disc image.
        *  on the device...

            *  >cd /data/sdk/device_scripts
            *  >./prep.sh -s (to load a fresh sandbox)
            *  >./prep.sh (to chroot with an existing, unpacked sandbox)
            *  >./unprep.sh (to unmount the sdk and subdirectories after exiting chroot)

         * If you want to skip creating a PyBOMBS sandbox, then just create a directory /sdcard/gnuradio/sdk_target
            
            *  command line options:
            
                *  --help, -h

                *  --sandbox_reload, -s... This option unpacks target.tar.gz, removing the previous sandbox (named sdk_target by default).  Use -s for the first prep and any subsequent prep requiring a sandbox refresh (after changing the source and rebuilding with the cross-compiler, for instance.  (Note: this call will unzip target.tar.gz, leaving target.tar in the base mount directory... you will be prompted to move the zipped sandbox back onto the device every time you use the -s option if a fresh, zipped sandbox is not in position.)

            *  input arguments summary:

                *  device name for sdcard... This argument applies if there's a real sdcard and if you need the prep script to manage that card.

                *  mount point for sdk... The directory where you'll mount the disc image.

                *  image file basename... The image file is sdk.img, and the basename is sdk if you've followed the instructions to this point.  
   
                *  prefix location... The path of the (untarred) sandbox.  The default reflects defaults in the PyBOMBS project.

                *  host sys name... The android directory with the linux-like sys structure (androids sometimes have both sys and system... pick the one with xbin and bin).

                *  busybox path... (/data/sdk/busybox in this example).

                *  chrooted shell... The shell you run inside chroot.
                
                *  path to mount under chrooted /data... There's a mount point on the disc image called /data for you to mount an android location on system memory... /data is a good one.

                * HOME for chrooted shell...  Probably make this the place where you put device_scripts, and probably make sure it's in system memory.

                * enter custom setup script... There's a hook to run whatever custom prep you need (kernel module loads, etc.).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages