Fix login CLI

This commit is contained in:
Pascal Vizeli 2018-04-16 23:41:13 +02:00
parent e3dfcb8309
commit a0c21ec319
4 changed files with 14 additions and 6 deletions

View File

@ -8,5 +8,6 @@ BOARD_DIR="$(dirname $0)"
# HassioOS tasks
fix_rootfs
install_hassio_cli
cp ${BOARD_DIR}/rauc.conf ${TARGET_DIR}/etc/rauc/system.conf

View File

@ -1,3 +1,3 @@
[Service]
ExecStart=
ExecStart=-/sbin/mingetty --noclear %I
ExecStart=/sbin/mingetty --noclear %I

View File

@ -3,19 +3,20 @@
# Load configs
CONFIG_FILE=/mnt/data/hassio.json
CLI="$(jq --raw-output '.cli' $CONFIG_FILE)"
DOCKER_ARGS="$(jq --raw-output '.cli_args // empty' $CONFIG_FILE)"
CLI="$(jq --raw-output '.cli' ${CONFIG_FILE})"
DOCKER_ARGS="$(jq --raw-output '.cli_args // empty' ${CONFIG_FILE})"
CLI_DATA=/mnt/data/cli
##
# Main program
run_cli() {
# Run CLI
docker rm --force cli || true
docker run --name cli \
--rm -ti --init \
-v $CLI_DATA:/data \
-v ${CLI_DATA}:/data \
$DOCKER_ARGS \
$CLI
${CLI}
# Jump to root shell
if [ $? -eq 10 ]; then
@ -25,7 +26,7 @@ run_cli() {
##
# Run endless CLI
mkdir -p $CLI_DATA
mkdir -p ${CLI_DATA}
while true; do
run_cli

View File

@ -6,3 +6,9 @@ function fix_rootfs() {
rm -rf ${TARGET_DIR}/etc/systemd/system/multi-user.target.wants/dhcpcd.service
rm -rf ${TARGET_DIR}/usr/lib/systemd/system/dhcpcd.service
}
function install_hassio_cli() {
sed -i "s|\(root.*\)/bin/sh|\1/usr/bin/hassio-cli|" ${TARGET_DIR}/etc/passwd
}