Changeset 15587 in niluje


Ignore:
Timestamp:
Dec 11, 2018, 12:06:45 AM (3 months ago)
Author:
NiLuJe
Message:

MRPI:

  • Double-check tmpfs mount/umount, like we do for the rootfs…
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Configs/trunk/Kindle/KUAL/MRInstaller/extensions/MRInstaller/bin/mrinstaller.sh

    r15586 r15587  
    298298MRPI_PKGDIR="/mnt/us/mrpackages"
    299299# We're using our own tmpfs
    300 MRPI_TMPFS="/tmp/mrpi"
     300MRPI_TMPFS="/var/tmp/mrpi"
    301301# We're working in a staging directory, in our tmpfs
    302302MRPI_WORKDIR="${MRPI_TMPFS}/staging"
     
    362362}
    363363
     364## Check if our own tmpfs is mounted
     365is_mrpi_tmpfs_up()
     366{
     367        if grep -q "^tmpfs ${MRPI_TMPFS} tmpfs " /proc/mounts ; then
     368                # Peachy :)
     369                return 0
     370        fi
     371
     372        # Huh, it's already up?
     373        return 1
     374}
     375
    364376## To make things faster, we'll try to do as much work in RAM as possible
    365377## But since none of the existing tmpfs fit our needs, we'll create our own.
     
    367379{
    368380        logmsg "I" "mount_mrpi_tmpfs" "" "trying to create mrpi tmpfs"
     381
     382        # Sync first...
     383        sync
     384
     385        # Don't do anything if for some strange reason it's already up...
     386        if is_mrpi_tmpfs_up ; then
     387                logmsg "W" "mount_mrpi_tmpfs" "" "mrpi tmpfs is already mounted!"
     388                return 0
     389        fi
    369390
    370391        # Namely, the default ones tend to be small. So let's say we want one that's about 62.5% of the total RAM.
     
    384405        fi
    385406
     407        # Even if it appeared to work, double check...
     408        if ! is_mrpi_tmpfs_up ; then
     409                logmsg "E" "mount_mrpi_tmpfs" "" "mrpi tmpfs is still not mounted!"
     410                return 1
     411        fi
     412
    386413        # Success!
    387414        logmsg "I" "mount_mrpi_tmpfs" "" "created ${tmpfs_size}kB mrpi tmpfs"
     
    400427        if [ $? -ne 0 ] ; then
    401428                logmsg "E" "umount_mrpi_tmpfs" "" "failed to unmount mrpi tmpfs!"
     429                return 1
     430        fi
     431
     432        # Even if it appeared to work, double check...
     433        if is_mrpi_tmpfs_up ; then
     434                logmsg "E" "umount_mrpi_tmpfs" "" "mrpi tmpfs is still mounted!"
    402435                return 1
    403436        fi
Note: See TracChangeset for help on using the changeset viewer.