Attempt at making init scripts container aware

This commit is contained in:
2017-11-26 17:09:27 -06:00
parent f977ad5793
commit 008c9f186a
10 changed files with 60 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e
@@ -7,25 +7,22 @@ case $1 in
exit 0
;;
postinst)
if [[ ${TARGET} ]]; then
chroot ${TARGET} update-rc required
else
update-rc required
update-rc required
if [ ! -f /etc/fstab ]; then
cp /usr/share/initscripts/fstab /etc/fstab
fi
if [ ! -f ${TARGET}/etc/modules.conf ]; then
cp ${TARGET}/usr/share/initscripts/modules.conf \
${TARGET}/etc/modules.conf
if [ ! -f /etc/modules.conf ]; then
cp /usr/share/initscripts/modules.conf /etc/modules.conf
fi
if [ ! -f ${TARGET}/etc/default/halt ]; then
cp ${TARGET}/usr/share/initscripts/halt.default \
${TARGET}/etc/default/halt
if [ ! -f /etc/default/halt ]; then
cp /usr/share/initscripts/halt.default /etc/default/halt
fi
if [ ! -f ${TARGET}/etc/default/rcS ]; then
cp ${TARGET}/usr/share/initscripts/rcS.default \
${TARGET}/etc/default/rcS
if [ ! -f /etc/default/rcS ]; then
cp /usr/share/initscripts/rcS.default /etc/default/rcS
fi
;;
prerm)