Skip to content

Commit

Permalink
layout: improve handling of GPT partitions
Browse files Browse the repository at this point in the history
- support newly added (legacy_boot) or undocumented (bios_grub) flags
- explicitly name a GPT partition
- handle the case of unnamed GPT partitions
  • Loading branch information
jhoekx committed Sep 1, 2011
1 parent a911636 commit e437453
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ EOF
fi
echo "parted -s $disk set $number $flag on >&2" >> $LAYOUT_CODE
done

# Explicitly name GPT partitions
if [[ "$label" = "gpt" ]] && [[ "$parttype" != "rear-noname" ]] ; then
echo "parted -s $disk name $number \"$parttype\"" >> $LAYOUT_CODE
fi
done < <(grep "^part $disk" $LAYOUT_FILE)

cat >> $LAYOUT_CODE <<EOF
Expand Down
6 changes: 5 additions & 1 deletion usr/share/rear/layout/save/GNU/Linux/20_partition_layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ Log "Saving disk partitions."
ptype=$(get_columns "$line" "$typefield" | tr -d " " | tr -d ";")
pflags=$(get_columns "$line" "flags" | tr -d "," |tr -d ";")

if [ -z "$ptype" ] ; then
ptype="rear-noname"
fi

case $device in
*cciss*)
pname="p${pnumber}"
Expand All @@ -98,7 +102,7 @@ Log "Saving disk partitions."
flags=""
for flag in $pflags ; do
case $flag in
boot|root|swap|hidden|raid|lvm|lba|palo)
boot|root|swap|hidden|raid|lvm|lba|palo|legacy_boot|bios_grub)
flags="$flags$flag,"
;;
esac
Expand Down

0 comments on commit e437453

Please sign in to comment.