summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
authorMing Liu <ming.liu@toradex.com>2022-07-04 13:52:50 +0200
committerMing Liu <ming.liu@toradex.com>2022-07-17 17:28:53 +0200
commitf3cbfc7c99743efd956e8f6108791a19b48d04a7 (patch)
treedfc8696b8f2c841e8c4eabfa0ea96158ca2e5cda /recipes-core
parent18f7a36452663dedd9b6f6e6377bc68890b5604c (diff)
udev-extraconf: remove hotplug rules and scripts
hotplug scripts had been broken since commit 523aea31bb7: [ Author: Luka Pivk <luka.pivk@toradex.com> Date: Fri Mar 6 16:01:52 2020 +0100 hostname: generate a uniqe hostname on boot This will generate a hostname based on machine name and serial number. (E.g. colibri-imx7-031111777) If serial number is not found it will say "no-serial-number" in host name. If machine is not supported hostname will include "unsupported-device" string. If /dev/device-tree does not exist it will say "recovery-mode" as it assumes its in recovery mode of Toradex Easy Installer To prevent openembedded from creating /etc/hostname file add hostname_pn-base-files = "" to configration Related-to: TEI-100, ELB-1322 Signed-off-by: Luka Pivk <luka.pivk@toradex.com> ] since the conditional checking for `uname -n` equals to machine name in hotplug.sh are compeletely wrong, they would never match because the output of `uname -n` now are machine names plus serial numers. So let's drop them, which should be safe since nobody complaint that. Signed-off-by: Ming Liu <ming.liu@toradex.com>
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/udev/files/hotplug.rules2
-rw-r--r--recipes-core/udev/files/hotplug.sh44
-rw-r--r--recipes-core/udev/udev-extraconf_%.bbappend12
3 files changed, 0 insertions, 58 deletions
diff --git a/recipes-core/udev/files/hotplug.rules b/recipes-core/udev/files/hotplug.rules
deleted file mode 100644
index a36a47d..0000000
--- a/recipes-core/udev/files/hotplug.rules
+++ /dev/null
@@ -1,2 +0,0 @@
-# SD card hotplug configuration of read_ahead cache size
-KERNEL=="mmcblk?", ACTION=="add" RUN+="/etc/udev/scripts/hotplug.sh"
diff --git a/recipes-core/udev/files/hotplug.sh b/recipes-core/udev/files/hotplug.sh
deleted file mode 100644
index 9d9fd89..0000000
--- a/recipes-core/udev/files/hotplug.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-#
-# Called from udev
-#
-# Set the read_ahead cache size of SD card on hotplug
-
-SYSNAME=$(uname -n)
-DISKNUM=$(echo $DEVNAME | sed -e 's/\(^.*\)\(.$\)/\2/')
-DISKNAME=$(echo $DEVNAME | sed 's/.*\///g;s/p.*//g')
-CORES=$(cat /proc/cpuinfo | grep processor | wc -l)
-
-set_read_ahead_size () {
- if [ $DISKNUM == "0" ]; then #eMMC
- echo $1 > /sys/block/$DISKNAME/queue/read_ahead_kb
- else #SD card
- echo $2 > /sys/block/$DISKNAME/queue/read_ahead_kb
- fi
-}
-
-if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ "$DEVTYPE" = "disk" ]; then
- #Set read_ahead cache of mmcblk? SD card
- if test -e /sys/block/$DISKNAME/queue/read_ahead_kb
- then
- if [ $SYSNAME == "colibri-imx6" ]; then
- if [ $CORES -eq 1 ]; then #imx6s
- set_read_ahead_size 512 512
- else #imx6dl
- set_read_ahead_size 1024 512
- fi
- elif [ $SYSNAME == "apalis-imx6" ]; then
- if [ $CORES -eq 2 ]; then #imx6d
- set_read_ahead_size 1024 512
- else #imx6q
- set_read_ahead_size 1024 512
- fi
- elif [ $SYSNAME == "apalis-tk1" ]; then
- set_read_ahead_size 4096 1024
- else
- logger "sd_hotplug.sh" "System name not compatible"
- fi
- else
- logger "sd_hotplug" "No read_ahead_kb configuration file found"
- fi
-fi
diff --git a/recipes-core/udev/udev-extraconf_%.bbappend b/recipes-core/udev/udev-extraconf_%.bbappend
index 0a380a8..fe459da 100644
--- a/recipes-core/udev/udev-extraconf_%.bbappend
+++ b/recipes-core/udev/udev-extraconf_%.bbappend
@@ -1,13 +1 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files/:"
-
-SRC_URI:append:tdx = " file://hotplug.rules \
- file://hotplug.sh \
-"
-
-do_install:append:tdx () {
- install -d ${D}${sysconfdir}/udev/rules.d
- install -m 0644 ${WORKDIR}/hotplug.rules ${D}${sysconfdir}/udev/rules.d/hotplug.rules
-
- install -d ${D}${sysconfdir}/udev/scripts/
- install -m 0755 ${WORKDIR}/hotplug.sh ${D}${sysconfdir}/udev/scripts/hotplug.sh
-}