Python logging module (write log file) / basicConfig does not create log file issue(solved)

Python

logging module : write log file for exec. log in python(i think)

issue :

If "fullpath = variable + filename" as shown above, there is an issue(not create a log file).
The cause is unknown, but if " fullpath = "./log/test.log" " directly, you can see that the file is normally generated.


example 1 and issue of example 1,  solved: example 2


example 1.

import logging

def writeLogFile(logText):
    mypath = "./log"
    fullpath = mypath + "/test.log"    #mypath = "./log"
    logging.basicConfig(filename = fullpath, level=logging.DEBUG)
    logging.debug(logText)

If "fullpath = variable + filename" as shown above, there is an issue(not create a log file).

The cause is unknown, but if " fullpath = "./log/test.log" " directly, you can see that the file is normally generated.

For the above problem, I don't use basicConfig, So, I use it with example 2.


example 2 and solve.

import logging
import logging.handlers

log : ""

def initLog():
    global log
    mypath = "./log"
    fullpath = mypath + "/test.log"    #mypath = "./log"

    log = logging.getLogger('my_log')
    log.setLevel(logging.DEBUG)
    fileHandler = logging.FileHandler(fullpath)
    log.addHandler(fileHandler)


def writeLogFile(logText):
    log.debug(logText)

As shown above, log can be created as a file without any problems.


#python #logging #log #logfile #basicConfig #issue #solve #logginghandler


Yocto Recipe / Some runtime variables


Recipe
.bb or .bbappend file
- Recipes describe how to handle a given package
- A recipe is a set of instructions to describe how to retrieve, patch, compile, install and generate binary packages for a given application.
- It also defines what build or runtime dependencies are required.
- The recipes are parsed by the BitBake build engine.
- The format of a recipe file name is <package-name>_<version>.bb
 
Some runtime variables
WORKDIR : The package location that was created after bitbake built the package.
$ bitbake -e vehicle | grep ^WORKDIR=
WORKDIR="/home/yocto/poky/build/tmp/work/arm-linux-gnueabi/vehicle/0.1-r0"

PN : package name(Extract from recipe file name)
PR : package revision
PV : package version

S : The location where bitbake unpacks the package.(where the source is located)
$ bitbake -e hello | grep ^S=
S="/home/yocto/poky/build/tmp/work/arm-linux-gnueabi/vehicle/0.1-r0"

D : Directory to import output files (destination directory)
$ bitbake -e hello | grep ^D=
D="/home/yocto/poky/build/tmp/work/arm-linux-gnueabi/vehicle/0.1-r0/image"

A command to be used after "D" path.
Bindir : /usr/bin
sbindir : /usr/sbin
libdir : /usr/lib
libexecdir : /usr/lib
sysconfdir : /etc
datadir : /usr/share
mandir : /usr/share/man
includedir : /usr/include

#Recipe #Runtime Variables #Yocto #Bitbake #Linux #Build system

What is Yocto ? Yocto Background


1. Yocto 근원
2001 발표한 Linux 기반의 PDA Sharp Zaurus SL-5000 시리즈 부터라고 한다.

OpenZaurus project
- Sharp
open source license 따라 SL-5000 제품의 ROM Image 소스코드를 공개하였고, 이를 기반으로 2002년에 OpenZaurus project 시작
debian
기반의 소스 빌드 방식을 사용한 프로젝트는 프로젝트의 규모가 커지면서 여러 Target architecture 지원하는데 한계를 나타냄.
이러한
문제를 개선하기 위해 2003년에 OpenEmbedded 시작.
 
2. OpenEmbedded project
- OpenZaurus
패키지들이 프로젝트에 통합됨.
OpenEmbedded
BitBake라는 Python 으로 작성된 빌드 프로그램과 Metadata(recipe 관련된 설정 파일들)라는 빌드 명세로 구분.
Bitbake 2004년에 Make tool 처럼 독립적인 프로젝트로 분리.
따라서, 다음과 같이 분리됨.
- Bitbake
별도의 독립적 프로젝트
- OpenEmbedded Bitbake Metadata 관리하는 프로젝트
OpenEmbedded 급성장하며, 7천여개의 recipe, 300여개의 Machine 지원하게 .
OpenEmbedded
경우, 개발자가 직접 commit 하는 push 모델로 운영되다 보니 규모가 커지면서 코드의 충돌 관리가 쉽지 않아지고, 상업적인 지원도 쉽지 않아짐.
이를 개선하기 위해 다양한 시도가 있었으며, 하나로 Poky Linux 등장.
 
