SlideShare a Scribd company logo
1 of 21
Download to read offline
Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Qt is a registered trade mark of Digia Plc and/or its subsidiaries. All other trademarks mentioned in this document are
trademarks of their respective owners.
mentor.com/automo
tive
Alison Chaiken
Sept. 8, 2015
systemd, the modern Linux
service and resource manager
2
Philosophy of systemd
●
Extract duplicate functionality from daemons and 
move it to systemd core or kernel.
●
Replace /etc scripts with declarative config files.
●
Expose newer kernel APIs to userspace via a simple 
interface.
2
3
systemd is:
●
modular;
●
asynchronous and concurrent;
●
described by declarative sets of
properties;
●
bundled with analysis tools and tests;
●
supplied with a fully language-agnostic
API.
3
4
init.d scripts  systemd unit properties
●
Unit's action and parameters: ExecStart= 
●
Dependencies: Before=, After=, Requires=,
Conflicts= and Wants=.
●
Default dependencies:
– Requires= and After= on basic.target;
– Conflicts= and Before= on
shutdown.target.
●
Types of unit files: service, socket, device,
mount, scope, slice, automount, swap,
target, path, timer, snapshot
4
5
Example: Automotive Message Broker
From /lib/systemd/system/ambd.service:
# ambd systemd service unit file
[Unit]
Description=Automotive Message Broker
After=syslog.target
[Service]
Type=dbus
BusName=org.automotive.message.broker
ExecStart=/usr/bin/ambd
[Install]
WantedBy=multi-user.target
5
6
Example: Make the gdp-hmi-controller only start when weston
is ready
From: Jonathan Maw <jonathan.maw@codethink.co.uk>
[ . . . ]
--- /dev/null
+++ b/recipes-demo-hmi/genivi-demo-platform-hmi/gdp-hmi-
launcher2/StartLauncher.path
+[Unit]
+Description=GENIVI Start Launcher when weston is ready
+Requires=weston.service
+After=weston.service
+[Path]
+PathExists=/var/run/user/0/wayland-0
6
7
sysVinit runlevels ≈ systemd targets
7
● Targets are synchronization points.
● Check /lib/systemd/system/runlevel?.target symlinks:
– multi-user.target (runlevel 3)
– graphical.target (runlevel 5)
● Select boot-target :
– via /etc/systemd/system/default.target symlink;
– appending number or systemd.unit=<target> to bootargs.
8
Illustration: systemd-bootchart and custom
targets
Courtesy Marko Hoyer, ADIT.
8
9
Custom Targets in
GENIVI's Lifecycle Management
9
LUC = Last User Context
Node Startup Controller
10 10
● Organized into system and user units
● /lib/systemd/system: systemd upstream defaults for system-
wide services
● /etc/systemd/system: local customizations by override and
extension
● /lib/systemd/user: systemd's upstream defaults for per-user
services
● $HOME/.local/share/systemd/user for user-installed units
● 'drop-ins' are run-time extensions
Hierarchy of unit files for system and user
sessions
11
Illustration:Tizen Multi-user system
Source: Dominig ar Foll, “Tizen 3 IVI Architecture Multi User App FW”, FOSDEM 2014
12
Tizen Login Manager and User Sessions
Source: Dominig ar Foll, “Tizen 3 IVI Architecture Multi User App FW”, FOSDEM 2014
13
using the systemd journal
13
● Easily pushed to a remote.
● Can be cryptographically 'sealed'.
● Configurable max size and rotation.
● Simple log-reading tools are scriptable:
journalctl -xn
journalctl -p err
journalctl -u cron
journalctl -o json-pretty
systemctl status
systemctl is-failed bluetooth
systemctl --failed
14
Both systemd journal and DLT:
14
● are modular and extensible.
● support pushing data to AF_INET socket.
● can share data with legacy syslog.
● natively output binary formats.
→ Linking systemd and DLT involves:
– translating binary formats;
– handshaking;
– synchronization.
● Performed by remote?
15
simplifies access to kernel's security, resource and
watchdog controls
●
Including Capabilities, Watchdog, Cgroups and
kdbus (still a 'coming attraction')
●
Kernel features configurable via simple ASCII
options in unit files.
●
Encourages creation of system policies via unit
templates.
15
16
granular resource control: systemd and cgroups
16
● cgroups: a kernel-level mechanism for allocating
storage, memory, CPU and network.
● slices are groups of daemons whose resources are
managed jointly.
● systemd scopes are resultant groups of user
processes.
● Can set BlockIOWeight, IOSchedulingPriority,
OOMScoreAdjust, CPUShares, MemoryLimit …
Tomorrow: “An introduction to Control Groups”
17
systemd and security:
granular encapsulation via kernel's capabilities
17
● CapabilityBoundingSet
● PrivateTmp, PrivateDevices, PrivateNetwork
● JoinNamespaces
● ProtectSystem (/usr and /etc), ProtectHome
● ReadOnlyDirectories, InaccessibleDirectories
● systemd-nspawn: systemd's native containers
18
systemd's watchdog support
●
Provides simple configuration of soft or hard
watchdogs.
●
RuntimeWatchdogSec sets a timer for petting the
dog.
●
ShutdownWatchdogSec sets a timer to force
reboot if shutdown hangs.
18
19
Summary
●
Adaptation to systemd requires considerable
thought.
●
Uniform dependency language is attractive.
●
Managing resources, security and and watchdogs
is potentially simplified.
●
Backwards compatibility eases transition, but
project moves quickly.
19
20 20
● Man pages are part of systemd git repo.
● freedesktop.org: systemd mailing list archives and wiki
● Poettering's 0pointer.de blog
● ➟At wayback machine: “Booting up” articles
● Neil Brown series at LWN
● ➟Fedora's SysVinit to systemd cheatsheet
● Poettering's 'What's new' talk from FOSDEM 2015
● Josh Triplett's Debconf talk video
● Linux Action Show interviews with Mark Shuttleworth and
Lennart Poettering
● A bunch of videos and slides linked at my website
Resources
21
resource utilization of systemd itself
21
● systemd-211 in Poky includes 17 packages = 8 MB.
● systemd-219 builds 90 MB of executables (not all needed).
● minimal build = systemd, udevd and journald.
● Memory (RSS) of fully featured build: ≈9 MB; minimum build ≈5 MB.
● Features added/removed via './configure'.

