advertisement
Yocto Reference Manual
GCC replaces it by the sysroot path
(here /opt/yogurt/i.MX6-PD15.3-rc/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/).
See the manpage of GCC for more information.
The variables $CFLAGS and $CXXFLAGS contain the compiler debug flag '-g' by default. This includes debugging information in the binary and makes it bigger. Those should be removed in the production image. If you create a
Bitbake recipe, the default behaviour is to turn on '-g', too. The debugging
symbols are used in the SDK rootfs to be able to get debugging information when invoking GDB from the host. Before installing the package to the target rootfs, Bitbake will invoke strip on the program which removes the debugging symbols. They are not found nor required on the target root filesystem per default.
6.8.5 Working with Kernel Modules
You will come to the point where you either need to set some options for a kernel module or you want to blacklist a module. Those things are handled by udev and go into *.conf files in /etc/modprobe.d/*.conf.
If you want to specify an option at buildtime, there are three relevant variables. If you just want to auto load a module which has e.g. no auto load capabilities, add it to
KERNEL_MODULE_AUTOLOAD += "your‐module" either in the kernel recipe or in the global variable scope.
If you need to specify options for a module you can do so with:
KERNEL_MODULE_AUTOLOAD += "your‐module"
KERNEL_MODULE_PROBECONF += "your‐module" module_conf_your‐module = "options your‐module parametername=parametervalue"
If you want to blacklist a module from auto loading, you can do it intuitively with:
KERNEL_MODULE_AUTOLOAD += "your‐module"
KERNEL_MODULE_PROBECONF += "your‐module" module_conf_your‐module = "blacklist your‐module"
6.8.6 Working with udev
Udev (Linux dynamic device management) is a system daemon that handles dynamic device
management in /dev.
It is controlled by udev rules that are located in /etc/udev/rules.d/ (sysadmin configuration space) and /lib/udev/rules.d/ (vendor provided).
36 © PHYTEC Messtechnik GmbH 2016 L-813e_3
Here is an example of an udev rule file:
Working with Poky and Bitbake
# file /etc/udev/rules.d/touchscreen.rules
# Create a symlink to any touchscreen input device
SUBSYSTEM=="input", KERNEL=="event[0‐9]*", ATTRS{modalias}=="input:*‐ e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
SUBSYSTEM=="input", KERNEL=="event[0‐9]*", ATTRS{modalias}=="ads7846",
SYMLINK+="input/touchscreen0"
See
http://www.freedesktop.org/software/systemd/man/udev.html
for more details about the syntax and usage. To get the list of attributes for a specific device that can be used in an udev rule you can use the udevadm info tool. It prints all existing attributes of the device node and its parents. The key value pairs from the output can be copied and pasted into a rule file. Some examples: target$ udevadm info ‐a /dev/mmcblk0 target$ udevadm info ‐a /dev/v4l‐subdev25 target$ udevadm info ‐a ‐p /sys/class/net/eth0
After changing an udev rule, you have to notify the daemon about that. Otherwise your changes are not reflected. Use the following command: target$ udevadm control ‐‐reload‐rules
While developing udev rules you should monitor the events in order to see when devices are de- or attached to the system. Use: target$ udevadm monitor
Furthermore it is very useful to monitor the system log in another shell, especially if the rule executes external scripts. Execute: target$ journalctl ‐f
You cannot start daemons or heavy scripts in a RUN attribute. See
http://www.freedesktop.org/software/systemd/man/udev.html#RUN{type}
This can only be used for very short-running foreground tasks. Running an event process for a long period of time may block all further events for this or a dependent device.
Starting daemons or other long-running processes is not appropriate for
udev; the forked processes, detached or not, will be unconditionally killed
after the event handling has finished.
You can use the special attribute ENV{SYSTEMD_WANTS}="service-
name.service" and a systemd service instead. See
http://unix.stackexchange.com/questions/63232/what-is-the-correct-way-towrite-a-udev-rule-to-stop-a-service-under-systemd
.
© PHYTEC Messtechnik GmbH 2016 L-813e_3 37
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Related manuals
advertisement
Table of contents
- 7 The Yocto Project
- 7 Introduction
- 7 Core Components
- 8 Vocabulary
- 8 Recipes
- 8 Classes
- 8 Layers
- 8 Machine
- 8 Distribution (Distro)
- 9 Bitbake
- 9 Toaster
- 9 Official Documentation
- 10 Compatible Linux Distributions
- 11 Introduction to the Phytec BSP
- 11 BSP Structure
- 11 BSP Management
- 11 phyLinux
- 12 BSP Metadata
- 12 meta-openembedded
- 12 meta-qt
- 12 meta-phytec
- 13 meta-yogurt
- 13 Build Configuration
- 14 Installation
- 14 Setting up the Host
- 14 Git Configuration
- 15 site.conf Setup
- 16 phyLinux Documentation
- 16 Get phyLinux
- 16 Basic Usage
- 17 Initialization
- 18 Advanced Usage
- 19 Working with Poky and Bitbake
- 19 Start the Build
- 19 Images
- 20 Installing the SDK
- 20 Accessing Development States between Releases
- 21 Inspect your Build Configuration
- 21 BSP Features of meta-phytec and meta-yogurt
- 21 Buildinfo
- 23 Customizing the BSP
- 23 How to disable the Qt Demo
- 24 How to add additional Software to the BSP Image
- 24 Notes about Packages and Recipes
- 25 How to add an additional Layer
- 26 How to create your own Layer
- 27 How to know your Kernel and Bootloader Recipe and Version
- 28 How to Configure the Kernel or Bootloader
- 29 How to add a Configuration Fragment to a Recipe
- 30 to a Recipe
- 31 How to patch the Kernel or Bootloader with devtool
- 32 How to patch the Kernel or Bootloader with the "temporary Method
- 35 How to work with the Kernel and Bootloader using SRC_URI in local.conf
- 36 Adding existing Software with the "sustainable Method
- 37 How to change the Network Configuration
- 38 Common Tasks
- 38 Debugging a User Space Application
- 39 Generating Source Mirrors, working offline
- 39 Compiling on the Target
- 40 Different Toolchains
- 40 Using the SDK
- 42 Working with Kernel Modules
- 42 Working with udev
- 44 Yocto Documentation
- 45 Revision History