diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules b/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules new file mode 100644 index 000000000..b35419fb5 --- /dev/null +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules @@ -0,0 +1,22 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Boot partitions +SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="kernels?", ACTION=="add", RUN+="/etc/udev/scripts/mount_bootparts.sh", GOTO="automount_rules_end" + +# Media automounting +SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" +LABEL="automount_rules_end" diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_bootparts.sh b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_bootparts.sh new file mode 100644 index 000000000..1e5982d93 --- /dev/null +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_bootparts.sh @@ -0,0 +1,27 @@ +#!/bin/sh +#=============================================================================== +# +# mount_bootparts.sh +# +# Copyright (C) 2014 by Digi International Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published by +# the Free Software Foundation. +# +# !Description: Attempt to mount boot partitions read-only (called from udev) +# +#=============================================================================== + +MOUNT="/bin/mount" + +# Use 'silent' if util-linux's mount (busybox's does not support that option) +[ "$(readlink ${MOUNT})" = "/bin/mount.util-linux" ] && MOUNT="${MOUNT} -o silent" + +MOUNTPOINT="/mnt/${ID_PART_ENTRY_NAME}" +mkdir -p ${MOUNTPOINT} +if ! ${MOUNT} -t auto -r ${DEVNAME} ${MOUNTPOINT}; then + logger -t udev "mount_bootparts.sh: mount ${DEVNAME} under ${MOUNTPOINT} failed!" + rmdir --ignore-fail-on-non-empty ${MOUNTPOINT} +fi diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf_1.0.bbappend b/meta-digi-arm/recipes-core/udev/udev-extraconf_1.0.bbappend index a9f8a94f8..034068d77 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf_1.0.bbappend +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf_1.0.bbappend @@ -4,3 +4,9 @@ PRINC := "${@int(PRINC) + 1}" PR_append = "+${DISTRO}" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://mount_bootparts.sh" + +do_install_append() { + install -m 0755 ${WORKDIR}/mount_bootparts.sh ${D}${sysconfdir}/udev/scripts/ +} diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.21.1/defconfig b/meta-digi-dey/recipes-core/busybox/busybox-1.21.1/defconfig index af79f4dec..82abf1da3 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.21.1/defconfig +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.21.1/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.21.1 -# Fri Feb 14 15:39:27 2014 +# Tue Mar 4 10:56:29 2014 # CONFIG_HAVE_DOT_CONFIG=y @@ -580,7 +580,7 @@ CONFIG_MOUNT=y CONFIG_FEATURE_MOUNT_FAKE=y CONFIG_FEATURE_MOUNT_VERBOSE=y CONFIG_FEATURE_MOUNT_HELPERS=y -# CONFIG_FEATURE_MOUNT_LABEL is not set +CONFIG_FEATURE_MOUNT_LABEL=y CONFIG_FEATURE_MOUNT_NFS=y CONFIG_FEATURE_MOUNT_CIFS=y CONFIG_FEATURE_MOUNT_FLAGS=y