3. Poky Linux
OpenedHand
라는 스타트업이 2006 발표한 Poky Linux 기존 OpenEmbedded 깔끔하게 정리한 프로젝트
- 특징
800여개 정도의 선별된 recipe
QEMU(가상화 소프트웨어) 가상 환경 SDK 빌드 지원
아주
정리된 Manual

회사는 2008 Intel 합병되고, 그로 인해 Poky Atom 기반의 장비에만 집중
 
4. Yocto Project
Poky Linux 기반으로 Embedded Linux 배포본 개발 절차를 개선하기 위한 프로젝트 (Linux Foundation Workgroup에서 2010 발표)
OE-Core : 2011
년에 Poky에서 분리된 Metadata이며, 현재 Yocto 에서 말하는 OpenEmbedded OE-Core 말함.
OE-Classic :
이전의 OpenEmbedded

- OE-Core 포함 범위
ARM, x86, x86-64, MIPS, MIPS64 같은 주요 아키텍쳐 지원
QEMU emulated machine 으로 X-Based GUI(Sato) 지원(실제 하드웨어 X)

실제 하드웨어 의존적이지 않은 Metadata set 지원
Bitbake Layering 기능으로 각각의 BSP metadata 분리
소프트웨어
모듈은 meta-qt, meta-nodejs 등과 같은 별도의 layering으로 구분
개발자가
직접 Comit 하는 Push model(OpenEmbedded) 아닌, Pull Model poky, openembedded 관리하여 프로젝트 충돌 가능성 없음.
 
5. 용어
bitbake : 2004 OE-Classic에서 분리된 빌드
OE-Core(OpenEmbedded-Core): 2011 Poky에서 분리된 Core Metadata, Poky에서는 Meta-openembedded 제공
OE-Classic(이전의 OpenEmbedded): Bitbake OE-Core
Poky: OE-Core
포함한 통합 Image 만들 있는 Metadata Bitbake
Yocto Project: Linux Foundation
에서 관리하는 Embedded linux 배포본 빌드 시스템
Metadata : 환경설정 파일(*.conf), 클래스 파일(*.bbclass), 레시피 파일(*.bb, *.bbappend)
 
#Source of Yocto #Yocto #BitBake #Poky #Feature #Term

Yocto Background and Yocto Term


1. Source of Yocto
It started with the Sharp Zaurus SL-5000 series, a Linux-based PDA announced in 2001.

OpenZaurus project
- Sharp
announced the source code of the ROM Image of SL-5000 products in accordance with the open source license, and based on this(announced the source code), the OpenZaurus project started in 2002.
The project(Using a debian-based source build method) has shown limitations in supporting multiple target architectures as the project expands in size.
OpenEmbedded was launched in 2003 to improve this problem.
 
2. OpenEmbedded project
- Packages in OpenZaurus have been integrated into this project.
OpenEmbedded is divided into a Python build program called BitBake and a build specification called Metadata(setting files related to recipe).
Bitbake was separated into an independent project like Make Tool(Cmake, …) in 2004.

Therefore, it was separated as follows:
- Bitbake: Separate independent projects
- OpenEmbedded : A project to manage Metadata for Bitbake
OpenEmbedded has grown rapidly, supporting 7,000 recipe and 300 machines.
In the case of OpenEmbedded, as it operates as a "Push model" that is committed by developers, it is not easy to manage conflicts in code as the scale grows, and commercial support is not easy.

There have been various attempts to improve this, and Poky Linux has appeared as one of them.
 
3. Poky Linux
Poky Linux, released in 2006 by a startup called OpenedHand, is a project that neatly organizes existing OpenEmbedded.

- Features
Has about 800 selected recipes
Supports virtualization software virtual environments(QEMU) and SDK builds.
Has a very well-organized manual

