mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-27 23:16:31 +00:00
Fix login CLI
This commit is contained in:
parent
e3dfcb8309
commit
a0c21ec319
@ -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
|
||||
|
@ -1,3 +1,3 @@
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/mingetty --noclear %I
|
||||
ExecStart=/sbin/mingetty --noclear %I
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user