mirror of
git://git.yoctoproject.org/meta-raspberrypi.git
synced 2025-07-05 05:04:45 +02:00

Add net.ifnames=0 kernel parameter into CMDLINE and make it possible to override. If we boot the kernel this way, the network interfaces will not be renamed. Otherwise it will be renamed. Without parameter: root@raspberrypi3-64:~# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: enu1u1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel qlen 1000 link/ether b8:27:eb:d9:fd:59 brd ff:ff:ff:ff:ff:ff 3: wlxb827eb8ca80c: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 link/ether b8:27:eb:8c:a8:0c brd ff:ff:ff:ff:ff:ff root@raspberrypi3-64:~# journalctl | grep wlan Feb 27 17:26:08 raspberrypi3-64 kernel: brcmfmac mmc1:0001:1 wlxb827eb8ca80c: renamed from wlan0 Feb 27 17:26:10 raspberrypi3-64 kernel[296]: [ 8.711897] brcmfmac mmc1:0001:1 wlxb827eb8ca80c: renamed from wlan0 With parameter: root@raspberrypi3-64:~# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel qlen 1000 link/ether b8:27:eb:d9:fd:59 brd ff:ff:ff:ff:ff:ff 3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel qlen 1000 link/ether b8:27:eb:8c:a8:0c brd ff:ff:ff:ff:ff:ff Signed-off-by: alperak <alperyasinak1@gmail.com>
79 lines
2.6 KiB
BlitzBasic
79 lines
2.6 KiB
BlitzBasic
SUMMARY = "cmdline.txt file used to boot the kernel on a Raspberry Pi device"
|
|
LICENSE = "MIT"
|
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
|
|
|
COMPATIBLE_MACHINE = "^rpi$"
|
|
INHIBIT_DEFAULT_DEPS = "1"
|
|
inherit deploy nopackages
|
|
|
|
CMDLINE_DWC_OTG ?= "dwc_otg.lpm_enable=0"
|
|
|
|
CMDLINE_ROOT_FSTYPE ?= "rootfstype=ext4"
|
|
CMDLINE_ROOT_PARTITION ?= "/dev/mmcblk0p2"
|
|
|
|
CMDLINE_ROOTFS ?= "root=${CMDLINE_ROOT_PARTITION} ${CMDLINE_ROOT_FSTYPE} rootwait"
|
|
|
|
CMDLINE_SERIAL ?= "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}"
|
|
|
|
CMDLINE_PITFT ?= "${@bb.utils.contains("MACHINE_FEATURES", "pitft", "fbcon=map:10 fbcon=font:VGA8x8", "", d)}"
|
|
|
|
# Add the kernel debugger over console kernel command line option if enabled
|
|
CMDLINE_KGDB ?= '${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
|
|
|
|
# Disable rpi logo on boot
|
|
CMDLINE_LOGO ?= '${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}'
|
|
|
|
# You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf
|
|
# to enable kernel debugging.
|
|
CMDLINE_DEBUG ?= ""
|
|
|
|
# Add a request to isolate processors from the Linux scheduler. ISOLATED_CPUS
|
|
# may have the form of a comma separated list of processor numbers "0,1,3", a
|
|
# range "0-2", a combination of the two "0-1,3", or a single processor you may
|
|
# not specify ALL processors simultaneously
|
|
def setup_isolcpus(d):
|
|
string = ""
|
|
if d.getVar('ISOLATED_CPUS'):
|
|
string = 'isolcpus=' + d.getVar('ISOLATED_CPUS')
|
|
return string
|
|
|
|
CMDLINE_ISOL_CPUS ?= "${@setup_isolcpus(d)}"
|
|
|
|
# Add RNDIS capabilities (must be after rootwait)
|
|
# example:
|
|
# CMDLINE_RNDIS = "modules-load=dwc2,g_ether g_ether.host_addr=<some MAC
|
|
# address> g_ether.dev_addr=<some MAC address>"
|
|
# if the MAC addresses are omitted, random values will be used
|
|
CMDLINE_RNDIS ?= ""
|
|
|
|
# That allows to keep the traditional network interface names
|
|
CMDLINE_IFNAMES ?= "net.ifnames=0"
|
|
|
|
CMDLINE = " \
|
|
${CMDLINE_ISOL_CPUS} \
|
|
${CMDLINE_DWC_OTG} \
|
|
${CMDLINE_SERIAL} \
|
|
${CMDLINE_ROOTFS} \
|
|
${CMDLINE_CMA} \
|
|
${CMDLINE_KGDB} \
|
|
${CMDLINE_LOGO} \
|
|
${CMDLINE_PITFT} \
|
|
${CMDLINE_DEBUG} \
|
|
${CMDLINE_RNDIS} \
|
|
${CMDLINE_IFNAMES} \
|
|
"
|
|
|
|
do_compile() {
|
|
echo "${@' '.join(d.getVar('CMDLINE').split())}" > "${WORKDIR}/cmdline.txt"
|
|
}
|
|
|
|
do_deploy() {
|
|
install -d "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
|
|
install -m 0644 "${WORKDIR}/cmdline.txt" "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
|
|
}
|
|
|
|
addtask deploy before do_build after do_install
|
|
do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
|
|
|
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|