shimboot/bootloader/bin/init

37 lines
942 B
Plaintext
Raw Permalink Normal View History

2023-10-02 01:08:31 -05:00
#!/bin/busybox sh
# Copyright 2015 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.
#
# /init script for use in factory install shim.
# Note that this script uses the busybox shell (not bash, not dash).
#original: https://chromium.googlesource.com/chromiumos/platform/initramfs/+/refs/heads/main/factory_shim/init
set -x
2023-11-09 15:13:59 -06:00
detect_tty() {
if [ -f "/bin/frecon-lite" ]; then
export TTY1="/dev/pts/0"
export TTY2="/dev/pts/1"
else
export TTY1="/dev/tty1"
export TTY2="/dev/tty2"
fi
}
2023-10-02 01:08:31 -05:00
setup_environment() {
# Install additional utility programs.
/bin/busybox --install /bin || true
}
main() {
setup_environment
2023-11-09 15:13:59 -06:00
detect_tty
2023-10-02 01:08:31 -05:00
# In case an error is not handled by bootstrapping, stop here
# so that an operator can see installation stop.
2023-11-09 15:13:59 -06:00
exec bootstrap.sh < "$TTY1" >> "$TTY1" 2>&1 || sleep 1d
2023-10-02 01:08:31 -05:00
}
main "$@"
exit 1