[Fedora-spins] [RFC PATCH] use systemd's /tmp-on-tmpfs mount rather than hardcoding it

Bill Nottingham notting at redhat.com
Fri Oct 12 13:11:00 UTC 2012


On live images, we're currently mounting a /tmp tmpfs on top of systemd's
default /tmp tmpfs. That's likely not wise.

This changes it to just enable the systemd service.

Note: this does it *on the image*, so it will carry over into the installed
system, even if the systemd default changes. We could do it in the livesys
script, but that's less clean, as it's doing it midway through boot.

Bill
-------------- next part --------------
diff --git a/fedora-live-base.ks b/fedora-live-base.ks
index 9869646..d4f9a74 100644
--- a/fedora-live-base.ks
+++ b/fedora-live-base.ks
@@ -159,9 +159,8 @@ fi
 # make it so that we don't do writing to the overlay for things which
 # are just tmpdirs/caches
 mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
-mount -t tmpfs tmp /tmp
 mount -t tmpfs vartmp /var/tmp
-[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
+[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /var/tmp >/dev/null 2>&1
 
 if [ -n "\$configdone" ]; then
   exit 0
@@ -280,6 +279,9 @@ chmod 755 /etc/rc.d/init.d/livesys-late
 /sbin/restorecon /etc/rc.d/init.d/livesys-late
 /sbin/chkconfig --add livesys-late
 
+# enable tmpfs for /tmp
+systemctl enable tmp.mount
+
 # work around for poor key import UI in PackageKit
 rm -f /var/lib/rpm/__db*
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
diff --git a/fedora-live-mini.ks b/fedora-live-mini.ks
index 1454c9a..ec91614 100644
--- a/fedora-live-mini.ks
+++ b/fedora-live-mini.ks
@@ -203,9 +203,8 @@ fi
 # make it so that we don't do writing to the overlay for things which
 # are just tmpdirs/caches
 mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
-mount -t tmpfs tmp /tmp
 mount -t tmpfs vartmp /var/tmp
-[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
+[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /var/tmp >/dev/null 2>&1
 
 # comment to fix sugar startup
 #if [ -n "\$configdone" ]; then
@@ -332,6 +331,9 @@ chmod 755 /etc/rc.d/init.d/livesys-late
 /sbin/restorecon /etc/rc.d/init.d/livesys-late
 /sbin/chkconfig --add livesys-late
 
+# enable tmpfs for /tmp
+systemctl enable tmp.mount
+
 # work around for poor key import UI in PackageKit
 rm -f /var/lib/rpm/__db*
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora


More information about the spins mailing list