Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Announce][Fremantle] FlopSwap - Swap GUI Management

    Reply
    Page 10 of 36 | Prev |   8     9   10   11     12   20 | Next | Last
    handaxe | # 91 | 2013-07-02, 22:28 | Report

    Originally Posted by sixwheeledbeast View Post
    So what I am calling a 'Hybrid CSSU-Thumb' setup.
    What does
    Code:
    blkid -c /dev/null -o device -t TYPE=swap
    yield on your device?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    sixwheeledbeast | # 92 | 2013-07-02, 22:37 | Report

    Originally Posted by handaxe View Post
    What does
    Code:
    blkid -c /dev/null -o device -t TYPE=swap
    yield on your device?
    Code:
    # blkid -c /dev/null -o device -t TYPE=swap
    /dev/mmcblk1p2
    /dev/mmcblk1p3
    /dev/mmcblk0p3

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to sixwheeledbeast For This Useful Post:
    handaxe

     
    pichlo | # 93 | 2013-07-03, 08:25 | Report

    FWIW, here's mine:
    Code:
    # blkid -c /dev/null -o device -t TYPE=swap
    /dev/mmcblk1p2
    /dev/mmcblk0p3
    No, I am not using FlopSwap. But I have fiddled with my /etc/event.d/rcS-late to get striped swap. (Currently evaluating but convinced more and more that it degrades performance rather than increases.)

    Your situation looks exactly like the result of my fiddling.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to pichlo For This Useful Post:
    fw190, handaxe

     
    handaxe | # 94 | 2013-07-03, 21:18 | Report

    @sixwheeledbest: does your /etc/fstab reflect all 3 swap locations? It should if I read /etc/event.d/rcS-late correctly.

    So what determines the swap enabled at bootup? I thought it was fstab. Can you clarify please.

    @pichlo: I am aware of striping but have never tried it. Thanks for info.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    sixwheeledbeast | # 95 | 2013-07-03, 21:42 | Report

    Originally Posted by handaxe View Post
    @sixwheeledbest: does your /etc/fstab reflect all 3 swap locations? It should if I read /etc/event.d/rcS-late correctly.
    Here's my full output from my latest Tmaemo8.2 to compare.
    I have never modified any of these settings and it is a clean device with only leafpad and flopswap installed.

    Code:
    # cat /etc/event.d/rcS-late
    
    description "late rcS actions"
    
    start on started hal
    stop on stopping hal
    
    console none
    
    script
        #mount /home; fix filesystem and retry mounting if 1st attempt fails
        mount_home ()
        {
        if ! grep -q -E '^\s*[^\s]+\s+/home\s' /etc/fstab; then
          # /home is not in fstab so is part of rootfs and already mounted
          return 0
        fi
        if [ "$home_fsck" != "0" ]; then
          echo "`date +'%Y-%m-%d %H:%M:%S'`  fsck -a /home" >> /var/log/fsck_home.log
          fsck -a /home >> /var/log/fsck_home.log 2>&1 || true
          echo "" >> /var/log/fsck_home.log
        fi
        /bin/mount /home && grep -q '^[^\ ]* /home [^\ ]* [^\ ]*rw.*' /proc/mounts
        if [ $? -eq 0 ]
        then
          return 0
        else
          grep -q '^[^\ ]* /home [^\ ]* [^\ ]*ro.*' /proc/mounts
          if [ $? -eq 0 ]
          then
            umount /home
          fi
          echo "`date +'%Y-%m-%d %H:%M:%S'`  fsck -y /home" >> /var/log/fsck_home.log
          fsck -y /home >> /var/log/fsck_home.log 2>&1 || true
          echo "" >> /var/log/fsck_home.log
          sync
          /bin/mount /home && grep -q '^[^\ ]* /home [^\ ]* [^\ ]*rw.*' /proc/mounts
          return $?
        fi
        }
    
        ACT_DEAD=0
        HOME_MOUNTED=0
    
        #check act_dead
        if [ -e /tmp/ACT_DEAD ]; then
          ACT_DEAD=1
        fi
    
        # Load fstab and mount options
        . /etc/default/mount-opts || true
    
        if [ ! -e /etc/fstab ] || [ "$genfstab" != "0" ]; then
    
          fstab=/etc/fstab
          tmp_fstab=/tmp/fstab
    
          # Find internal eMMC device, fallback to mmcblk0
          for emmc in mmcblk1 mmcblk0; do
            if [ ! -e /dev/$emmc ]; then continue; fi
            device=`stat /dev/$emmc | sed -n 's/.*Device type: //p'`
            major=`echo $device | sed 's/,.*//'`
            minor=`echo $device | sed 's/.*,//'`
            major=$((0x$major))
            minor=$((0x$minor))
            if grep -q internal /sys/dev/block/$major:$minor/device/../slot_name; then
              break
            fi
          done
    
          # Check if / is on ubi
          if grep -q '^ubi0:rootfs / ubifs' /proc/mounts; then
            root_is_ubi=1
          else
            root_is_ubi=0
          fi
    
          # MyDocs will be first eMMC partition, /home will be second
          mydocs=/dev/${emmc}p1
          home=/dev/${emmc}p2
    
          mydocs_type=`blkid -c /dev/null -o value -s TYPE $mydocs`
          home_type=`blkid -c /dev/null -o value -s TYPE $home`
    
          [ -z "$mydocs_type" ] && mydocs_type=vfat;
          [ -z "$home_type" ] && home_type=ext3;
    
          eval mydocs_opts=$common_opts,$user_opts,\$${mydocs_type}_opts
          eval home_opts=$common_opts,$root_opts,\$${home_type}_opts
    
          # Remove duplicate commas from variables
          mydocs_opts=`echo $mydocs_opts | sed ':l;s/,,/,/g;tl;s/^,//;s/,$//'`
          home_opts=`echo $home_opts | sed ':l;s/,,/,/g;tl;s/^,//;s/,$//'`
    
          [ -z "$mydocs_opts" ] && mydocs_opts=defaults
          [ -z "$home_opts" ] && home_opts=defaults
    
          swaps=`blkid -c /dev/null -o device -t TYPE=swap`
    
          if [ "$swap_sd" = "0" ]; then
            swaps=`echo $swaps | tr ' ' '\n' | grep $emmc || true`
          fi
    
          # Generate fstab
          rm -f $tmp_fstab
          echo "# This file was generated by script /etc/event.d/rcS-late" >> $tmp_fstab
          echo "# !!! Do not edit this file. It will be overwritten in next device startup !!!" >> $tmp_fstab
          echo "# If you want static /etc/fstab add genfstab=\"0\" to file /etc/default/mount-opts-overwrite" >> $tmp_fstab
    
          # /
          grep '^[^\ ]* / ' /proc/mounts >> $tmp_fstab || true
    
          # /home
          if [ $root_is_ubi -eq 1 ]; then
            echo "$home /home $home_type $home_opts 0 2" >> $tmp_fstab
          fi
    
          # /opt
          if [ $root_is_ubi -eq 1 ] || [ ! -e /opt ] || [ -d /opt -a -z "`ls -A /opt`" ]; then
            echo "/home/opt /opt none bind 0 0" >> $tmp_fstab
          fi
    
          # /home/user/MyDocs
          echo "$mydocs /home/user/MyDocs $mydocs_type $mydocs_opts 0 2" >> $tmp_fstab
    
          # swap
          for dev in $swaps; do
            echo "$dev none swap sw 0 0" >> $tmp_fstab
          done
    
          cmp -s $tmp_fstab $fstab || cp $tmp_fstab $fstab
          rm -f $tmp_fstab
    
        fi
    
        if [ $ACT_DEAD -eq 0 ]; then
          /sbin/swapon -a || echo "Failed to enable paging partition."
          # Setup lowmem module
          echo 32768  > /proc/sys/vm/lowmem_deny_watermark_pages || true
          echo 98304  > /proc/sys/vm/lowmem_notify_high_pages || true
          echo 131072 > /proc/sys/vm/lowmem_notify_low_pages || true
          echo 1024   > /proc/sys/vm/lowmem_nr_decay_pages || true
          # Exclude some UIDs from memory allocation denial.
          # 30000 is messagebus, 30001 could be used by Matchbox
          echo "30000 30001 30002 30003" > /proc/sys/vm/lowmem_allowed_uids || true
        fi
    
        mount_home && HOME_MOUNTED=1
    
        # If failed to mount /home and system has been already optified - reboot 
        if [ $HOME_MOUNTED -eq 0 ]
        then
          if [ -e /var/lib/maemo-optify-firstboot-do-not-clean-home-opt ]; then
            telinit 6
          fi
        else
          [ ! -d /home/opt ] && mkdir /home/opt
          [ ! -d /opt ] && mkdir /opt
        fi
    
        if [ $ACT_DEAD -eq 0 ]
        then
          if [ $HOME_MOUNTED -eq 1 ]
          then
            if [ -x /usr/sbin/maemo-optify-firstboot.sh ]; then
                . /usr/sbin/maemo-optify-firstboot.sh
            fi
          fi
        fi
    
        /bin/mount /opt || echo "Failed to mount(bind) /opt."
    
        if [ $ACT_DEAD -eq 0 ]
        then
          if [ $HOME_MOUNTED -eq 1 ]
          then
            if [ -x /usr/sbin/maemo-optify-auto-opt.sh ]; then
                . /usr/sbin/maemo-optify-auto-opt.sh
            fi
          fi
    
          if [ -d /home/preinstalled -a -d /home/user ]
          then
            rm -rf /home/user
          fi
    
          if [ ! -d /home/user ]
          then
            if [ -d /home/preinstalled ]
            then
              mv /home/preinstalled /home/user
            else
              mkdir /home/user
            fi
            cd /etc/skel
            cp -a . /home/user
            chown -R user:users /home/user
            sync
          fi
        fi
    
        if [ ! -d /home/user ]
        then
          mkdir /home/user
          chown user:users /home/user
          sync
        fi
    
        # We can safely continue booting now.
        initctl emit MOUNTS_OK
    
        # Adjust flushing of memory card buffers
        echo 40 > /proc/sys/vm/dirty_ratio
        echo 10 > /proc/sys/vm/dirty_background_ratio
    
        # Initialize PRNG pool with the HW RNG. Slow, but that's ok.
        URANDOM_POOLSZ=512
        if [ -e /dev/hwrng ]; then
          RANDOM=/dev/hwrng
        elif [ -e /dev/hw_random ]; then
          RANDOM=/dev/hw_random
        fi
        if [ -e "$RANDOM" ]; then
          echo "Seeding entropy pool"
          dd if=$RANDOM of=/dev/urandom bs=$URANDOM_POOLSZ count=1
        fi
    
        # Data for the panic info driver
        mount -t debugfs nodev /sys/kernel/debug
        if modprobe panic_info_buff; then
          OSSO_VERSION="$(osso-product-info 2>/dev/null || true)"
          CSSU_VERSION="CSSU_VERSION='$(dpkg-query -W -f \${Version} mp-fremantle-community-pr 2>/dev/null || echo '<unknown>')'"
          KERNEL_VERSION="KERNEL_VERSION='$(uname -a 2>/dev/null || echo '<unknown>')'"
          sleep 1
          printf "%s\n%s\n%s" "$OSSO_VERSION" "$CSSU_VERSION" "$KERNEL_VERSION" > /sys/kernel/debug/panic_info_buff || true
        fi
    end script
    
    normal exit 0
    Code:
    # cat /etc/fstab
    
    # This file was generated by script /etc/event.d/rcS-late
    # !!! Do not edit this file. It will be overwritten in next device startup !!!
    # If you want static /etc/fstab add genfstab="0" to file /etc/default/mount-opts-overwrite
    rootfs / rootfs rw 0 0
    ubi0:rootfs / ubifs rw,bulk_read,no_chk_data_crc 0 0
    /dev/mmcblk0p2 /home ext3 noatime,nodiratime,errors=continue,commit=1,data=writeback 0 2
    /home/opt /opt none bind 0 0
    /dev/mmcblk0p1 /home/user/MyDocs vfat noatime,nodiratime,noauto,nodev,exec,nosuid,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0000,rodir 0 2
    /dev/mmcblk0p3 none swap sw 0 0

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to sixwheeledbeast For This Useful Post:
    fw190, handaxe

     
    handaxe | # 96 | 2013-07-03, 22:43 | Report

    Originally Posted by sixwheeledbeast View Post
    Code:
    # cat /etc/fstab
    .....
    
    /dev/mmcblk0p3 none swap sw 0 0
    Mine has all 3 swaps and that clearly is the problem.... why does /etc/event.d/rcS-late generate 3 swaps in fstab for me and not for you? /etc/event.d/rcS-late on my device is the same as yours.

    Sorry to bug-on: what does
    Code:
    /etc/defaults/mount-opts
    contain? I have just found a /etc/default/mount-opts.dpkg-dist with extended options. Did not install for some reason. It has an option
    Code:
    # When generating fstab add also swap partitions from SD card (if exists)
    swap_sd="0"
    that appears relevant.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    sixwheeledbeast | # 97 | 2013-07-04, 19:35 | Report

    Code:
    # cat /etc/default/mount-opts 
    # !!! Do not edit this file. It can be overwritten in next update !!!
    # !!! Instead create and edit file /etc/default/mount-opts-overwrite !!!
    
    # Options for mounting all filesystems
    common_opts="noatime,nodiratime"
    
    # Options for mounting root's filesystems (/, /home)
    root_opts="errors=continue,commit=1,data=writeback"
    
    # Options for mounting user's filesystems (MyDocs, SD cards, ...)
    user_opts="noauto,nodev,exec,nosuid"
    
    # Options for different filesystems
    vfat_opts="utf8,uid=29999,shortname=mixed,dmask=000,fmask=0000,rodir"
    ntfs_opts="nls=utf8,uid=29999,umask=0000"
    
    # Renerate fstab at boot time in /etc/event.d/rcS-late
    genfstab="1"
    
    # When generating fstab add also swap partitions from SD card (if exists)
    swap_sd="0"
    
    # Call fsck.<fstype> -p for /home at boot time in /etc/event.d/rcS-late
    home_fsck="0"
    
    # Call fsck.<fstype> -p for user's partitions (MyDocs, SD cards, ...)
    user_fsck="0"
    
    # Include overwrite file
    if [ -f /etc/default/mount-opts-overwrite ]; then
    	. /etc/default/mount-opts-overwrite
    fi

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to sixwheeledbeast For This Useful Post:
    handaxe

     
    handaxe | # 98 | 2013-07-04, 22:09 | Report

    Originally Posted by sixwheeledbeast View Post
    Code:
    # cat /etc/default/mount-opts 
    # !!! Do not edit this file. It can be overwritten in next update !!!
    # !!! Instead create and edit file /etc/default/mount-opts-overwrite !!!
    ....
    
    # When generating fstab add also swap partitions from SD card (if exists)
    swap_sd="0"
    ...
    Bingo! Yours is the extended version that was not installed on my device, for reasons not clear to me. In a rush, but will test and report back but I believe we have the culprit.....

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to handaxe For This Useful Post:
    fw190, klinglerware, sixwheeledbeast

     
    handaxe | # 99 | 2013-07-05, 13:21 | Report

    Issue with multiple sd-based swaps being active after boot-up is solved.

    /etc/default/mount-opts must be the one posted by sixwheeledbeast and NOT the rather simple default one (i.e. it should be one installed by CSSU-T).

    It appears that there is at least one scenario, following a reflash and installation of CSSU-testing with an in-situ sd-card with 2 swap partitions, where a replacement mount-ops does not get installed. In such a case, /etc/event.d/rcS-late will generate 3 swaps in fstab and all can be made active (mounted). If flopswap is installed, with "swap to sd" enabled then the 2 sd-card swaps will show as active.

    Thanks to "swb" for sticking with me.... (and for info added here)

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by handaxe; 2013-07-05 at 23:16.
    The Following 7 Users Say Thank You to handaxe For This Useful Post:
    Android_808, elros34, fw190, iceskateclog, klinglerware, pichlo, sixwheeledbeast

     
    sixwheeledbeast | # 100 | 2013-07-05, 18:57 | Report

    Originally Posted by handaxe View Post
    Thanks to "swb" for sticking with me....
    No problem. I am glad we got there finally.
    This maybe a bug in CSSU-T, mount-ops should have got installed with CSSU-T.
    I would like to know if anybody else has this issue. Obviously I would like to keep FlopSwap compatible with all Flavours of CSSU.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to sixwheeledbeast For This Useful Post:
    klinglerware

     
    Page 10 of 36 | Prev |   8     9   10   11     12   20 | Next | Last
vBulletin® Version 3.8.8
Normal Logout