From da71a34b846c8871904f04e7b6b20f8debdab7a8 Mon Sep 17 00:00:00 2001 From: David Marec Date: Sat, 3 Nov 2018 16:24:41 +0100 Subject: [PATCH] review install --- zfsinstall.sh | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) 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 -- 2.47.0