blob: 89d874cce32bb69873a611d61e9c7501e7bb8979 [file] [log] [blame]
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
EAPI="5"
inherit systemd user
DESCRIPTION="Dev image init scripts for Lakitu"
HOMEPAGE=""
SRC_URI=""
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="*"
IUSE="+serial-getty -serial-getty-autologin"
RDEPEND="${DEPEND}
sys-apps/systemd
"
getty_console() {
case ${ARCH} in
amd64) echo "ttyS1";;
arm64) echo "ttyAMA1";;
*) eerror "unsupported architecture: ${ARCH}";;
esac
}
S="${WORKDIR}"
src_install() {
systemd_dounit "${FILESDIR}"/usr-local.mount
systemd_enable_service local-fs.target usr-local.mount
systemd_dounit "${FILESDIR}"/usr-local-remount.service
systemd_newtmpfilesd "${FILESDIR}"/dev-image.tmpfiles dev-image.conf
use serial-getty && systemd_enable_service getty.target serial-getty@$(getty_console).service
use serial-getty-autologin && systemd_install_serviced \
"${FILESDIR}"/serial-getty.service.conf serial-getty@$(getty_console).service
}