summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2017-01-02 12:00:45 +0100
committerGatis Paeglis <gatis.paeglis@qt.io>2017-01-05 08:50:38 +0000
commit21703b921dc113bee64e65e3e63bb5482a15c734 (patch)
treef652b0e14596fda5d2b9968a408da42c961036b8
parent67d7afa9def07eac716ea164fa1a2be101c420de (diff)
Remove the remaining traces of System V support
Support for System V was dropped a while back for the following reasons: - b2qt images have switched to systemd by default, therefore System V code path is untested and can't be officially supported. - supporting anyting else than systemd is not a high priority (if somebody really wants to use some other init system, that can be done with little extra effort). Change-Id: I33295d85ff72af232bf431989b5244f15b62747a Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
-rwxr-xr-xdracut/generate-initramfs26
-rwxr-xr-xdracut/systemv/module-setup.sh37
-rwxr-xr-xdracut/systemv/prepare-root.sh1
-rw-r--r--qt-ostree/ostree-remount.sh40
-rwxr-xr-xqt-ostree/qt-ostree23
5 files changed, 12 insertions, 115 deletions
diff --git a/dracut/generate-initramfs b/dracut/generate-initramfs
index 2e46f21..4471611 100755
--- a/dracut/generate-initramfs
+++ b/dracut/generate-initramfs
@@ -68,11 +68,10 @@ generate_initramfs()
{
MODULE_PATH=/usr/lib/dracut/modules.d/
- substring="No such file or directory"
- output=$("${ADB}" shell ls /lib/systemd/systemd)
- systemd=false
- if [[ $output != *${substring}* ]] ; then
- systemd=true
+ init_system=$(basename $("${ADB}" shell readlink -f /sbin/init) | tr -d '\r')
+ if [ "$init_system" != "systemd" ] ; then
+ echo "error: Failed to detected systemd init support on the image"
+ exit 1
fi
options='/boot/initramfs.img
@@ -82,18 +81,11 @@ generate_initramfs()
--stdlog 3
--force'
- if [ ${systemd} = true ] ; then
- # OSTree ships with a dracut module for systemd based images.
- echo "Generating initramfs for systemd based image ..."
- "${ADB}" push "${ROOT}"/systemd/01-qt.conf /etc/dracut.conf.d/
- "${ADB}" push "${ROOT}"/systemd/e2fsck.conf /etc/
- custom_options="--add systemd --install /etc/e2fsck.conf"
- else
- # Deploy our custom dracut module for systemd-less images.
- echo "WARNING: Failed to detect systemd init support. Using System V as a fallback init system ..."
- "${ADB}" push "${ROOT}"/systemv/ "${MODULE_PATH}"/98ostree/
- custom_options="--omit systemd"
- fi
+ # OSTree ships with a dracut module for systemd based images.
+ echo "Generating initramfs for systemd based image ..."
+ "${ADB}" push "${ROOT}"/systemd/01-qt.conf /etc/dracut.conf.d/
+ "${ADB}" push "${ROOT}"/systemd/e2fsck.conf /etc/
+ custom_options="--add systemd --install /etc/e2fsck.conf"
# Recovery module parts
#"${ADB}" push "${ROOT}"/recovery/ "${MODULE_PATH}"/98recovery/
diff --git a/dracut/systemv/module-setup.sh b/dracut/systemv/module-setup.sh
deleted file mode 100755
index def4f70..0000000
--- a/dracut/systemv/module-setup.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
-##
-## This file is part of the Qt Enterprise Embedded Scripts of the Qt
-## framework.
-##
-## $QT_BEGIN_LICENSE$
-## Commercial License Usage Only
-## Licensees holding valid commercial Qt license agreements with Digia
-## with an appropriate addendum covering the Qt Enterprise Embedded Scripts,
-## may use this file in accordance with the terms contained in said license
-## agreement.
-##
-## For further information use the contact form at
-## http://www.qt.io/contact-us.
-##
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-check() {
- if [ -x /usr/sbin/ostree-prepare-root ]; then
- return 255
- fi
-
- return 1
-}
-
-depends() {
- return 0
-}
-
-install() {
- inst_hook cleanup 20 "$moddir/prepare-root.sh"
- inst_multiple ostree-prepare-root
-}
diff --git a/dracut/systemv/prepare-root.sh b/dracut/systemv/prepare-root.sh
deleted file mode 100755
index a9b4b42..0000000
--- a/dracut/systemv/prepare-root.sh
+++ /dev/null
@@ -1 +0,0 @@
-/usr/sbin/ostree-prepare-root /sysroot
diff --git a/qt-ostree/ostree-remount.sh b/qt-ostree/ostree-remount.sh
deleted file mode 100644
index 40e5e86..0000000
--- a/qt-ostree/ostree-remount.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the Qt OTA Update module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 or (at your option) any later version
-## approved by the KDE Free Qt Foundation. The licenses are as published by
-## the Free Software Foundation and appearing in the file LICENSE.GPL3
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-# This script is used by system V init system in ostree based images.
-case "$1" in
-start)
- /usr/sbin/ostree-remount
- ;;
-*)
- echo "Usage: $0 start"
- exit 1
-esac
-exit 0
diff --git a/qt-ostree/qt-ostree b/qt-ostree/qt-ostree
index a5b4798..295f321 100755
--- a/qt-ostree/qt-ostree
+++ b/qt-ostree/qt-ostree
@@ -723,26 +723,9 @@ convert_to_ostree_sysroot()
echo "PRETTY_NAME=\"${OS_NAME}\"" > ${GENERATED_TREE}/etc/os-release
fi
- systemd=false
- cd ${GENERATED_TREE}
- if [ -e lib/systemd/systemd ] ; then
- systemd=true
- qt_ostree_info "Detected systemd init support on the image"
- fi
-
- if [ ${systemd} = false ] ; then
- qt_ostree_warning "Failed to detect systemd init support. Using System V as a fallback init system."
- # Run ostree-remount on startup. This makes sure that
- # rw/ro mounts are set correctly for ostree to work.
- cp ${ROOT}/ostree-remount.sh etc/init.d/
- chmod +x etc/init.d/ostree-remount.sh
- # System V init services are started in alphanumeric order. We want to remount
- # things as early as possible so we prepend 'a' in S01[a]ostree-remount.sh
- ln -fs ../init.d/ostree-remount.sh etc/rc1.d/S01aostree-remount.sh
- ln -fs ../init.d/ostree-remount.sh etc/rc2.d/S01aostree-remount.sh
- ln -fs ../init.d/ostree-remount.sh etc/rc3.d/S01aostree-remount.sh
- ln -fs ../init.d/ostree-remount.sh etc/rc4.d/S01aostree-remount.sh
- ln -fs ../init.d/ostree-remount.sh etc/rc5.d/S01aostree-remount.sh
+ init_system=$(basename $(readlink -f ${GENERATED_TREE}/sbin/init))
+ if [ "$init_system" != "systemd" ] ; then
+ qt_ostree_error "Failed to detected systemd init support on the image"
fi
adjust_sysroot_layout