The company was merged with Intel in 2008, and Poky focuses only on Atom-based equipment.
 
4. Yocto Project and Feature
Projects to improve the Embedded Linux Distribution development process based on Poky Linux (released in 2010 by Linux Foundation Workgroup)
OE-Core: Metadata separated from Poky in 2011. OpenEmbedded, which is currently referred to in Yocto, refers to OE-Core.
OE-Classic: Previous OpenEmbedded

Feature
- OE-Core
    Supports major architectures such as ARM, x86, x86-64, MIPS, and MIPS64, ....
    Support X-Based GUI with QEMU emulated machine. (Real hardware X)
- Metadata sets that are not hardware dependent are supported.
- Separate BSP metadata with Bitbake's Layering function.
- The software modules are divided into separate layering such as meta-qt, meta-nodejs, etc.
- There is no possibility of project collision by managing poky and openembeded, with a Pull model(not push model which is directly committed by developers).
 
5. Yocto Term
bitbake : "Build tool" separated from OE-Classic 2004
OE-Core (OpenEmbedded-Core) : Core Metadata separated from Poky in 2011. provides meta-openembedded.
OE-Classic (formerly OpenEmbedded) : Bitbake and OE-Core
Poky : Metadata and Bitbake to create an integrated image with OE-Core
Yocto Project : Embedded Linux Foundation Workgroup managed Embedded Linux Distribution Building System
Metadata : configuration file (*.conf), class file (*.bbclass), recipe file (*.bb, *.bbappend)
 


#Source of Yocto #Yocto #BitBake #Poky #Feature #Term

Yocto error : Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (systemd) matches the entries enabled in DISTRO_FEATURES


ERROR : Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (systemd) matches the entries enabled in DISTRO_FEATURES

kiwon@kiwon-VirtualBox:~/yocto/ivi/poky/build$ bitbake ivi-image
WARNING: Host distribution "ubuntu-20.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
ERROR: /home/kiwon/yocto/ivi/poky/meta-ivi/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-boot-genivi.bb: Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (systemd) matches the entries enabled in DISTRO_FEATURES
ERROR: Failed to parse recipe: /home/kiwon/yocto/ivi/poky/meta-ivi/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-boot-genivi.bb


Solve:
Modify ${BuildPath}/conf/local.conf

Add… 
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
IMX_DEFAULT_DISTRO_FEATURES_append = " systemd"

And Re-Build



#Yocto #Bitbake #Error #Linux #Embedded #DISTRO_FEATURES #VIRTUAL-RUNTIME


Yocto Related Sites




Website: The Yocto Project Website provides background information, the latest builds, breaking news, full development documentation, and access to a rich Yocto Project Development Community into which you can tap.
https://www.yoctoproject.org/

Developer Screencast: The Getting Started with the Yocto Project - New Developer Screencast Tutorial provides a 30-minute video created for users unfamiliar with the Yocto Project but familiar with Linux build hosts. While this screencast is somewhat dated, the introductory and fundamental concepts are useful for the beginner.
Getting Started with the Yocto Project - New Developer Screencast Tutorial


Yocto Project Overview and Concepts Manual: The Yocto Project Overview and Concepts Manual is a great place to start to learn about the Yocto Project. This manual introduces you to the Yocto Project and its development environment. The manual also provides conceptual information for various aspects of the Yocto Project.

Yocto Project Wiki: The Yocto Project Wiki provides additional information on where to go next when ramping up with the Yocto Project, release information, project planning, and QA information.

Yocto Project Mailing Lists: Related mailing lists provide a forum for discussion, patch submission and announcements. Several mailing lists exist and are grouped according to areas of concern. See the "Mailing lists" section in the Yocto Project Reference Manual for a complete list of Yocto Project mailing lists.

Comprehensive List of Links and Other Documentation: The "Links and Related Documentation" section in the Yocto Project Reference Manual provides a comprehensive list of all related links and other user documentation.






#Useful Yocto Related Sites #Yocto #Bitbake #Manual #Linux #Embedded #Example


Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore!

 🏙️ Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore! 🚨 Are you thinking about buying an apartment in 2025? 🏢  It’...