summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Shapiro <guy.shapiro@mobi-wize.com>2017-08-24 12:10:09 +0300
committerGuy Shapiro <guy.shapiro@mobi-wize.com>2017-08-24 12:29:19 +0300
commit12819a28becb416f8c8b2ed5a61fb7415cd690e5 (patch)
tree53bf4a0e4e114563a808a9f9e638ba12e7360806
parent4e5064a1caae234a2ba755c246803d550234fd2b (diff)
downloadmeta-updater-12819a28becb416f8c8b2ed5a61fb7415cd690e5.tar.gz
Fix cronie and OSTree conflicts
The cronie recipe needs the `/var/spool/cron` directory to operate. Other recipes, such as ntp, modify files in that directory to create periodic jobs. The OSTree image class ignores files on `/var/` as they are system persistent and not managed by OSTree. This commit modifies the cronie recipe to use `/usr/share/cronie-spool/` and makes the image generation class move the files from `/var/spool/cron` into that path.
-rw-r--r--classes/image_types_ostree.bbclass6
-rw-r--r--recipes-extended/cronie/cronie_%.bbappend9
-rw-r--r--recipes-extended/cronie/files/Disable-hard-link-check-by-default.patch32
3 files changed, 47 insertions, 0 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 8c9f262..29f267d 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -82,6 +82,12 @@ IMAGE_CMD_ostree () {
82 ln -sf var/rootdirs/home home 82 ln -sf var/rootdirs/home home
83 fi 83 fi
84 84
85 # Move cron jobs if exist
86 if [ -d "var/spool/cron" ] && [ "$(ls -A var/spool/cron)" ] &&
87 [ -d "usr/share/cronie-spool" ] ; then
88 mv var/spool/cron/* usr/share/cronie-spool/
89 fi
90
85 # Move persistent directories to /var 91 # Move persistent directories to /var
86 dirs="opt mnt media srv" 92 dirs="opt mnt media srv"
87 93
diff --git a/recipes-extended/cronie/cronie_%.bbappend b/recipes-extended/cronie/cronie_%.bbappend
new file mode 100644
index 0000000..18842d6
--- /dev/null
+++ b/recipes-extended/cronie/cronie_%.bbappend
@@ -0,0 +1,9 @@
1
2FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
3SRC_URI += "file://Disable-hard-link-check-by-default.patch "
4export SPOOL_DIR = "${datadir}/cronie-spool"
5FILES_${PN} += "${datadir}/cronie-spool"
6
7do_install_append () {
8 install -d ${D}${datadir}/cronie-spool/
9}
diff --git a/recipes-extended/cronie/files/Disable-hard-link-check-by-default.patch b/recipes-extended/cronie/files/Disable-hard-link-check-by-default.patch
new file mode 100644
index 0000000..cd3bfbe
--- /dev/null
+++ b/recipes-extended/cronie/files/Disable-hard-link-check-by-default.patch
@@ -0,0 +1,32 @@
1From 9ef211dcb89edbad605c49964faf302fb97b6ba9 Mon Sep 17 00:00:00 2001
2From: Guy Shapiro <guy.shapiro@mobi-wize.com>
3Date: Thu, 24 Aug 2017 10:58:14 +0300
4Subject: [PATCH] Disable hard link check by default
5
6Without the "-p" flag, cronie does several checks on the
7crontab files. Those checks prevent crontrab files from being
8editable by unauthorized users.
9One of those checks won't permit loading file that is
10hard link count greater than 1.
11
12When OSTree manages crontab file, it uses hard links.
13All those user checks are irrelevant in the case embedded system, so
14disable them by default.
15
16Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com>
17---
18 crond.sysconfig | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/crond.sysconfig b/crond.sysconfig
22index ee23703..1cb083f 100644
23--- a/crond.sysconfig
24+++ b/crond.sysconfig
25@@ -1,3 +1,3 @@
26 # Settings for the CRON daemon.
27 # CRONDARGS= : any extra command-line startup arguments for crond
28-CRONDARGS=
29+CRONDARGS="-p"
30--
312.1.4
32