11/08/2020

Yocto 의 Licence 정보확인 와 Build Space 구조

1. Yocto의 Licence 정보 와 Build 구조 


Yocto Recipe 작성방법 (반드시 확인 및 이해)

1.1  Yocto Source의 License 설정 

Yocto의 기본인 poky에서 모든 LICENSE를 설정하는 곳이 별도로 존재하며, 
이 기반으로 Recipe에서 선언을 하면 쉽게 License 관리가 된다. 

  • Yocto의 licenses.conf 설정확인 
Yocto의  Source에서 Licenses 관리 부분 SPDXLICENSEMAP 기반으로 Recipe에서 LICENSE로 관리되어짐 

$ vi ./poky/meta/conf/licenses.conf

SRC_DISTRIBUTE_LICENSES += "AAL Adobe AFL-1.2 AFL-2.0 AFL-2.1 AFL-3.0"
SRC_DISTRIBUTE_LICENSES += "AGPL-3.0 ANTLR-PD Apache-1.0 Apache-1.1 Apache-2.0"
SRC_DISTRIBUTE_LICENSES += "APL-1.0 APSL-1.0 APSL-1.1 APSL-1.2 APSL-2.0"
SRC_DISTRIBUTE_LICENSES += "Artistic-1.0 Artistic-2.0 BitstreamVera BSD"
SRC_DISTRIBUTE_LICENSES += "BSD-2-Clause BSD-3-Clause BSD-4-Clause BSL-1.0"
SRC_DISTRIBUTE_LICENSES += "CATOSL-1.1 CC0-1.0 CC-BY-1.0 CC-BY-2.0 CC-BY-2.5"
SRC_DISTRIBUTE_LICENSES += "CC-BY-3.0 CC-BY-NC-1.0 CC-BY-NC-2.0 CC-BY-NC-2.5"
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-3.0 CC-BY-NC-ND-1.0 CC-BY-NC-ND-2.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-ND-2.5 CC-BY-NC-ND-3.0 CC-BY-NC-SA-1.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-2.0 CC-BY-NC-SA-2.5 CC-BY-NC-SA-3.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-ND-1.0 CC-BY-ND-2.0 CC-BY-ND-2.5 CC-BY-ND-3.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-SA-1.0 CC-BY-SA-2.0 CC-BY-SA-2.5 CC-BY-SA-3.0 CC-BY-SA-4.0"
..........
# AGPL variations
SPDXLICENSEMAP[AGPL-3] = "AGPL-3.0"
SPDXLICENSEMAP[AGPLv3] = "AGPL-3.0"
SPDXLICENSEMAP[AGPLv3.0] = "AGPL-3.0"

# GPL variations
SPDXLICENSEMAP[GPL-1] = "GPL-1.0"
SPDXLICENSEMAP[GPLv1] = "GPL-1.0"
SPDXLICENSEMAP[GPLv1.0] = "GPL-1.0"
SPDXLICENSEMAP[GPL-2] = "GPL-2.0"
SPDXLICENSEMAP[GPLv2] = "GPL-2.0"
SPDXLICENSEMAP[GPLv2.0] = "GPL-2.0"
SPDXLICENSEMAP[GPL-3] = "GPL-3.0"
SPDXLICENSEMAP[GPLv3] = "GPL-3.0"
SPDXLICENSEMAP[GPLv3.0] = "GPL-3.0"

#LGPL variations
SPDXLICENSEMAP[LGPLv2] = "LGPL-2.0"
SPDXLICENSEMAP[LGPLv2.0] = "LGPL-2.0"
SPDXLICENSEMAP[LGPL2.1] = "LGPL-2.1"
SPDXLICENSEMAP[LGPLv2.1] = "LGPL-2.1"
SPDXLICENSEMAP[LGPLv3] = "LGPL-3.0"

#MPL variations
SPDXLICENSEMAP[MPL-1] = "MPL-1.0"
SPDXLICENSEMAP[MPLv1] = "MPL-1.0"
SPDXLICENSEMAP[MPLv1.1] = "MPL-1.1"
SPDXLICENSEMAP[MPLv2] = "MPL-2.0"
.........

Yocto의 License 관리하는 곳 
  https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/conf/licenses.conf

상위 SRC_DISTRIBUTE_LICENSES는 최신 Version에서는 사라짐 
  https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-AVAILABLE_LICENSES
  https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-COMMON_LICENSE_DIR


1.2 Yocto Source의 Receipe 사용방법 

  • 상위 Config 기반으로 Recipe 적용하여 설정 
