mirror of
https://github.com/linuxboot/heads.git
synced 2025-03-23 12:35:24 +00:00
BUGFIX >2tb drives: replace all fdisk -l calls with stderr suppression (workaround)
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
parent
2d19fa9470
commit
836af32a42
@ -113,7 +113,7 @@ while true; do
|
||||
;;
|
||||
"b")
|
||||
CURRENT_OPTION="$(load_config_value CONFIG_BOOT_DEV)"
|
||||
if ! fdisk -l | grep "Disk /dev/" | cut -f2 -d " " | cut -f1 -d ":" >/tmp/disklist.txt; then
|
||||
if ! fdisk -l 2>/dev/null | grep "Disk /dev/" | cut -f2 -d " " | cut -f1 -d ":" >/tmp/disklist.txt; then
|
||||
whiptail_error --title 'ERROR: No bootable devices found' \
|
||||
--msgbox " $ERROR\n\n" 0 80
|
||||
exit 1
|
||||
@ -208,7 +208,7 @@ while true; do
|
||||
;;
|
||||
"R")
|
||||
CURRENT_OPTION="$(load_config_value CONFIG_ROOT_DEV)"
|
||||
fdisk -l | grep "Disk /dev/" | cut -f2 -d " " | cut -f1 -d ":" >/tmp/disklist.txt
|
||||
fdisk -l 2>/dev/null | grep "Disk /dev/" | cut -f2 -d " " | cut -f1 -d ":" >/tmp/disklist.txt
|
||||
# filter out extraneous options
|
||||
>/tmp/root_device_list.txt
|
||||
for i in $(cat /tmp/disklist.txt); do
|
||||
|
@ -367,7 +367,7 @@ detect_root_device()
|
||||
fi
|
||||
|
||||
# generate list of possible boot devices
|
||||
fdisk -l | grep "Disk /dev/" | cut -f2 -d " " | cut -f1 -d ":" > /tmp/disklist
|
||||
fdisk -l 2>/dev/null | grep "Disk /dev/" | cut -f2 -d " " | cut -f1 -d ":" > /tmp/disklist
|
||||
|
||||
# filter out extraneous options
|
||||
> /tmp_root_device_list
|
||||
|
@ -645,7 +645,7 @@ device_has_partitions() {
|
||||
# This check covers that: [ $(fdisk -l "$b" | wc -l) -eq 5 ]
|
||||
# In both cases the output is 5 lines: 3 about device info, 1 empty line
|
||||
# and the 5th will be the table header or the invalid message.
|
||||
local DISK_DATA=$(fdisk -l "$DEVICE")
|
||||
local DISK_DATA=$(fdisk -l "$DEVICE" 2>/dev/null)
|
||||
if echo "$DISK_DATA" | grep -q "doesn't contain a valid partition table" ||
|
||||
[ "$(echo "$DISK_DATA" | wc -l)" -eq 5 ]; then
|
||||
# No partition table
|
||||
@ -1066,7 +1066,7 @@ is_gpt_bios_grub() {
|
||||
# Now we know the device and partition number, get the type. This is
|
||||
# specific to GPT disks, MBR disks are shown differently by fdisk.
|
||||
TRACE "$PART_DEV is partition $NUMBER of $DEVICE"
|
||||
if [ "$(fdisk -l "/dev/$DEVICE" | awk '$1 == '"$NUMBER"' {print $5}')" == grub ]; then
|
||||
if [ "$(fdisk -l "/dev/$DEVICE" 2>/dev/null | awk '$1 == '"$NUMBER"' {print $5}')" == grub ]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
@ -1139,7 +1139,7 @@ detect_boot_device() {
|
||||
fi
|
||||
|
||||
# generate list of possible boot devices
|
||||
fdisk -l | grep "Disk /dev/" | cut -f2 -d " " | cut -f1 -d ":" >/tmp/disklist
|
||||
fdisk -l 2>/dev/null | grep "Disk /dev/" | cut -f2 -d " " | cut -f1 -d ":" >/tmp/disklist
|
||||
|
||||
# Check each possible boot device
|
||||
for i in $(cat /tmp/disklist); do
|
||||
|
@ -181,7 +181,7 @@ show_system_info()
|
||||
kernel=$(uname -s -r)
|
||||
|
||||
whiptail_type $BG_COLOR_MAIN_MENU --title 'System Info' \
|
||||
--msgbox "${BOARD_NAME}\n\nFW_VER: ${FW_VER}\nKernel: ${kernel}\n\nCPU: ${cpustr}\nRAM: ${memtotal} GB\n$battery_status\n$(fdisk -l | grep -e '/dev/sd.:' -e '/dev/nvme.*:' | sed 's/B,.*/B/')" 0 80
|
||||
--msgbox "${BOARD_NAME}\n\nFW_VER: ${FW_VER}\nKernel: ${kernel}\n\nCPU: ${cpustr}\nRAM: ${memtotal} GB\n$battery_status\n$(fdisk -l 2>/dev/null | grep -e '/dev/sd.:' -e '/dev/nvme.*:' | sed 's/B,.*/B/')" 0 80
|
||||
}
|
||||
|
||||
# Get "Enable" or "Disable" to display in the configuration menu, based on a
|
||||
|
Loading…
x
Reference in New Issue
Block a user