summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb')
-rw-r--r--meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb b/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
new file mode 100644
index 0000000000..0e0410043b
--- /dev/null
+++ b/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
@@ -0,0 +1,36 @@
1SUMMARY = "Provider of the machine specific securetty file"
2SECTION = "base utils"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5
6INHIBIT_DEFAULT_DEPS = "1"
7
8PR = "r3"
9
10SRC_URI = "file://securetty"
11
12# Since SERIAL_CONSOLES is likely to be set from the machine configuration
13PACKAGE_ARCH = "${MACHINE_ARCH}"
14
15do_install () {
16 # Ensure we add a suitable securetty file to the package that has
17 # most common embedded TTYs defined.
18 install -d ${D}${sysconfdir}
19 install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty
20 if [ ! -z "${SERIAL_CONSOLES}" ]; then
21 # Our SERIAL_CONSOLES contains a baud rate and sometimes extra
22 # options as well. The following pearl :) takes that and converts
23 # it into newline-separated tty's and appends them into
24 # securetty. So if a machine has a weird looking console device
25 # node (e.g. ttyAMA0) that securetty does not know, it will get
26 # appended to securetty and root logins will be allowed on that
27 # console.
28 tmp="${SERIAL_CONSOLES}"
29 for entry in $tmp ; do
30 ttydev=`echo "$entry" | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
31 if ! grep -q $ttydev ${D}${sysconfdir}/securetty; then
32 echo $ttydev >> ${D}${sysconfdir}/securetty
33 fi
34 done
35 fi
36}