From 091601f3a5991fb1d94b35a60f32cc4b5dcab0bc Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Mon, 7 Mar 2005 17:44:40 +0000 Subject: [PATCH] - Tack pfi.conf onto the end of rc.conf later (only after pfi.conf has been copied to /etc, not when it is being looked for.) This allows a pfi.conf file already in /etc (e.g. placed there as part of a custom release) to DTRT in pfi_rc_actions. - Use a much more straightforward method of restoring the original rc.conf file when done. --- nrelease/installer/etc/rc.d/pfi | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nrelease/installer/etc/rc.d/pfi b/nrelease/installer/etc/rc.d/pfi index cfa5868b06..49f732964c 100755 --- a/nrelease/installer/etc/rc.d/pfi +++ b/nrelease/installer/etc/rc.d/pfi @@ -1,7 +1,7 @@ #!/bin/sh # $Id: pfi,v 1.4 2004/08/06 23:26:05 cpressey Exp $ -# $DragonFly: src/nrelease/installer/etc/rc.d/pfi,v 1.4 2005/03/07 17:30:09 cpressey Exp $ +# $DragonFly: src/nrelease/installer/etc/rc.d/pfi,v 1.5 2005/03/07 17:44:40 cpressey Exp $ # # PROVIDE: pfi @@ -22,8 +22,6 @@ get_pfi_config() echo " found!" tr -d "\r" < $1/pfi.conf > /etc/pfi.conf echo "pfi_found_on_device='$2'" >> /etc/pfi.conf - echo "#@@@@@" >>/etc/rc.conf - cat /etc/pfi.conf >>/etc/rc.conf if [ -r /etc/defaults/pfi.conf ]; then . /etc/defaults/pfi.conf fi @@ -94,6 +92,12 @@ pfi_start() echo '' >/etc/pfi.conf fi + # Tack pfi.conf onto the end of rc.conf, so that variables in + # pfi.conf are available to the rc subsystem (for pfi_rc_actions.) + + cp /etc/rc.conf /etc/rc.conf.orig + cat /etc/pfi.conf >>/etc/rc.conf + if [ -r /etc/defaults/pfi.conf ]; then . /etc/defaults/pfi.conf fi @@ -153,12 +157,9 @@ pfi_start() done fi - # Now remove the copy of pfi.conf that we tacked onto - # the end of rc.conf so the above would work + # Restore the original rc.conf. - awk '$1=="#@@@@@" || cut { cut = 1 } !cut { print $0 }' \ - /etc/rc.conf.new - mv /etc/rc.conf.new /etc/rc.conf + mv /etc/rc.conf.orig /etc/rc.conf # Set up auto-login if requested. -- 2.41.0