Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # This is configured for the virtual box computer at the moment
- #
- MNT=/mnt
- iface=re0
- FBSD_DIST=/usr/freebsd-dist
- dsk=/dev/ada0
- part1=/dev/ada0s1
- TMP=/tmp/bsdlabelout.$$
- TMP2=/tmp/mylabelout.$$
- # Assume a 16 GB Blank Disk
- gpart create -s mbr $dsk
- gpart add -t freebsd -i 1 $dsk
- #Makes a new blank BSD Disk label
- bsdlabel -wB /dev/ad0s1
- echo "# /dev/ad0s1:" > $TMP2
- echo "8 partitions:" >> $TMP2
- echo "# size offset fstype [fsize bsize bps/cpg]" >> $TMP2
- echo "a: 2G 16 4.2BSD 0 0 0" >> $TMP2
- echo "b: 4G * swap 0 0" >> $TMP2
- disklabel $part1 | grep c: >> $TMP2
- echo "d: 5G * 4.2BSD 0 0 0" >> $TMP2
- echo "e: * * 4.2BSD 0 0 0" >> $TMP2
- cat $TMP2
- echo
- echo "Check all correct, Press Enter key to carry on"
- read x
- disklabel -R $part1 $TMP2
- echo "Formatting Drives"
- newfs -U -O2 /dev/ad0s1a
- newfs -U -O2 /dev/ad0s1d
- newfs -U -O2 /dev/ad0s1e
- echo "Making Mount Points"
- mount /dev/ad0s1a /mnt
- mkdir /mnt/usr
- mount /dev/ad0s1e /mnt/usr
- mkdir /mnt/usr/home
- mount /dev/ad0s1d /mnt/home
- boot0cfg -B /dev/ada0
- cd /mnt
- echo "Copying Files"
- for loop in `ls /usr/freebsd-dist/*.txz `
- do
- tar vxjpf $loop
- done
- echo "Making fstab"
- echo "#Device Mount FSTtype Option Dump Pass
- /dev/ad0s1a / ufs rw 1 1
- /dev/ad0s1b none swap sw 0 0
- /dev/ad0s1e /usr ufs rw 0 0
- /dev/ad0s1d /home ufs rw 0 0
- proc /proc procfs rw 0 0" >> /mnt/etc/fstab
- echo "Making /etc/rc.conf"
- echo '# Set Hostname
- hostname="TestComp"
- #Set Keyboard
- keymap="uk.iso.kbd"
- echo #Set Network
- ifconfig_em0="DHCP"
- # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
- dumpdev="AUTO" ' >> /mnt/etc/rc.conf
- echo "Root Password, entering chroot environment type exit
- when done. Type passwd to change root password and
- adduser to add a user"
- cd /mnt
- chroot .
- # Exit of Change Root Environment
- cd /
- umount /mnt/usr/home
- umount /mnt/usr
- umount /mnt
- echo "You may reboot the system"
- echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement