shimboot/bootloader/bin/bootstrap.sh

40 lines
1.1 KiB
Bash

#!/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.
#
# To bootstrap the factory installer on rootfs. This file must be executed as
# PID=1 (exec).
# 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/bootstrap.sh
set +x
invoke_terminal() {
local tty="$1"
local title="$2"
shift
shift
# Copied from factory_installer/factory_shim_service.sh.
echo "${title}" >>${tty}
setsid sh -c "exec script -afqc '$*' /dev/null <${tty} >>${tty} 2>&1 &"
}
enable_debug_console() {
local tty="$1"
info -e '\033[1;33m[cros_debug] enabled on '${tty}'.\033[m'
invoke_terminal "${tty}" "[Bootstrap Debug Console]" "/bin/busybox sh"
}
main() {
info "...:::||| Bootstrapping ChromeOS Factory Shim |||:::..."
info "TTY: ${TTY}, LOG: ${LOG_TTY}, INFO: ${INFO_TTY}, DEBUG: ${DEBUG_TTY}"
echo "idk please work"
enable_debug_console "/dev/pts/0"
}
main "$@"
sleep 1d