mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 07:26:28 +00:00
Fix login CLI
This commit is contained in:
parent
e3dfcb8309
commit
a0c21ec319
@ -8,5 +8,6 @@ BOARD_DIR="$(dirname $0)"
|
|||||||
|
|
||||||
# HassioOS tasks
|
# HassioOS tasks
|
||||||
fix_rootfs
|
fix_rootfs
|
||||||
|
install_hassio_cli
|
||||||
|
|
||||||
cp ${BOARD_DIR}/rauc.conf ${TARGET_DIR}/etc/rauc/system.conf
|
cp ${BOARD_DIR}/rauc.conf ${TARGET_DIR}/etc/rauc/system.conf
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
[Service]
|
[Service]
|
||||||
ExecStart=
|
ExecStart=
|
||||||
ExecStart=-/sbin/mingetty --noclear %I
|
ExecStart=/sbin/mingetty --noclear %I
|
||||||
|
@ -3,19 +3,20 @@
|
|||||||
# Load configs
|
# Load configs
|
||||||
CONFIG_FILE=/mnt/data/hassio.json
|
CONFIG_FILE=/mnt/data/hassio.json
|
||||||
|
|
||||||
CLI="$(jq --raw-output '.cli' $CONFIG_FILE)"
|
CLI="$(jq --raw-output '.cli' ${CONFIG_FILE})"
|
||||||
DOCKER_ARGS="$(jq --raw-output '.cli_args // empty' $CONFIG_FILE)"
|
DOCKER_ARGS="$(jq --raw-output '.cli_args // empty' ${CONFIG_FILE})"
|
||||||
CLI_DATA=/mnt/data/cli
|
CLI_DATA=/mnt/data/cli
|
||||||
|
|
||||||
##
|
##
|
||||||
# Main program
|
# Main program
|
||||||
run_cli() {
|
run_cli() {
|
||||||
# Run CLI
|
# Run CLI
|
||||||
|
docker rm --force cli || true
|
||||||
docker run --name cli \
|
docker run --name cli \
|
||||||
--rm -ti --init \
|
--rm -ti --init \
|
||||||
-v $CLI_DATA:/data \
|
-v ${CLI_DATA}:/data \
|
||||||
$DOCKER_ARGS \
|
$DOCKER_ARGS \
|
||||||
$CLI
|
${CLI}
|
||||||
|
|
||||||
# Jump to root shell
|
# Jump to root shell
|
||||||
if [ $? -eq 10 ]; then
|
if [ $? -eq 10 ]; then
|
||||||
@ -25,7 +26,7 @@ run_cli() {
|
|||||||
|
|
||||||
##
|
##
|
||||||
# Run endless CLI
|
# Run endless CLI
|
||||||
mkdir -p $CLI_DATA
|
mkdir -p ${CLI_DATA}
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
run_cli
|
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}/etc/systemd/system/multi-user.target.wants/dhcpcd.service
|
||||||
rm -rf ${TARGET_DIR}/usr/lib/systemd/system/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