More Related Content

What's hot

從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
Macpaul Lin
 
Claudio Scordino - Handling mixed criticality on embedded multi-core systems
Claudio Scordino - Handling mixed criticality on embedded multi-core systemsClaudio Scordino - Handling mixed criticality on embedded multi-core systems
Claudio Scordino - Handling mixed criticality on embedded multi-core systems
linuxlab_conf
 
Porting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt projectPorting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt project
Macpaul Lin
 
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
Linaro
 

What's hot (20)

Kernel Recipes 2015: How to choose a kernel to ship with a product
Kernel Recipes 2015: How to choose a kernel to ship with a productKernel Recipes 2015: How to choose a kernel to ship with a product
Kernel Recipes 2015: How to choose a kernel to ship with a product
 
Kernel Recipes 2013 - Kernel for your device
Kernel Recipes 2013 - Kernel for your deviceKernel Recipes 2013 - Kernel for your device
Kernel Recipes 2013 - Kernel for your device
 
libreCMC : The Libre Embedded GNU/Linux Distro
libreCMC : The Libre Embedded GNU/Linux DistrolibreCMC : The Libre Embedded GNU/Linux Distro
libreCMC : The Libre Embedded GNU/Linux Distro
 
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
 
Kernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneKernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyone
 
Kernel Recipes 2015: Speed up your kernel development cycle with QEMU
Kernel Recipes 2015: Speed up your kernel development cycle with QEMUKernel Recipes 2015: Speed up your kernel development cycle with QEMU
Kernel Recipes 2015: Speed up your kernel development cycle with QEMU
 
Systemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveSystemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to love
 
Kernel Recipes 2015 - The Dronecode Project – A step in open source drones
Kernel Recipes 2015 - The Dronecode Project – A step in open source dronesKernel Recipes 2015 - The Dronecode Project – A step in open source drones
Kernel Recipes 2015 - The Dronecode Project – A step in open source drones
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profit
 
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
 
LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager
 
Systemd for developers
Systemd for developersSystemd for developers
Systemd for developers
 
Claudio Scordino - Handling mixed criticality on embedded multi-core systems
Claudio Scordino - Handling mixed criticality on embedded multi-core systemsClaudio Scordino - Handling mixed criticality on embedded multi-core systems
Claudio Scordino - Handling mixed criticality on embedded multi-core systems
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android N
 
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARMSFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
 
Porting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt projectPorting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt project
 
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
 

Viewers also liked

Developing automotive Linux
Developing automotive LinuxDeveloping automotive Linux
Developing automotive Linux
Alison Chaiken
 

Viewers also liked (19)

Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)
Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)
Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)
 
Embedding Linux For An Automotive Environment
Embedding Linux For An Automotive EnvironmentEmbedding Linux For An Automotive Environment
Embedding Linux For An Automotive Environment
 
Introduction to Optee (26 may 2016)
Introduction to Optee (26 may 2016)Introduction to Optee (26 may 2016)
Introduction to Optee (26 may 2016)
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting Review
 
GENIVI Development Platform, la plataforma para desarrolladores de software l...
GENIVI Development Platform, la plataforma para desarrolladores de software l...GENIVI Development Platform, la plataforma para desarrolladores de software l...
GENIVI Development Platform, la plataforma para desarrolladores de software l...
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 boot
 
Developing automotive Linux
Developing automotive LinuxDeveloping automotive Linux
Developing automotive Linux
 
Consolidation of IVI Graphic Subsystems; Weston, a Wayland Compositor, and Ge...
Consolidation of IVI Graphic Subsystems; Weston, a Wayland Compositor, and Ge...Consolidation of IVI Graphic Subsystems; Weston, a Wayland Compositor, and Ge...
Consolidation of IVI Graphic Subsystems; Weston, a Wayland Compositor, and Ge...
 
Ivi external briefing_pack_v.aim
Ivi external briefing_pack_v.aimIvi external briefing_pack_v.aim
Ivi external briefing_pack_v.aim
 
The Importance of IVI, GENIVI and Open Source
The Importance of IVI, GENIVI and Open SourceThe Importance of IVI, GENIVI and Open Source
The Importance of IVI, GENIVI and Open Source
 
Current trends in open source and automotive
Current trends in open source and automotiveCurrent trends in open source and automotive
Current trends in open source and automotive
 
Developing the Next Generation Embedded HMIs
Developing the Next Generation Embedded HMIs Developing the Next Generation Embedded HMIs
Developing the Next Generation Embedded HMIs
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
 
Introduction to the Hadoop Ecosystem (FrOSCon Edition)
Introduction to the Hadoop Ecosystem (FrOSCon Edition)Introduction to the Hadoop Ecosystem (FrOSCon Edition)
Introduction to the Hadoop Ecosystem (FrOSCon Edition)
 
Contributing to Automotive Grade Linux (AGL) and GENIVI Development Platform ...
Contributing to Automotive Grade Linux (AGL) and GENIVI Development Platform ...Contributing to Automotive Grade Linux (AGL) and GENIVI Development Platform ...
Contributing to Automotive Grade Linux (AGL) and GENIVI Development Platform ...
 
IVI Software Update - Challenges and Strategies - Webinar Presentation (updated)
IVI Software Update - Challenges and Strategies - Webinar Presentation (updated)IVI Software Update - Challenges and Strategies - Webinar Presentation (updated)
IVI Software Update - Challenges and Strategies - Webinar Presentation (updated)
 
Automotive Linux, Cybersecurity and Transparency
Automotive Linux, Cybersecurity and TransparencyAutomotive Linux, Cybersecurity and Transparency
Automotive Linux, Cybersecurity and Transparency
 
Chronic granulomatous disease
Chronic granulomatous diseaseChronic granulomatous disease
Chronic granulomatous disease
 
