X-Git-Url: http://popeye.lapinbilly.eu/git/?p=zfsinstaller.git;a=blobdiff_plain;f=zfsinstall.sh;h=6d86850273c3bebc3da02b3cec0c2fccc2ab4ce6;hp=aa8a465fdd5a461ef62fd8626a381f3843d5551c;hb=da71a34b846c8871904f04e7b6b20f8debdab7a8;hpb=c3c67d55f32104765308ac3871e9e77f91988a86 diff --git a/zfsinstall.sh b/zfsinstall.sh index aa8a465..6d86850 100644 --- a/zfsinstall.sh +++ b/zfsinstall.sh @@ -33,10 +33,8 @@ echo partitioning ${DESTDISK} echo ============= gpart create -s gpt ${DESTDISK} -gpart add -a 4k -t efi -s 200M -l efiboot0 ${DESTDISK} -gpart bootcode -p /boot/boot1.efifat -i 1 ${DESTDISK} gpart add -a 4k -t freebsd-boot -s 512k -l gptboot0 ${DESTDISK} -gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ${DESTDISK} +gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${DESTDISK} gpart add -a 1m -s 32G -t freebsd-swap -l swap0 ${DESTDISK} gpart add -a 1m -t freebsd-zfs -l zfs0 ${DESTDISK} gpart set -a active ${DESTDISK} @@ -48,7 +46,7 @@ sysctl vfs.zfs.min_auto_ashift=12 echo set up zfs pool: ${ZPOOL} alt mount: ${DESTDIR} echo ================= -zpool create -m none -f -R ${DESTDIR} ${ZPOOL} ${DESTDISK}p4 ada1 +zpool create -m none -f -R ${DESTDIR} ${ZPOOL} ${DESTDISK}p3 ada1 if [ "${?}" -ne 0 ]; then echo "unable to create zpool" exit 1 @@ -130,27 +128,24 @@ dumpdev="AUTO" zfs_enable="YES" EOF -cd ${SCRIPTBASE} -for I in resolv.conf rc.conf.local; do - if [ -r "${I}" ]; then - echo installing ${I} - install -o root -g wheel -m 0644 ${I} ${DESTDIR}/etc/ - fi -done - -for I in loader.conf.local; do - if [ -r "${I}" ]; then - echo installing ${I} - install -o root -g wheel -m 0644 ${I} ${DESTDIR}/boot/ - fi +COPYCAT="/etc" +cd ${SCRIPTBASE}${COPYCAT} || exit 1 +echo installing files into ${COPYCAT} +for I in *.conf*; do + if [ -r "${I}" -a -f ${I} ]; then + install -o root -g wheel -m 0644 ${I} ${DESTDIR}${COPYCAT}/ + fi done - -echo installing rc.conf.d -install -o root -g wheel -d -m 0755 ${DESTDIR}/etc/rc.conf.d -if [ -d "./rc.conf.d" ]; then - echo installing files into rc.conf.d - install -o root -g wheel -m 0644 ./rc.conf.d/* ${DESTDIR}/etc/rc.conf.d/ -fi +COPYCAT="/etc/rc.conf.d" +cd ${SCRIPTBASE}${COPYCAT} || exit 1 +install -o root -g wheel -d -m 0755 ${DESTDIR}${COPYCAT} || exit 1 +echo installing files into ${COPYCAT} +install -o root -g wheel -m 0644 * ${DESTDIR}${COPYCAT}/ +COPYCAT="/etc/rc.conf.d/network" +cd ${SCRIPTBASE}${COPYCAT} || exit 1 +install -o root -g wheel -d -m 0755 ${DESTDIR}${COPYCAT} || exit 1 +echo installing files into ${COPYCAT} +install -o root -g wheel -m 0644 * ${DESTDIR}${COPYCAT}/ chroot ${DESTDIR} passwd chroot ${DESTDIR} adduser