summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-04-30 15:32:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-02 17:41:54 +0100
commit4ea0449039517490688bc7ede7766e730af897d8 (patch)
tree323af27a9078dca56ff6f9b55ad9751373662012 /meta
parentc58cfcefced6afcb1381d3571e612d1b8712f531 (diff)
downloadpoky-4ea0449039517490688bc7ede7766e730af897d8.tar.gz
shadow-securetty: change to handle SERIAL_CONSOLES
SERIAL_CONSOLES is now set from SERIAL_CONSOLE if not already set. This change also installs the file before modifying it in place, allowing do_install to re-execute properly. (From OE-Core rev: 013a1e304e6845eda97b94d133ad75bbccff0b9a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/shadow/shadow-securetty_4.1.4.3.bb20
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/recipes-extended/shadow/shadow-securetty_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow-securetty_4.1.4.3.bb
index 86b5c8978a..4a1f79f8e5 100644
--- a/meta/recipes-extended/shadow/shadow-securetty_4.1.4.3.bb
+++ b/meta/recipes-extended/shadow/shadow-securetty_4.1.4.3.bb
@@ -10,22 +10,28 @@ PR = "r2"
10 10
11SRC_URI = "file://securetty" 11SRC_URI = "file://securetty"
12 12
13# Since we deduce our arch from ${SERIAL_CONSOLE} 13# Since SERIAL_CONSOLES is likely to be set from the machine configuration
14PACKAGE_ARCH = "${MACHINE_ARCH}" 14PACKAGE_ARCH = "${MACHINE_ARCH}"
15 15
16do_install () { 16do_install () {
17 # Ensure we add a suitable securetty file to the package that has 17 # Ensure we add a suitable securetty file to the package that has
18 # most common embedded TTYs defined. 18 # most common embedded TTYs defined.
19 if [ ! -z "${SERIAL_CONSOLE}" ]; then 19 install -d ${D}${sysconfdir}
20 # Our SERIAL_CONSOLE contains a baud rate and sometimes a -L 20 install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty
21 # option as well. The following pearl :) takes that and converts 21 if [ ! -z "${SERIAL_CONSOLES}" ]; then
22 # Our SERIAL_CONSOLES contains a baud rate and sometimes extra
23 # options as well. The following pearl :) takes that and converts
22 # it into newline-separated tty's and appends them into 24 # it into newline-separated tty's and appends them into
23 # securetty. So if a machine has a weird looking console device 25 # securetty. So if a machine has a weird looking console device
24 # node (e.g. ttyAMA0) that securetty does not know, it will get 26 # node (e.g. ttyAMA0) that securetty does not know, it will get
25 # appended to securetty and root logins will be allowed on that 27 # appended to securetty and root logins will be allowed on that
26 # console. 28 # console.
27 echo "${SERIAL_CONSOLE}" | sed -e 's/[0-9][0-9]\|\-L//g'|tr "[ ]" "[\n]" >> ${WORKDIR}/securetty 29 tmp="${SERIAL_CONSOLES}"
30 for entry in $tmp ; do
31 ttydev=`echo "$entry" | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
32 if ! grep -q $ttydev ${D}${sysconfdir}/securetty; then
33 echo $ttydev >> ${D}${sysconfdir}/securetty
34 fi
35 done
28 fi 36 fi
29 install -d ${D}${sysconfdir}
30 install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty
31} 37}