blob: a22f50d643eb2bd57d8b8508f4941ae2f0a9a768 [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"
Patrick Williams169d7bc2024-01-05 11:33:25 -060012CMDLINE_ROOT_PARTITION ?= "/dev/mmcblk0p2"
13
14CMDLINE_ROOTFS ?= "root=${CMDLINE_ROOT_PARTITION} ${CMDLINE_ROOT_FSTYPE} rootwait"
Andrew Geissler26e4bea2020-11-30 19:54:03 -060015
16CMDLINE_SERIAL ?= "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}"
17
Andrew Geissler26e4bea2020-11-30 19:54:03 -060018CMDLINE_PITFT ?= "${@bb.utils.contains("MACHINE_FEATURES", "pitft", "fbcon=map:10 fbcon=font:VGA8x8", "", d)}"
19
20# Add the kernel debugger over console kernel command line option if enabled
21CMDLINE_KGDB ?= '${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
22
23# Disable rpi logo on boot
24CMDLINE_LOGO ?= '${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}'
25
26# You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf
27# to enable kernel debugging.
28CMDLINE_DEBUG ?= ""
29
Patrick Williamsde0582f2022-04-08 10:23:27 -050030# Add a request to isolate processors from the Linux scheduler. ISOLATED_CPUS
31# may have the form of a comma separated list of processor numbers "0,1,3", a
32# range "0-2", a combination of the two "0-1,3", or a single processor you may
33# not specify ALL processors simultaneously
34def setup_isolcpus(d):
35 string = ""
36 if d.getVar('ISOLATED_CPUS'):
37 string = 'isolcpus=' + d.getVar('ISOLATED_CPUS')
38 return string
39
40CMDLINE_ISOL_CPUS ?= "${@setup_isolcpus(d)}"
41
Andrew Geissler5199d832021-09-24 16:47:35 -050042# Add RNDIS capabilities (must be after rootwait)
43# example:
44# CMDLINE_RNDIS = "modules-load=dwc2,g_ether g_ether.host_addr=<some MAC
45# address> g_ether.dev_addr=<some MAC address>"
46# if the MAC addresses are omitted, random values will be used
47CMDLINE_RNDIS ?= ""
48
Andrew Geissler26e4bea2020-11-30 19:54:03 -060049CMDLINE = " \
Patrick Williamsde0582f2022-04-08 10:23:27 -050050 ${CMDLINE_ISOL_CPUS} \
Andrew Geissler26e4bea2020-11-30 19:54:03 -060051 ${CMDLINE_DWC_OTG} \
52 ${CMDLINE_SERIAL} \
53 ${CMDLINE_ROOTFS} \
54 ${CMDLINE_CMA} \
55 ${CMDLINE_KGDB} \
56 ${CMDLINE_LOGO} \
57 ${CMDLINE_PITFT} \
58 ${CMDLINE_DEBUG} \
Andrew Geissler5199d832021-09-24 16:47:35 -050059 ${CMDLINE_RNDIS} \
Andrew Geissler26e4bea2020-11-30 19:54:03 -060060 "
61
62do_compile() {
Patrick Williams92b42cb2022-09-03 06:53:57 -050063 echo "${@' '.join(d.getVar('CMDLINE').split())}" > "${WORKDIR}/cmdline.txt"
Andrew Geissler26e4bea2020-11-30 19:54:03 -060064}
65
66do_deploy() {
67 install -d "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
68 install -m 0644 "${WORKDIR}/cmdline.txt" "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
69}
70
71addtask deploy before do_build after do_install
72do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
Andrew Geisslera4353c82021-06-25 14:23:27 -050073
74PACKAGE_ARCH = "${MACHINE_ARCH}"