add freebsd 4.x support into the grub shell and grub-install.

This commit is contained in:
okuji committed 2001-02-28 11:19:39 +00:00
1 parent 348785cfbc
commit dfee6ac3ec
3 files changed
+33

No files matched your search

+21
View File
@@ -86,6 +86,13 @@ convert () {
gnu*)
tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
freebsd*)
tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \
| sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'`
tmp_part=`echo "$1" \
| sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \
| sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"`
;;
*)
echo "grub-install does not support your OS yet." 1>&2
exit 1 ;;
@@ -121,6 +128,20 @@ convert () {
| sed "s%)%,$tmp_bsd_partition)%"`
fi
echo "$tmp_drive" ;;
freebsd*)
if echo $tmp_part | grep "^s" >/dev/null; then
tmp_pc_slice=`echo $tmp_part \
| sed "s%s\([0-9]*\)[a-h]*$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"`
fi
if echo $tmp_part | grep "[a-h]$" >/dev/null; then
tmp_bsd_partition=`echo "$tmp_part" \
| sed "s%s\{0,1\}[0-9]*\([a-h]\)$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,$tmp_bsd_partition)%"`
fi
echo "$tmp_drive" ;;
esac
else
# If no partition is specified, just print the drive name.