Permalink
Browse files

examples/rconfig: Some fixes to our installation scripts.

* Allow the script to be run in a netbooted scenario, too.

* Raise the default size of the root partition to 768M (like the
  installer's default).

* While here, add some comments and whitespace.

Submitted-by: Joachim de Groot <jdegroot@web.de>
  • Loading branch information...
1 parent b96eeef commit 6a2fca969f2788204e15730e255a0d8eeb994e8a Sascha Wildner committed May 17, 2012
Showing with 12 additions and 10 deletions.
  1. +6 −4 share/examples/rconfig/encrypted_root.sh
  2. +6 −6 share/examples/rconfig/hammer.sh
@@ -20,12 +20,12 @@
set disk = "ad0"
-# For safety this only runs on a CD-booted machine
+# For safety this only runs on a CD- or PXE-booted machine
#
-df / | awk '{ print $1; }' | fgrep cd
+df / | egrep -q '^(*.cd|.+:)'
if ( $status > 0 ) then
echo "This program formats your disk and you didn't run it from"
- echo "A CD boot!"
+ echo "a CD or NFS boot!"
exit 1
endif
@@ -61,8 +61,9 @@ fdisk -IB ${disk}
disklabel64 -r -w ${disk}s1 auto
disklabel64 -B ${disk}s1
disklabel64 ${disk}s1 > /tmp/label
+
cat >> /tmp/label << EOF
- a: 256m 0 4.2BSD
+ a: 768m 0 4.2BSD
b: 2g * swap
d: * * HAMMER
EOF
@@ -76,6 +77,7 @@ kldload dm
cryptsetup -y luksFormat /dev/${disk}s1d
cryptsetup luksOpen /dev/${disk}s1d root || exit 1
+# Create file system
newfs_hammer -L ROOT /dev/mapper/root
# Mount it
@@ -12,17 +12,15 @@
#
# WARNING: HAMMER filesystems (and pseudo-filesystems) must be
# occassionally pruned and reblocked. 'man hammer' for more information.
-#
-# $DragonFly: src/share/examples/rconfig/hammer.sh,v 1.4 2008/10/21 14:02:48 swildner Exp $
set disk = "ad6"
-# For safety this only runs on a CD-booted machine
+# For safety this only runs on a CD- or PXE-booted machine
#
-df / | awk '{ print $1; }' | fgrep cd
+df / | egrep -q '^(*.cd|.+:)'
if ( $status > 0 ) then
echo "This program formats your disk and you didn't run it from"
- echo "A CD boot!"
+ echo "a CD or NFS boot!"
exit 1
endif
@@ -58,13 +56,15 @@ fdisk -IB ${disk}
disklabel64 -r -w ${disk}s1 auto
disklabel64 -B ${disk}s1
disklabel64 ${disk}s1 > /tmp/label
+
cat >> /tmp/label << EOF
- a: 256m 0 4.2BSD
+ a: 768m 0 4.2BSD
b: 2g * swap
d: * * HAMMER
EOF
disklabel64 -R ${disk}s1 /tmp/label
+# Create file systems
newfs /dev/${disk}s1a
newfs_hammer -L ROOT /dev/${disk}s1d

0 comments on commit 6a2fca9

Please sign in to comment.