blob: 0e1620f1ad0b70f7e92c18f815c8bbf1ba232c61 [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 tmpfiles
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
newtmpfiles "${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
}