From f3cbfc7c99743efd956e8f6108791a19b48d04a7 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Mon, 4 Jul 2022 13:52:50 +0200 Subject: udev-extraconf: remove hotplug rules and scripts hotplug scripts had been broken since commit 523aea31bb7: [ Author: Luka Pivk 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 ] 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 --- recipes-core/udev/files/hotplug.rules | 2 -- recipes-core/udev/files/hotplug.sh | 44 ----------------------------- recipes-core/udev/udev-extraconf_%.bbappend | 12 -------- 3 files changed, 58 deletions(-) delete mode 100644 recipes-core/udev/files/hotplug.rules delete mode 100644 recipes-core/udev/files/hotplug.sh (limited to 'recipes-core') 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 -} -- cgit v1.2.3