From 97d700e3e03c5ea48d3f91e3a45bf738ce34bc78 Mon Sep 17 00:00:00 2001 From: ading2210 Date: Fri, 27 Oct 2023 23:09:20 -0700 Subject: [PATCH] add copyright notice to bootloader --- bootloader/bin/bootstrap.sh | 38 +++++++++++++++++++++++++++++-------- bootloader/bin/init | 0 2 files changed, 30 insertions(+), 8 deletions(-) mode change 100644 => 100755 bootloader/bin/bootstrap.sh mode change 100644 => 100755 bootloader/bin/init diff --git a/bootloader/bin/bootstrap.sh b/bootloader/bin/bootstrap.sh old mode 100644 new mode 100755 index ec91617..0fcba7f --- a/bootloader/bin/bootstrap.sh +++ b/bootloader/bin/bootstrap.sh @@ -24,7 +24,7 @@ invoke_terminal() { enable_debug_console() { local tty="$1" - echo -e '\033[1;33m[cros_debug] enabled on '${tty}'.\033[m' + echo -e "debug console enabled on ${tty}" invoke_terminal "${tty}" "[Bootstrap Debug Console]" "/bin/busybox sh" } @@ -56,6 +56,26 @@ move_mounts() { done } +print_license() { + cat << EOF +ading2210/shimboot: Boot desktop Linux from a Chrome OS RMA shim. +Copyright (C) 2023 ading2210 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +EOF +} + print_selector() { local rootfs_partitions="$1" local i=1 @@ -78,6 +98,7 @@ print_selector() { echo "q) reboot" echo "s) enter a shell" + echo "l) view license" } get_selection() { @@ -92,6 +113,12 @@ get_selection() { reset enable_debug_console "/dev/pts/0" return 0 + elif [ "$selection" = "l" ]; then + clear + print_license + echo + read -p "press [enter] to return to the bootloader menu" + return 1 fi for rootfs_partition in $rootfs_partitions; do @@ -100,7 +127,6 @@ get_selection() { if [ "$selection" = "$i" ]; then echo "selected $part_path" - sleep 2 boot_target $part_path return 0 fi @@ -109,14 +135,12 @@ get_selection() { done echo "invalid selection" + sleep 1 return 1 } boot_target() { local target="$1" - #scuffed way to get init to output to the right tty - #x11 doesn't use tty1 anyways so this shouldn't cause issues - mount -o bind /dev/pts/0 /dev/tty1 echo "moving mounts to newroot" mkdir /newroot @@ -131,8 +155,7 @@ boot_target() { } main() { - echo "...:::||| Bootstrapping ChromeOS Factory Shim |||:::..." - echo "idk please work" + echo "starting the shimboot bootloader" enable_debug_console "/dev/pts/1" @@ -144,7 +167,6 @@ main() { if get_selection "${rootfs_partitions}"; then break fi - sleep 2 done } diff --git a/bootloader/bin/init b/bootloader/bin/init old mode 100644 new mode 100755