[PC-BSD Commits] r21589 - in pcbsd/current: src-qt4/pc-installgui src-sh/xtrafiles/local/share/pcbsd/scripts
svn at pcbsd.org
svn at pcbsd.org
Wed Feb 20 06:35:14 PST 2013
Author: kris
Date: 2013-02-20 14:35:14 +0000 (Wed, 20 Feb 2013)
New Revision: 21589
Modified:
pcbsd/current/src-qt4/pc-installgui/installer.cpp
pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/reset-firewall
pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh
Log:
Enhance the system init script, so we can run just a single command to
turn a FreeBSD system into PC-BSD / TrueOS.
Add some checks when running firewall reset, make sure we don't blow away
an existing ruleset
Modified: pcbsd/current/src-qt4/pc-installgui/installer.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/installer.cpp 2013-02-20 11:57:35 UTC (rev 21588)
+++ pcbsd/current/src-qt4/pc-installgui/installer.cpp 2013-02-20 14:35:14 UTC (rev 21589)
@@ -1007,20 +1007,11 @@
// Setup the desktop
cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh desktop";
- // Refresh the xdg menus
- cfgList << "runCommand=/usr/local/bin/pc-xdgutil updatemenu";
-
- // Re-Extract PC-BSD distfile to update some pkg config files
- cfgList << "runCommand=/usr/local/bin/pc-extractoverlay ports";
-
- // Copy the known good xorg config to disk
- cfgList << "runExtCommand=cp /etc/X11/xorg.conf ${FSMNT}/usr/local/share/pcbsd/xorg-gui/conf/xorg.conf.basic";
-
- // Flag us for a first boot startup
+ // Setup for a fresh system first boot
+ cfgList << "# Touch flags to enable PC-BSD setup at first boot";
cfgList << "runCommand=touch /var/.runxsetup";
cfgList << "runCommand=touch /var/.pcbsd-firstboot";
cfgList << "runCommand=touch /var/.pcbsd-firstgui";
- cfgList << "runCommand=newaliases";
// Unmount our /dev
cfgList << "runExtCommand=umount -f ${FSMNT}/dev";
@@ -1029,7 +1020,6 @@
// Setup the desktop
cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh server";
- cfgList << "runCommand=newaliases";
} else { // End of PC-BSD specific setup
// Doing FreeBSD Install
@@ -1046,6 +1036,9 @@
cfgList << "runExtCommand=umount -f ${FSMNT}/dev";
}
+ // Run newaliases to fix mail errors
+ cfgList << "runCommand=newaliases";
+
// Now write out the cfgList to file
QFile cfgfile( PCSYSINSTALLCFG );
if ( cfgfile.open( QIODevice::WriteOnly ) ) {
Modified: pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/reset-firewall
===================================================================
--- pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/reset-firewall 2013-02-20 11:57:35 UTC (rev 21588)
+++ pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/reset-firewall 2013-02-20 14:35:14 UTC (rev 21589)
@@ -12,6 +12,12 @@
pf_rules="/etc/pf.conf"
+if [ -e "$pf_rules" ] ; then
+ echo "${pf_rules} already exists!"
+ echo "Remove this file first to re-generate ruleset"
+ exit 1
+fi
+
echo "Creating $pf_rules."
echo "set skip on lo0" > $pf_rules
echo "set block-policy return" >> $pf_rules
Modified: pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh
===================================================================
--- pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh 2013-02-20 11:57:35 UTC (rev 21588)
+++ pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh 2013-02-20 14:35:14 UTC (rev 21589)
@@ -1,16 +1,31 @@
#!/bin/sh
# Script which does some first time init
+case $1 in
+ desktop|server) ;;
+ *) echo "Error: Please specify 'desktop' or 'server'"
+ exit 1
+ ;;
+esac
+
################################################
# Do generic init
################################################
# Setup /home link
-ln -s /usr/home /home
+if [ ! -e "/home" ] ; then
+ ln -s /usr/home /home
+fi
# Init the firewall
sh /usr/local/share/pcbsd/scripts/reset-firewall
+# Update XDG menus
+/usr/local/bin/pc-xdgutil updatemenu
+
+# Update ports overlay files
+/usr/local/bin/pc-extractoverlay ports
+
################################################
# Do desktop specific init
################################################
More information about the Commits
mailing list