Revision: 7074 http://sourceforge.net/p/ipcop/svn/7074 Author: gespinasse Date: 2013-07-07 14:00:01 +0000 (Sun, 07 Jul 2013) Log Message: ----------- Really fix unmounting shm on stdumount when /dev/shm is a symlink to /run/shm like debian v7 It does not work to test if ${LFS}/dev/shm is mounted and I find no other way than counting how many time /run/shm is mounted. If the number is greater than 1, assume it's our script that mount bind shm and it is needed to umount.
Add a comment why the umount is conditional as ./make.sh clean doesn't mount On machines that have /dev/shm as symlink, it is required to fix sudo configuration Modified Paths: -------------- ipcop/trunk/make.sh Modified: ipcop/trunk/make.sh =================================================================== --- ipcop/trunk/make.sh 2013-07-02 17:50:26 UTC (rev 7073) +++ ipcop/trunk/make.sh 2013-07-07 14:00:01 UTC (rev 7074) @@ -747,12 +747,13 @@ ${SUDO} ${LOSETUP} -d ${DEVICE} > /dev/null 2>&1 done - # Umount /dev/pts and /dev/shm before /dev + # Umount /dev/pts and /dev/shm before /dev, test if mounted as ./make.sh clean doesn't mount. ${MOUNT} | grep -q ${LFS}/dev/pts && ${SUDO} ${UMOUNT} ${LFS}/dev/pts - # Trying to check ${LFS}/dev/shm may find nothing on debian v7 /run/shm - ${SUDO} ${UMOUNT} ${LFS}/dev/shm + # Find nothing mounted if /dev/shm is a symlink to /run/shm + ${MOUNT} | grep -q ${LFS}/dev/shm && ${SUDO} ${UMOUNT} ${LFS}/dev/shm + # Debian v7 symlink /dev/shm to /run/shm, assume another mounted shm than the first was by us. + [ $(${MOUNT} | grep /run/shm | wc -l) -gt 1 ] && ${SUDO} ${UMOUNT} /run/shm - # Now find and unmount any of the bound filesystems we need for the build for i in `${MOUNT} | grep ${BASEDIR} | sed 's/^.* on \(.[^ ]*\).*$/\1/'` do @@ -889,6 +890,12 @@ SUDO_ERROR=1 fi done + # If /dev/shm is a symlink to /run/shm like debian v7, it is required to umount /run/shm and not ${LFS}/dev/shm + [ -h /dev/shm ] && if ( ! ${SUDO} -ll -U ${CURRENT_USER} | grep -q 'umount /run/shm'); then + [ $SUDO_ERROR -eq 0 ] && beautify message FAIL + beautify message FAIL "sudo not configured to umount /run/shm" + SUDO_ERROR=1 + fi fi echo -ne "${NORMAL}" if [ ${SUDO_ERROR} -eq 0 ]; then @@ -919,7 +926,8 @@ echo -ne "Cmnd_Alias RM = ${RM} ${BASEDIR}/*, \\ \n" echo -ne "\t\t${RM} /${TOOLS_DIR}\n" echo -ne "Cmnd_Alias UMOUNT = ${UMOUNT} ${LFS}/*, \\ \n" - echo -ne "\t\t${UMOUNT} /dev/loop*\n\n" + echo -ne "\t\t${UMOUNT} /dev/loop*, \\ \n" + echo -ne "\t\t${UMOUNT} /run/shm\n\n" echo -ne "IPCOP_BUILDER ALL = NOPASSWD: BIND,CHMOD,DU,LN,LOSETUP,MKDIR,MKNOD,MV,NICECMD,RM,UMOUNT\n" echo -ne "# *** End of IPCop configuration ***\n" echo -ne "${NORMAL}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn