Skip to content
Permalink
Browse files

Pass getDiskFromPartition if image type is raw

If image type is raw, the disk is the partition. This should fix the problem with testing the partition tables with raw imaging formats.
  • Loading branch information...
mastacontrola committed Nov 8, 2019
1 parent e0202be commit 5600a5adf952d6cef50f60c4fde1a1551c2ba7ee
Showing with 10 additions and 1 deletion.
  1. +10 −1 Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/funcs.sh
@@ -1247,7 +1247,12 @@ sec2string() {
# $1 is the partition to grab the disk from
getDiskFromPartition() {
local part="$1"
local israw="$2"
[[ -z $part ]] && handleError "No partition passed (${FUNCNAME[0]})\n Args Passed: $*"
if [[ $israw -eq 1 ]]; then
disk=$part
return
fi
disk=$(readlink /sys/class/block/$part)
disk=${disk%/*}
disk=/dev/${disk##*/}
@@ -2098,7 +2103,11 @@ restorePartition() {
local ebrfilename=""
local disk=""
local part_number=0
getDiskFromPartition "$part"
local israw=0
if [[ $imgType == "dd" ]]; then
israw=1
fi
getDiskFromPartition "$part" "$israw"
getPartitionNumber "$part"
echo " * Processing Partition: $part ($part_number)"
debugPause

0 comments on commit 5600a5a

Please sign in to comment.
You can’t perform that action at this time.