Commit fce62d61 authored by Franco Fichtner's avatar Franco Fichtner

etc: move rc.conf_mount_r*

parent ebcc9920
...@@ -96,7 +96,7 @@ ON_DISK_V6_CKSUM=`md5 /tmp/bogonsv6 | awk '{ print $4 }'` ...@@ -96,7 +96,7 @@ ON_DISK_V6_CKSUM=`md5 /tmp/bogonsv6 | awk '{ print $4 }'`
if [ "$BOGON_V4_CKSUM" = "$ON_DISK_V4_CKSUM" ] || [ "$BOGON_V6_CKSUM" = "$ON_DISK_V6_CKSUM" ]; then if [ "$BOGON_V4_CKSUM" = "$ON_DISK_V4_CKSUM" ] || [ "$BOGON_V6_CKSUM" = "$ON_DISK_V6_CKSUM" ]; then
# At least one of the downloaded checksums matches, so mount RW # At least one of the downloaded checksums matches, so mount RW
/etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
ENTRIES_MAX=`pfctl -s memory | awk '/table-entries/ { print $4 }'` ENTRIES_MAX=`pfctl -s memory | awk '/table-entries/ { print $4 }'`
...@@ -145,7 +145,7 @@ if [ "$BOGON_V4_CKSUM" = "$ON_DISK_V4_CKSUM" ] || [ "$BOGON_V6_CKSUM" = "$ON_DIS ...@@ -145,7 +145,7 @@ if [ "$BOGON_V4_CKSUM" = "$ON_DISK_V4_CKSUM" ] || [ "$BOGON_V6_CKSUM" = "$ON_DIS
fi fi
# We mounted RW, so switch back to RO # We mounted RW, so switch back to RO
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
fi fi
if [ "$checksum_error" != "" ]; then if [ "$checksum_error" != "" ]; then
......
#!/bin/sh #!/bin/sh
/etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
PFSENSETYPE=`cat /usr/local/etc/platform` PFSENSETYPE=`cat /usr/local/etc/platform`
......
#!/bin/sh #!/bin/sh
/etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
# Record the previous version # Record the previous version
PRIOR_VERSION=`uname -r | cut -d'.' -f1` PRIOR_VERSION=`uname -r | cut -d'.' -f1`
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Save the DHCP lease database to the config path. # Save the DHCP lease database to the config path.
if [ -d "/var/dhcpd/var/db" ]; then if [ -d "/var/dhcpd/var/db" ]; then
/etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
cd / && tar -czf /cf/conf/dhcpleases.tgz -C / var/dhcpd/var/db/ cd / && tar -czf /cf/conf/dhcpleases.tgz -C / var/dhcpd/var/db/
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
fi fi
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
# Save the rrd databases to the config path. # Save the rrd databases to the config path.
if [ -d "${RRDDBPATH}" ]; then if [ -d "${RRDDBPATH}" ]; then
[ -z "$NO_REMOUNT" ] && /etc/rc.conf_mount_rw [ -z "$NO_REMOUNT" ] && /usr/local/etc/rc.conf_mount_rw
for rrdfile in "${RRDDBPATH}"/*.rrd ; do for rrdfile in "${RRDDBPATH}"/*.rrd ; do
xmlfile="${rrdfile%.rrd}.xml" xmlfile="${rrdfile%.rrd}.xml"
/usr/bin/nice -n20 /usr/local/bin/rrdtool dump "$rrdfile" "$xmlfile" /usr/bin/nice -n20 /usr/local/bin/rrdtool dump "$rrdfile" "$xmlfile"
done done
cd / && tar -czf "${CF_CONF_PATH}"/rrd.tgz -C / "${RRDDBPATH#/}"/*.xml cd / && tar -czf "${CF_CONF_PATH}"/rrd.tgz -C / "${RRDDBPATH#/}"/*.xml
rm "${RRDDBPATH}"/*.xml rm "${RRDDBPATH}"/*.xml
[ -z "$NO_REMOUNT" ] && /etc/rc.conf_mount_ro [ -z "$NO_REMOUNT" ] && /usr/local/etc/rc.conf_mount_ro
fi fi
#!/usr/local/bin/php -f #!/usr/local/bin/php -f
<?php <?php
/* $Id$ */
/* /*
rc.conf_mount_ro
part of pfSense (https://www.pfsense.org) part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich Copyright (C) 2004 Scott Ullrich
All rights reserved. All rights reserved.
...@@ -32,5 +31,3 @@ ...@@ -32,5 +31,3 @@
require_once("config.inc"); require_once("config.inc");
conf_mount_ro(); conf_mount_ro();
?>
#!/usr/local/bin/php -f #!/usr/local/bin/php -f
<?php <?php
/* $Id$ */
/* /*
rc.conf_mount_rw
part of pfSense (https://www.pfsense.org) part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich Copyright (C) 2004 Scott Ullrich
All rights reserved. All rights reserved.
...@@ -32,5 +31,3 @@ ...@@ -32,5 +31,3 @@
require_once("config.inc"); require_once("config.inc");
conf_mount_rw(); conf_mount_rw();
?>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# All rights reserved. # All rights reserved.
# mount /cf # mount /cf
/etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
# Reset file(s) # Reset file(s)
echo "" >/conf/upgrade_log.txt echo "" >/conf/upgrade_log.txt
...@@ -123,7 +123,7 @@ enable) ...@@ -123,7 +123,7 @@ enable)
echo "" >> /conf/upgrade_log.txt echo "" >> /conf/upgrade_log.txt
echo "Enable" >> /conf/upgrade_log.txt echo "Enable" >> /conf/upgrade_log.txt
echo "" >> /conf/upgrade_log.txt echo "" >> /conf/upgrade_log.txt
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
;; ;;
auto) auto)
touch /var/run/firmwarelock.dirty touch /var/run/firmwarelock.dirty
...@@ -131,14 +131,14 @@ auto) ...@@ -131,14 +131,14 @@ auto)
remove_chflags remove_chflags
/usr/local/etc/rc.firmware_auto /usr/local/etc/rc.firmware_auto
restore_chflags restore_chflags
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
;; ;;
pfSenseNanoBSDupgrade) pfSenseNanoBSDupgrade)
# Sanity check - bail early if there's no firmware file! # Sanity check - bail early if there's no firmware file!
if [ ! -r $IMG ]; then if [ ! -r $IMG ]; then
echo "2nd parameter has not been passed or file does not exist. Exiting." >> /conf/upgrade_log.txt 2>&1 echo "2nd parameter has not been passed or file does not exist. Exiting." >> /conf/upgrade_log.txt 2>&1
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
exit 1 exit 1
fi fi
...@@ -147,7 +147,7 @@ pfSenseNanoBSDupgrade) ...@@ -147,7 +147,7 @@ pfSenseNanoBSDupgrade)
echo "You cannot use a full file for upgrade. Please use a file labeled nanobsd upgrade." echo "You cannot use a full file for upgrade. Please use a file labeled nanobsd upgrade."
file_notice "NanoBSDUpgradeFailure" "You have attemped to use a full NanoBSD installation file as an upgrade. Please use a NanoBSD file labeled 'upgrade' instead." file_notice "NanoBSDUpgradeFailure" "You have attemped to use a full NanoBSD installation file as an upgrade. Please use a NanoBSD file labeled 'upgrade' instead."
rm -f $IMG rm -f $IMG
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
exit 1 exit 1
fi fi
...@@ -217,7 +217,7 @@ pfSenseNanoBSDupgrade) ...@@ -217,7 +217,7 @@ pfSenseNanoBSDupgrade)
rm -f /var/run/firmwarelock.dirty rm -f /var/run/firmwarelock.dirty
rm -f /var/run/firmware.lock rm -f /var/run/firmware.lock
rm -f ${IMG} rm -f ${IMG}
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
exit 1 exit 1
fi fi
...@@ -268,7 +268,7 @@ pfSenseNanoBSDupgrade) ...@@ -268,7 +268,7 @@ pfSenseNanoBSDupgrade)
rm -f $IMG rm -f $IMG
rm -f /var/run/firmwarelock.dirty rm -f /var/run/firmwarelock.dirty
rm -f /var/run/firmware.lock rm -f /var/run/firmware.lock
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
exit 1 exit 1
fi fi
...@@ -314,7 +314,7 @@ pfSenseNanoBSDupgrade) ...@@ -314,7 +314,7 @@ pfSenseNanoBSDupgrade)
rm -f /var/run/firmwarelock.dirty rm -f /var/run/firmwarelock.dirty
rm -f /var/run/firmware.lock rm -f /var/run/firmware.lock
umount /tmp/$GLABEL_SLICE umount /tmp/$GLABEL_SLICE
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
exit 1 exit 1
fi fi
echo "" >> /conf/upgrade_log.txt echo "" >> /conf/upgrade_log.txt
...@@ -362,7 +362,7 @@ pfSenseNanoBSDupgrade) ...@@ -362,7 +362,7 @@ pfSenseNanoBSDupgrade)
touch /conf/needs_package_sync touch /conf/needs_package_sync
# remount /cf ro # remount /cf ro
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
/bin/sync /bin/sync
echo "NanoBSD Firmware upgrade is complete. Rebooting in 10 seconds." >> /conf/upgrade_log.txt 2>&1 echo "NanoBSD Firmware upgrade is complete. Rebooting in 10 seconds." >> /conf/upgrade_log.txt 2>&1
...@@ -381,7 +381,7 @@ pfSenseupgrade) ...@@ -381,7 +381,7 @@ pfSenseupgrade)
# Sanity check - bail early if there's no firmware file! # Sanity check - bail early if there's no firmware file!
if [ ! -r $IMG ]; then if [ ! -r $IMG ]; then
echo "2nd parameter has not been passed or file does not exist. Exiting." >> /conf/upgrade_log.txt 2>&1 echo "2nd parameter has not been passed or file does not exist. Exiting." >> /conf/upgrade_log.txt 2>&1
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
exit exit
fi fi
...@@ -480,7 +480,7 @@ pfSenseupgrade) ...@@ -480,7 +480,7 @@ pfSenseupgrade)
echo "" >> /conf/upgrade_log.txt echo "" >> /conf/upgrade_log.txt
# remount /cf ro # remount /cf ro
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
# release the firmware lock # release the firmware lock
rm -f /var/run/firmwarelock.dirty rm -f /var/run/firmwarelock.dirty
...@@ -511,7 +511,7 @@ delta_update) ...@@ -511,7 +511,7 @@ delta_update)
binary_update $IMG binary_update $IMG
restore_chflags restore_chflags
find / -name CVS -type d -exec rm {} \; find / -name CVS -type d -exec rm {} \;
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
/sbin/umount -f /cf 2>/dev/null /sbin/umount -f /cf 2>/dev/null
/sbin/mount -r /cf 2>/dev/null /sbin/mount -r /cf 2>/dev/null
/sbin/umount -f / 2>/dev/null /sbin/umount -f / 2>/dev/null
......
...@@ -45,13 +45,13 @@ if [ "$PMD" = "$MD" ]; then ...@@ -45,13 +45,13 @@ if [ "$PMD" = "$MD" ]; then
echo "MD5's match." | logger -p daemon.info -i -t AutoUpgrade echo "MD5's match." | logger -p daemon.info -i -t AutoUpgrade
echo "Beginning ${product} upgrade." | wall echo "Beginning ${product} upgrade." | wall
if [ "$PLATFORM" = "net45xx" ]; then if [ "$PLATFORM" = "net45xx" ]; then
/usr/local/bin/php /etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
fi fi
if [ "$PLATFORM" = "wrap" ]; then if [ "$PLATFORM" = "wrap" ]; then
/usr/local/bin/php /etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
fi fi
if [ "$PLATFORM" = "nanobsd" ]; then if [ "$PLATFORM" = "nanobsd" ]; then
/usr/local/bin/php /etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
fi fi
if [ -r "/tmp/custom.tgz" ]; then if [ -r "/tmp/custom.tgz" ]; then
sh /usr/local/etc/rc.firmware pfSenseupgrade /tmp/latest.tgz /tmp/custom.tgz sh /usr/local/etc/rc.firmware pfSenseupgrade /tmp/latest.tgz /tmp/custom.tgz
...@@ -65,7 +65,7 @@ if [ "$PMD" = "$MD" ]; then ...@@ -65,7 +65,7 @@ if [ "$PMD" = "$MD" ]; then
if [ "$PLATFORM" = "wrap" ]; then if [ "$PLATFORM" = "wrap" ]; then
/bin/sync /bin/sync
sleep 5 sleep 5
/usr/local/bin/php /etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
if [ -e /etc/init_bootloader.sh ]; then if [ -e /etc/init_bootloader.sh ]; then
sh /etc/init_bootloader.sh sh /etc/init_bootloader.sh
fi fi
...@@ -73,7 +73,7 @@ if [ "$PMD" = "$MD" ]; then ...@@ -73,7 +73,7 @@ if [ "$PMD" = "$MD" ]; then
if [ "$PLATFORM" = "net45xx" ]; then if [ "$PLATFORM" = "net45xx" ]; then
/bin/sync /bin/sync
sleep 5 sleep 5
/usr/local/bin/php /etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
if [ -e /etc/init_bootloader.sh ]; then if [ -e /etc/init_bootloader.sh ]; then
sh /etc/init_bootloader.sh sh /etc/init_bootloader.sh
fi fi
......
#!/bin/sh #!/bin/sh
#write the uptime in seconds to the persistent log in /conf/ #write the uptime in seconds to the persistent log in /conf/
/etc/rc.conf_mount_rw /usr/local/etc/rc.conf_mount_rw
/bin/echo `date -j +%Y.%m.%d-%H:%M:%S` $1 >> /conf/$2.log /bin/echo `date -j +%Y.%m.%d-%H:%M:%S` $1 >> /conf/$2.log
/etc/rc.conf_mount_ro /usr/local/etc/rc.conf_mount_ro
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment