Commit dafac2af authored by Mike Hibler's avatar Mike Hibler

Script I did long ago. To be run post-frisbee from the frisbee MFS to

fixup /etc/fstab and anything else that might have hardwired DOS partition
information.  This is the piece of the puzzle needed for loading an image
into a partition other than the one in which it was created.  I never
installed it since there was no demand and it is one more piece on the disk
loading path that could break.

Just checking this in for the day when we might want it.  Note that it is
still not installed (i.e., I didn't change the Makefile to install it).
parent 594a08cd
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
disk="ad0"
case $# in
1)
part=$1
;;
2)
part=$1
disk=$2
;;
*)
echo "Usage: $0 partition [disk]"
exit 1
esac
ptype=`fdisk -$part | grep sysid | sed 's/.*sysid \([0-9][0-9]*\),.*/\1/'`
ptype=${ptype:-0}
dofreebsd() {
# see if there is a root ('a') partition on this BSD slice
`disklabel ${disk}s${part} 2>1 | grep -s -E '^[ ]+a:' >/dev/null` || {
return 1
}
rootdev=/dev/${disk}s${part}a
echo "fixing FreeBSD root partition ${disk}s${part}a"
fsck -p $rootdev || {
echo "Fsck of $rootdev failed"
return 1
}
mount $rootdev /mnt || {
echo "Mount of $rootdev failed"
return 1
}
sed -i .orig -e "s/${disk}s./${disk}s${part}/" /mnt/etc/fstab || {
echo "Failed to update /etc/fstab"
umount $rootdev
return 1
}
sed -i .orig -e "s/${disk}s./${disk}s${part}/" /mnt/etc/dumpdates || {
echo "Failed to update /etc/dumpdates"
umount $rootdev
return 1
}
umount $rootdev
return 0
}
dolinux() {
# need to update fstab, lilo.conf
}
case $ptype in
165)
dofreebsd
exit $?
;;
0)
;;
*)
echo "ignoring partition type $ptype"
;;
esac
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment