4/27/2017

Cellphone의 BaseBand 관련내용

  • 각 Chip 업체의 baseband Chip 업체  
Cellular Modem DSP Cores
  1. Coresonic: Owned by MediaTek
  2. FRIO: Jointly developed by Intel and Analog Devices
  3. Tensilica: Now part of Cadence Design Systems
  4. ZSP: Licensed by VeriSilicon (US) Inc

아래의 기사를 보면 현재 Mobile Modem의 상황을 자세히 알수가 있다.
NVIDIA는 국내 뿐만 아니라,  Icera관련 비지니스를 접은 것 같다.

  https://fwdconcepts.com/enewsletter-51915/



  • Samsung과 Mediatek 이 Qualcomm 관련기사 
  http://rethinkresearch.biz/articles/samsung-and-mediatek-attack-qualcomms-lte-soc-dominance/

  • Nvidia 의 Icera 2011년 5월 인수 
Nvidia는 영국의 Icera를 인수하고 Mobile 로 진출하려고했지만 얼마지나지못해 국내 모바일 사업을 철수했다.

  https://www.electronicsweekly.com/blogs/mannerisms/wireless-mannerisms/icera-sold-to-nvidia-2-2011-05/





4/23/2017

Jenkins Ubuntu에서 설치

1. Jenkins 설치 

  • Ubuntu에서 Jenkins 설치방법 
  1. Docker 사용
  2. Jenkins의 WAR(Web application ARchive) 을 Download해서 직접실행 (JDK Version 체크)
  3. Ubuntu에서 Package로 설치방법(아래설치)

가장쉬운방법은 Docker를 이용하는 것이지만, 기존 Ubuntu의 Package 관리 Tool을 이용하여 설치해보자.


1.1 Jenkins 기본준비사항

Jenkins를 설치하기 위해서 OpenJDK가 필요하며,  만약 Android를 빌드를 한다면, 매우 민감한 사항이므로,
설치를 해준후 Version에 따라 구동을 다르게 하자.

  • OpenJDK 8/9 설치 
$ ls /var/lib/dpkg/alternatives/ | grep java  // OpenJDK 설치되었는지 확인-1  
java
javac
javadoc
javah
javap
javaws

$ update-java-alternatives -l   // OpenJDK 설치되었는지 확인-2  

$ sudo apt-get install openjdk-8-jdk   // 설치되지 않았을 경우, 각 version을 설치 

$ sudo update-alternatives --config java  // Jenkins에 맞게 Open JDK의 Version 각 버전을 선택 


Jenkins의 설치전 요구사항 확인 (JDK)
  https://jenkins.io/doc/administration/requirements/java/

Open JDK 설치 참조
  https://openjdk.java.net/install/

Open JDK 관련에러사항
  http://goddaehee.tistory.com/25


1.2 Jenkins WAR 설치 및 실행

  • Ubuntu에서 WAR 직접 Download 후 실행 (JDK 설치후)
Jenkins WAR Download
  https://www.jenkins.io/download/

$ java -jar jenkins.war          // WAR download 후 바로 실행 후 8080 Port로 접속  
or
$ java -jar jenkins.war --httpPort=8090 

WAR로 바로 실행 후 browser 로 확인 및 ~/.jenkins/  확인 


1.3 Jenkins Package 설치 및 실행

Ubuntu에서 Jenkins를 Package로 설치를 해도, war 기반으로 동작하지만, 환경설정을 아래와 같이 해줘야한다. 
 
  • Ubuntu에서 Package 설치방법
Ubuntu에서 기본 Package List에 없기 때문에 이를 추가하고 업데이트 한 후 이를 설치해주자.

$ wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -            // 인증 추가 
$ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'   // repository 주소 추가 
$ sudo apt-get update              // 추가된 Repository 주소 적용  
$ sudo apt-get install jenkins


Jenkins 설치방법
  https://jenkins.io/doc/pipeline/tour/getting-started/
  https://jenkins.io/doc/book/installing/
  https://pkg.jenkins.io/debian/

Jenkins Version 확인
  http://pkg.jenkins.io/debian-stable/


  • Jenkins Package 설치 후 설정 

$ vi /etc/default/jenkins  // 설정파일 확인 , 변경하지 않을 경우 그대로 사용 
...
JENKINS_WAR=/usr/share/$NAME/$NAME.war  # Jenkins WAR 파일 (실행파일) 위치 확인 

JENKINS_HOME=/var/lib/$NAME   # 설정 위치 확인 

JENKINS_LOG=/var/log/$NAME/$NAME.log # Jenkins Log 위치 확인 

HTTP_PORT=8080   #사용 Port 확인 변경시  


$ java -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*"/\1\2/p;' # Java Version 확인 
18
$ vi /etc/init.d/jenkins
JAVA_ALLOWED_VERSION="18"   ## Java Version 확인 

$ /etc/init.d/jenkins start
or 
$ sudo service jenkins 

자동으로 서비스에 등록하여, 자동실행 


2. Jenkins 실행 후 기본 PlugIn 설치


Jenkins를 설치 후 실행한 후 아래와 같이 해당값을 읽어 Unlock 후 각 PlugIn 설치 

$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
0b3a8f996c1540a389abeae48668f42d



일단 제안된 PlugIn 설치



  • PlugIn 설치진행 후 기본 확인
  1. 계정과 암호/ 이름/ 이메일을 설정
  2. 계정으로 로그인 
  3. 메뉴->Jenkins 관리 -> 플러그인 관리 -> 설치된 플러그인 목록 확인 
  4. 메뉴->Jenkins 관리 -> 플러그인 관리 -> 설치가능 (추가설치)

** 거의 설치가능메뉴에서 메뉴가 나오지 않는다면, 방화벽문제 혹은 Network 문제 
** 각 Port 의 Accept 확인 
$ sudo iptables -L -n  //현재 설정확인   

  • Project Item 생성 및 기본설정 (Build Item)
  1. 메뉴->New Item -> Enter Item Name  :  TEST_S  (원하는대로 이름 설정) 
  2. Free Style Project or 다른 기능 선택 후 OK 설정 
  3. Free Style로 했을 경우, 세부 Remote Repository 설정 한 후 각 Git Site 와 연결 
  4. Build Script 작성 
  5. Build 후 기능 추가 

각 Git site (Github /Bitbucket/ Gitlab) 관련설정을 추후에 직접 설정해보고, 각 기능을 사용해보자. 


  • Item 추가 후 Build 사항 점검
  1. 작업공간 확인 
  2. 상위 추가된 Item으로 Build 진행
  3. Console Output 빌드사항 확인 (문제 발생시 반드시 확인)
  4. Build History 부분 확인

  • Build 된 사항 의 Item의 workspace 위치확인
  1. ~/.jenkins/workspace/TEST_S/

Package로 설치를 하면 각 환경설정 및 Service로 쉽게 할 수 있어서 좋다. 
WAR로 직접 실행하면, 모든 환경설정 및 PlugIn / Workspace가 ~/.jenkins/ 안에 존재 


Jenkins 설치 (nginx 기반)
  https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu
  https://www.slideshare.net/agebreak/140315-ci?next_slideshow=1
  https://www.lesstif.com/pages/viewpage.action?pageId=15269892

Jenkins와 Github
  https://www.slideshare.net/agebreak/ci-32339131?next_slideshow=2

Jenkins와 Gitlab
  https://www.slideshare.net/parkjoongsoo1/jenkinsgitmaven-56007274

4/12/2017

AM437x-EVM-GP HDMI 설정

1. AM437x-EVM 관련정보

AM437x-EVM을 빌려서 , 집에서 가지고 놀게 되었지만, TI에서 제공되는 자료가 거의 오픈이 되어서 너무 좋고, 설정하기도 편하다.
역시 BeagleBone Board에 보다 성능이 좋다.

  • AM437x EVM 
  http://processors.wiki.ti.com/index.php/AM437X_EVM_Boards


1.1 AM437x-EVM 의 HDMI 설정 및 분석

AM437x인 경우 기본적으로 HDMI Host controller 가 존재하지 않아 Silicon Image사의Chip 인 Sil9022A을 이용하여
HDMI를 전송을 하고 있으며, 이를 설정하기 위해서는 Device Tree 설정파일인 DTB만 변경하면된다.



  • DSS( Display Subsystem)의 역할 
AM437x 에서 Video Display 관련부분의 Hardware Interface이며, Pin Description을 보면
기존에 사용하던 모든이 Hsync와 Vsync, Pixel Clock 및 Data0~23, En 로 기본구성이 되어있다.

많이 사용되어지고 있는 MIPI DSI는 구현이 되어있지 않다고 되어있다.
ERRATA에 보면 DSS에 많은 제약이 있음을 알게된다. (해상도 및 memory bandwidth )

관련자료
  http://www.ti.com/lit/ug/spruhl7f/spruhl7f.pdf

1.2 AM437x EVM  HDMI HW 관련 정보 
VIDEO는 현재 24bit가 아닌 16Bit만을 사용하고 있으며, AUDIO를 구조도 동일하다.
VIDEO 같은 경우는 LCD모드와 크게 별반 차이가 없다고 생각하면 되겠다.

  1. DSS, 영상 Data(AM437X_LCD_DATA0~15) -> Buffer Chip(SN74LVC32244ZKE,SN74LVC244A )  전압 3.3V변화 및 Buffer
  2. 변경된 DATA -> Sil9022A 연결 
  3. McASP -> Buffer Chip 전압 변경 
  4. 변경된 DATA -> Sil9022A 연결 

관련자료 
  http://processors.wiki.ti.com/images/9/95/Am437x_gp_evm_3k0006_schematic_rev1_4a.pdf
  http://processors.wiki.ti.com/index.php/AM437X_EVM_Boards



1.2 AM437x의 EVM Software 및 관련 설명서 
TI에서 EVM의 간단한 설명서 및 사용법 쉽게 파악가능하다
BSP를 Download 가능하며, Image를 가지고 쉽게 Write를 하여 SD Boot로 TEST 가능.

관련자료
  http://www.ti.com/tool/tmdsevm437x#descriptionArea

처음 회로도를 보고, LCD와 HDMI 동시 출력이 가능할 것이라고 생각을 했지만,
지원이 되지 않는다고 TI에서 명시를 해주고 있다. 이부분은 시간이 나면 다시 확인해봐야겠지만,
현재 시간이 없어 추후 회로도에서 TI Buffer chip 3개 부분을 다시 잘 보면 되겠다.

Memory bandwidth 제한으로 인하여 HD급 영상만 720p@60 재생이 되며,
AM437x 현재 Sigle output으로  LCD or HDMI 를 동시에 출력이 불가능하다고 한다.


  • 일반적인 HDMI 설정변경

 Device Tree인 *.dtb를 이용하여 변경을 하면된다고 한다.

관련자료
  http://processors.wiki.ti.com/index.php/Linux_Core_DSS_User%27s_Guide#AM4_Boards


1.3 AM437x EVM GP HDMI 설정 

위에서 설명했듯이 기본으로 제공해주는 Device Tree 인 파일인 DTB 파일을 찾아 변경을 해주면된다.

  • prebuilt-Image 의 Device Tree 설정확인 
    아래의 두개의 Device Tree 설정을 쉽게 확인가능, 이를 적용하자

