pax_global_header00006660000000000000000000000064121576132560014522gustar00rootroot0000000000000052 comment=03b40b599a17fc6be6e147b5ae7fb3d5172ab434 installer-feature-kdesktop-tmpfs-2.1/000075500000000000000000000000001215761325600177615ustar00rootroot00000000000000installer-feature-kdesktop-tmpfs-2.1/.gear-rules000064400000000000000000000000071215761325600220250ustar00rootroot00000000000000tar: . installer-feature-kdesktop-tmpfs-2.1/80-kdesktop-tmpfs.sh000075500000000000000000000032411215761325600235200ustar00rootroot00000000000000#!/bin/sh export LC_ALL=POSIX SYSTEMCTL=systemctl a= . install2-init-functions set_type_units() { ACTION=$1 shift UNITTYPE=$1 shift while [ -n "$1" ] do exec_chroot $SYSTEMCTL $ACTION ${1}.${UNITTYPE} ||: shift done } # set TMPDIR to /tmp/.private/LOGNAME exec_chroot control pam_mktemp enabled ||: # turn off tmpfs sed -i 's|^tmpfs|#tmpfs|' $destdir/etc/fstab ||: # turn off systemd tmp.mount # don't mask because systemd local fs mount bug ALT#29066 #set_type_units mask mount tmp # find free space for /tmp BEST_SPACE=0 BEST_MP= while read DEV MP X do echo "$DEV" | grep -qe '^UUID=' || echo "$DEV" | grep -qe '^/dev/' || continue echo "$MP" | grep -qe '^/' || continue # tmpdir already configured if [ "$MP" == "/tmp" ]; then BEST_MP= ((BEST_SPACE=0)) break fi # check for writing TEST_WRITE_FILE="${destdir}/${MP}/_TEST_WRITE_" if touch "$TEST_WRITE_FILE" then # check for permissions chmod --quiet 1777 "$TEST_WRITE_FILE" \ || continue NEW_PERMS=`stat --printf='%a' "$TEST_WRITE_FILE"` rm -f "$TEST_WRITE_FILE" [ "$NEW_PERMS" == "1777" ] \ || continue else continue fi # check for free space MP_SPACE=$(echo `/bin/df "$destdir/$MP"| tail -n 1`| cut -d\ -f 4) if (($MP_SPACE > $BEST_SPACE)) ; then BEST_MP=$MP ((BEST_SPACE=$MP_SPACE)) fi done < $destdir/etc/fstab if (($BEST_SPACE > 0)) && [ -n "$BEST_MP" -a "$BEST_MP" != "/" -a ! -d "$destdir/$BEST_MP/tmp" ] then # setup tmp mount point cp -ar $destdir/tmp "$destdir/$BEST_MP"/ ||: echo -e "$BEST_MP/tmp\t/tmp\tauto\tbind,rw,nosuid\t0\t0" >> $destdir/etc/fstab ||: fi installer-feature-kdesktop-tmpfs-2.1/installer-feature-kdesktop-tmpfs.spec000064400000000000000000000017331215761325600272400ustar00rootroot00000000000000Name: installer-feature-kdesktop-tmpfs Version: 2.1 Release: alt1 Summary: Setup services for start/not start on boot License: GPL Group: System/Configuration/Other Url: http://www.altlinux.org/Installer/beans BuildArch: noarch Source: %name-%version.tar %description Setup tmp filesystem: - turn off tmpfs - turn on pam_mktemp - find biggest free space for /tmp; modyfy /etc/fstab if needed %prep %setup %build %install %define hookdir %_datadir/install2/postinstall.d mkdir -p %buildroot%hookdir install -pm755 *.sh %buildroot%hookdir/ %files %hookdir/* %changelog * Mon Jun 17 2013 Sergey V Turchin 2.1-alt1 - don't mask tmp.mount unit - add nosuid option for /tmp * Thu May 16 2013 Sergey V Turchin 2.0-alt1 - mask tmp.mount unit * Wed Feb 13 2013 Sergey V Turchin 1.1-alt1 - check for possibility to change file mode on filesystem * Wed Oct 13 2010 Sergey V Turchin 1.0-alt1 - initial build