Download Multi-purpose Embedded Communication Gateway: System Design

Transcript
Chi Winth Ea
Morten Sørbø
Multi-purpose Embedded Communication Gateway:
System Design and Testbed Implementation
The compilation process is started when downloading the source code to the Linux kernel, and a
compiler designed for the target computer – in our case the RPi. Then the source code is primed with
the current config, which is copied directly from the Raspberry Pi. When this is done, the kernel can
be modified by adding or removing features. In order to make the kernel more stable, we removed a
lot of unnecessary modules. After repeating this process until we had a reduced version that worked
without flaws, we transferred the kernel and the modules to RPi.
Below is a set of commands to download the necessary files and prepare for selecting modules. We
have not automated the selection, as this was done in an interactive menu [83].
mkdir ~/rpi
cd ~/rpi
wget https://github.com/raspberrypi/linux/archive/rpi-3.2.27.tar.gz
wget https://github.com/raspberrypi/tools/archive/master.tar.gz
tar xzf rpi-3.2.27.tar.gz
tar xzf master.tar.gz
export CCPREFIX=/home/picompile/rpi/tools-master/arm-bcm2708/arm-bcm2708-linuxgnueabi/bin/arm-bcm2708-linux-gnueabiexport KERNEL_SRC=/home/picompile/rpi/linux-rpi-3.2.27
cd $KERNEL_SRC
make mrproper
scp [email protected]:/proc/config.gz ./
zcat config.gz > .config
make ARCH=arm CROSS_COMPILE=${CCPREFIX} oldconfig
Please note that the username on the Ubuntu install is “picompile” and the IP address of the
Raspberry Pi is “192.168.1.18” in the code example. The code above is first making a folder in the
home directory, then downloading two .tar.gz-files. These files are then extracted. The “export”
commands are creating variables to ease the rest of the process. Instead of using the long folder
paths, the variables can be used.
The “cd” command changes directory to perform the following commands from inside the kernel
source folder. When inside this directory “make mrproper” cleans up old files before the compilation
is started [83]. As this command also will remove configuration files, we wait until after this to copy
the configuration from the RPi.
“scp” is the command used to transfer the current configuration from RPi. This starts a SSH session
and will copy the file to the Ubuntu machine. Then the configuration file is extracted and used to
select the modules in the source that is already installed on the Raspberry Pi. In order to make
changes in the kernel, run the following command and select or unselect modules [84]
make ARCH=arm CROSS_COMPILE=${CCPREFIX} menuconfig
When this is done, the kernel will be compiled using the command “make
ARCH=arm
CROSS_COMPILE=${CCPREFIX}”,
ARCH=arm
and
the
modules
will
be
built
with
“make
44
Version 0.7