$ ./board-support/prebuilt-images
$ ls 
MLO-am437x-evm          am437x-gp-evm.dtb  am43x-epos-evm-hdmi.dtb  u-boot-am437x-evm.img      uEnv.txt
am437x-gp-evm-hdmi.dtb  am437x-sk-evm.dtb  am43x-epos-evm.dtb       u-boot-spl.bin-am437x-evm  zImage-am437x-evm.bin


  • Kernel Device Tree 설정 확인 
     Device Tree 좀 더 변경하고자 한다면 아래에서 확인

$ cd ./board-support/linux*
$ vi arch/arm/boot/dts/am437x-gp-evm-hdmi.dts // device tree 설정확인 
....


  • AM437x Device Tree 관련내용 
  AM437x Device Tree MMC BOOT관련내용. (UBoot의 환경설정에서 변경)

Uboot Script 과 Kernel Device Tree
  http://ahyuo79.blogspot.kr/2015/08/am437x-kernel-device-tree.html


2. UBOOT 설정 변경

현재 AM437x는 bootz라는 command를 이용하여 zImage와 *.dtb 을 booting한다.
uboot에서 findfdt 에서 fdtfile을 직접 변경하거나, board_name을 변경한다면
dtb 설정이 변경이 된다.

이 부분은 상위  device tree 부분을 참조


3. Sys File 변경 및 Uboot 설정변경


$ fbset  // display 해상도 확인 
$ fbset -i // display 해상도 확인 


  http://e2e.ti.com/support/arm/sitara_arm/f/791/p/551865/2017650
  http://processors.wiki.ti.com/index.php/Matrix_Users_Guide#I_don.27t_want_Matrix_to_run_on_boot_up
  https://e2e.ti.com/support/arm/sitara_arm/f/791/p/358458/1258352#1258352
  http://processors.wiki.ti.com/index.php/DSS2_SYSFS_Examples#SYSFS_Entries_for_FB


4. AM437x EVM Devic 확인사항 

 ....
omap_i2c 44e0b000.i2c: bus 0 rev0.12 at 100 kHz  // 아래 driver 는 I2C로 설정 
sii9022 1-003b: sil9022 HDMI Chip version = b0
....

4/10/2017

Boot Time 관련 정리

1. Boot Time 관련사항 

OS에서 Boot Time은 최적화를 위해서 중요하며, 보다 빠른 실행을 봐야할 부분이 아닐까 싶다. 이전부터 Linux 기반으로 Boot Time을 줄이기 위해서
기본적으로 Kernel 의 불필요한 기능제거 부터 시작하여 File System의 구성을 최적화하고 정리하고 필요한 부분을 Ramdisk도 이용하기도 했다.


Serial로 Booting 을 보면 시간이 다 기록이 되기때문에 이것으로도 도움이 되지만, Boot TIme을 줄이기 위해서는 본인이 원하는 Service(Program) 실행되어지는 순서변경과
Boot Time의 정확한 측정방법이 파악이 아닐 까 싶다.

  • BootTime 에 관련부분 설명 문서 
  https://bootlin.com/doc/training/boot-time/
  https://elixir.bootlin.com/linux/latest/ident/
  http://www.bootchart.org/samples.html
  https://www.raspberrypi.org/forums/viewtopic.php?t=76606


  • TI Fast Boot Example 
  http://www.makelinux.com/emb/fastboot/
  http://www.makelinux.com/emb/fastboot/omap
  http://www.makelinux.com/emb/fastboot/dm365
  http://e2e.ti.com/support/embedded/linux/f/354/t/51158
  http://www.makelinux.com/emb/fastboot/dm6467
  http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_Boot_Time_Reduction

  • General Boot Time  관련내용
  1. Kernel Speed up 하는 법 
  2. Boot up Time 측정하는 법 

  http://tree.celinuxforum.org/CelfPubWiki/KoreaTechJamboree3?action=AttachFile&do=get&target=The_Fast_Booting_of_Embedded_Linux.pdf


1.1 Snapshot Booting 

Memory의 정보를 Snapshot 형태로 보관해서 이 부분을 Booting 하는 방식이며, DMA까지 이용한다고 한다.

  • FA linux의 zeroboot 
  http://www.falinux.com/kr/desktop/solution/zeroboot
  http://forum.falinux.com/zbxe/index.php?document_srl=561345&mid=falinux
  http://djji.tistory.com/entry/ZEROBOOT%EC%A0%9C%EB%A1%9C%EB%B6%80%ED%8A%B8

  • Snapshot boot
  http://elinux.org/images/c/c3/Elc2011_kang.pdf
  http://elinux.org/images/3/37/Snapshot-boot-final.pdf


2. Boot Time 분석 

Boo Time에 관련된 기본정보들이 있음

  https://elinux.org/Boot_Time

2.1 Kernel Log 및 Kernel Serial 로 시간분석 

dmesg 및 kernel log로 이부분을 확인이 가능

  https://ahyuo79.blogspot.com/2016/02/kernel-message.html
  https://ahyuo79.blogspot.com/2014/09/kernel-debug.html

  https://elinux.org/Printk_Times

2.2 systemd-analyze 이용 

Linux file system init의 구조가 sysvinit 에서 systemd로 변경이 되어지고 있으며, 혹은 혼합하여 사용중이다. (현재 TI는 혼합해서 사용하고 있기에 이를 적용하기 무리가 있다)
systemd의 분석기능을 제공하고 있으며, dmesg로 boot time을 체크하는 것과는 별도로 진행을 해야 할 것 같다. .

  https://ahyuo79.blogspot.com/2017/04/systemd-analyze.html
  https://wiki.archlinux.org/index.php/Improving_performance/Boot_process

2.3 bootchart/bootchart2 이용

기본적으로 busybox에서 제공을 해주고 있으며, Kernel parameter에서 init=/sbin/bootchartd 를 설정을 해주어야 동작이 가능

  https://ahyuo79.blogspot.com/2017/03/bootchart.html

4/09/2017

Linux systemd 구조분석 (AM335x-SK)

1 TI-Sitara(AM335x-SK)

AM335x-SK, Start Kit 관련하여 File system을 간단히 분석을 해보고, 이를 최적화를 하려고 한다.
분석을 해보면, /sbin/init 을 systemd로 이용하고 SysVinit의 bootscript 을 혼용해서 사용하고 있다.
TI의 경우는 변화 도중 인지 몰라도 /lib/systemd/systemd boot 후 SysVInit Script모드를 사용한다.
현재의 추세가 SysVInit 에서 systemd로 변환되어지는 구조이며, 혼용해서 사용하는 독특한 구조이다.

Systemd 와 SysVInit 혼용
  https://ahyuo79.blogspot.com/2017/04/linux-init-script.html

1.1 기본동작분석

boot parameter 확인하고, file system의 구조를 파악을 하자

  • PID 1의 boot parameter 확인 
Kernel은 Filesystem이 존재하지 않으면 Booting이 되지 않기때문에 아래의 두개의 중요
  1. root= filesystem
  2. init=  init program ( 현재 설정하지 않았기 때문에 기본설정 /sbin/init)

root@am335x-evm:~# cat /proc/cmdline 
console=ttyO0,115200n8 root=PARTUUID=000390f5-02 rw rootfstype=ext4 rootwait

root@am335x-evm:~# cat /proc/1/cmdline  // init args 확인 
root@am335x-evm:~# ls /proc/1/fd     // 관련 FD 확인 부모 Process / 자식 Process
or
root@am335x-evm:~# ls /proc/1/fdinfo 

상위 커널 Argument를 보면 현재 /sbin/init로 기반으로 동작

/sbin/init ->  /lib/systemd/systemd  (현재 /sbin/init 은 /lib/systemd/systemd에 link)

  • /sin/init 와 runlevel 존재 확인 
root@am335x-evm:~# ls /sbin      
agetty                  e2fsck                  fsck.minix              ifup                    losetup                 mkswap.util-linux       route                   switch_root.util-linux
arp                     e2image                 fsck.minix.util-linux   init                    losetup.util-linux      modinfo                 routef                  sysctl
badblocks               e2label                 fsck.msdos              insmod                  lsmod                   modinfo.kmod            routel                  sysctl.procps
blkid                   e2undo                  fsck.util-linux         insmod.kmod             mkdosfs                 modprobe                rtmon                   syslogd
blockdev                e4crypt                 fsck.vfat               ip                      mke2fs                  modprobe.kmod           rtpr                    tc
blockdev.util-linux     e4defrag                fstrim                  ip.iproute2             mkfs.ext2               mount-copybind          runlevel                tune2fs
bridge                  fatlabel                fw_printenv             iwconfig                mkfs.ext3               mount.nfs               setconsole              udevd
cfdisk                  fdisk                   fw_setenv               iwgetid                 mkfs.ext4               mount.nfs4              shutdown                udhcpc
ctrlaltdel              fdisk.util-linux        getty                   iwlist                  mkfs.ext4dev            nologin                 start-stop-daemon       uevent
debugfs                 filefrag                halt                    iwpriv                  mkfs.fat                pivot_root              sulogin                 umount.nfs
depmod                  fsck                    hdparm                  iwspy                   mkfs.minix              pivot_root.util-linux   sulogin.util-linux      umount.nfs4
depmod.kmod             fsck.ext2               hdparm.hdparm           klogd                   mkfs.minix.util-linux   populate-extfs.sh       swapoff                 vconfig
dosfsck                 fsck.ext3               hwclock                 ldconfig                mkfs.msdos              poweroff                swapoff.util-linux      vigr
dosfslabel              fsck.ext4               ifcfg                   loadkmap                mkfs.vfat               reboot                  swapon                  vigr.shadow
dumpe2fs                fsck.ext4dev            ifconfig                logread                 mklost+found            rmmod                   swapon.util-linux       vipw
e2freefrag              fsck.fat                ifdown                  logsave                 mkswap                  rmmod.kmod              switch_root             vipw.shadow


  • runlevel 0~6까지 존재하며, init를 통해 다시 확인가능
  1. init 0 : Halt 
  2. init 1 : Single-user Mode 
  3. init 2 : Multi-user Mode  (Not support network)
  4. init 3 : Multi-user Mode with Networking
  5. init 4 : Not used/User-definable  (For special purposes)
  6. init 5 : Graphic-user Mode ( As runlevel 3 + display manager)
  7. init 6 : Reboot  (Reboots the system)

  https://wiki.kldp.org/KoreanDoc/html/Boot_Process-KLDP/iterateinittab.html

  • systemd 관련 명령어 (system damon)
systemd 명령어와 관련 명령어 검색

root@am335x-evm:~# find / -name systemd
/var/lib/systemd
/lib/systemd
/lib/systemd/systemd   // 실제 user를 위한 system daemon 이며 이동작을 확인 (systemctl) 
/etc/systemd
/etc/xdg/systemd
/sys/fs/cgroup/systemd
/run/user/0/systemd
/run/udev/tags/systemd
/run/systemd
/usr/lib/systemd
/usr/share/systemd
/usr/include/systemd
/tmp/0-runtime-dir/systemd

다양한 systemd의 실행이며 각각의 역할이 있으며, 이 부분은 좀 더 자세히 알아보자

