list disks in the bootloader

This commit is contained in:
ading2210 2023-10-03 17:29:55 -07:00
parent 791de19297
commit e94e2b1168
4 changed files with 14 additions and 6 deletions

View File

@ -27,12 +27,19 @@ enable_debug_console() {
invoke_terminal "${tty}" "[Bootstrap Debug Console]" "/bin/busybox sh"
}
find_rootfs_partitions() {
disks=$(fdisk -l | sed -n "s/Disk \(\/dev\/.*\):.*/\1/p")
for disk in $disks; do
echo $disk
done
}
main() {
echo "...:::||| Bootstrapping ChromeOS Factory Shim |||:::..."
echo "TTY: ${TTY}, LOG: ${LOG_TTY}, echo: ${echo_TTY}, DEBUG: ${DEBUG_TTY}"
echo "idk please work"
find_rootfs_partitions
enable_debug_console "/dev/pts/0"
}

View File

@ -10,11 +10,7 @@
set -x
. /lib/init.sh
setup_environment() {
#initialize
# Install additional utility programs.
/bin/busybox --install /bin || true
}

View File

@ -15,7 +15,7 @@ print_help() {
}
check_deps() {
local needed_commands="cpio binwalk pcregrep realpath cgpt"
local needed_commands="cpio binwalk pcregrep realpath cgpt mkfs.ext4 mkfs.ext2 fdisk"
for command in $needed_commands; do
if ! command -v $command &> /dev/null; then
echo $command

View File

@ -59,6 +59,11 @@ partition_disk() {
echo #accept default parition number
echo #accept default first sector
echo #accept default size to fill rest of image
echo x #enter expert mode
echo n #change the partition name
echo #accept default partition number
echo "shimboot_rootfs:default" #set partition name
echo r #return to normal more
#write changes
echo w