summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThorsten Glaser <tg@mirbsd.org>2010-11-21 16:45:25 +0000
committerWaldemar Brodkorb <wbx@openadk.org>2010-11-21 19:45:30 +0100
commit60f67d3883bc11f93419a97a7ae1d5103ca7efc2 (patch)
tree4c839df7cbd3c60858ea1c0e739be538d10c3b24 /scripts
parentd7b9445db33c1f0472a07ab6127b8d89103eff1e (diff)
automate BSD disklabel creation; display UUID at end of the script
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install.sh42
1 files changed, 33 insertions, 9 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
index b8f21a0c6..ab9c4f2cf 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -294,15 +294,37 @@ print -n "$ostr" | \
dd if="$T/firsttrack" of="$tgt"
if [[ $basedev = /dev/svnd+([0-9]) ]]; then
- print
- fdisk -c $cyls -h $heads -s $secs ${basedev#/dev/}
- print
- print "This is a BSD vnd(4) device. You MUST now use"
- print "\t\$ sudo disklabel -E svnd0"
- print "to create a valid BSD disklabel on it. Make"
- print "two slices i for the ext2fs partition and j"
- print "for the cfgfs partition. Then press Enter."
- read dummy
+ (( quiet )) || print "Creating BSD disklabel on target device..."
+ # c: whole device (must be so)
+ # i: ext2fs (matching first partition)
+ # j: cfgfs (matching second partition)
+ # p: MBR and GRUB2 area (by tradition)
+ cat >"$T/bsdlabel" <<-EOF
+ type: vnd
+ disk: vnd device
+ label: OpenADK
+ flags:
+ bytes/sector: 512
+ sectors/track: $secs
+ tracks/cylinder: $heads
+ sectors/cylinder: $((heads * secs))
+ cylinders: $cyls
+ total sectors: $((cyls * heads * secs))
+ rpm: 3600
+ interleave: 1
+ trackskew: 0
+ cylinderskew: 0
+ headswitch: 0
+ track-to-track seek: 0
+ drivedata: 0
+
+ 16 partitions:
+ c: $((cyls * heads * secs)) 0 unused
+ i: $(((cyls - cfgfs) * heads * secs - partofs)) $partofs ext2fs
+ j: $((cfgfs * heads * secs)) $(((cyls - cfgfs) * heads * secs)) unknown
+ p: $partofs 0 unknown
+EOF
+ disklabel -R ${basedev#/dev/} "$T/bsdlabel"
fi
(( quiet )) || print "Creating ext2fs on ${part}..."
@@ -355,5 +377,7 @@ cp "${grubfiles[@]}" boot/grub/
cd "$TOPDIR"
umount "$T"
+(( quiet )) || print "\nNote: the rootfs UUID is: $partuuid"
+
rm -rf "$T"
exit 0