cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
428 Views
Registered: ‎11-27-2018

Petalinux: How to modify the file "/proc/sys/kernel/hotplug"

Hi all, I've a Zynq7020 custom board with petalinux 2018.2, I want to enable the hot plug function of the SDCARD, so I've to insert a line "mdev -s" into the file "/proc/sys/kernel/hotplug".

I've modified the file "/etc/fstab" follow this link:

SD-Card-Automount-with-fstab-petalinux

But I don't understand how the system know where the file fstab to place, how the path "/etc" is determined?

If I want to modify "/proc/sys/kernel/hotplug", what should I do?

Thanks.

0 Kudos
1 Reply
Highlighted
Participant
Participant
393 Views
Registered: ‎11-27-2018

I created a installation project using the command:

petalinux-create -t apps -n myconf --template install --enable

and pug a file hotplug in folder files, which has a line:

mdev -s

and modified the file myconf.bb like this:

# This file is the myconf recipe.
#

SUMMARY = "Simple myconf application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://myconf \
	file://mdev.conf \
	file://sd_card_inserting \
	file://sd_card_removing \
	file://hotplug \
	"

FILES_${PN} += "/proc/sys/kernel/*"

S = "${WORKDIR}"

do_install() {
#	     install -d ${D}/${bindir}
#	     install -m 0755 ${S}/myconf ${D}/${bindir}
	install -d ${D}${sysconfdir}
	install -m 0755 ${S}/sd_card_inserting ${D}${sysconfdir}/sd_card_inserting
	install -m 0755 ${S}/sd_card_removing  ${D}${sysconfdir}/sd_card_removing
	install -m 0644 ${S}/mdev.conf         ${D}${sysconfdir}/mdev.conf
        install -d ${D}/proc/sys/kernel
        install -m 0644 ${S}/hotplug ${D}/proc/sys/kernel/hotplug
}

After typing petalinux-build -c myconf, and petalinux-build, there is no error. And I checked the file rootfs.tar.gz, there do has a file /proc/sys/kernel/hotplug, with a line "mdev -s" in it.

But after burn the flash and reboot, the file /proc/sys/kernel/hotplug is empty.

Any hints? Thanks in advance.

0 Kudos