Recipe 안에서 LICENSE LIC_FILES_CHKSUM로 개별관리가 되므로 주의

Yocto의 Recipe 작성법 혹은 Config 설정확인
  https://ahyuo79.blogspot.com/2020/02/yocto-recipe.html

Openembedded의 Recipe 부분 참조 
  https://www.openembedded.org/wiki/Recipe_License_Fields


2.  Build Space 의 기본구조 확인 

  • Build Space 기본구조 분석 
Build Space 전체 기분구조 확인 
$ tree -t -L 1 --charset unicode
or
$ tree -t -L 1 --charset utf8
.
|-- conf
|-- tmp
|-- sstate-cache
|-- cache
`-- bitbake-cookerdaemon.log

  • Build Space 의 User Config 확인 
Build Space의 User Config 관련사항 

Source의 일반적인 Layer Config

$ tree -t -L 2 --charset unicode conf/   // Build Space의 User Config 
conf/
|-- local.conf.sample
|-- templateconf.cfg
|-- bblayers.conf.org
|-- local.conf
|-- local.conf.org
|-- bblayers.conf
`-- sanity_info 

  • Build Space의 tmp 부분 구조

$ tree -t -d -L 2 --charset unicode tmp/
tmp/
|-- hosttools
|-- log
|   `-- cooker
|-- cache
|   `-- default-glibc
|-- stamps
|   |-- all-poky-linux
|   |-- cortexa9hf-neon-mx6sx-poky-linux-gnueabi
|   |-- cortexa9hf-neon-poky-linux-gnueabi
|   |-- imx6sxsabresd-poky-linux-gnueabi
|   |-- x86_64-linux
|   `-- work-shared
|-- work-shared
|   |-- gcc-8.3.0-r0
|   `-- imx6sxsabresd
|-- work
|   |-- cortexa9hf-neon-mx6sx-poky-linux-gnueabi
|   |-- all-poky-linux
|   |-- imx6sxsabresd-poky-linux-gnueabi
|   |-- cortexa9hf-neon-poky-linux-gnueabi
|   `-- x86_64-linux
|-- pkgdata
|   `-- imx6sxsabresd
|-- deploy
|   |-- images
|   |-- rpm
|   `-- licenses
|-- sysroots-components
|   |-- all
|   |-- x86_64
|   |-- cortexa9hf-neon-mx6sx
|   |-- imx6sxsabresd
|   |-- cortexa9hf-neon
|   `-- manifests
|-- buildstats
|   |-- 20201027081937
|   |-- 20201028005722
|   |-- 20201028012636
|   |-- 20201028015306
|   |-- 20201028015422
|   |-- 20201028015551
|   |-- 20201028020411
|   |-- 20201028022652
|   |-- 20201028023144
|   |-- 20201028023437
|   |-- 20201028033851
|   |-- 20201028041736
|   |-- 20201028060743
|   |-- 20201028071633
|   |-- 20201028071841
|   |-- 20201028073336
|   |-- 20201028073710
|   |-- 20201028073849
|   |-- 20201028075408
|   |-- 20201028080901
|   |-- 20201028081657
|   |-- 20201028085730
|   |-- 20201029082105
|   |-- 20201029085354
|   |-- 20201029085549
|   |-- 20201029085755
|   |-- 20201030043736
|   |-- 20201030080459
|   |-- 20201103084648
|   |-- 20201104015257
|   `-- 20201105060918
|-- sysroots
|   `-- imx6sxsabresd
`-- sstate-control




2.1 Build Space에서 License 정보확인 


  • 사용된 Package들의 License 조사

아래와 같이 찾아보면, tmp/deploy/licenses 에 기본적으로 Yocto에서 사용되어지는 Package들 License를 쉽게 찾을 수 있다. 

그 아래를 보면 GCC License가 두 종료로 분리되어 나오

$ find . -name licenses
./tmp/deploy/licenses
./tmp/work/imx6sxsabresd-poky-linux-gnueabi/base-files/3.0.14-r89/licenses
./tmp/work/cortexa9hf-neon-poky-linux-gnueabi/util-linux/2.32.1-r0/util-linux-2.32.1/Documentation/licenses
./tmp/work/cortexa9hf-neon-poky-linux-gnueabi/gnutls/3.6.7-r0/gnutls-3.6.7/lib/extras/licenses
./tmp/work/x86_64-linux/util-linux-native/2.32.1-r0/util-linux-2.32.1/Documentation/license


  • 사용되어지는 Package들의 License 정보확인

Build Space에서 실제 빌드된 Package 정보들이 확인 가능하며, deploy에 배포된 licenses 정보들이 별도로 관리가 되어진다.

이곳에서 관련 licenses 정보들을 확인

$ pwd                 // Yocto의 Build Space 위치 확인 

$ bitbake -h        // Yocto의 Build Space 설정상태확인 

$ ls tmp/deploy/licenses/             // Licenses 에서 사용된 Package 정보들 
acl                                           db                            kmod-native                m4                              qemu-native
alsa-lib                                      db-native                     m4-native                  qemuwrapper-cross
alsa-state                                    dbus                          ldconfig-native            make                            quilt-native
alsa-utils                                    dbus-glib                     libarchive-native          makedevs-native                 quota
attr                                          dbus-glib-native              libassuan-native           make-native                     re2c-native
attr-native                                   dbus-native                   libcap                     mdadm                           readline
autoconf-archive                              dbus-test                     libcheck                   meson-native                    readline-native
autoconf-archive-native                       debianutils-native            libcheck-native            minicom                         rng-tools
autoconf-native                               depmodwrapper-cross           libcomps-native            mklibs-native                   rpcbind
automake-native                               diffutils                     libdaemon                  mobile-broadband-provider-info  rpm-native
avahi                                         dnf-native                    libdnf-native              mpfr-native                     run-postinsts
base-files                                    dosfstools                    libffi                     mtools-native                   sed
base-passwd                                   dosfstools-native             libffi-native              ncurses                         shadow
bash                                          dtc-native                    libgcc                     ncurses-native                  shadow-native
bash-completion                               dwarfsrcfiles-native          libgcc-initial             neard                           shadow-securetty
bc                                            e2fsprogs                     libgcrypt                  netbase                         shadow-sysroot
bc-native                                     e2fsprogs-native              libgpg-error               nettle                          shared-mime-info
binutils                                      elfutils                      libgpg-error-native        ninja-native                    shared-mime-info-native
binutils-cross-arm                            elfutils-native               libical                    nspr-native                     socat
binutils-native                               expat                         libidn2                    nss-native                      sqlite3
bison                                         expat-native                  libjitterentropy           ofono                           sqlite3-native
bison-native                                  file-native                   libmnl                     openssh                         sudo
bluez5                                        firmware-imx                  libmodulemd-native         openssl                         swig-native
bmap-tools-native                             flac                          libmpc-native              openssl-native                  sysfsutils
btrfs-tools                                   flex                          libnl                      opkg-native                     systemd
busybox                                       flex-native                   libnsl2                    opkg-utils                      systemd-compat-units
bzip2                                         gawk                          libnsl2-native             opkg-utils-native               systemd-conf
bzip2-native                                  gcc-cross-arm                 libnss-mdns                optee-client-imx                systemd-serialgetty
ca-certificates                               gcc-runtime                   libogg                     optee-os-imx                    systemd-systemctl-native
chrpath-native                                gdbm                          libpcap                    optee-test-imx                  tcpdump
cmake-native                                  gdbm-native                   libpcre                    os-release                      tcp-wrappers
core-image-base                               gettext-minimal-native        libpcre-native             packagegroup-base               tele-set
core-image-base-imx6sxsabresd-20201027081937 gettext-native                librepo-native             packagegroup-core-boot          texinfo-dummy-native
........

$ ls tmp/deploy/licenses/u-boot-imx/
generic_GPLv2  gpl-2.0.txt  recipeinfo

$ ls tmp/deploy/licenses/gcc-cross-arm/
COPYING  COPYING3  COPYING3.LIB  COPYING.LIB  COPYING.RUNTIME  generic_GPL-3.0-with-GCC-exception  generic_GPLv3  recipeinfo

  • Image에서 사용되어진 License 확인 
사용되어진 Image의 Package들의 License 정보를 알파벳순서로  확인가능하지만, 
주의해야할 것은 모두 나오지는 않으며, 안나오는 것은 상위 Package에서 직접보자.

안나오는 경우는 LICENSECLOSE해버리면 당연히 나오지 않게된다.

나의 경우 간단히 Uboot와 Yocto에서 사용되어지는 Python의 License들은 나오지 않았다.

$ bitbake -e | grep ^MACHINE_ARCH
MACHINE_ARCH="imx6sxsabresd"
MACHINE_ARCH_FILTER="virtual/kernel"

$ bitbake -e | grep ^TUNE_PKGARCH
TUNE_PKGARCH="cortexa9hf-neon"

$ bitbake -e | grep ^IMAGE

$ cat tmp/deploy/licenses/core-image-base-imx6sxsabresd-20201027081937/image_license.manifest
RECIPE NAME: linux-imx
VERSION: 4.19.35
LICENSE: GPLv2
FILES: imx6sx-sdb-ldo--4.19.35-r0-imx6sxsabresd-20201028015422.dtb imx6sx-sdb-mqs--4.19.35-r0-imx6sxsabresd-20201028015422.dtb imx6sx-sdb-btwifi--4.19.35-r0-imx6sxsabresd-20201028015422.dtb imx6sx-sdb-reva-ldo--4.19.35-r0-imx6sxsabresd-20201028015422.dtb imx6sx-sdb-reva--4.19.35-r0-imx6sxsabresd-20201028015422.dtb imx6sx-sdb-lcdif1--4.19.35-r0-imx6sxsabresd-20201028015422.dtb zImage--4.19.35-r0-imx6sxsabresd-20201028015422.bin imx6sx-sdb--4.19.35-r0-imx6sxsabresd-20201028015422.dtb modules--4.19.35-r0-imx6sxsabresd-20201028015422.tgz imx6sx-sdb-sai--4.19.35-r0-imx6sxsabresd-20201028015422.dtb imx6sx-sdb-emmc--4.19.35-r0-imx6sxsabresd-20201028015422.dtb imx6sx-sdb-m4--4.19.35-r0-imx6sxsabresd-20201028015422.dtb

RECIPE NAME: optee-os-imx
VERSION: git
LICENSE: BSD
FILES: uTee-6sxsdb tee.mx6sxsabresd.bin

RECIPE NAME: u-boot-imx
VERSION: 2019.04
LICENSE: GPLv2+
FILES: u-boot-emmc-2019.04-r0.imx


$ cat tmp/deploy/licenses/core-image-base-imx6sxsabresd-20201105060918/package.manifest
alsa-conf
alsa-state
alsa-states
alsa-utils-alsactl
alsa-utils-alsamixer
avahi-daemon
avahi-locale-en-gb
base-files
base-passwd
bash
binutils
bluez5
busybox
busybox-syslog
busybox-udhcpc
db
dbus-1
e2fsprogs-e2fsck
firmware-imx-sdma
glibc-locale-en-gb
imx-alsa-plugins
iptables
iptables-module-ebt-802-3
iptables-module-ebt-ip
iptables-module-ebt-log
iptables-module-ebt-mark-m
iptables-module-ip6t-ah
iptables-module-ip6t-dnat
iptables-module-ip6t-dnpt
iptables-module-ip6t-dst
iptables-module-ip6t-eui64
iptables-module-ip6t-frag
iptables-module-ip6t-hbh
iptables-module-ip6t-hl
iptables-module-ip6t-icmp6
iptables-module-ip6t-ipv6header
iptables-module-ip6t-log
iptables-module-ip6t-masquerade
......

$ cat tmp/deploy/licenses/core-lora-image-imx6sxsabresd-20201027081937/license.manifest
PACKAGE NAME: alsa-conf
PACKAGE VERSION: 1.1.8
RECIPE NAME: alsa-lib
LICENSE: LGPLv2.1 & GPLv2+

PACKAGE NAME: alsa-lib
PACKAGE VERSION: 1.1.8
RECIPE NAME: alsa-lib
LICENSE: LGPLv2.1 & GPLv2+

PACKAGE NAME: alsa-state
PACKAGE VERSION: 0.2.0
RECIPE NAME: alsa-state
LICENSE: MIT

PACKAGE NAME: alsa-states
PACKAGE VERSION: 0.2.0
RECIPE NAME: alsa-state
LICENSE: MIT

PACKAGE NAME: alsa-utils-alsactl
PACKAGE VERSION: 1.1.8
RECIPE NAME: alsa-utils
LICENSE: GPLv2+

PACKAGE NAME: alsa-utils-alsamixer
PACKAGE VERSION: 1.1.8
RECIPE NAME: alsa-utils
LICENSE: GPLv2+

PACKAGE NAME: avahi-daemon
PACKAGE VERSION: 0.7
RECIPE NAME: avahi
LICENSE: GPLv2+ & LGPLv2.1+

PACKAGE NAME: avahi-locale-en-gb
PACKAGE VERSION: 0.7
RECIPE NAME: avahi
LICENSE: GPLv2+ & LGPLv2.1+

PACKAGE NAME: base-files
PACKAGE VERSION: 3.0.14
RECIPE NAME: base-files
LICENSE: GPLv2

PACKAGE NAME: base-passwd
PACKAGE VERSION: 3.5.29
RECIPE NAME: base-passwd
LICENSE: GPLv2+
......


댓글 없음 :