root@am335x-evm:~# ls /lib/systemd/ 
network                       systemd-ac-power              systemd-initctl               systemd-networkd-wait-online  systemd-shutdown              systemd-udevd
system                        systemd-backlight             systemd-journald              systemd-quotacheck            systemd-sleep                 systemd-update-done
system-generators             systemd-bootchart             systemd-localed               systemd-random-seed           systemd-socket-proxyd         systemd-update-utmp
system-preset                 systemd-cgroups-agent         systemd-logind                systemd-remount-fs            systemd-sysctl                systemd-user-sessions
system-shutdown               systemd-fsck                  systemd-machined              systemd-reply-password        systemd-sysv-install          systemd-vconsole-setup
system-sleep                  systemd-hibernate-resume      systemd-modules-load          systemd-resolved              systemd-timedated
systemd                       systemd-hostnamed             systemd-networkd              systemd-rfkill                systemd-timesyncd

root@am335x-evm:~# /lib/systemd/systemd --help

systemd [OPTIONS...]

Starts up and maintains the system or user services.

  -h --help                      Show this help
     --test                      Determine startup sequence, dump it and exit
     --no-pager                  Do not pipe output into a pager
     --dump-configuration-items  Dump understood unit configuration items
     --unit=UNIT                 Set default unit
     --system                    Run a system instance, even if PID != 1
     --user                      Run a user instance
     --dump-core[=BOOL]          Dump core on crash
     --crash-vt=NR               Change to specified VT on crash
     --crash-reboot[=BOOL]       Reboot on crash
     --crash-shell[=BOOL]        Run shell on crash
     --confirm-spawn[=BOOL]      Ask for confirmation when spawning processes
     --show-status[=BOOL]        Show status updates on the console during bootup
     --log-target=TARGET         Set log target (console, journal, kmsg, journal-or-kmsg, null)
     --log-level=LEVEL           Set log level (debug, info, notice, warning, err, crit, alert, emerg)
     --log-color[=BOOL]          Highlight important log messages
     --log-location[=BOOL]       Include code location in log messages
     --default-standard-output=  Set default standard output for services
     --default-standard-error=   Set default standard error output for services


systemd의 설명
  https://www.freedesktop.org/software/systemd/man/systemd.html#


  • systemd의 설정 (system/user 설정 값확인)
  1. /etc/systemd/system.conf
  2. /etc/systemd/user.conf
  https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html#


1.2 systemd-x program들 

각 systemd-xxx program 설치는 옵션이므로, 대부분 필요한 것들을 별도설치

root@am335x-evm:~# ls -al /usr/bin/systemd-*
-rwxr-xr-x    1 root     root         26160 Dec 15 00:09 /usr/bin/systemd-cat
-rwxr-xr-x    1 root     root        256116 Dec 15 00:09 /usr/bin/systemd-cgls
-rwxr-xr-x    1 root     root        268436 Dec 15 00:09 /usr/bin/systemd-cgtop
-rwxr-xr-x    1 root     root         54932 Dec 15 00:09 /usr/bin/systemd-delta
-rwxr-xr-x    1 root     root         30256 Dec 15 00:09 /usr/bin/systemd-detect-virt
-rwxr-xr-x    1 root     root        535036 Dec 15 00:09 /usr/bin/systemd-nspawn
-rwxr-xr-x    1 root     root         34348 Dec 15 00:09 /usr/bin/systemd-path
-rwxr-xr-x    1 root     root        292980 Dec 15 00:09 /usr/bin/systemd-resolve
-rwxr-xr-x    1 root     root        334168 Dec 15 00:09 /usr/bin/systemd-run
-rwxr-xr-x    1 root     root         46672 Dec 15 00:09 /usr/bin/systemd-socket-activate
-rwxr-xr-x    1 root     root        239724 Dec 15 00:09 /usr/bin/systemd-stdio-bridge
...


systemd-cat
  https://www.freedesktop.org/software/systemd/man/systemd-cat.html#

systemd-cgls
  https://www.freedesktop.org/software/systemd/man/systemd-cgls.html#

systemd-cgtop
  https://www.freedesktop.org/software/systemd/man/systemd-cgtop.html#

systemd-run
  https://www.freedesktop.org/software/systemd/man/systemd-run.html

systemd-nspanwn
  https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

systemd-xxx 검색
  https://www.freedesktop.org/software/systemd/man/index.html

systemd-analyze가 없음 (추후 설치)
  https://www.freedesktop.org/software/systemd/man/systemd-analyze.html

systemd의 service 등록방법
  https://chhanz.github.io/linux/2019/01/18/linux-how-to-create-custom-systemd-service/
  https://fmd1225.tistory.com/93

systemd의 Yocto service 등록방법
  https://community.nxp.com/thread/472820

systemd-analyze 못찾을 경우
  https://stackoverflow.com/questions/34501611/systemd-apparently-not-finding-service-file

backup
  https://stackoverflow.com/questions/50354012/systemctl-failing-with-unknown-section-timer

1.3 Process 의 PID 분석 

Process의 PID를 보고 현재 실행되는 순서를 역분석을 해보면, 아래와 같이 /sbin/init 가 PID가 1 지만, link만 존재하므로 systemd가 실행이 되어있다.

확인할 경우 아래와 같이 ps -ax or ps -aux 전체사항을 확인하고 필요한 사항이 있다면, grep or head or tail 사용하자.

root@am335x-evm:~# ps -aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  9.9  1.7   5232  4384 ?        Ss   23:15   0:08 /sbin/init
root         2  0.0  0.0      0     0 ?        S    23:15   0:00 [kthreadd]
root         3  0.1  0.0      0     0 ?        S    23:15   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker/0:0]
root         5  0.0  0.0      0     0 ?        S<   23:15   0:00 [kworker/0:0H]
root         6  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker/u2:0]
root         7  0.2  0.0      0     0 ?        S    23:15   0:00 [rcu_preempt]
root         8  0.0  0.0      0     0 ?        S    23:15   0:00 [rcu_sched]
root         9  0.0  0.0      0     0 ?        S    23:15   0:00 [rcu_bh]
root        10  0.0  0.0      0     0 ?        S    23:15   0:00 [kdevtmpfs]
root        11  0.0  0.0      0     0 ?        S<   23:15   0:00 [netns]
root        12  0.0  0.0      0     0 ?        S<   23:15   0:00 [perf]
root        13  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker/0:1]
root        14  0.0  0.0      0     0 ?        S<   23:15   0:00 [writeback]
root        15  0.0  0.0      0     0 ?        S<   23:15   0:00 [crypto]
root        16  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        17  0.0  0.0      0     0 ?        S<   23:15   0:00 [kblockd]
root        18  0.0  0.0      0     0 ?        S<   23:15   0:00 [edac-poller]
root        19  0.0  0.0      0     0 ?        S<   23:15   0:00 [rpciod]
root        20  0.0  0.0      0     0 ?        S    23:15   0:00 [kswapd0]
root        21  0.0  0.0      0     0 ?        S    23:15   0:00 [fsnotify_mark]
root        22  0.0  0.0      0     0 ?        S<   23:15   0:00 [nfsiod]
root        31  0.0  0.0      0     0 ?        S<   23:15   0:00 [dma_wq]
root        32  0.7  0.0      0     0 ?        S    23:15   0:00 [kworker/u2:1]
root        33  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        34  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        35  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        36  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        37  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        38  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        39  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        40  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        43  0.0  0.0      0     0 ?        S<   23:15   0:00 [kpsmoused]
root        44  0.0  0.0      0     0 ?        S    23:15   0:00 [irq/180-4803c00]
root        45  0.0  0.0      0     0 ?        S    23:15   0:00 [irq/179-4803c00]
root        46  0.0  0.0      0     0 ?        S<   23:15   0:00 [ipv6_addrconf]
root        47  0.0  0.0      0     0 ?        S<   23:15   0:00 [deferwq]
root        48  0.0  0.0      0     0 ?        S    23:15   0:00 [irq/159-44e0b00]
root        49  0.1  0.0      0     0 ?        S    23:15   0:00 [kworker/u2:2]
root        50  0.0  0.0      0     0 ?        S    23:15   0:00 [irq/33-48060000]
root        51  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker/u2:3]
root        52  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
root        53  1.6  0.0      0     0 ?        S    23:15   0:01 [mmcqd/0]
root        54  0.1  0.0      0     0 ?        S<   23:15   0:00 [kworker/0:1H]
root        55  0.0  0.0      0     0 ?        S    23:15   0:00 [jbd2/mmcblk0p2-]
root        56  0.0  0.0      0     0 ?        S<   23:15   0:00 [ext4-rsv-conver]
root        68  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker/0:2]
root        76  0.0  0.0      0     0 ?        S<   23:15   0:00 [cryptodev_queue]
root        98  2.3  0.7   3616  1908 ?        Ss   23:15   0:01 /lib/systemd/systemd-journald // log를 위해 시작 
root       121  0.1  0.0      0     0 ?        S    23:15   0:00 [kworker/0:3]
root       127  1.6  1.0  10524  2528 ?        Ss   23:15   0:01 /lib/systemd/systemd-udevd  //udevd 시작 
root       325  0.0  0.0      0     0 ?        S<   23:15   0:00 [pvr_timer]
systemd+   398  0.2  0.6  12136  1608 ?        Ssl  23:15   0:00 /lib/systemd/systemd-timesyncd
root       432  0.0  0.0      0     0 ?        S    23:15   0:00 [irq/195-remotep]
root       437  0.0  0.0      0     0 ?        S    23:15   0:00 [irq/197-remotep]
root       456  0.0  0.0      0     0 ?        S    23:15   0:00 [scsi_eh_0]
root       457  0.0  0.0      0     0 ?        S<   23:15   0:00 [scsi_tmf_0]
root       458  0.0  0.0      0     0 ?        S    23:15   0:00 [usb-storage]
root       460  0.0  0.5   1956  1300 ?        Ss   23:15   0:00 /sbin/klogd -n
root       469  2.5  2.5   8864  6408 ?        Ss   23:15   0:01 /usr/sbin/ofonod -n
root       471  0.1  0.7   2600  1812 ?        Ss   23:15   0:00 /lib/systemd/systemd-logind
root       475  0.1  0.5   1908  1440 ?        Ss   23:15   0:00 /usr/libexec/ipsec/starter --daemon charon --nofork
root       480  0.1  0.4   1972  1244 ?        Ss   23:15   0:00 /sbin/syslogd -n -C
avahi      483  0.0  0.9   4660  2484 ?        Ss   23:15   0:00 avahi-daemon: running [am335x-evm.local]
message+   492  0.5  0.9   4320  2496 ?        Ss   23:15   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root       494  0.0  0.0      0     0 ?        S<   23:15   0:00 [bioset]
avahi      501  0.0  0.7   4660  1792 ?        S    23:15   0:00 avahi-daemon: chroot helper
root       513  0.0  0.0      0     0 ?        S    23:15   0:00 [file-storage]
systemd+   535  0.2  0.8   2776  2056 ?        Ss   23:15   0:00 /lib/systemd/systemd-networkd
root       562  0.2  1.8 142008  4528 ?        Ssl  23:15   0:00 /usr/libexec/ipsec/charon
systemd+   677  0.0  0.7   2984  1904 ?        Ss   23:15   0:00 /lib/systemd/systemd-resolved
root       682  0.0  0.4   1780  1184 tty1     Ss+  23:15   0:00 /sbin/agetty --noclear tty1 linux
root       688  0.1  0.8   4864  2132 ttyS0    Ss   23:15   0:00 /bin/login --
root       689  0.0  0.4   1780  1196 ttyGS0   Ss+  23:15   0:00 /sbin/agetty -8 -L ttyGS0 115200 xterm
root       691  0.2  1.1   5160  2984 ?        Ss   23:15   0:00 /usr/sbin/lighttpd -D -f /etc/lighttpd.conf
root       773  0.0  0.0      0     0 ?        S<   23:15   0:00 [pvr_workqueue]
root       807  0.0  0.7   2664  1776 tty4     Ss+  23:15   0:00 /bin/sh /usr/bin/runWeston
root       810  0.5  5.0  19144 12556 tty4     S+   23:15   0:00 weston --idle-time=0
root       815  0.0  0.3   1956   868 ?        Ss   23:15   0:00 /usr/sbin/telnetd
root       822  0.2  2.0   7008  5096 tty4     S+   23:15   0:00 /usr/libexec/weston-keyboard
root       823  0.2  2.0   7016  5024 tty4     S+   23:15   0:00 /usr/libexec/weston-desktop-shell
nobody     829  0.0  0.6   2448  1632 ?        Ss   23:15   0:00 /usr/sbin/thttpd -d /srv/www -p 8080
root       835  0.0  0.3   2292   928 ?        Ss   23:15   0:00 /usr/sbin/rngd -r /dev/urandom
root       843  8.3 24.3 176048 60924 ?        Sl   23:15   0:04 /usr/bin/matrix_browser http://localhost:80/
root       860  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker/0:4]
root       863  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker/0:5]
root       867  0.4  0.0      0     0 ?        S    23:15   0:00 [kworker/0:6]
root       894  1.3  1.7   5348  4388 ?        Ss   23:15   0:00 /lib/systemd/systemd --user  //user용 systemd 실행 (일반서비스) 
root       898  0.0  0.9   7492  2352 ?        S    23:15   0:00 (sd-pam)
root       901  0.0  0.8   2668  2044 ttyS0    S    23:15   0:00 -sh
root       918  0.2  0.4   1780  1212 ?        Ss   23:16   0:00 /sbin/agetty -8 -L ttyS3 115200 xterm
root       922  0.0  0.5   2612  1272 ttyS0    R+   23:16   0:00 ps -aux