GENIVI Development Platform (GDP) summary : 15th AMM
GENIVI Development Platform (GDP) summary : 15th AMMGENIVI Development Platform (GDP) summary : 15th AMM
GENIVI Development Platform (GDP) summary : 15th AMM
 

Similar to Automotive Grade Linux and systemd

Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
a3sec
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
Opersys inc.
 
Remote security with Red Hat Enterprise Linux
Remote security with Red Hat Enterprise LinuxRemote security with Red Hat Enterprise Linux
Remote security with Red Hat Enterprise Linux
Giuseppe Paterno'
 

Similar to Automotive Grade Linux and systemd (20)

Securing Applications and Pipelines on a Container Platform
Securing Applications and Pipelines on a Container PlatformSecuring Applications and Pipelines on a Container Platform
Securing Applications and Pipelines on a Container Platform
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
Linux 开源操作系统发展新趋势
Linux 开源操作系统发展新趋势Linux 开源操作系统发展新趋势
Linux 开源操作系统发展新趋势
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Securing Applications and Pipelines on a Container Platform
Securing Applications and Pipelines on a Container PlatformSecuring Applications and Pipelines on a Container Platform
Securing Applications and Pipelines on a Container Platform
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Linux Security
Linux SecurityLinux Security
Linux Security
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
[OW2con'21] Hosting Identity in the Cloud with OW2 free softwares
[OW2con'21] Hosting Identity in the Cloud with OW2 free softwares[OW2con'21] Hosting Identity in the Cloud with OW2 free softwares
[OW2con'21] Hosting Identity in the Cloud with OW2 free softwares
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Monitoring.pptx
Monitoring.pptxMonitoring.pptx
Monitoring.pptx
 
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
 
LTTng-UST: Efficient System-Wide User-Space Tracing
LTTng-UST: Efficient System-Wide User-Space TracingLTTng-UST: Efficient System-Wide User-Space Tracing
LTTng-UST: Efficient System-Wide User-Space Tracing
 
Remote security with Red Hat Enterprise Linux
Remote security with Red Hat Enterprise LinuxRemote security with Red Hat Enterprise Linux
Remote security with Red Hat Enterprise Linux
 

More from Alison Chaiken

Not breaking userspace: the evolving Linux ABI
Not breaking userspace: the evolving Linux ABINot breaking userspace: the evolving Linux ABI
Not breaking userspace: the evolving Linux ABI
Alison Chaiken
 
Automotive Free Software 2013: "Right to Repair" and Privacy
Automotive Free Software 2013: "Right to Repair" and PrivacyAutomotive Free Software 2013: "Right to Repair" and Privacy
Automotive Free Software 2013: "Right to Repair" and Privacy
Alison Chaiken
 
The next frontier: open source in the car
The next frontier: open source in the carThe next frontier: open source in the car
The next frontier: open source in the car
Alison Chaiken
 

More from Alison Chaiken (20)

Not breaking userspace: the evolving Linux ABI
Not breaking userspace: the evolving Linux ABINot breaking userspace: the evolving Linux ABI
Not breaking userspace: the evolving Linux ABI
 
Supporting SW Update via u-boot and GPT/EFI
Supporting SW Update via u-boot and GPT/EFISupporting SW Update via u-boot and GPT/EFI
Supporting SW Update via u-boot and GPT/EFI
 
Two C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsTwo C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp Insights
 
V2X Communications: Getting our Cars Talking
V2X Communications: Getting our Cars TalkingV2X Communications: Getting our Cars Talking
V2X Communications: Getting our Cars Talking
 
Practical Challenges to Deploying Highly Automated Vehicles
Practical Challenges to Deploying Highly Automated VehiclesPractical Challenges to Deploying Highly Automated Vehicles
Practical Challenges to Deploying Highly Automated Vehicles
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
 
Functional AI and Pervasive Networking in Automotive
 Functional AI and Pervasive Networking in Automotive Functional AI and Pervasive Networking in Automotive
Functional AI and Pervasive Networking in Automotive
 
Flash in Vehicles: an End-User's Perspective
Flash in Vehicles: an End-User's PerspectiveFlash in Vehicles: an End-User's Perspective
Flash in Vehicles: an End-User's Perspective
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
 
Developing Automotive Linux
Developing Automotive LinuxDeveloping Automotive Linux
Developing Automotive Linux
 
Technology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected CarTechnology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected Car
 
Best practices for long-term support and security of the device-tree
Best practices for long-term support and security of the device-treeBest practices for long-term support and security of the device-tree
Best practices for long-term support and security of the device-tree
 
The “Telematics Horizon” V2V and V2I Networking
The “Telematics Horizon” V2V and V2I NetworkingThe “Telematics Horizon” V2V and V2I Networking
The “Telematics Horizon” V2V and V2I Networking
 
Automotive Free Software 2013: "Right to Repair" and Privacy
Automotive Free Software 2013: "Right to Repair" and PrivacyAutomotive Free Software 2013: "Right to Repair" and Privacy
Automotive Free Software 2013: "Right to Repair" and Privacy
 
Addressing the hard problems of automotive Linux: networking and IPC
Addressing the hard problems of automotive Linux: networking and IPCAddressing the hard problems of automotive Linux: networking and IPC
Addressing the hard problems of automotive Linux: networking and IPC
 
Tier X and the Coming of the Whitebox Car
Tier X and the Coming of the Whitebox CarTier X and the Coming of the Whitebox Car
Tier X and the Coming of the Whitebox Car
 
Booth content from Maker Faire Bay Area 2012
Booth content from Maker Faire Bay Area 2012Booth content from Maker Faire Bay Area 2012
Booth content from Maker Faire Bay Area 2012
 
From Driver Distraction to Driver Augmentation: Open Source in Cars
From Driver Distraction to Driver Augmentation: Open Source in CarsFrom Driver Distraction to Driver Augmentation: Open Source in Cars
From Driver Distraction to Driver Augmentation: Open Source in Cars
 
Edmunds presentation
Edmunds presentationEdmunds presentation
Edmunds presentation
 
The next frontier: open source in the car
The next frontier: open source in the carThe next frontier: open source in the car
The next frontier: open source in the car
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Recently uploaded (20)

Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 

Automotive Grade Linux and systemd

  • 1. Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. Qt is a registered trade mark of Digia Plc and/or its subsidiaries. All other trademarks mentioned in this document are trademarks of their respective owners. mentor.com/automo tive Alison Chaiken Sept. 8, 2015 systemd, the modern Linux service and resource manager
  • 3. 3 systemd is: ● modular; ● asynchronous and concurrent; ● described by declarative sets of properties; ● bundled with analysis tools and tests; ● supplied with a fully language-agnostic API. 3
  • 4. 4 init.d scripts  systemd unit properties ● Unit's action and parameters: ExecStart=  ● Dependencies: Before=, After=, Requires=, Conflicts= and Wants=. ● Default dependencies: – Requires= and After= on basic.target; – Conflicts= and Before= on shutdown.target. ● Types of unit files: service, socket, device, mount, scope, slice, automount, swap, target, path, timer, snapshot 4
  • 5. 5 Example: Automotive Message Broker From /lib/systemd/system/ambd.service: # ambd systemd service unit file [Unit] Description=Automotive Message Broker After=syslog.target [Service] Type=dbus BusName=org.automotive.message.broker ExecStart=/usr/bin/ambd [Install] WantedBy=multi-user.target 5
  • 6. 6 Example: Make the gdp-hmi-controller only start when weston is ready From: Jonathan Maw <jonathan.maw@codethink.co.uk> [ . . . ] --- /dev/null +++ b/recipes-demo-hmi/genivi-demo-platform-hmi/gdp-hmi- launcher2/StartLauncher.path +[Unit] +Description=GENIVI Start Launcher when weston is ready +Requires=weston.service +After=weston.service +[Path] +PathExists=/var/run/user/0/wayland-0 6
  • 7. 7 sysVinit runlevels ≈ systemd targets 7 ● Targets are synchronization points. ● Check /lib/systemd/system/runlevel?.target symlinks: – multi-user.target (runlevel 3) – graphical.target (runlevel 5) ● Select boot-target : – via /etc/systemd/system/default.target symlink; – appending number or systemd.unit=<target> to bootargs.
  • 8. 8 Illustration: systemd-bootchart and custom targets Courtesy Marko Hoyer, ADIT. 8
  • 9. 9 Custom Targets in GENIVI's Lifecycle Management 9 LUC = Last User Context Node Startup Controller
  • 10. 10 10 ● Organized into system and user units ● /lib/systemd/system: systemd upstream defaults for system- wide services ● /etc/systemd/system: local customizations by override and extension ● /lib/systemd/user: systemd's upstream defaults for per-user services ● $HOME/.local/share/systemd/user for user-installed units ● 'drop-ins' are run-time extensions Hierarchy of unit files for system and user sessions
  • 11. 11 Illustration:Tizen Multi-user system Source: Dominig ar Foll, “Tizen 3 IVI Architecture Multi User App FW”, FOSDEM 2014
  • 12. 12 Tizen Login Manager and User Sessions Source: Dominig ar Foll, “Tizen 3 IVI Architecture Multi User App FW”, FOSDEM 2014
  • 13. 13 using the systemd journal 13 ● Easily pushed to a remote. ● Can be cryptographically 'sealed'. ● Configurable max size and rotation. ● Simple log-reading tools are scriptable: journalctl -xn journalctl -p err journalctl -u cron journalctl -o json-pretty systemctl status systemctl is-failed bluetooth systemctl --failed
  • 14. 14 Both systemd journal and DLT: 14 ● are modular and extensible. ● support pushing data to AF_INET socket. ● can share data with legacy syslog. ● natively output binary formats. → Linking systemd and DLT involves: – translating binary formats; – handshaking; – synchronization. ● Performed by remote?
  • 15. 15 simplifies access to kernel's security, resource and watchdog controls ● Including Capabilities, Watchdog, Cgroups and kdbus (still a 'coming attraction') ● Kernel features configurable via simple ASCII options in unit files. ● Encourages creation of system policies via unit templates. 15
  • 16. 16 granular resource control: systemd and cgroups 16 ● cgroups: a kernel-level mechanism for allocating storage, memory, CPU and network. ● slices are groups of daemons whose resources are managed jointly. ● systemd scopes are resultant groups of user processes. ● Can set BlockIOWeight, IOSchedulingPriority, OOMScoreAdjust, CPUShares, MemoryLimit … Tomorrow: “An introduction to Control Groups”
  • 17. 17 systemd and security: granular encapsulation via kernel's capabilities 17 ● CapabilityBoundingSet ● PrivateTmp, PrivateDevices, PrivateNetwork ● JoinNamespaces ● ProtectSystem (/usr and /etc), ProtectHome ● ReadOnlyDirectories, InaccessibleDirectories ● systemd-nspawn: systemd's native containers
  • 18. 18 systemd's watchdog support ● Provides simple configuration of soft or hard watchdogs. ● RuntimeWatchdogSec sets a timer for petting the dog. ● ShutdownWatchdogSec sets a timer to force reboot if shutdown hangs. 18
  • 19. 19 Summary ● Adaptation to systemd requires considerable thought. ● Uniform dependency language is attractive. ● Managing resources, security and and watchdogs is potentially simplified. ● Backwards compatibility eases transition, but project moves quickly. 19
  • 20. 20 20 ● Man pages are part of systemd git repo. ● freedesktop.org: systemd mailing list archives and wiki ● Poettering's 0pointer.de blog ● ➟At wayback machine: “Booting up” articles ● Neil Brown series at LWN ● ➟Fedora's SysVinit to systemd cheatsheet ● Poettering's 'What's new' talk from FOSDEM 2015 ● Josh Triplett's Debconf talk video ● Linux Action Show interviews with Mark Shuttleworth and Lennart Poettering ● A bunch of videos and slides linked at my website Resources
  • 21. 21 resource utilization of systemd itself 21 ● systemd-211 in Poky includes 17 packages = 8 MB. ● systemd-219 builds 90 MB of executables (not all needed). ● minimal build = systemd, udevd and journald. ● Memory (RSS) of fully featured build: ≈9 MB; minimum build ≈5 MB. ● Features added/removed via './configure'.