Andrew Geissler | 26e4bea | 2020-11-30 19:54:03 -0600 | [diff] [blame] | 1 | SUMMARY = "cmdline.txt file used to boot the kernel on a Raspberry Pi device" |
| 2 | LICENSE = "MIT" |
| 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
| 4 | |
| 5 | COMPATIBLE_MACHINE = "^rpi$" |
| 6 | INHIBIT_DEFAULT_DEPS = "1" |
| 7 | inherit deploy nopackages |
| 8 | |
| 9 | CMDLINE_DWC_OTG ?= "dwc_otg.lpm_enable=0" |
Andrew Geissler | ad7fa35 | 2021-07-23 12:55:23 -0400 | [diff] [blame] | 10 | |
| 11 | CMDLINE_ROOT_FSTYPE ?= "rootfstype=ext4" |
| 12 | CMDLINE_ROOTFS ?= "root=/dev/mmcblk0p2 ${CMDLINE_ROOT_FSTYPE} rootwait" |
Andrew Geissler | 26e4bea | 2020-11-30 19:54:03 -0600 | [diff] [blame] | 13 | |
| 14 | CMDLINE_SERIAL ?= "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}" |
| 15 | |
Andrew Geissler | 26e4bea | 2020-11-30 19:54:03 -0600 | [diff] [blame] | 16 | CMDLINE_PITFT ?= "${@bb.utils.contains("MACHINE_FEATURES", "pitft", "fbcon=map:10 fbcon=font:VGA8x8", "", d)}" |
| 17 | |
| 18 | # Add the kernel debugger over console kernel command line option if enabled |
| 19 | CMDLINE_KGDB ?= '${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}' |
| 20 | |
| 21 | # Disable rpi logo on boot |
| 22 | CMDLINE_LOGO ?= '${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}' |
| 23 | |
| 24 | # You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf |
| 25 | # to enable kernel debugging. |
| 26 | CMDLINE_DEBUG ?= "" |
| 27 | |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 28 | # Add a request to isolate processors from the Linux scheduler. ISOLATED_CPUS |
| 29 | # may have the form of a comma separated list of processor numbers "0,1,3", a |
| 30 | # range "0-2", a combination of the two "0-1,3", or a single processor you may |
| 31 | # not specify ALL processors simultaneously |
| 32 | def setup_isolcpus(d): |
| 33 | string = "" |
| 34 | if d.getVar('ISOLATED_CPUS'): |
| 35 | string = 'isolcpus=' + d.getVar('ISOLATED_CPUS') |
| 36 | return string |
| 37 | |
| 38 | CMDLINE_ISOL_CPUS ?= "${@setup_isolcpus(d)}" |
| 39 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 40 | # Add RNDIS capabilities (must be after rootwait) |
| 41 | # example: |
| 42 | # CMDLINE_RNDIS = "modules-load=dwc2,g_ether g_ether.host_addr=<some MAC |
| 43 | # address> g_ether.dev_addr=<some MAC address>" |
| 44 | # if the MAC addresses are omitted, random values will be used |
| 45 | CMDLINE_RNDIS ?= "" |
| 46 | |
Andrew Geissler | 26e4bea | 2020-11-30 19:54:03 -0600 | [diff] [blame] | 47 | CMDLINE = " \ |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 48 | ${CMDLINE_ISOL_CPUS} \ |
Andrew Geissler | 26e4bea | 2020-11-30 19:54:03 -0600 | [diff] [blame] | 49 | ${CMDLINE_DWC_OTG} \ |
| 50 | ${CMDLINE_SERIAL} \ |
| 51 | ${CMDLINE_ROOTFS} \ |
| 52 | ${CMDLINE_CMA} \ |
| 53 | ${CMDLINE_KGDB} \ |
| 54 | ${CMDLINE_LOGO} \ |
| 55 | ${CMDLINE_PITFT} \ |
| 56 | ${CMDLINE_DEBUG} \ |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 57 | ${CMDLINE_RNDIS} \ |
Andrew Geissler | 26e4bea | 2020-11-30 19:54:03 -0600 | [diff] [blame] | 58 | " |
| 59 | |
| 60 | do_compile() { |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 61 | echo "${@' '.join(d.getVar('CMDLINE').split())}" > "${WORKDIR}/cmdline.txt" |
Andrew Geissler | 26e4bea | 2020-11-30 19:54:03 -0600 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | do_deploy() { |
| 65 | install -d "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}" |
| 66 | install -m 0644 "${WORKDIR}/cmdline.txt" "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}" |
| 67 | } |
| 68 | |
| 69 | addtask deploy before do_build after do_install |
| 70 | do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}" |
Andrew Geissler | a4353c8 | 2021-06-25 14:23:27 -0500 | [diff] [blame] | 71 | |
| 72 | PACKAGE_ARCH = "${MACHINE_ARCH}" |