]> Untitled Git - hvlinux.git/commitdiff
Use tmpfs to mount /tmp
authorHugo Villeneuve <hugo@hugovil.com>
Fri, 23 Aug 2013 00:36:34 +0000 (20:36 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 31 Jul 2014 02:15:23 +0000 (22:15 -0400)
Add optional size for /tmp partition. By default, tmpfs will reserve up to half
the RAM for any tmpfs filesystem without a specific size.

config/acer-731/sysinfos
config/sysinfos.default
stage1/bootscripts/cleanfs
stage1/bootscripts/mountkernfs
stage1/create-config-files

index 1f34502247cc663763793ef48c057d77f85d99ee..fb51bece32d4184d9803c26886229b0a952a9494 100644 (file)
@@ -14,6 +14,7 @@ LFS="/mnt/rescue"
 LFS_PARTITION="/dev/sda3"
 BOOT_PARTITION="/dev/sda1"
 SWAP_PARTITION="/dev/sda2"
+TMP_PARTITION_SIZE="10G"
 
 # New user to create
 REGUSER="hugo"
index e2e29d0d8e2769a1d8b86da0bf73729a2f030057..a1140b3c646a965df5f83b702bc87ebf3f3152eb 100644 (file)
@@ -28,6 +28,9 @@ LFS="/mnt/hvlinux"
 #BOOT_PARTITION="/dev/sdb1"
 #SWAP_PARTITION="/dev/sdb2"
 
+# /tmp is now mounted with tmpfs.
+TMP_PARTITION_SIZE="8G"
+
 # New user to create
 REGUSER=""
 
index 48c2fdc1282d1ddb76dcc41af05a88e732cb6f0c..1efde79a49c81ab90d55600bf8c7fb1c01a18267 100755 (executable)
@@ -12,9 +12,6 @@ clean_files()
 {
     failed=0
 
-    cd /tmp &&
-    find . -xdev -mindepth 1 ! -name lost+found ! -name trash -delete || failed=1
-
     cd /var/lock &&
     find . -type f ! -newer /proc -exec rm -f {} \; || failed=1
 
index a81cf626a891be01b79e33c8f07ad745e87965a2..e0552afc4f3fd33f4f48bfbd25b4516f544518d6 100755 (executable)
@@ -14,6 +14,7 @@ case "$1" in
        # which we are in the process of mounting).
        cmd_run_log_box "Mounting /proc" mount -n /proc
        cmd_run_log_box "Mounting /sys" mount /sys
+       cmd_run_log_box "Mounting /tmp" mount /tmp
        cmd_run_log_box "Mounting /run" mount /run
        ;;
 
index 35ef06ae09fa7257f71f409c8902a55722d49830..1dbb9bec6444c5dc6d276ee56cdb532a2b139d41 100755 (executable)
@@ -20,12 +20,15 @@ cat >> ${LFS}/etc/fstab << "EOF"
 proc              /proc             proc     defaults         0 0
 sysfs             /sys              sysfs    defaults         0 0
 tmpfs             /run              tmpfs    defaults         0 0
+tmpfs             /tmp              tmpfs    defaults,mode=1777,size=_TMP_PARTITION_SIZE_ 0 0
 devpts            /dev/pts          devpts   gid=4,mode=620   0 0
 shm               /dev/shm          tmpfs    defaults         0 0
 
 /dev/dvd        /media/dvd      auto      noauto,ro,users
 EOF
 
+sed -i -e "s!_TMP_PARTITION_SIZE_!${TMP_PARTITION_SIZE}!g" ${LFS}/etc/fstab
+
 echo "Creating basic /etc/profile and /etc/profile.d"
 install -v -m755 -d ${LFS}/etc/profile.d
 cat > ${LFS}/etc/profile << "EOF"