Posts

Showing posts with the label make

Build and Flash OpenWrt for Raspberry Pi

Image
OpenWrt is an open source project for embedded operating system based on Linux, primarily used on embedded devices to route network traffic. [ 1 ] In this post, I will write about how to get the OpenWrt source, compile it for your Raspberry Pi board type and flash the SD card with the generated image. First of all, you need a Linux build environment installed with the requirements needed to build the OpenWrt. I use Ubuntu 14.04. In the market, there are 4 types of Raspberry Pi boards. Type 1, 2, 3 and Zero. OpenWrt's latest trunk branch supports all of these types. I will go through trunk. Check out the source: git clone git://github.com/openwrt/openwrt.git This will create a directory called "openwrt" in your current directory. Go inside this directory and run make package/symlinks command. msezgin@ubuntu:~/openwrt/make package/symlinks Now, we need to do the configuration before starting the build. msezgin@ubuntu:~/openwrt/make menuconfig ...

Linux Debugfs implementation as a userspace interface

debugfs is a Linux file system. It is a user space interface to and from the Linux kernel. It is mounted at /sys/kernel/debug.  The kernel must be compiled with the   CONFIG_DEBUG_FS option to use this file system. It exists in the Linux kernel since version 2.6.10-rc3 [1] In the below example, you will see an example to a debugfs. A 32-bit flag is created under the /sys/kernel/debug/debugfs_ex directory called enable for read and write. debugfs_ex.c #include <linux/version.h> #include <linux/module.h> #include <linux/debugfs.h> static struct dentry * dn; /* Dentry object for debugfs directory */ static int enable; /* Enable flag for debugfs_ex module */ /* * debugfs_ex_init() */ static int __init debugfs_ex_init ( void ) { printk(KERN_INFO "debugfs_ex init \n " ); dn = debugfs_create_dir( "debugfs_ex" , NULL ); if ( ! dn) { printk(KERN_ERR "Failed to create debugfs_ex directory in debugfs \n " ); ...