Raspbian Info
This topic provides some helpful tips to install Legato on a Raspbian distribution.
Download and Install
Download Raspbian Lite image from the official website.
Then, install the Raspbian system on your Raspberry Pi.
See the Raspbian Linux docs for details.
- Note
- Legato requires specific kernel options, so you need to rebuild your kernel. This will be changed in a future release.
Rebuild Kernel
Before building the kernel, you need to setup the configuration.
First, create a file in the directory of the downloaded kernel with these configuration settings:
Sample legatocfg
CONFIG_CGROUPS=yCONFIG_CGROUP_DEBUG=yCONFIG_CGROUP_FREEZER=yCONFIG_CGROUP_CPUACCT=yCONFIG_CGROUP_DEVICE=yCONFIG_MEMCG=y# CONFIG_MEMCG_SWAP is not set# CONFIG_MEMCG_KMEM is not setCONFIG_CGROUP_SCHED=yCONFIG_FAIR_GROUP_SCHED=yCONFIG_RT_GROUP_SCHED=yCONFIG_BLK_CGROUP=yCONFIG_SECURITY=yCONFIG_SECURITY_SMACK=yCONFIG_DEFAULT_SECURITY_SMACK=y# CONFIG_DEFAULT_SECURITY_DAC is not setCONFIG_DEFAULT_SECURITY="smack"CONFIG_HOTPLUG_CPU=yCONFIG_ARM_CPU_SUSPEND=yCONFIG_SUSPEND=yCONFIG_PM_SLEEP=yCONFIG_PM_WAKELOCKS=yCONFIG_PM_WAKELOCKS_LIMIT=100CONFIG_PM_WAKELOCKS_GC=yCONFIG_PM_DEBUG=yCONFIG_PM_ADVANCED_DEBUG=y# CONFIG_PM_TEST_SUSPEND is not setCONFIG_PM_SLEEP_DEBUG=yCONFIG_SQUASHFS=yCONFIG_SQUASHFS_DECOMP_SINGLE=yCONFIG_SQUASHFS_EMBEDDED=yCONFIG_SQUASHFS_FILE_DIRECT=y# CONFIG_SQUASHFS_FILE_CACHE is not set
Then, run the following command to set up the default kernel configuration for the Raspberry Pi 3 merging options needed by Legato.
ARCH=arm make bcm2709_defconfig && ARCH=arm scripts/kconfig/merge_config.sh -O . .config legatocfg
If you have a Raspberry Pi 2, use bcm2835
instead of bcm2709
.
After you've set the options, you can build the kernel:
$ make -j 4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs
Follow the Raspbian installing Linux images docs for details on how to update the kernel on the SD card.
See the Raspbian building docs if you want detailed info about building the kernel (CROSS-COMPILING).
Download and Install Legato Framework
On the Target, run these commands:
$ mkdir /mnt/flash$ mkdir /mnt/legato$ mkdir /legato$ cp /lib/systemd/system/systemd-journald.service /etc/systemd/system/
You also need to edit:
/etc/systemd/system/systemd-journald
.service- add "SmackProcessLabel=syslog" in [Service]
To allow you to login as root:
- edit
/etc/ssh/sshd_config
- set PermitRootLogin to Yes.
On the Host PC, download Legato from the GitHub repo
If you have a Rapberry Pi 3, Legato's toolchain doesn't currently support the ARMv8 processor. You have to do a few extra steps to add the ARMv8 support:
Clone the Raspberry Pi tools repository.
Set the following envvars
, changing ~/rpi/
to your cloned directory name:
export RASPI_TOOLCHAIN_DIR=~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/export RASPI_TOOLCHAIN_PREFIX=arm-linux-gnueabihf-
Make Legato for Raspbian
You can now make Legato for Raspbian.
cd to your Legato directory
Run $ make raspi
The makefile creates a /build/raspi/legato
.squashfs file system. Copy this file into the /boot
of the SD card:
$ scp build/raspi/legato.squashfs root@IP_RASPBERRY:/boot
To finish, mount the squash file on the Raspberry Pi and start Legato:
$ sudo mount -t squashfs /boot/legato.squashfs /mnt/legato/$ /./mnt/legato/start
- Note
- To use data connection, you must install PPP Daemon (use 'apt-get install ppp')
Configure WiFi
To use your Raspberry Pi as a WiFi access point, you need to configure wlan0
in the /etc/network/interfaces
file like this:
allow-hotplug wlan0iface wlan0 inet manualwireless-mode master
The WiFi access point sample app demonstrates how one Internet connection can be shared with multiple WiFi devices. To have Wireless WAN connectivity on a Raspberry Pi, a module like Linkwave's The PiloT is required. The PiloT is known to work with Legato and Raspberry Pi, and can be used to create a wireless WiFi hotspot with the WiFi access point sample app.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.