summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2012-09-30 18:19:49 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-09-30 18:19:49 +0200
commit19da29a60408f9000e8db7aefff55d254e54152d (patch)
tree2cb19bd716c933b91d2c2fe661a9668503cafb68
parent2c117c8065660f45367d5d7d11c441fbe23bd6fe (diff)
downloadptxdist-19da29a60408f9000e8db7aefff55d254e54152d.tar.gz
ptxdist-19da29a60408f9000e8db7aefff55d254e54152d.tar.xz
fake-overlayfs: add systemd support
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--generic/etc/init.d/fake-overlayfs31
-rw-r--r--generic/lib/systemd/system/fake-overlayfs.service11
-rw-r--r--generic/sbin/fake-overlayfs25
-rw-r--r--rules/fake-overlayfs.make15
4 files changed, 50 insertions, 32 deletions
diff --git a/generic/etc/init.d/fake-overlayfs b/generic/etc/init.d/fake-overlayfs
index a09ca063c..c579f84af 100644
--- a/generic/etc/init.d/fake-overlayfs
+++ b/generic/etc/init.d/fake-overlayfs
@@ -4,40 +4,11 @@
# /etc/init.d/fake-overlay
#
-OVERLAY_DIRS="@OVERLAY_DIRLIST@"
-
-bdir=/tmp/.fake-overlay-root
-
-fake_overlay() {
- mkdir $bdir
- mount -o bind,ro / $bdir
- IFS=:
- set $OVERLAY_DIRS
- while [ $# -gt 0 ]; do
- if [ -z "$1" ]; then
- shift
- continue
- fi
- echo $1
- src="$bdir$1"
- dst="$1/"
- test -e "$dst" || mkdir $dst
- cp -a "$src/"* "$src/".[^.]* "$src/"..?* $dst 2> /dev/null
- shift
- done
- umount $bdir
- rmdir $bdir
-}
-
-#
-# Main
-#
-
case $1 in
start)
echo "${PREFIX}copying files to tmpfs..."
- fake_overlay
+ /sbin/fake_overlay
;;
stop)
;;
diff --git a/generic/lib/systemd/system/fake-overlayfs.service b/generic/lib/systemd/system/fake-overlayfs.service
new file mode 100644
index 000000000..242805124
--- /dev/null
+++ b/generic/lib/systemd/system/fake-overlayfs.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Fake Overlay Filesystem
+DefaultDependencies=no
+After=local-fs.target
+Requires=local-fs.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=no
+ExecStart=/sbin/fake-overlayfs
+
diff --git a/generic/sbin/fake-overlayfs b/generic/sbin/fake-overlayfs
new file mode 100644
index 000000000..5e3c44314
--- /dev/null
+++ b/generic/sbin/fake-overlayfs
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+OVERLAY_DIRS="@OVERLAY_DIRLIST@"
+
+bdir=/tmp/.fake-overlay-root
+
+mkdir $bdir
+mount -o bind,ro / $bdir
+IFS=:
+set $OVERLAY_DIRS
+while [ $# -gt 0 ]; do
+ if [ -z "$1" ]; then
+ shift
+ continue
+ fi
+ echo $1
+ src="$bdir$1"
+ dst="$1/"
+ test -e "$dst" || mkdir $dst
+ cp -a "$src/"* "$src/".[^.]* "$src/"..?* $dst 2> /dev/null
+ shift
+done
+umount $bdir
+rmdir $bdir
+
diff --git a/rules/fake-overlayfs.make b/rules/fake-overlayfs.make
index 54227fc01..7c81d4b60 100644
--- a/rules/fake-overlayfs.make
+++ b/rules/fake-overlayfs.make
@@ -49,15 +49,26 @@ $(STATEDIR)/fake-overlayfs.targetinstall:
@$(call install_fixup, fake-overlayfs,DESCRIPTION,missing)
@$(call install_alternative, fake-overlayfs, 0, 0, 0755, \
- /etc/init.d/fake-overlayfs)
- @$(call install_replace, fake-overlayfs, /etc/init.d/fake-overlayfs, \
+ /sbin/fake-overlayfs)
+ @$(call install_replace, fake-overlayfs, /sbin/fake-overlayfs, \
@OVERLAY_DIRLIST@, $(FAKE_OVERLAYFS_DIRS))
+ifdef PTXCONF_INITMETHOD_BBINIT
+ @$(call install_alternative, fake-overlayfs, 0, 0, 0755, \
+ /etc/init.d/fake-overlayfs)
+
ifneq ($(call remove_quotes,$(PTXCONF_FAKE_OVERLAYFS_BBINIT_LINK)),)
@$(call install_link, fake-overlayfs, \
../init.d/fake-overlayfs, \
/etc/rc.d/$(PTXCONF_FAKE_OVERLAYFS_BBINIT_LINK))
endif
+endif
+ifdef PTXCONF_LIGHTTPD_SYSTEMD_UNIT
+ @$(call install_alternative, fake-overlayfs, 0, 0, 0644, \
+ /lib/systemd/system/fake-overlayfs.service)
+ @$(call install_link, fake-overlayfs, ../fake-overlayfs.service, \
+ /lib/systemd/system/sysinit.target.wants/fake-overlayfs.service)
+endif
@$(call install_finish, fake-overlayfs)