From 6a2fca969f2788204e15730e255a0d8eeb994e8a Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Thu, 17 May 2012 22:17:53 +0200 Subject: [PATCH] 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 --- share/examples/rconfig/encrypted_root.sh | 10 ++++++---- share/examples/rconfig/hammer.sh | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/share/examples/rconfig/encrypted_root.sh b/share/examples/rconfig/encrypted_root.sh index 1009a658ab..71c28f38d3 100644 --- a/share/examples/rconfig/encrypted_root.sh +++ b/share/examples/rconfig/encrypted_root.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 diff --git a/share/examples/rconfig/hammer.sh b/share/examples/rconfig/hammer.sh index aa86dcf738..61ceb1e745 100644 --- a/share/examples/rconfig/hammer.sh +++ b/share/examples/rconfig/hammer.sh @@ -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 -- 2.41.0