2 systemd 와 init script 혼합 (telinit) 

/sbin/telinit  확인필요

  • run level 3 확인 (init.d link)
root@am335x-evm:~# runlevel 
N 3   // multi-user mode 

root@am335x-evm:/etc# ls -al  rc3.d    // Runlevel 3 분석 
drwxr-xr-x    2 root     root          4096 Dec 15  2016 .
drwxr-xr-x   46 root     root          4096 Dec 14 23:15 ..
lrwxrwxrwx    1 root     root            20 Dec 15  2016 S01networking -> ../init.d/networking
lrwxrwxrwx    1 root     root            16 Dec 15  2016 S02dbus-1 -> ../init.d/dbus-1
lrwxrwxrwx    1 root     root            19 Dec 15  2016 S03uim-sysfs -> ../init.d/uim-sysfs
lrwxrwxrwx    1 root     root            16 Dec 15  2016 S08rc.pvr -> ../init.d/rc.pvr
lrwxrwxrwx    1 root     root            18 Dec 15  2016 S10dropbear -> ../init.d/dropbear
lrwxrwxrwx    1 root     root            17 Dec 15  2016 S10telnetd -> ../init.d/telnetd
lrwxrwxrwx    1 root     root            17 Dec 15  2016 S12rpcbind -> ../init.d/rpcbind
lrwxrwxrwx    1 root     root            21 Dec 14 23:36 S15mountnfs.sh -> ../init.d/mountnfs.sh
lrwxrwxrwx    1 root     root            19 Dec 15  2016 S19nfscommon -> ../init.d/nfscommon
lrwxrwxrwx    1 root     root            24 Dec 15  2016 S20busybox-udhcpd -> ../init.d/busybox-udhcpd
lrwxrwxrwx    1 root     root            20 Dec 15  2016 S20hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx    1 root     root            16 Dec 15  2016 S20syslog -> ../init.d/syslog
lrwxrwxrwx    1 root     root            16 Dec 15  2016 S20thttpd -> ../init.d/thttpd
lrwxrwxrwx    1 root     root            22 Dec 15  2016 S21avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx    1 root     root            15 Dec 15  2016 S22ofono -> ../init.d/ofono
lrwxrwxrwx    1 root     root            19 Dec 15  2016 S30rng-tools -> ../init.d/rng-tools
lrwxrwxrwx    1 root     root            18 Dec 15  2016 S70lighttpd -> ../init.d/lighttpd
lrwxrwxrwx    1 root     root            24 Dec 15  2016 S97matrix-gui-2.0 -> ../init.d/matrix-gui-2.0
lrwxrwxrwx    1 root     root            18 Dec 15  2016 S98parse-ip -> ../init.d/parse-ip
lrwxrwxrwx    1 root     root            27 Dec 15  2016 S98thermal-zone-init -> ../init.d/thermal-zone-init
lrwxrwxrwx    1 root     root            22 Dec 15  2016 S99gplv3-notice -> ../init.d/gplv3-notice
lrwxrwxrwx    1 root     root            22 Dec 14 23:36 S99rmnologin.sh -> ../init.d/rmnologin.sh


  • /etc/init.d  확인 
root@am335x-evm:/etc# ls -al init.d/
drwxr-xr-x    2 root     root          4096 Dec 15  2016 .
drwxr-xr-x   46 root     root          4096 Dec 14 23:15 ..
-rw-r--r--    1 root     root          1150 Dec 15 00:09 README
-rwxr-xr-x    1 root     root           250 Dec 14 23:23 alignment.sh
-rwxr-xr-x    1 root     root           811 Dec 14 23:45 alsa-state
-rwxr-xr-x    1 root     root          4491 Dec 15 00:13 avahi-daemon
-rwxr-xr-x    1 root     root           492 Dec 14 23:23 banner.sh
-rwxr-xr-x    1 root     root          1922 Dec 14 23:23 bootmisc.sh
-rwxr-xr-x    1 root     root          1042 Dec 14 23:50 busybox-udhcpd
-rwxr-xr-x    1 root     root          3581 Dec 14 23:23 checkroot.sh
-rwxr-xr-x    1 root     root          2887 Dec 15 00:11 dbus-1
-rwxr-xr-x    1 root     root           526 Dec 14 23:23 devpts.sh
-rwxr-xr-x    1 root     root           353 Dec 14 23:23 dmesg.sh
-rwxr-xr-x    1 root     root          3002 Dec 15 00:00 dropbear
lrwxrwxrwx    1 root     root            33 Dec 15  2016 functions -> /etc/init.d/functions.initscripts
-rw-r--r--    1 root     root          2141 Dec 14 23:23 functions.initscripts
-rwxr-xr-x    1 root     root          2389 Dec 14 23:48 gplv3-notice
-rwxr-xr-x    1 root     root           510 Dec 14 23:23 halt
-rwxr-xr-x    1 root     root           546 Dec 15 00:00 hostapd
-rwxr-xr-x    1 root     root           580 Dec 14 23:23 hostname.sh
-rwxr-xr-x    1 root     root          2541 Dec 14 23:50 hwclock.sh
-rwxr-xr-x    1 root     root           579 Dec 14 23:50 inetd.busybox
-rwxr-xr-x    1 root     root           632 Dec 14 23:52 lighttpd
-rwxr-xr-x    1 root     root          1102 Dec 14 23:51 matrix-gui-2.0
-rwxr-xr-x    1 root     root          1223 Dec 14 23:48 modutils.sh
-rwxr-xr-x    1 root     root           859 Dec 14 23:23 mountall.sh
-rwxr-xr-x    1 root     root          1522 Dec 14 23:23 mountnfs.sh
-rwxr-xr-x    1 root     root          2124 Dec 14 23:48 networking
-rwxr-xr-x    1 root     root          1609 Dec 14 23:49 nfscommon
-rwxr-xr-x    1 root     root           516 Dec 15 00:15 ofono
-rwxr-xr-x    1 root     root          1950 Dec 15 00:00 parse-ip
-rwxr-xr-x    1 root     root          6721 Dec 14 23:23 populate-volatile.sh
-rwxr-xr-x    1 root     root           521 Dec 14 23:50 psplash.sh
-rwxr-xr-x    1 1001     1001          3203 Dec 14 23:15 rc.pvr
-rwxr-xr-x    1 root     root           968 Dec 14 23:23 read-only-rootfs-hook.sh
-rwxr-xr-x    1 root     root           289 Dec 14 23:23 reboot
-rwxr-xr-x    1 root     root           585 Dec 14 23:23 rmnologin.sh
-rwxr-xr-x    1 root     root          1098 Dec 14 23:48 rng-tools
-rwxr-xr-x    1 root     root          1827 Dec 15 00:12 rpcbind
-rwxr-xr-x    1 root     root            25 Dec 14 23:47 run-postinsts
-rwxr-xr-x    1 root     root           336 Dec 14 23:23 save-rtc.sh
-rwxr-xr-x    1 root     root           438 Dec 14 23:23 sendsigs
-rwxr-xr-x    1 root     root           578 Dec 14 23:23 single
-rwxr-xr-x    1 root     root           782 Dec 14 23:23 sysfs.sh
lrwxrwxrwx    1 root     root            26 Dec 15  2016 syslog -> /etc/init.d/syslog.busybox
-rwxr-xr-x    1 root     root          1715 Dec 14 23:50 syslog.busybox
-rwxr-xr-x    1 root     root          3183 Dec 15 00:09 systemd-udevd
-rwxr-xr-x    1 root     root          1455 Dec 14 23:48 telnetd
-rwxr-xr-x    1 root     root           414 Dec 14 23:48 thermal-zone-init
-rwxr-xr-x    1 root     root          1033 Dec 14 23:48 thttpd
-rwxr-xr-x    1 root     root           663 Dec 15 00:00 uim-sysfs
-rwxr-xr-x    1 root     root           516 Dec 14 23:23 umountfs
-rwxr-xr-x    1 root     root           711 Dec 14 23:23 umountnfs.sh
-rwxr-xr-x    1 root     root          1473 Dec 14 23:23 urandom
-rwxr-xr-x    1 root     root          2750 Dec 15 00:00 weston


2.1 systemctl 확인 사항 

상위 init script에 대해 알아봤으니, 이제 systemd의 기본 명령어인 systemctl 을 이용하여 기본설정과 현재 동작하는 순서에 대해서 알아보자.

  • systemctl 명령어
root@am335x-evm:/# systemctl get-default // default mode 확인

root@am335x-evm:/# systemctl list-dependencies multi-user.target  // default-mode 관련부분 list 확인 
.......
root@am335x-evm:/# systemctl list-unit-files // unit 관련 list 전부확인
........


2.2 systemd unit 기능 확인 (AM335x-SK)

  • 현재 boot mode 확인
# systemctl get-default  // 현재 boot mode 3 
multi-user.target

상위 runlevel과 동일하며, 3에 해당하는 유저로, 만약 X Server를 이용한다면, graphical. target으로 나올 것이다.

default.target -> /lib/systemd/system/multi-user.target



  • Unit 분석 방법

이런식으로 현재 분석을 하고 있으며, 추후 더 시간이 있을 경우 다시 분석

$ grep WantedBy=multi-user.target -r /lib/systemd/system  // 확인 
$ grep WantedBy=multi-user.target -r /etc/systemd/system  // 확인
$ grep WantedBy=sysinit.target -r /lib/systemd/system 
$ ls multi-user.target.wants // 확인 

Unit 문법확인
  https://www.freedesktop.org/software/systemd/man/systemd.unit.html

일반적인 사용되는 Unit 전체구조 설명
  https://www.freedesktop.org/software/systemd/man/systemd.special.html#

*. slice 의 부분설명 (machine.slice, system.slice, user.slice )
  https://www.freedesktop.org/software/systemd/man/systemd.special.html#Special%20Slice%20Units

sysinit.target : 기본적으로 실행되는 곳
  https://www.freedesktop.org/software/systemd/man/systemd.special.html#sysinit.target


  • 각 unit 확인 (/etc/systemd/system)
/etc/systemd/system 의 unit은 대부분 link로 구성이 되며 사용되는것은 /lib/systemd/system 에 연결 or 사용되지 않는다면 /dev/null 연결
별도로 추가한다면 이곳에 추가
root@am335x-evm:/# cd /etc/systemd/system  // 사용하는 service는 /lib or /etc/systemd/system 
root@am335x-evm:/etc/systemd/system# ls -al
drwxr-xr-x   11 root     root          4096 Dec 15 02:24 .
drwxr-xr-x    5 root     root          4096 Dec 14 23:43 ..
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 banner.service -> /dev/null  // 사용하지 않는다면, /dev/null link 하며, 사용한다면, /lib/systemd/system link 
drwxr-xr-x    2 root     root          4096 Dec 14 23:15 basic.target.wants
drwxr-xr-x    2 root     root          4096 Dec 15 02:23 bluetooth.target.wants
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 bootmisc.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 busybox-udhcpc.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 checkfs.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 checkroot.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 dbus-1.service -> /dev/null
lrwxrwxrwx    1 root     root            37 Dec 15 02:23 dbus-org.bluez.service -> /lib/systemd/system/bluetooth.service
lrwxrwxrwx    1 root     root            40 Dec 15 02:23 dbus-org.freedesktop.Avahi.service -> /lib/systemd/system/avahi-daemon.service
lrwxrwxrwx    1 root     root            37 Dec 15 02:24 default.target -> /lib/systemd/system/multi-user.target
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 devpts.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 dmesg.service -> /dev/null
drwxr-xr-x    2 root     root          4096 Dec 15 02:22 getty.target.wants
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 hostname.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 hwclock.service -> /dev/null
drwxr-xr-x    2 root     root          4096 Dec 15 02:23 local-fs.target.wants
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 modutils.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 mountall.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 mountnfs.service -> /dev/null
drwxr-xr-x    2 root     root          4096 Dec 15 02:23 multi-user.target.wants
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 network-online.target.wants
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 networking.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 nfscommon.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 nfsserver.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 populate-volatile.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 psplash.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 read-only-rootfs-hook.service -> /dev/null
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 rmnologin.service -> /dev/null
drwxr-xr-x    2 root     root          4096 Dec 15 02:23 sockets.target.wants
-rw-r--r--    1 root     root           327 Dec 15 00:09 sync-clocks.service
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 sysfs.service -> /dev/null
drwxr-xr-x    2 root     root          4096 Dec 14 23:15 sysinit.target.wants
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 syslog.busybox.service -> /dev/null
lrwxrwxrwx    1 root     root            42 Dec 15 02:23 syslog.service -> /lib/systemd/system/busybox-syslog.service
-rw-r--r--    1 root     root           709 Dec 15 00:09 systemd-hostnamed.service
drwxr-xr-x    2 root     root          4096 Dec 15 02:23 systemd-random-seed.service.wants
-rw-r--r--    1 root     root           843 Dec 15 00:09 systemd-udevd.service
lrwxrwxrwx    1 root     root             9 Dec 15 02:23 urandom.service -> /dev/null

  • 각 unit 확인 (/lib/systemd/system)
기본으로 제공되는 unit으로 많이사용하는 것을 이곳에 넣어 보관

