Date: Mon, 18 Aug 2014 10:38:52 GMT From: kczekirda@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272602 - in soc2014/kczekirda/pxe-fai-head: head/usr.sbin/bsdinstall head/usr.sbin/bsdinstall/scripts tools/mfsbsd/conf Message-ID: <201408181038.s7IAcqu4038170@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kczekirda Date: Mon Aug 18 10:38:51 2014 New Revision: 272602 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272602 Log: mentor's comments and change spaces to tabs Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/bsdinstall soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/auto soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/hostname soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/keymap soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/mirrorselect soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/script soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/services soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/time soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/zfsboot soc2014/kczekirda/pxe-fai-head/tools/mfsbsd/conf/rc.local.sample Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/bsdinstall Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/bsdinstall Mon Aug 18 10:38:51 2014 (r272602) @@ -60,14 +60,14 @@ # when option "tofile" - only simulation if [ "$1" = "tofile" ]; then - if [ $2 ]; then - export TOFILE="$2" - shift; shift # need delete option and path - echo "# installer configuration file from bsdinstall" > "$TOFILE" - else - echo "missing path - tofile parameter" - exit - fi + if [ "$2" ]; then + export TOFILE="$2" + shift 2 # need delete option and path + echo "# installer configuration file from bsdinstall" > "$TOFILE" + else + echo "missing path - tofile parameter" + exit + fi fi # What are we here to do? Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/auto Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/auto Mon Aug 18 10:38:51 2014 (r272602) @@ -76,7 +76,7 @@ for dist in $EXTRA_DISTS; do export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" done - [ -n "$TOFILE" ] && echo "DISTRIBUTIONS=\"$DISTRIBUTIONS\"" >> "$TOFILE" + [ -n "$TOFILE" ] && echo "DISTRIBUTIONS=\"$DISTRIBUTIONS\"" >> "$TOFILE" fi FETCH_DISTRIBUTIONS="" @@ -103,8 +103,8 @@ fi if [ -z "$TOFILE" ]; then - rm -f $PATH_FSTAB - touch $PATH_FSTAB + rm -f $PATH_FSTAB + touch $PATH_FSTAB fi PMODES="\ @@ -113,8 +113,8 @@ Shell \"Open a shell and partition by hand\"" if [ ! -z "$TOFILE" ]; then - PMODES="\ - Classic \"Choose disk for installation\"" + PMODES="\ + Classic \"Choose disk for installation\"" fi CURARCH=$( uname -m ) @@ -153,33 +153,33 @@ bsdinstall mount || error ;; "Classic") # only disk choise - disks= - debug= f_device_find "" $DEVICE_TYPE_DISK disks - f_device_sort_by name disks disks - - disk_check_list= - for disk in $disks; do - desc= - $disk get name name - $disk get desc desc - f_shell_escape "$desc" desc - f_getvar _${disk}_status:-off onoff - disk_check_list="$disk_check_list - $name '$desc' " - done - - exec 3>&1 - DISK=`echo "$disk_check_list" | xargs dialog --backtitle 'FreeBSD Installer' --title 'Target Selection' --menu 'Please select a disk to install FreeBSD:' 0 0 0 2>&1 1>&3` - if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi - exec 3>&- - - echo "PARTITIONS=\"$DISK { auto freebsd-ufs /}\"" >> "$TOFILE" - ;; + disks= + debug= f_device_find "" $DEVICE_TYPE_DISK disks + f_device_sort_by name disks disks + + disk_check_list= + for disk in $disks; do + desc= + $disk get name name + $disk get desc desc + f_shell_escape "$desc" desc + f_getvar _${disk}_status:-off onoff + disk_check_list="$disk_check_list + $name '$desc' " + done + + exec 3>&1 + DISK=`echo "$disk_check_list" | xargs dialog --backtitle 'FreeBSD Installer' --title 'Target Selection' --menu 'Please select a disk to install FreeBSD:' 0 0 0 2>&1 1>&3` + if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi + exec 3>&- + + echo "PARTITIONS=\"$DISK { auto freebsd-ufs /}\"" >> "$TOFILE" + ;; "ZFS") # ZFS bsdinstall zfsboot || error - if [ -z "$TOFILE" ]; then - bsdinstall mount || error - fi + if [ -z "$TOFILE" ]; then + bsdinstall mount || error + fi ;; *) error @@ -209,9 +209,9 @@ fi if [ -z "$TOFILE" ]; then - bsdinstall checksum || error - bsdinstall distextract || error - bsdinstall rootpass || error + bsdinstall checksum || error + bsdinstall distextract || error + bsdinstall rootpass || error fi trap true SIGINT # This section is optional @@ -222,9 +222,9 @@ bsdinstall services if [ -z "$TOFILE" ]; then - dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \ - "Would you like to add users to the installed system now?" 0 0 && \ - bsdinstall adduser + dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \ + "Would you like to add users to the installed system now?" 0 0 && \ + bsdinstall adduser fi finalconfig() { @@ -279,7 +279,7 @@ trap error SIGINT # SIGINT is bad again if [ -z "$TOFILE" ]; then - bsdinstall config || error + bsdinstall config || error fi if [ ! -z "$BSDINSTALL_FETCHDEST" -a -z "$TOFILE" ]; then @@ -290,7 +290,7 @@ if [ -z "$TOFILE" ]; then dialog --backtitle "FreeBSD Installer" --title "Manual Configuration" \ - --yesno "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 + --yesno "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 if [ $? -eq 0 ]; then clear mount -t devfs devfs "$BSDINSTALL_CHROOT/dev" Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/hostname ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/hostname Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/hostname Mon Aug 18 10:38:51 2014 (r272602) @@ -43,9 +43,9 @@ exec 3>&- if [ -z "$TOFILE" ]; then - echo "hostname=\"$HOSTNAME\"" > $BSDINSTALL_TMPETC/rc.conf.hostname + echo "hostname=\"$HOSTNAME\"" > $BSDINSTALL_TMPETC/rc.conf.hostname else - echo "HOSTNAME=\"$HOSTNAME\"" >> "$TOFILE" + echo "HOSTNAME=\"$HOSTNAME\"" >> "$TOFILE" fi if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/keymap ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/keymap Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/keymap Mon Aug 18 10:38:51 2014 (r272602) @@ -227,11 +227,11 @@ # Get actual keymap setting while we update $keymap and $KEYMAPFILE keymap_$k get keym keymap - if [ -z "$TOFILE" ]; then - echo "keymap=\"$keymap\"" > "$KEYMAPFILE" - else - echo "KEYMAP=\"$keymap\"" >> "$TOFILE" - fi + if [ -z "$TOFILE" ]; then + echo "keymap=\"$keymap\"" > "$KEYMAPFILE" + else + echo "KEYMAP=\"$keymap\"" >> "$TOFILE" + fi done Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/mirrorselect Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/mirrorselect Mon Aug 18 10:38:51 2014 (r272602) @@ -171,9 +171,9 @@ BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}" if [ "$TOFILE" ]; then - echo "MIRROR=\"$MIRROR\"" >> "$TOFILE" - echo "RELDIR=\"$RELDIR\"" >> "$TOFILE" - echo "RELEASE=\"${_UNAME_R}\"" >> "$TOFILE" + echo "MIRROR=\"$MIRROR\"" >> "$TOFILE" + echo "RELDIR=\"$RELDIR\"" >> "$TOFILE" + echo "RELEASE=\"${_UNAME_R}\"" >> "$TOFILE" fi case $MIRROR_BUTTON in Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig Mon Aug 18 10:38:51 2014 (r272602) @@ -70,9 +70,9 @@ exec 3>&- if [ -z "$TOFILE" ]; then - : > $BSDINSTALL_TMPETC/._rc.conf.net + : > $BSDINSTALL_TMPETC/._rc.conf.net else - echo INTERFACE=\"$INTERFACE\" >> "$TOFILE" + echo INTERFACE=\"$INTERFACE\" >> "$TOFILE" fi IFCONFIG_PREFIX="" @@ -107,7 +107,7 @@ exec $0 else IPV4_AVAIL=0 - [ ! -z "$TOFILE" ] && echo IPV4=\"NO\" >> "$TOFILE" + [ "$TOFILE" ] && echo IPV4=\"NO\" >> "$TOFILE" fi fi # In case wlanconfig left an option and we do not support IPv4 we need to write @@ -122,7 +122,7 @@ bsdinstall netconfig_ipv6 ${INTERFACE} || exec $0 else IPV6_AVAIL=0 - [ ! -z "$TOFILE" ] && echo IPV6=\"NO\" >> "$TOFILE" + [ "$TOFILE" ] && echo IPV6=\"NO\" >> "$TOFILE" fi fi @@ -192,58 +192,58 @@ exec 3>&- if [ -z "$TOFILE" ]; then - echo ${RESOLV} | tr ' ' '\n' | \ - awk ' - BEGIN { - search=-1; - } - { - if (/^[[:space:]]+$/) { - next; - } - if (/^Nameserver$/) { - printf "\n"; - search=0; - next; - } - if (search == -1) { - printf "search "; - search=1; - } - if (search > 0) { - printf "%s%s", (search > 1) ? " " : "", $1; - search++; - next; - } - printf "nameserver %s\n", $1; - }' > ${BSDINSTALL_TMPETC}/resolv.conf - mv $BSDINSTALL_TMPETC/._rc.conf.net $BSDINSTALL_TMPETC/rc.conf.net + echo ${RESOLV} | tr ' ' '\n' | \ + awk ' + BEGIN { + search=-1; + } + { + if (/^[[:space:]]+$/) { + next; + } + if (/^Nameserver$/) { + printf "\n"; + search=0; + next; + } + if (search == -1) { + printf "search "; + search=1; + } + if (search > 0) { + printf "%s%s", (search > 1) ? " " : "", $1; + search++; + next; + } + printf "nameserver %s\n", $1; + }' > ${BSDINSTALL_TMPETC}/resolv.conf + mv $BSDINSTALL_TMPETC/._rc.conf.net $BSDINSTALL_TMPETC/rc.conf.net else - echo ${RESOLV} | tr ' ' '\n' | \ - awk ' - BEGIN { - search=-1; - dns=1; - } - { - if (/^[[:space:]]+$/) { - next; - } - if (/^Nameserver$/) { - printf "\"\n"; - search=0; - next; - } - if (search == -1) { - printf "DOMAIN=\""; - search=1; - } - if (search > 0) { - printf "%s%s", (search > 1) ? " " : "", $1; - search++; - next; - } - printf "DNS%s=\"%s\"\n", dns, $1; - dns++; - }' >> "$TOFILE" + echo ${RESOLV} | tr ' ' '\n' | \ + awk ' + BEGIN { + search=-1; + dns=1; + } + { + if (/^[[:space:]]+$/) { + next; + } + if (/^Nameserver$/) { + printf "\"\n"; + search=0; + next; + } + if (search == -1) { + printf "DOMAIN=\""; + search=1; + } + if (search > 0) { + printf "%s%s", (search > 1) ? " " : "", $1; + search++; + next; + } + printf "DNS%s=\"%s\"\n", dns, $1; + dns++; + }' >> "$TOFILE" fi Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Mon Aug 18 10:38:51 2014 (r272602) @@ -48,11 +48,11 @@ dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 if [ $? -eq $DIALOG_OK ]; then - if [ -z "$TOFILE" ]; then - echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> $BSDINSTALL_TMPETC/._rc.conf.net - else - echo DHCP=\"YES\" >> "$TOFILE" - fi + if [ -z "$TOFILE" ]; then + echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> $BSDINSTALL_TMPETC/._rc.conf.net + else + echo DHCP=\"YES\" >> "$TOFILE" + fi if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0 @@ -82,17 +82,17 @@ exec 3>&- if [ -z "$TOFILE" ]; then - echo $INTERFACE $IF_CONFIG | - awk -v prefix="$IFCONFIG_PREFIX" '{ - printf("ifconfig_%s=\"%s\inet %s netmask %s\"\n", $1, prefix, $2, $3); - printf("defaultrouter=\"%s\"\n", $4); - }' >> $BSDINSTALL_TMPETC/._rc.conf.net + echo $INTERFACE $IF_CONFIG | + awk -v prefix="$IFCONFIG_PREFIX" '{ + printf("ifconfig_%s=\"%s\inet %s netmask %s\"\n", $1, prefix, $2, $3); + printf("defaultrouter=\"%s\"\n", $4); + }' >> $BSDINSTALL_TMPETC/._rc.conf.net else - echo $IF_CONFIG | - awk '{printf("ADDRESSV4=\"%s\"\n", $1); - printf("NETMASK=\"%s\"\n", $2); - printf("GWV4=\"%s\"\n", $3); - }' >> "$TOFILE" + echo $IF_CONFIG | + awk '{printf("ADDRESSV4=\"%s\"\n", $1); + printf("NETMASK=\"%s\"\n", $2); + printf("GWV4=\"%s\"\n", $3); + }' >> "$TOFILE" fi if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/netconfig_ipv6 Mon Aug 18 10:38:51 2014 (r272602) @@ -73,14 +73,14 @@ continue fi fi - if [ -z "$TOFILE" ]; then - echo ifconfig_${INTERFACE}_ipv6=\"inet6 accept_rtadv\" >> $BSDINSTALL_TMPETC/._rc.conf.net - else - echo SLAAC=\"YES\" >> "$TOFILE" - fi + if [ -z "$TOFILE" ]; then + echo ifconfig_${INTERFACE}_ipv6=\"inet6 accept_rtadv\" >> $BSDINSTALL_TMPETC/._rc.conf.net + else + echo SLAAC=\"YES\" >> "$TOFILE" + fi exit 0 else - echo SLAAC=\"NO\" >> "$TOFILE" + echo SLAAC=\"NO\" >> "$TOFILE" break fi done @@ -121,63 +121,63 @@ exec 3>&- if [ -z "$TOFILE" ]; then - echo ${IF_CONFIG} | tr ' ' '\n' | \ - awk -v iface="${INTERFACE}" ' - BEGIN { - dfr=0; - count=0; - } - { - if (/^[[:space:]]+$/) { - next; - } - if (/DefaultRouter/) { - dfr=1; - next; - } - if (dfr == 1) { - printf("ipv6_defaultrouter=\"%s\"\n", $1); - next; - } - if (count > 0) { - # Ignore all but the first IP address for now. - next; - } - count++; - if (!match($1, "/")) { - sub("$", "/64", $1); - } - printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1); - }' >> $BSDINSTALL_TMPETC/._rc.conf.net + echo ${IF_CONFIG} | tr ' ' '\n' | \ + awk -v iface="${INTERFACE}" ' + BEGIN { + dfr=0; + count=0; + } + { + if (/^[[:space:]]+$/) { + next; + } + if (/DefaultRouter/) { + dfr=1; + next; + } + if (dfr == 1) { + printf("ipv6_defaultrouter=\"%s\"\n", $1); + next; + } + if (count > 0) { + # Ignore all but the first IP address for now. + next; + } + count++; + if (!match($1, "/")) { + sub("$", "/64", $1); + } + printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1); + }' >> $BSDINSTALL_TMPETC/._rc.conf.net else - echo ${IF_CONFIG} | tr ' ' '\n' | \ - awk -v iface="${INTERFACE}" ' - BEGIN { - >---dfr=0; - >---count=0; - } - { - >---if (/^[[:space:]]+$/) { - >--->---next; - >---} - >---if (/DefaultRouter/) { - >--->---dfr=1; - >--->---next; - >---} - >---if (dfr == 1) { - >--->---printf("ipv6_defaultrouter=\"%s\"\n", $1); - >--->---next; - >---} - >---if (count > 0) { - >--->---# Ignore all but the first IP address for now. - >--->---next; - >---} - >---count++; - >---if (!match($1, "/")) { - >--->---sub("$", "/64", $1); - >---} - >---printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1); - }' >> "$TOFILE" + echo ${IF_CONFIG} | tr ' ' '\n' | \ + awk -v iface="${INTERFACE}" ' + BEGIN { + dfr=0; + count=0; + } + { + if (/^[[:space:]]+$/) { + next; + } + if (/DefaultRouter/) { + dfr=1; + next; + } + if (dfr == 1) { + printf("ipv6_defaultrouter=\"%s\"\n", $1); + next; + } + if (count > 0) { + # Ignore all but the first IP address for now. + next; + } + count++; + if (!match($1, "/")) { + sub("$", "/64", $1); + } + printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1); + }' >> "$TOFILE" fi if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/script ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/script Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/script Mon Aug 18 10:38:51 2014 (r272602) @@ -142,7 +142,7 @@ # Keymap if [ -n "$KEYMAP" ]; then - echo "keymap=\"$KEYMAP\"" > $BSDINSTALL_TMPETC/rc.conf.keymap + echo "keymap=\"$KEYMAP\"" > $BSDINSTALL_TMPETC/rc.conf.keymap fi # Services @@ -166,31 +166,31 @@ if [ ! -f /tmp/bsdinstall-installscript-ab ]; then echo "#!/bin/sh" > /tmp/bsdinstall-installscript-ab fi - echo "tzsetup \"$TIMEZONE\"" >> /tmp/bsdinstall-installscript-ab + echo "tzsetup \"$TIMEZONE\"" >> /tmp/bsdinstall-installscript-ab fi # Root password hash if [ -n "$ROOTPWHASH" ]; then - if [ ! -f /tmp/bsdinstall-installscript-ab ]; then - echo "#!/bin/sh" > /tmp/bsdinstall-installscript-ab - fi - echo "echo '$ROOTPWHASH' | pw user mod root -H 0" >> /tmp/bsdinstall-installscript-ab + if [ ! -f /tmp/bsdinstall-installscript-ab ]; then + echo "#!/bin/sh" > /tmp/bsdinstall-installscript-ab + fi + echo "echo '$ROOTPWHASH' | pw user mod root -H 0" >> /tmp/bsdinstall-installscript-ab fi # Root password plaintext if [ -n "$ROOTPWPLAIN" ]; then - if [ ! -f /tmp/bsdinstall-installscript-ab ]; then - echo "#!/bin/sh" > /tmp/bsdinstall-installscript-ab - fi - echo "echo '$ROOTPWPLAIN' | pw user mod root -h 0" >> /tmp/bsdinstall-installscript-ab + if [ ! -f /tmp/bsdinstall-installscript-ab ]; then + echo "#!/bin/sh" > /tmp/bsdinstall-installscript-ab + fi + echo "echo '$ROOTPWPLAIN' | pw user mod root -h 0" >> /tmp/bsdinstall-installscript-ab fi # Users if [ -n "$USERSCONFIG" ]; then - if [ ! -f /tmp/bsdinstall-installscript-ab ]; then - echo "#!/bin/sh" > /tmp/bsdinstall-installscript-ab - fi - echo "adduser -f $USERSCONFIG" >> /tmp/bsdinstall-installscript-ab + if [ ! -f /tmp/bsdinstall-installscript-ab ]; then + echo "#!/bin/sh" > /tmp/bsdinstall-installscript-ab + fi + echo "adduser -f $USERSCONFIG" >> /tmp/bsdinstall-installscript-ab fi # Make partitions @@ -206,14 +206,14 @@ # Network if [ -n "$INTERFACE" ] && [ "$IPV4" = "YES" ]; then - if [ "$DHCP" = "YES" ]; then - echo "ifconfig_${INTERFACE}=\"DHCP\"" >> $BSDINSTALL_TMPETC/rc.conf.network - fi - - if [ "$DHCP" = "NO" ]; then - echo "ifconfig_${INTERFACE}=\"inet $ADDRESSV4 netmask $NETMASK\"" >> $BSDINSTALL_TMPETC/rc.conf.network - echo "defaultrouter=\"$GWV4\"" >> $BSDINSTALL_TMPETC/rc.conf.networ - fi + if [ "$DHCP" = "YES" ]; then + echo "ifconfig_${INTERFACE}=\"DHCP\"" >> $BSDINSTALL_TMPETC/rc.conf.network + fi + + if [ "$DHCP" = "NO" ]; then + echo "ifconfig_${INTERFACE}=\"inet $ADDRESSV4 netmask $NETMASK\"" >> $BSDINSTALL_TMPETC/rc.conf.network + echo "defaultrouter=\"$GWV4\"" >> $BSDINSTALL_TMPETC/rc.conf.networ + fi fi if [ -n "$INTERFACE" ] && [ "$IPV6" = "YES" ]; then @@ -223,32 +223,32 @@ fi if [ "$SLAAC" = "NO" ]; then - echo "ifconfig_${INTERFACE}_ipv6=\"ineti6 $ADDRESSV6 prefixlen $PREFIXV6\"" >> $BSDINSTALL_TMPETC/rc.conf.network - echo "ipv6_defaultrouter=\"$GWV6\"" >> $BSDINSTALL_TMPETC/rc.conf.network - fi + echo "ifconfig_${INTERFACE}_ipv6=\"ineti6 $ADDRESSV6 prefixlen $PREFIXV6\"" >> $BSDINSTALL_TMPETC/rc.conf.network + echo "ipv6_defaultrouter=\"$GWV6\"" >> $BSDINSTALL_TMPETC/rc.conf.network + fi fi # resolver mkdir $BSDINSTALL_CHROOT/etc/ if [ "$DOMAIN" ]; then - echo "domain $DOMAIN" >> $BSDINSTALL_CHROOT/etc/resolv.conf + echo "domain $DOMAIN" >> $BSDINSTALL_CHROOT/etc/resolv.conf fi if [ "$DNS1" ]; then - echo "nameserver $DNS1" >> $BSDINSTALL_CHROOT/etc/resolv.conf + echo "nameserver $DNS1" >> $BSDINSTALL_CHROOT/etc/resolv.conf fi if [ "$DNS2" ]; then - echo "nameserver $DNS2" >> $BSDINSTALL_CHROOT/etc/resolv.conf + echo "nameserver $DNS2" >> $BSDINSTALL_CHROOT/etc/resolv.conf fi if [ "$DNS3" ]; then - echo "nameserver $DNS3" >> $BSDINSTALL_CHROOT/etc/resolv.conf + echo "nameserver $DNS3" >> $BSDINSTALL_CHROOT/etc/resolv.conf fi if [ "$DNS4" ]; then - echo "nameserver $DNS4" >> $BSDINSTALL_CHROOT/etc/resolv.conf + echo "nameserver $DNS4" >> $BSDINSTALL_CHROOT/etc/resolv.conf fi Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/services ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/services Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/services Mon Aug 18 10:38:51 2014 (r272602) @@ -55,22 +55,22 @@ havedump= if [ -z "$TOFILE" ]; then - for daemon in $DAEMONS; do - [ "$daemon" = "dumpdev" ] && havedump=1 continue - echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services - done + for daemon in $DAEMONS; do + [ "$daemon" = "dumpdev" ] && havedump=1 continue + echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services + done else - for daemon in $DAEMONS; do - DAEMONLIST="$DAEMONLIST $daemon" - done - echo "DAEMONS=\"$DAEMONLIST\"" >> "$TOFILE" + for daemon in $DAEMONS; do + DAEMONLIST="$DAEMONLIST $daemon" + done + echo "DAEMONS=\"$DAEMONLIST\"" >> "$TOFILE" fi echo '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \ - 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services + 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services if [ "$havedump" ]; then - [ -z "$TOFILE" ] && echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services + [ -z "$TOFILE" ] && echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services else - [ -z "$TOFILE" ] && echo dumpdev=\"NO\" >> $BSDINSTALL_TMPETC/rc.conf.services + [ -z "$TOFILE" ] && echo dumpdev=\"NO\" >> $BSDINSTALL_TMPETC/rc.conf.services fi Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/time ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/time Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/time Mon Aug 18 10:38:51 2014 (r272602) @@ -35,9 +35,9 @@ exec 3>&1 TIMEZONE=`dialog --backtitle "FreeBSD Installer" \ - --title "Time Zone Selection" \ - --menu "Please select a country or region closest to you." \ - 0 0 0 \ + --title "Time Zone Selection" \ + --menu "Please select a country or region closest to you." \ + 0 0 0 \ Africa/Abidjan ""\ Africa/Accra ""\ Africa/Addis_Ababa ""\ @@ -414,6 +414,6 @@ ;; $DIALOG_OK) echo "TIMEZONE=\"$TIMEZONE\"" >> "$TOFILE" - ;; + ;; esac fi Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/zfsboot Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/zfsboot Mon Aug 18 10:38:51 2014 (r272602) @@ -1465,42 +1465,42 @@ fi fi - if [ ! -z "$TOFILE" ]; then - echo "ZFSBOOT=\"YES\"" >> "$TOFILE" - echo "ZFSBOOT_VDEV_TYPE=\"$ZFSBOOT_VDEV_TYPE\"" >> "$TOFILE" - echo "ZFSBOOT_DISKS=\"$ZFSBOOT_DISKS\"" >> "$TOFILE" - echo "ZFSBOOT_POOL_NAME=\"$ZFSBOOT_POOL_NAME\"" >> "$TOFILE" - echo "ZFSBOOT_PARTITION_SCHEME=\"$ZFSBOOT_PARTITION_SCHEME\"" >> "$TOFILE" - echo "ZFSBOOT_SWAP_SIZE=\"$ZFSBOOT_SWAP_SIZE\"" >> "$TOFILE" - echo "ZFSBOOT_CONFIRM_LAYOUT=" >> "$TOFILE" - echo "ZFSBOOT_PRESEED_CONFIRM=\"YES\"" >> "$TOFILE" - - if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then - echo "ZFSBOOT_GNOP_4K_FORCE_ALIGN=\"YES\"" >> "$TOFILE" - else - echo "ZFSBOOT_GNOP_4K_FORCE_ALIGN=\"NO\"" >> "$TOFILE" - fi - - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - echo "ZFSBOOT_GELI_ENCRYPTION=\"YES\"" >> "$TOFILE" - else - echo "ZFSBOOT_GELI_ENCRYPTION=\"NO\"" >> "$TOFILE" - fi - - if [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then - echo "ZFSBOOT_SWAP_ENCRYPTION=\"YES\"" >> "$TOFILE" - else - echo "ZFSBOOT_SWAP_ENCRYPTION=\"NO\"" >> "$TOFILE" - fi - - if [ "$ZFSBOOT_SWAP_MIRROR" ]; then - echo "ZFSBOOT_SWAP_MIRROR=\"YES\"" >> "$TOFILE" - else - echo "ZFSBOOT_SWAP_MIRROR=\"NO\"" >> "$TOFILE" - fi + if [ ! -z "$TOFILE" ]; then + echo "ZFSBOOT=\"YES\"" >> "$TOFILE" + echo "ZFSBOOT_VDEV_TYPE=\"$ZFSBOOT_VDEV_TYPE\"" >> "$TOFILE" + echo "ZFSBOOT_DISKS=\"$ZFSBOOT_DISKS\"" >> "$TOFILE" + echo "ZFSBOOT_POOL_NAME=\"$ZFSBOOT_POOL_NAME\"" >> "$TOFILE" + echo "ZFSBOOT_PARTITION_SCHEME=\"$ZFSBOOT_PARTITION_SCHEME\"" >> "$TOFILE" + echo "ZFSBOOT_SWAP_SIZE=\"$ZFSBOOT_SWAP_SIZE\"" >> "$TOFILE" + echo "ZFSBOOT_CONFIRM_LAYOUT=" >> "$TOFILE" + echo "ZFSBOOT_PRESEED_CONFIRM=\"YES\"" >> "$TOFILE" + + if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then + echo "ZFSBOOT_GNOP_4K_FORCE_ALIGN=\"YES\"" >> "$TOFILE" + else + echo "ZFSBOOT_GNOP_4K_FORCE_ALIGN=\"NO\"" >> "$TOFILE" + fi + + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + echo "ZFSBOOT_GELI_ENCRYPTION=\"YES\"" >> "$TOFILE" + else + echo "ZFSBOOT_GELI_ENCRYPTION=\"NO\"" >> "$TOFILE" + fi + + if [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then + echo "ZFSBOOT_SWAP_ENCRYPTION=\"YES\"" >> "$TOFILE" + else + echo "ZFSBOOT_SWAP_ENCRYPTION=\"NO\"" >> "$TOFILE" + fi + + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then + echo "ZFSBOOT_SWAP_MIRROR=\"YES\"" >> "$TOFILE" + else + echo "ZFSBOOT_SWAP_MIRROR=\"NO\"" >> "$TOFILE" + fi - break - fi + break + fi # # Last Chance! Modified: soc2014/kczekirda/pxe-fai-head/tools/mfsbsd/conf/rc.local.sample ============================================================================== --- soc2014/kczekirda/pxe-fai-head/tools/mfsbsd/conf/rc.local.sample Mon Aug 18 10:33:52 2014 (r272601) +++ soc2014/kczekirda/pxe-fai-head/tools/mfsbsd/conf/rc.local.sample Mon Aug 18 10:38:51 2014 (r272602) @@ -46,58 +46,52 @@ file="/etc/installerconfig" -if [ -f "$file" ] && [ `head -n 1 "$file"` == "#!fai" ]; then - method="installerconfig" +if [ -f "$file" -a "$( head -n 1 "$file" )" = "#!fai" ]; then + method="installerconfig" fi -preseed=`cat /var/db/dhclient.leases.* | grep bootfile-name | head -n 1 | awk '{print $3}' | tr -d '";'` +preseed=$( awk '/bootfile-name/{sub(/;/,"",$3);print $3;exit}' +/var/db/dhclient.leases.* ) -if [ ! -z "$preseed" ]; then - input="/tmp/fai.conf" +if [ "$preseed" ]; then + input="/tmp/fai.conf" - # default config + # default config - fetch "$preseed"/default -o "$input".default - if [ `head -n "$input".default` == "#!fai" ]; then - method="default"; - fi - - # mac based config - - macs=`ifconfig | grep ether | awk '{print $2}'` - - for mac in $macs - do - fetch "$preseed"/"$mac" -o "$input".$mac - if [ `head -n 1 "$input"."$mac"` == "#!fai" ]; then - method="mac" - rightmac="$mac" - break - fi - done + fetch "$preseed"/default -o "$input.default" + if [ "$( head -n "$input.default" )" = "#!fai" ]; then + method="default" + fi + + # mac based config + + for mac in $( ifconfig | awk '/ether/{print $2}' ); do + fetch "$preseed"/"$mac" -o "$input.$mac" + if [ "$( head -n 1 "$input.$mac" )" = "#!fai" ]; then + method="mac" + rightmac="$mac" + break + fi + done fi case "$method" in - installerconfig) - input="$file" - ;; - default) - input="$input".default - ;; - mac) - input="$input"."$rightmac" - ;; - *) - echo "No installation method detected, run bsdinstall manually" - exit - ;; + installerconfig) input="$file" ;; + default) input="$input.default" ;; + mac) input="$input"."$rightmac" ;; + *) + echo "No installation method detected, run bsdinstall manually" + exit + ;; esac if bsdinstall script "$input"; then - dialog --backtitle "FreeBSD Installer" --title "Complete" --no-cancel --ok-label "Reboot" --pause "Installation of FreeBSD complete! Rebooting in 10 seconds" 10 30 10 + dialog --backtitle "FreeBSD Installer" --title "Complete" \ + --no-cancel --ok-label "Reboot" --pause \ + "Installation of FreeBSD complete! Rebooting in 10 seconds" 10 30 10 reboot else - dialog --backtitle "FreeBSD Installer" --title "Error" --textbox /tmp/bsdinstall_log 0 0 + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --textbox /tmp/bsdinstall_log 0 0 fi -exit
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408181038.s7IAcqu4038170>