Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    N900 rescue OS - testing release

    Reply
    Page 8 of 10 | Prev |   6     7   8   9     10   | Next
    maurochiado | # 71 | 2013-09-09, 13:50 | Report

    Hello all,

    I would like to ask you all some directions in using rescueOS to rescue a N900 stuck in a reboot loop after a number of problems.

    As I posted here http://talk.maemo.org/showpost.php?p...48&postcount=8 I faced a readonly rootfs after an update (busybox possibly).
    I figured ou the problem was with the filesystem journal, so I used the following directions taken from an Ubuntu blog:

    Code:
    Before you remove the journal, you need to remove the needs_recovery flag from the volume.  You’d think this is possible with tune2fs, but it doesn’t seem so.  So you do it with debugfs:
    debugfs -w -R “feature ^needs_recovery” /dev/mmcblk0p2
    
    Then remove the journal, forcibly:
    tune2fs -f -O ^has_journal /dev/mmcblk0p2
    The problem was gone, even though dumpe2fs was still reporting filesystem problems.
    But then I completely lost my mind by issuing:

    Code:
    Nokia-N900-42-11:~# apt-get upgrade
    and then rebooted. I know it was a big mistake, but now it's too late.
    (PS I have the full text of this command)


    I would like to know whether there is a chance to know where the system hangs. I'm in no hurry to fix the issue, and I would like to avoid a reflash, taking the opportunity to improve my command line skills.

    So I started using rescueOS, accessing the device via telnet.
    Is there any bootup log I can check?

    I'm used to save each and every command I issue (I usually save the whole Cygwin window cache) and I can provide system responses, if any of you could help me!

    Ps I checked a couple of files which got changed by the upgrade command..

    Here is one of mount-opts:
    Code:
    ~$ nano /mnt/maemo/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 swap partitions
    swap_opts=""
    
    # 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 -p for /home at boot time in /etc/event.d/rcS-late
    home_fsck="0"
    
    # Call fsck -p for user's partitions (MyDocs, SD cards, ...)
    user_fsck="0"
    
    # Include overwrite file
    if [ -f /etc/default/mount-opts-overwrite ]; then
    And here is rcS-late:
    Code:
    ~$ cat /mnt/maemo/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
    
        # Backup old fsck logs, max size is 512kB
        if [ -e /var/log/fsck.log ]; then
            FSCK_SIZE=`du -sk /var/log/fsck.log | cut -f1`
            if [ $FSCK_SIZE -ge 512 ]; then
                mv /var/log/fsck.log /var/log/fsck.log.old || true
            fi
        fi
        if [ -e /var/log/fsck_home.log ]; then
            FSCK_HOME_SIZE=`du -sk /var/log/fsck_home.log | cut -f1`
            if [ $FSCK_HOME_SIZE -ge 512 ]; then
                mv /var/log/fsck_home.log /var/log/fsck_home.log.old || true
            fi
        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;
    
          swap_opts="sw,$swap_opts"
    
          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/,$//'`
          swap_opts=`echo $swap_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 $swap_opts 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


    Is there any chance to fix the bootup by replacing the old files?


    Thanks in advance!
    M

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

     
    Estel | # 72 | 2013-09-09, 15:53 | Report

    Originally Posted by maurochiado View Post
    As I posted here http://talk.maemo.org/showpost.php?p...48&postcount=8 I faced a readonly rootfs after an update (busybox possibly).
    I figured ou the problem was with the filesystem journal, so I used the following directions taken from an Ubuntu blog:
    (...)
    debugfs -w -R “feature ^needs_recovery” /dev/mmcblk0p2
    rootfs doesn't have anything to do with /dev/mmcblk0p2, or with journals, for that matter. Rootfs is ubifs, so trying any ext* tools on it would be futile.

    I guess, hoever, that you're talking about OptFS, which indeed, is /dev/mmcblk0p2. But, busybox-power doesn't have anything to do with it, it goes into rootfs. Not that bb-power caused any such problems to anyone, ever

    /Estel

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Estel For This Useful Post:
    maurochiado, Wikiwide

     
    maurochiado | # 73 | 2013-09-09, 16:29 | Report

    Originally Posted by Estel View Post
    rootfs doesn't have anything to do with /dev/mmcblk0p2, or with journals, for that matter. Rootfs is ubifs, so trying any ext* tools on it would be futile.

    I guess, hoever, that you're talking about OptFS, which indeed, is /dev/mmcblk0p2. But, busybox-power doesn't have anything to do with it, it goes into rootfs. Not that bb-power caused any such problems to anyone, ever

    /Estel
    Thank you Estel!
    Maybe the issue arose from a number of problems, even prior to the update. What I know is, before that particular update, the OS was working ok. And the commands I reported allowed me to, for example, be able to delete conversation again, or run apt-get update/ugrade.

    Anyway, now it's a matter of resolving the reboot loop. Is there any log saved upon bootup I can check from rescueOS?
    Is there any file where (for example) mount options could be messed up?

    Thanks again!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to maurochiado For This Useful Post:
    Estel, Wikiwide

     
    viktor80 | # 74 | 2013-11-21, 10:49 | Report

    Hello!

    First of all, thanks for making this, today i was not able to turn on my lovely device, and finally after some hours of research i fond this topic.

    The wiki page on how to use it is a bit unclear tough, it should be stated more precise that you have two ways to use rescueOS. Luckily someone on irc channel told me i have to download the kernel file even if i am using the .img version. I am not a pro linux user but not even a noob now, and it was not clear.

    Anyways, how can i see if the battery is charging? And how long do i have to wait 'till i can boot it up normally? I am still afraid a bit if it will work... Since few minutes on charging atm, its showing an increase in voltage, zero level.

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

     
    NIN101 | # 75 | 2013-11-21, 16:55 | Report

    Originally Posted by
    The wiki page on how to use it is a bit unclear tough, it should be stated more precise that you have two ways to use rescueOS.
    The wiki page is outdated. I edited it now. The official documentation can be found here: https://raw.github.com/NIN101/N900_R...umentation.txt

    Originally Posted by
    Anyways, how can i see if the battery is charging?
    Read the output of the script.

    Originally Posted by
    And how long do i have to wait 'till i can boot it up normally?
    I assume you mean booting Maemo. It all depends - I don't have any numbers.

    Also note that it isn't my charging script and it's stated everywhere that if you want to use, you do it on your own risk.

    I am not qualified to answer technical questions about the charge21 script and can not give support on it (and shouldn't), sorry. You would probably have more luck in the #maemo IRC Channel.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to NIN101 For This Useful Post:
    peterleinchen, viktor80, Wikiwide

     
    viktor80 | # 76 | 2013-11-21, 19:55 | Report

    Yes, i have read that, again from irc someone told me i can pull off the phone from pc and i have to put in on wall charger before using script, for more energy. After that charging was clearly noticeable, but i had to restart the whole procedure.

    Had to reflash anyways, my system got corrupted, i guess the frequent restarts because of the low battery power.

    Even if its not your script, since its on the img, it'd be nice if the wiki would be more accurate with the whole procedure. It saved my phone so i am really glad that i found this, and that on irc there were people who helped more.

    Thanks again.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to viktor80 For This Useful Post:
    misiak, Wikiwide

     
    NIN101 | # 77 | 2015-05-31, 15:18 | Report

    After almost 2 years, a new version (1.2) is available. For changes, take a look at the changelog. Download it here.

    Edit: 1.3 with a minor fix (telnetd auto start): https://n900.quitesimple.org/rescueOS/rescueOS-1.3/

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by NIN101; 2016-11-04 at 22:28.
    The Following 11 Users Say Thank You to NIN101 For This Useful Post:
    DA5, Halftux, Marshall Banana, nieldk, nokiabot, peterleinchen, reinob, saponga, Sohil876, t-b, xes

     
    xes | # 78 | 2015-05-31, 19:31 | Report

    Nice! ...but i'm still hoping you would include midnight commander again..

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to xes For This Useful Post:
    nokiabot, peterleinchen, reinob

     
    Halftux | # 79 | 2015-06-02, 11:16 | Report

    I am wondering if there is a possibility to change the keyboard layout to another language.
    It is not a knock-out criterion but would be nice to have for writing things before connecting with telnet.

    Anyway it working like a charm thanks.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    NotMicro | # 80 | 2015-12-21, 13:46 | Report

    I used rescueOS and it works! Many, many thanks !! I have a question: is there any chance to uninstall f-cam drivers after mounting maemo root?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 8 of 10 | Prev |   6     7   8   9     10   | Next
vBulletin® Version 3.8.8
Normal Logout