-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
125 lines (72 loc) · 6.62 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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.).