blob: 50c2b5318592b4b9f457cf6f75d19064d8ab5f20 [file] [log] [blame]
Andrew Geissler26e4bea2020-11-30 19:54:03 -06001SUMMARY = "cmdline.txt file used to boot the kernel on a Raspberry Pi device"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
4
5COMPATIBLE_MACHINE = "^rpi$"
6INHIBIT_DEFAULT_DEPS = "1"
7inherit deploy nopackages
8
9CMDLINE_DWC_OTG ?= "dwc_otg.lpm_enable=0"
Andrew Geisslerad7fa352021-07-23 12:55:23 -040010
11CMDLINE_ROOT_FSTYPE ?= "rootfstype=ext4"
12CMDLINE_ROOTFS ?= "root=/dev/mmcblk0p2 ${CMDLINE_ROOT_FSTYPE} rootwait"
Andrew Geissler26e4bea2020-11-30 19:54:03 -060013
14CMDLINE_SERIAL ?= "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}"
15
16CMDLINE_CMA ?= "${@oe.utils.conditional("RASPBERRYPI_CAMERA_V2", "1", "cma=64M", "", d)}"
17
William A. Kennington IIIa99e9b62021-06-02 12:47:56 -070018CMDLINE_CMA ?= "${@oe.utils.conditional("RASPBERRYPI_HD_CAMERA", "1", "cma=64M", "", d)}"
19
Andrew Geissler26e4bea2020-11-30 19:54:03 -060020CMDLINE_PITFT ?= "${@bb.utils.contains("MACHINE_FEATURES", "pitft", "fbcon=map:10 fbcon=font:VGA8x8", "", d)}"
21
22# Add the kernel debugger over console kernel command line option if enabled
23CMDLINE_KGDB ?= '${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
24
25# Disable rpi logo on boot
26CMDLINE_LOGO ?= '${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}'
27
28# You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf
29# to enable kernel debugging.
30CMDLINE_DEBUG ?= ""
31
Andrew Geissler5199d832021-09-24 16:47:35 -050032# Add RNDIS capabilities (must be after rootwait)
33# example:
34# CMDLINE_RNDIS = "modules-load=dwc2,g_ether g_ether.host_addr=<some MAC
35# address> g_ether.dev_addr=<some MAC address>"
36# if the MAC addresses are omitted, random values will be used
37CMDLINE_RNDIS ?= ""
38
Andrew Geissler26e4bea2020-11-30 19:54:03 -060039CMDLINE = " \
40 ${CMDLINE_DWC_OTG} \
41 ${CMDLINE_SERIAL} \
42 ${CMDLINE_ROOTFS} \
43 ${CMDLINE_CMA} \
44 ${CMDLINE_KGDB} \
45 ${CMDLINE_LOGO} \
46 ${CMDLINE_PITFT} \
47 ${CMDLINE_DEBUG} \
Andrew Geissler5199d832021-09-24 16:47:35 -050048 ${CMDLINE_RNDIS} \
Andrew Geissler26e4bea2020-11-30 19:54:03 -060049 "
50
51do_compile() {
Andrew Geissler11105212021-02-12 15:30:38 -060052 echo "${@' '.join('${CMDLINE}'.split())}" > "${WORKDIR}/cmdline.txt"
Andrew Geissler26e4bea2020-11-30 19:54:03 -060053}
54
55do_deploy() {
56 install -d "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
57 install -m 0644 "${WORKDIR}/cmdline.txt" "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
58}
59
60addtask deploy before do_build after do_install
61do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
Andrew Geisslera4353c82021-06-25 14:23:27 -050062
63PACKAGE_ARCH = "${MACHINE_ARCH}"