root@am335x-evm:/# cd /lib/systemd/system
root@am335x-evm:/lib/systemd/system# ls -al
-rw-r--r--    1 root     root           403 Dec 15 00:09 -.slice
drwxr-xr-x   19 root     root         12288 Dec 15 02:23 .
drwxr-xr-x    8 root     root          4096 Dec 14 23:50 ..
-rw-r--r--    1 root     root           506 Dec 15 00:10 alsa-restore.service
-rw-r--r--    1 root     root           410 Dec 15 00:10 alsa-state.service
lrwxrwxrwx    1 root     root            14 Dec 15 00:09 autovt@.service -> getty@.service
-rw-r--r--    1 root     root          1044 Dec 15 00:13 avahi-daemon.service
-rw-r--r--    1 root     root           874 Dec 15 00:13 avahi-daemon.socket
-rw-r--r--    1 root     root           879 Dec 15 00:09 basic.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:10 basic.target.wants
-rw-r--r--    1 root     root           176 Dec 15 00:13 bluetooth.service
-rw-r--r--    1 root     root           379 Dec 15 00:09 bluetooth.target
-rw-r--r--    1 root     root           358 Dec 15 00:09 busnames.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 busnames.target.wants
-rw-r--r--    1 root     root           116 Dec 14 23:50 busybox-klogd.service
-rw-r--r--    1 root     root           270 Dec 14 23:50 busybox-syslog.service
-rw-r--r--    1 root     root           770 Dec 15 00:09 console-getty.service
-rw-r--r--    1 root     root           752 Dec 15 00:09 console-shell.service
-rw-r--r--    1 root     root           791 Dec 15 00:09 container-getty@.service
lrwxrwxrwx    1 root     root            13 Dec 15 00:09 ctrl-alt-del.target -> reboot.target
lrwxrwxrwx    1 root     root            25 Dec 15 00:09 dbus-org.freedesktop.hostname1.service -> systemd-hostnamed.service
lrwxrwxrwx    1 root     root            23 Dec 15 00:09 dbus-org.freedesktop.locale1.service -> systemd-localed.service
lrwxrwxrwx    1 root     root            22 Dec 15 00:09 dbus-org.freedesktop.login1.service -> systemd-logind.service
lrwxrwxrwx    1 root     root            24 Dec 15 00:09 dbus-org.freedesktop.machine1.service -> systemd-machined.service
lrwxrwxrwx    1 root     root            24 Dec 15 00:09 dbus-org.freedesktop.network1.service -> systemd-networkd.service
lrwxrwxrwx    1 root     root            24 Dec 15 00:09 dbus-org.freedesktop.resolve1.service -> systemd-resolved.service
lrwxrwxrwx    1 root     root            25 Dec 15 00:09 dbus-org.freedesktop.timedate1.service -> systemd-timedated.service
-rw-r--r--    1 root     root           366 Dec 15 00:11 dbus.service
-rw-r--r--    1 root     root           106 Dec 15 00:11 dbus.socket
drwxr-xr-x    2 root     root          4096 Dec 15 00:11 dbus.target.wants
-rw-r--r--    1 root     root          1008 Dec 15 00:09 debug-shell.service
lrwxrwxrwx    1 root     root            16 Dec 15 00:09 default.target -> graphical.target
-rw-r--r--    1 root     root           670 Dec 15 00:09 dev-hugepages.mount
-rw-r--r--    1 root     root           624 Dec 15 00:09 dev-mqueue.mount
-rw-r--r--    1 root     root           131 Dec 15 00:00 dropbear.socket
-rw-r--r--    1 root     root           384 Dec 15 00:00 dropbear@.service
-rw-r--r--    1 root     root           453 Dec 15 00:00 dropbearkey.service
-rw-r--r--    1 root     root           995 Dec 15 00:09 emergency.service
-rw-r--r--    1 root     root           431 Dec 15 00:09 emergency.target
-rw-r--r--    1 root     root           501 Dec 15 00:09 exit.target
-rw-r--r--    1 root     root           440 Dec 15 00:09 final.target
-rw-r--r--    1 root     root           420 Dec 15 00:00 gadget-init.service
-rw-r--r--    1 root     root           460 Dec 15 00:09 getty.target
-rw-r--r--    1 root     root          1536 Dec 15 00:09 getty@.service
-rw-r--r--    1 root     root           198 Dec 14 23:48 gplv3-notice.service
-rw-r--r--    1 root     root           558 Dec 15 00:09 graphical.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 graphical.target.wants
-rw-r--r--    1 root     root           565 Dec 15 00:09 halt-local.service
-rw-r--r--    1 root     root           487 Dec 15 00:09 halt.target
-rw-r--r--    1 root     root           447 Dec 15 00:09 hibernate.target
-rw-r--r--    1 root     root           468 Dec 15 00:09 hybrid-sleep.target
-rw-r--r--    1 root     root           630 Dec 15 00:09 initrd-cleanup.service
-rw-r--r--    1 root     root           553 Dec 15 00:09 initrd-fs.target
-rw-r--r--    1 root     root           790 Dec 15 00:09 initrd-parse-etc.service
-rw-r--r--    1 root     root           526 Dec 15 00:09 initrd-root-fs.target
-rw-r--r--    1 root     root           640 Dec 15 00:09 initrd-switch-root.service
-rw-r--r--    1 root     root           691 Dec 15 00:09 initrd-switch-root.target
-rw-r--r--    1 root     root           664 Dec 15 00:09 initrd-udevadm-cleanup-db.service
-rw-r--r--    1 root     root           671 Dec 15 00:09 initrd.target
-rw-r--r--    1 root     root           501 Dec 15 00:09 kexec.target
-rw-r--r--    1 root     root           677 Dec 15 00:09 kmod-static-nodes.service
-rw-r--r--    1 root     root           658 Dec 15 00:09 ldconfig.service
-rw-r--r--    1 root     root           292 Dec 14 23:52 lighttpd.service
-rw-r--r--    1 root     root           395 Dec 15 00:09 local-fs-pre.target
-rw-r--r--    1 root     root           507 Dec 15 00:09 local-fs.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 local-fs.target.wants
-rw-r--r--    1 root     root           405 Dec 15 00:09 machine.slice
-rw-r--r--    1 root     root           531 Dec 15 00:09 machines.target
-rw-r--r--    1 root     root           492 Dec 15 00:09 multi-user.target
drwxr-xr-x    2 root     root          4096 Dec 15 02:22 multi-user.target.wants
-rw-r--r--    1 root     root           464 Dec 15 00:09 network-online.target
-rw-r--r--    1 root     root           461 Dec 15 00:09 network-pre.target
-rw-r--r--    1 root     root           480 Dec 15 00:09 network.target
-rw-r--r--    1 root     root           250 Dec 14 23:49 nfs-statd.service
-rw-r--r--    1 root     root           514 Dec 15 00:09 nss-lookup.target
-rw-r--r--    1 root     root           473 Dec 15 00:09 nss-user-lookup.target
-rw-r--r--    1 root     root           183 Dec 15 00:15 ofono.service
-rw-r--r--    1 root     root           521 Dec 14 23:50 opkg-configure.service
-rw-r--r--    1 root     root           554 Dec 15 00:09 org.freedesktop.hostname1.busname
-rw-r--r--    1 root     root           550 Dec 15 00:09 org.freedesktop.locale1.busname
-rw-r--r--    1 root     root           598 Dec 15 00:09 org.freedesktop.login1.busname
-rw-r--r--    1 root     root           549 Dec 15 00:09 org.freedesktop.machine1.busname
-rw-r--r--    1 root     root           675 Dec 15 00:09 org.freedesktop.network1.busname
-rw-r--r--    1 root     root           763 Dec 15 00:09 org.freedesktop.resolve1.busname
-rw-r--r--    1 root     root           480 Dec 15 00:09 org.freedesktop.systemd1.busname
-rw-r--r--    1 root     root           538 Dec 15 00:09 org.freedesktop.timedate1.busname
-rw-r--r--    1 root     root           354 Dec 15 00:09 paths.target
-rw-r--r--    1 root     root           552 Dec 15 00:09 poweroff.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 poweroff.target.wants
-rw-r--r--    1 root     root           377 Dec 15 00:09 printer.target
-rw-r--r--    1 root     root           178 Dec 15 00:16 ptpd.service
-rw-r--r--    1 root     root           576 Dec 15 00:09 quotaon.service
-rw-r--r--    1 root     root           612 Dec 15 00:09 rc-local.service
-rw-r--r--    1 root     root           543 Dec 15 00:09 reboot.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 reboot.target.wants
-rw-r--r--    1 root     root           396 Dec 15 00:09 remote-fs-pre.target
-rw-r--r--    1 root     root           482 Dec 15 00:09 remote-fs.target
-rw-r--r--    1 root     root           988 Dec 15 00:09 rescue.service
-rw-r--r--    1 root     root           486 Dec 15 00:09 rescue.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 rescue.target.wants
-rw-r--r--    1 root     root           212 Dec 15 00:12 rpcbind.service
-rw-r--r--    1 root     root           132 Dec 15 00:12 rpcbind.socket
-rw-r--r--    1 root     root           500 Dec 15 00:09 rpcbind.target
-rw-r--r--    1 root     root           385 Dec 14 23:47 run-postinsts.service
lrwxrwxrwx    1 root     root            15 Dec 15 00:09 runlevel0.target -> poweroff.target
lrwxrwxrwx    1 root     root            13 Dec 15 00:09 runlevel1.target -> rescue.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 runlevel1.target.wants
lrwxrwxrwx    1 root     root            17 Dec 15 00:09 runlevel2.target -> multi-user.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 runlevel2.target.wants
lrwxrwxrwx    1 root     root            17 Dec 15 00:09 runlevel3.target -> multi-user.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 runlevel3.target.wants
lrwxrwxrwx    1 root     root            17 Dec 15 00:09 runlevel4.target -> multi-user.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 runlevel4.target.wants
lrwxrwxrwx    1 root     root            16 Dec 15 00:09 runlevel5.target -> graphical.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 runlevel5.target.wants
lrwxrwxrwx    1 root     root            13 Dec 15 00:09 runlevel6.target -> reboot.target
-rw-r--r--    1 root     root          1059 Dec 14 23:23 serial-getty@.service
-rw-r--r--    1 root     root           402 Dec 15 00:09 shutdown.target
-rw-r--r--    1 root     root           362 Dec 15 00:09 sigpwr.target
-rw-r--r--    1 root     root           420 Dec 15 00:09 sleep.target
-rw-r--r--    1 root     root           409 Dec 15 00:09 slices.target
-rw-r--r--    1 root     root           380 Dec 15 00:09 smartcard.target
-rw-r--r--    1 root     root           356 Dec 15 00:09 sockets.target
drwxr-xr-x    2 root     root          4096 Dec 15 02:22 sockets.target.wants
-rw-r--r--    1 root     root           380 Dec 15 00:09 sound.target
-rw-r--r--    1 root     root           204 Dec 15 00:03 strongswan.service
-rw-r--r--    1 root     root           441 Dec 15 00:09 suspend.target
-rw-r--r--    1 root     root           353 Dec 15 00:09 swap.target
-rw-r--r--    1 root     root           715 Dec 15 00:09 sys-fs-fuse-connections.mount
-rw-r--r--    1 root     root           719 Dec 15 00:09 sys-kernel-config.mount
-rw-r--r--    1 root     root           662 Dec 15 00:09 sys-kernel-debug.mount
-rw-r--r--    1 root     root           518 Dec 15 00:09 sysinit.target
drwxr-xr-x    2 root     root          4096 Dec 15 02:22 sysinit.target.wants
lrwxrwxrwx    1 root     root             9 Dec 14 23:50 syslog.service -> /dev/null
-rw-r--r--    1 root     root          1235 Dec 15 00:09 syslog.socket
-rw-r--r--    1 root     root           585 Dec 15 00:09 system-update.target
-rw-r--r--    1 root     root           436 Dec 15 00:09 system.slice
-rw-r--r--    1 root     root           646 Dec 15 00:09 systemd-ask-password-console.path
-rw-r--r--    1 root     root           653 Dec 15 00:09 systemd-ask-password-console.service
-rw-r--r--    1 root     root           574 Dec 15 00:09 systemd-ask-password-wall.path
-rw-r--r--    1 root     root           681 Dec 15 00:09 systemd-ask-password-wall.service
-rw-r--r--    1 root     root           724 Dec 15 00:09 systemd-backlight@.service
-rw-r--r--    1 root     root           650 Dec 15 00:09 systemd-bootchart.service
-rw-r--r--    1 root     root           497 Dec 15 00:09 systemd-exit.service
-rw-r--r--    1 root     root           755 Dec 15 00:09 systemd-firstboot.service
-rw-r--r--    1 root     root           574 Dec 15 00:09 systemd-fsck-root.service
-rw-r--r--    1 root     root           600 Dec 15 00:09 systemd-fsck@.service
-rw-r--r--    1 root     root           544 Dec 15 00:09 systemd-halt.service
-rw-r--r--    1 root     root           631 Dec 15 00:09 systemd-hibernate-resume@.service
-rw-r--r--    1 root     root           501 Dec 15 00:09 systemd-hibernate.service
-rw-r--r--    1 root     root           710 Dec 15 00:09 systemd-hostnamed.service
-rw-r--r--    1 root     root           778 Dec 15 00:09 systemd-hwdb-update.service
-rw-r--r--    1 root     root           519 Dec 15 00:09 systemd-hybrid-sleep.service
-rw-r--r--    1 root     root           480 Dec 15 00:09 systemd-initctl.service
-rw-r--r--    1 root     root           524 Dec 15 00:09 systemd-initctl.socket
-rw-r--r--    1 root     root           667 Dec 15 00:09 systemd-journal-catalog-update.service
-rw-r--r--    1 root     root           731 Dec 15 00:09 systemd-journal-flush.service
-rw-r--r--    1 root     root           607 Dec 15 00:09 systemd-journald-audit.socket
-rw-r--r--    1 root     root          1090 Dec 15 00:09 systemd-journald-dev-log.socket
-rw-r--r--    1 root     root          1293 Dec 15 00:09 systemd-journald.service
-rw-r--r--    1 root     root           842 Dec 15 00:09 systemd-journald.socket
-rw-r--r--    1 root     root           557 Dec 15 00:09 systemd-kexec.service
-rw-r--r--    1 root     root           691 Dec 15 00:09 systemd-localed.service
-rw-r--r--    1 root     root          1126 Dec 15 00:09 systemd-logind.service
-rw-r--r--    1 root     root           693 Dec 15 00:09 systemd-machine-id-commit.service
-rw-r--r--    1 root     root           948 Dec 15 00:09 systemd-machined.service
-rw-r--r--    1 root     root           967 Dec 15 00:09 systemd-modules-load.service
-rw-r--r--    1 root     root           685 Dec 15 00:09 systemd-networkd-wait-online.service
-rw-r--r--    1 root     root          1339 Dec 15 00:09 systemd-networkd.service
-rw-r--r--    1 root     root           591 Dec 15 00:09 systemd-networkd.socket
-rw-r--r--    1 root     root          1378 Dec 15 00:09 systemd-nspawn@.service
-rw-r--r--    1 root     root           553 Dec 15 00:09 systemd-poweroff.service
-rw-r--r--    1 root     root           618 Dec 15 00:09 systemd-quotacheck.service
-rw-r--r--    1 root     root           717 Dec 15 00:09 systemd-random-seed.service
-rw-r--r--    1 root     root           548 Dec 15 00:09 systemd-reboot.service
-rw-r--r--    1 root     root           757 Dec 15 00:09 systemd-remount-fs.service
-rw-r--r--    1 root     root           907 Dec 15 00:09 systemd-resolved.service
-rw-r--r--    1 root     root           696 Dec 15 00:09 systemd-rfkill.service
-rw-r--r--    1 root     root           617 Dec 15 00:09 systemd-rfkill.socket
-rw-r--r--    1 root     root           497 Dec 15 00:09 systemd-suspend.service
-rw-r--r--    1 root     root           649 Dec 15 00:09 systemd-sysctl.service
-rw-r--r--    1 root     root           655 Dec 15 00:09 systemd-timedated.service
-rw-r--r--    1 root     root          1032 Dec 15 00:09 systemd-timesyncd.service
-rw-r--r--    1 root     root           598 Dec 15 00:09 systemd-tmpfiles-clean.service
-rw-r--r--    1 root     root           450 Dec 15 00:09 systemd-tmpfiles-clean.timer
-rw-r--r--    1 root     root           703 Dec 15 00:09 systemd-tmpfiles-setup-dev.service
-rw-r--r--    1 root     root           683 Dec 15 00:09 systemd-tmpfiles-setup.service
-rw-r--r--    1 root     root           823 Dec 15 00:09 systemd-udev-settle.service
-rw-r--r--    1 root     root           743 Dec 15 00:09 systemd-udev-trigger.service
-rw-r--r--    1 root     root           578 Dec 15 00:09 systemd-udevd-control.socket
-rw-r--r--    1 root     root           570 Dec 15 00:09 systemd-udevd-kernel.socket
-rw-r--r--    1 root     root           842 Dec 15 00:09 systemd-udevd.service
-rw-r--r--    1 root     root           630 Dec 15 00:09 systemd-update-done.service
-rw-r--r--    1 root     root           757 Dec 15 00:09 systemd-update-utmp-runlevel.service
-rw-r--r--    1 root     root           754 Dec 15 00:09 systemd-update-utmp.service
-rw-r--r--    1 root     root           573 Dec 15 00:09 systemd-user-sessions.service
-rw-r--r--    1 root     root           613 Dec 15 00:09 systemd-vconsole-setup.service
-rw-r--r--    1 root     root           395 Dec 15 00:09 time-sync.target
-rw-r--r--    1 root     root           405 Dec 15 00:09 timers.target
drwxr-xr-x    2 root     root          4096 Dec 15 00:09 timers.target.wants
-rw-r--r--    1 root     root           625 Dec 15 00:09 tmp.mount
-rw-r--r--    1 root     root           417 Dec 15 00:09 umount.target
-rw-r--r--    1 root     root           392 Dec 15 00:09 user.slice
-rw-r--r--    1 root     root           528 Dec 15 00:09 user@.service
-rw-r--r--    1 root     root           475 Dec 15 00:09 var-lib-machines.mount
-rw-r--r--    1 root     root           496 Dec 14 23:22 var-volatile-lib.service



root@am335x-evm:/lib/systemd/system# cd /usr/lib/systemd // system 이 존재하지 않음 
root@am335x-evm:/usr/lib/systemd# ls -al
drwxr-xr-x    6 root     root          4096 Dec 15  2016 .
drwxr-xr-x   56 root     root         53248 Dec 15  2016 ..
drwxr-xr-x    2 root     root          4096 Dec 15  2016 catalog
drwxr-xr-x    2 root     root          4096 Dec 15  2016 network
drwxr-xr-x    2 root     root          4096 Dec 15  2016 user
drwxr-xr-x    2 root     root          4096 Dec 15  2016 user-generators


  • 전체 service status 확인 및 기본분석 
방향키가 상 아래가 동작이 되며, 실시간으로 반영이 되기 때문에 확인가능
서비스 종료를 원한다면 q를 사용
  1. /etc/systemd/system.conf  : /lib/systemd/systemd --system 설정 : Consol에서만 가능  
  2. /etc/systemd/user.conf : /lib/systemd/systemd --user 설정 : SSH로 로그인시 확인가능


#systemctl status  // 현재 전체 service 확인 
?? am335x-evm
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Thu 1970-01-01 00:00:02 UTC; 46 years 11 months ago
   CGroup: /
           ???€init.scope  // init.scope 영역 , 만약 ssh를 사용하여 login을 한다면, user.slice가 존재 
           ?? ???€1 /sbin/init  // PID 1 /sbin/init
           ???€system.slice  //systemd 로 실행되는 각 service들 
           ?? ???€avahi-daemon.service
           ?? ?? ???€502 avahi-daemon: running [am335x-evm.local  // 502는 PID, init scirpt도 존재 
           ?? ?? ???€524 avahi-daemon: chroot helpe
           ?? ???€dbus.service
           ?? ??  ???€475 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
           ?? ???€lighttpd.service
           ?? ?? ???€695 /usr/sbin/lighttpd -D -f /etc/lighttpd.conf
           ?? ???€matrix-gui-2.0.service
           ?? ?? ???€857 /usr/bin/matrix_browser http://localhost:80/
           ?? ???€weston.service
           ?? ?? ???€811 /bin/sh /usr/bin/runWeston
           ?? ?? ???€814 weston --idle-time=0
           ?? ?? ???€826 /usr/libexec/weston-keyboard
           ?? ?? ???€828 /usr/libexec/weston-desktop-shell
           ?? ???€busybox-klogd.service
           ?? ?? ???€506 /sbin/klogd -n
           ?? ???€telnetd.service
           ?? ?? ???€819 /usr/sbin/telnetd
           ?? ???€system-serial\x2dgetty.slice
           ?? ?? ???€serial-getty@ttyS3.service
           ?? ?? ?? ???€1018 /sbin/agetty -8 -L ttyS3 115200 xterm
           ?? ?? ???€serial-getty@ttyGS0.service
           ?? ??   ???€685 /sbin/agetty -8 -L ttyGS0 115200 xterm
           ?? ???€systemd-journald.service
           ?? ?? ???€99 /lib/systemd/systemd-journald
           ?? ???€busybox-udhcpd.service
           ?? ?? ???€833 /usr/sbin/udhcpd -S /etc/udhcpd_usb0.conf
           ?? ???€thttpd.service
           ?? ?? ???€831 /usr/sbin/thttpd -d /srv/www -p 8080
           ?? ???€systemd-resolved.service
           ?? ?? ???€687 /lib/systemd/systemd-resolved
           ?? ???€systemd-timesyncd.service
           ?? ?? ???€396 /lib/systemd/systemd-timesyncd
           ?? ???€systemd-logind.service
           ?? ?? ???€465 /lib/systemd/systemd-logind
           ?? ???€systemd-networkd.service
           ?? ?? ???€496 /lib/systemd/systemd-networkd
           ?? ???€system-getty.slice
           ?? ?? ???€getty@tty1.service
           ?? ??   ???€682 /sbin/agetty --noclear tty1 linux
           ?? ???€ofono.service
           .......



  • systemd 관련 관리
  https://wiki.archlinux.org/index.php/systemd
  https://websetnet.com/ko/manage-systemd-services-and-units/
  http://www.phytec.eu/fileadmin/user_upload/downloads/Manuals/L-818e_1.pdf

  • Frame buffer Console 기능
  https://e2e.ti.com/support/embedded/linux/f/354/t/324198

4/03/2017

dmesg 와 systemd-analyze 비교

systemd에서는 각각의 실행시간을 분석해주는 Tool이 존재하며 이를 이용하여 각각의 실행시간을 알수가 있지만, 정확한 사용방법을 알아야한다.

아래의 결과는 Raspberry Pi에서 동일하게 실행한 결과이지만, 아래와 같이 시간이 제각각이다.


  • dmseg와 비교 
$ dmesg 
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.34-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1110 SMP Mon Apr 16 15:18:51 BST 2018
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 8 MiB at 0x37800000
[    0.000000] On node 0 totalpages: 229376
[    0.000000] free_area_init_node: node 0, pgdat 80c84e40, node_mem_map b7016000
[    0.000000]   Normal zone: 2016 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 229376 pages, LIFO batch:31
[    0.000000] random: fast init done
[    0.000000] percpu: Embedded 17 pages/cpu @b6fbf000 s38720 r8192 d22720 u69632
[    0.000000] pcpu-alloc: s38720 r8192 d22720 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 227360
[    0.000000] Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=0c830106-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 887456K/917504K available (7168K kernel code, 575K rwdata, 2072K rodata, 1024K init, 706K bss, 21856K reserved, 8192K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xb8800000 - 0xff800000   (1136 MB)
                   lowmem  : 0x80000000 - 0xb8000000   ( 896 MB)
                   modules : 0x7f000000 - 0x80000000   (  16 MB)
                     .text : 0x80008000 - 0x80800000   (8160 kB)
                     .init : 0x80b00000 - 0x80c00000   (1024 kB)
                     .data : 0x80c00000 - 0x80c8fd4c   ( 576 kB)
                      .bss : 0x80c96f4c - 0x80d478b4   ( 707 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 25231 entries in 74 pages
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000019] Switching to timer-based delay loop, resolution 52ns
[    0.000267] Console: colour dummy device 80x30
[    0.000285] console [tty1] enabled
[    0.000310] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000324] pid_max: default: 32768 minimum: 301
[    0.000640] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000654] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001589] Disabling memory control group subsystem
[    0.001669] CPU: Testing write buffer coherency: ok
[    0.002060] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002435] Setting up static identity map for 0x100000 - 0x10003c
[    0.002553] Hierarchical SRCU implementation.
[    0.003188] smp: Bringing up secondary CPUs ...
[    0.003869] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.004618] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.005346] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.005449] smp: Brought up 1 node, 4 CPUs
[    0.005460] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.005465] CPU: All CPU(s) started in HYP mode.
[    0.005469] CPU: Virtualization extensions available.
[    0.006311] devtmpfs: initialized
[    0.016951] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.017174] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.017192] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.017748] pinctrl core: initialized pinctrl subsystem
[    0.018490] NET: Registered protocol family 16
[    0.021211] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.026008] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.026015] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.026219] Serial: AMBA PL011 UART driver
[    0.027834] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.028291] uart-pl011 3f201000.serial: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[    0.059383] bcm2835-dma 3f007000.dma: DMA legacy API manager at b8813000, dmachans=0x1
[    0.060908] SCSI subsystem initialized
[    0.061128] usbcore: registered new interface driver usbfs
[    0.061179] usbcore: registered new interface driver hub
[    0.061261] usbcore: registered new device driver usb
[    0.070088] raspberrypi-firmware soc:firmware: Attached to firmware from 2018-04-16 18:21
[    0.071505] clocksource: Switched to clocksource arch_sys_counter
[    0.148883] VFS: Disk quotas dquot_6.6.0
[    0.148967] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.149154] FS-Cache: Loaded
[    0.149351] CacheFiles: Loaded
[    0.158152] NET: Registered protocol family 2
[    0.158874] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.158984] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.159170] TCP: Hash tables configured (established 8192 bind 8192)
[    0.159299] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.159343] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.159571] NET: Registered protocol family 1
[    0.160016] RPC: Registered named UNIX socket transport module.
[    0.160022] RPC: Registered udp transport module.
[    0.160027] RPC: Registered tcp transport module.
[    0.160032] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.161625] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    0.164360] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    0.172272] FS-Cache: Netfs 'nfs' registered for caching
[    0.172862] NFS: Registering the id_resolver key type
[    0.172900] Key type id_resolver registered
[    0.172906] Key type id_legacy registered
[    0.172921] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.174757] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.174881] io scheduler noop registered
[    0.174887] io scheduler deadline registered (default)
[    0.175165] io scheduler cfq registered
[    0.175173] io scheduler mq-deadline registered
[    0.175179] io scheduler kyber registered
[    0.177875] BCM2708FB: allocated DMA memory f7910000
[    0.177903] BCM2708FB: allocated DMA channel 0 @ b8813000
[    0.235713] Console: switching to colour frame buffer device 240x67
[    0.270742] bcm2835-rng 3f104000.rng: hwrng registered
[    0.270873] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    0.271359] vc-sm: Videocore shared memory driver
[    0.271668] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    0.281295] brd: module loaded
[    0.290358] loop: module loaded
[    0.290371] Loading iSCSI transport class v2.0-870.
[    0.291045] libphy: Fixed MDIO Bus: probed
[    0.291140] usbcore: registered new interface driver lan78xx
[    0.291196] usbcore: registered new interface driver smsc95xx
[    0.291213] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    0.519375] Core Release: 2.80a
[    0.519387] Setting default values for core params
[    0.519418] Finished setting default values for core params
[    0.719681] Using Buffer DMA mode
[    0.719687] Periodic Transfer Interrupt Enhancement - disabled
[    0.719693] Multiprocessor Interrupt Enhancement - disabled
[    0.719699] OTG VER PARAM: 0, OTG VER FLAG: 0
[    0.719710] Dedicated Tx FIFOs mode
[    0.720068] WARN::dwc_otg_hcd_init:1046: FIQ DMA bounce buffers: virt = 0xb7904000 dma = 0xf7904000 len=9024
[    0.720095] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[    0.720102] dwc_otg: Microframe scheduler enabled
[    0.720158] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x805e6a40
[    0.720169] WARN::hcd_init_fiq:460: FIQ ASM at 0x805e6da8 length 36
[    0.720182] WARN::hcd_init_fiq:486: MPHI regs_base at 0xb887e000
[    0.720238] dwc_otg 3f980000.usb: DWC OTG Controller
[    0.720273] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    0.720305] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[    0.720350] Init: Port Power? op_state=1
[    0.720355] Init: Power Port (0)
[    0.720566] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.720577] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.720585] usb usb1: Product: DWC OTG Controller
[    0.720594] usb usb1: Manufacturer: Linux 4.14.34-v7+ dwc_otg_hcd
[    0.720602] usb usb1: SerialNumber: 3f980000.usb
[    0.721235] hub 1-0:1.0: USB hub found
[    0.721274] hub 1-0:1.0: 1 port detected
[    0.721851] dwc_otg: FIQ enabled
[    0.721857] dwc_otg: NAK holdoff enabled
[    0.721862] dwc_otg: FIQ split-transaction FSM enabled
[    0.721872] Module dwc_common_port init
[    0.722108] usbcore: registered new interface driver usb-storage
[    0.722280] mousedev: PS/2 mouse device common for all mice
[    0.722356] IR NEC protocol handler initialized
[    0.722361] IR RC5(x/sz) protocol handler initialized
[    0.722367] IR RC6 protocol handler initialized
[    0.722372] IR JVC protocol handler initialized
[    0.722377] IR Sony protocol handler initialized
[    0.722382] IR SANYO protocol handler initialized
[    0.722388] IR Sharp protocol handler initialized
[    0.722393] IR MCE Keyboard/mouse protocol handler initialized
[    0.722398] IR XMP protocol handler initialized
[    0.723081] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[    0.723342] bcm2835-cpufreq: min=600000 max=1200000
[    0.723695] sdhci: Secure Digital Host Controller Interface driver
[    0.723700] sdhci: Copyright(c) Pierre Ossman
[    0.724059] mmc-bcm2835 3f300000.mmc: could not get clk, deferring probe
[    0.724384] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    0.724475] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.725899] ledtrig-cpu: registered to indicate activity on CPUs
[    0.726080] hidraw: raw HID events driver (C) Jiri Kosina
[    0.726204] usbcore: registered new interface driver usbhid
[    0.726210] usbhid: USB HID core driver
[    0.726986] vchiq: vchiq_init_state: slot_zero = b7980000, is_master = 0
[    0.728438] [vc_sm_connected_init]: start
[    0.738907] [vc_sm_connected_init]: end - returning 0
[    0.739490] Initializing XFRM netlink socket
[    0.739515] NET: Registered protocol family 17
[    0.739614] Key type dns_resolver registered
[    0.740155] Registering SWP/SWPB emulation handler
[    0.740743] registered taskstats version 1
[    0.746682] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    0.746760] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[    0.748563] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[    0.748573] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[    0.802145] sdhost: log_buf @ b7907000 (f7907000)
[    0.841999] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    0.843546] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    0.845094] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    0.847873] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    0.881525] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    0.882587] of_cfs_init
[    0.882674] of_cfs_init: OK
[    0.883263] Waiting for root device PARTUUID=0c830106-02...
[    0.931645] Indeed it is in host mode hprt0 = 00021501
[    1.025154] mmc1: new high speed SDIO card at address 0001
[    1.062700] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.066145] mmc0: new high speed SDHC card at address aaaa
[    1.066597] mmcblk0: mmc0:aaaa SL16G 14.8 GiB
[    1.068991]  mmcblk0: p1 p2
[    1.082349] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.082407] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    1.090094] devtmpfs: mounted
[    1.093347] Freeing unused kernel memory: 1024K
[    1.141555] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.141709] Indeed it is in host mode hprt0 = 00001101
[    1.381850] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.381866] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.382646] hub 1-1:1.0: USB hub found
[    1.382738] hub 1-1:1.0: 5 ports detected
[    1.467302] systemd[1]: System time before build time, advancing clock.
[    1.593629] NET: Registered protocol family 10
[    1.594870] Segment Routing with IPv6
[    1.607961] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.630555] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[    1.631146] systemd[1]: Detected architecture arm.
[    1.636234] systemd[1]: Set hostname to .
[    1.701617] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    1.831917] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    1.831933] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.834693] smsc95xx v1.0.6
[    1.935161] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ef:b7:f8
[    2.088664] systemd[1]: Listening on fsck to fsckd communication Socket.
[    2.089776] systemd[1]: Created slice User and Session Slice.
[    2.090066] systemd[1]: Listening on Journal Socket (/dev/log).
[    2.090367] systemd[1]: Listening on Journal Socket.
[    2.090623] systemd[1]: Listening on udev Kernel Socket.
[    2.090869] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    2.091802] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    2.213886] i2c /dev entries driver
[    2.550410] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    2.636913] systemd-journald[85]: Received request to flush runtime journal from PID 1
[    3.188170] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[    3.193560] bcm2835_alsa bcm2835_alsa: card created with 8 channels
[    3.324525] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[    3.335237] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430-sdio.bin for chip 0x00a9a6(43430) rev 0x000001
[    3.335531] usbcore: registered new interface driver brcmfmac
[    3.586694] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[    3.587608] brcmfmac: brcmf_c_preinit_dcmds: CLM version = API: 12.2 Data: 7.11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05-26 10:53:55 Inc Data: 9.10.39 Inc Compiler: 1.29.4 Inc ClmImport: 1.36.3 Creation: 2017-10-23 03:47:14 
[    4.653711] uart-pl011 3f201000.serial: no DMA platform data
[    5.262444] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    5.262495] brcmfmac: power management disabled
[    5.553997] Process accounting resumed
[    5.788790] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[    5.827103] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[    5.827305] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    7.266908] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[    9.231593] Bluetooth: Core ver 2.22
[    9.231749] NET: Registered protocol family 31
[    9.231756] Bluetooth: HCI device and connection manager initialized
[    9.233499] Bluetooth: HCI socket layer initialized
[    9.233524] Bluetooth: L2CAP socket layer initialized
[    9.233588] Bluetooth: SCO socket layer initialized
[    9.263519] Bluetooth: HCI UART driver ver 2.3
[    9.263534] Bluetooth: HCI UART protocol H4 registered
[    9.263541] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    9.263800] Bluetooth: HCI UART protocol Broadcom registered
[    9.463472] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    9.463481] Bluetooth: BNEP filters: protocol multicast
[    9.463503] Bluetooth: BNEP socket layer initialized
[    9.519323] Bluetooth: RFCOMM TTY layer initialized
[    9.519370] Bluetooth: RFCOMM socket layer initialized
[    9.519398] Bluetooth: RFCOMM ver 1.11
[   10.458720] fuse init (API version 7.26)


  • 전체시간- dmesg 비교 
dmesg의 정보와 비교해보면 각각의 시간차이가 존재하며, 이부분은 어쩔수 없는 것 같다.
일단 비교를 해보자.

$ systemd-analyze 
Startup finished in 1.422s (kernel) + 8.050s (userspace) = 9.472s

상위에서 Kernel이라고 생각하는 부분이 systemd의 첫번째 실행시간 같으며, 그전의 시간을 Kernel이라고 생각하는 것 같다.

요즘 Filesystem의 구조를 보면 sysvInit 구성에서 systemd의 구성으로 변경이 되고 있지만,혼재되어 사용되어지기 때문에 이를 가지고 정확한  데이타로 보기는 힘들것 같다.



  • Service 실행시간 비교 
아래부분은 systemd의 시간비교이기 때문에, Kernel 제외를 해야겠지만, init부분도 포함되어지는 것 같다.

$ systemd-analyze blame   // 상위가 마지막으로 실행된 서비스 
          4.893s hciuart.service
          1.917s networking.service
          1.600s dphys-swapfile.service
          1.210s bootchart.service
          1.200s bootchart-done.service
          1.186s dev-mmcblk0p2.device
          1.149s acct.service
          1.139s raspi-config.service
           719ms lightdm.service
           704ms keyboard-setup.service
           603ms systemd-logind.service
           368ms polkit.service
           359ms ssh.service
           329ms avahi-daemon.service
           322ms systemd-timesyncd.service
           314ms systemd-fsck@dev-disk-by\x2dpartuuid-0c830106\x2d01.service
           304ms systemd-udev-trigger.service
           291ms udisks2.service
           270ms systemd-fsck-root.service
           265ms systemd-udevd.service
           229ms rsyslog.service
           219ms dhcpcd.service
           201ms systemd-journald.service
           169ms fake-hwclock.service
           167ms gldriver-test.service
           160ms wifi-country.service
           156ms systemd-tmpfiles-setup-dev.service
           148ms triggerhappy.service
           144ms systemd-tmpfiles-setup.service
           134ms user@1000.service
           132ms bluetooth.service
           114ms plymouth-start.service
           112ms systemd-remount-fs.service
           105ms alsa-restore.service
           103ms sys-kernel-debug.mount
            97ms run-rpc_pipefs.mount
            90ms systemd-journal-flush.service
            81ms dev-mqueue.mount
            78ms systemd-update-utmp.service
            74ms kmod-static-nodes.service
            71ms systemd-random-seed.service
            70ms systemd-modules-load.service
            67ms boot.mount
            57ms systemd-sysctl.service
            53ms plymouth-read-write.service
            49ms console-setup.service
            48ms plymouth-quit-wait.service
            43ms systemd-update-utmp-runlevel.service
            34ms rc-local.service
            34ms nfs-config.service
            33ms systemd-rfkill.service
            32ms plymouth-quit.service
            27ms systemd-user-sessions.service
            26ms sys-kernel-config.mount
            17ms sys-fs-fuse-connections.mount



  • Target 분석 

Unit 단위로 Tree형태로 @와  offset 시간을 제공을 해주고 잇다.

$  systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @7.995s
└─multi-user.target @7.994s
  └─bluealsa.service @7.994s
    └─bluetooth.service @7.858s +132ms
      └─hciuart.service @2.958s +4.893s
        └─basic.target @2.768s
          └─sockets.target @2.768s
            └─avahi-daemon.socket @2.768s
              └─sysinit.target @2.766s
                └─systemd-timesyncd.service @2.442s +322ms
                  └─systemd-tmpfiles-setup.service @2.283s +144ms
                    └─local-fs.target @2.275s
                      └─run-user-1000.mount @6.960s
                        └─local-fs-pre.target @1.468s
                          └─keyboard-setup.service @760ms +704ms
                            └─system.slice @688ms
                              └─-.slice @568ms



  • 전체시간을 그림표현 

$ systemd-analyze plot > plot.svg   // svg 그림파일로 변경 
$ eog plot.svg   // svg 파일 확인 or 브라우저 확인 

기본이 Kernel Boot 부터 본인의 boot mode의 target (e.g multi-user.target)까지 의 분석이며, 착각하지 말아야 할거이 부팅때마다 다를 수 있다는 것을 명심하자




좀더 자세한 분석 방법은 아래의 메뉴얼참조
  https://jlk.fjfi.cvut.cz/arch/manpages/man/systemd-analyze.1
  https://wiki.archlinux.org/index.php/Improving_performance/Boot_process
  http://man7.org/linux/man-pages/man1/systemd-analyze.1.html