Go Back   maemo.org - Talk > OS / Platform > Maemo 5 / Fremantle
 
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
  #1  
Old 2010-01-02, 03:11
mikhmv mikhmv is offline
 
Join Date: Nov 2009
Location: Pittsburgh, PA, USA
Posts: 207
Thanks!: 88
Thanked 119 Times in 58 Posts
Default "init 1" mode on n900

Hi Guys,
I little bit played with file "/etc/event.d/rcS-late".
Now my phone cannot be loaded. I exactly know which line with error, I exactly know how to fix error but I don't know how to modify this file.

Can anybody give advice how can i do it?

Now when phone start to boot it is hang up and didn't boot completely. I would like to enter in analog of linux "init 1" mode but don't know how to do it.
Reply With Quote
  #2  
Old 2010-01-02, 03:41
pete pete is offline
 
Join Date: Dec 2009
Location: Dublin, Ireland
Posts: 23
Thanks!: 0
Thanked 3 Times in 3 Posts
Default Re: "init 1" mode on n900

It's been a long while since I was using Linux daily, but I remember that runlevel switching to singleuser mode was at boot time from LILO (usually to fix something). I don't know what bootloader Maemo uses but it's probably similar unless things have drastically changed.

Does the phone start at all or can you not reboot it? If you changed the runlevel in a running kernel, it's likely dropped you out of runlevel 3, which is what I think is normal multiuser mode, so no X, etc., .

I've just done a Google search and came up with this: the phone will not boot without Nokia servicing if the /var/lib/dsme/boot_count reaches 50. This is a record of the number of times the phone has rebooted itself e.g., due to a crash and not with the user starting the reboot. Might be something there with your problem?

This is what my phone says it contains. What did you change?

~ $ cat /etc/event.d/rcS-late
Code:
description "late rcS actions" 

start on started xomap 
stop on stopping bme 

console none 

script 
# Generate fstab and mount /home 
. /etc/default/mount-opts 

fstab=/etc/fstab 
tmp_fstab=/tmp/fstab 

sfdisk -l /dev/mmcblk0 | awk \ 
-v home_opts="$home_opts" -v fat_opts="$fat_opts" \ 
-f /usr/lib/genfstab.awk > $tmp_fstab 

cmp -s $tmp_fstab $fstab || cp $tmp_fstab $fstab 
rm -f $tmp_fstab 

/bin/mount /home || echo "Failed to mount /home partition." 

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 
fi 

# We can safely continue booting now. 
initctl emit MOUNTS_OK 

/sbin/swapon -a || echo "Failed to enable paging partition." 

# Setup lowmem module 
echo 32768 > /proc/sys/vm/lowmem_deny_watermark_pages 
echo 98304 > /proc/sys/vm/lowmem_notify_high_pages 
echo 131072 > /proc/sys/vm/lowmem_notify_low_pages 
echo 1024 > /proc/sys/vm/lowmem_nr_decay_pages 

# 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 

# 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 
echo "Seeding entropy pool" 
dd if=/dev/hwrng of=/dev/urandom bs=$URANDOM_POOLSZ count=1 
fi 
end script 

normal exit 0

Last edited by pete; 2010-01-02 at 03:52.
Reply With Quote
  #3  
Old 2010-01-02, 03:55
mikhmv mikhmv is offline
 
Join Date: Nov 2009
Location: Pittsburgh, PA, USA
Posts: 207
Thanks!: 88
Thanked 119 Times in 58 Posts
Default Re: "init 1" mode on n900

Quote:
Originally Posted by pete View Post
It's been a long while since I was using Linux daily, but I remember that runlevel switching to singleuser mode was at boot time from LILO (usually to fix something). I don't know what bootloader Maemo uses but it's probably similar unless things have drastically changed.
I have never used LILO. I used only GRUB. But on n900 they don't use GRUB and I don't think that it is LILO.....

Quote:
Does the phone start at all or can you not reboot it? If you changed the runlevel in a running kernel, it's likely dropped you out of runlevel 3, which is what I think is normal multiuser mode, so no X, etc., .
Phone is bricked. Cannot reboot or boot. I know that I can re-flash it but I would like to try do it without flashing. Partially I am intresting in this mode because I have corrupted files in /home/user folder. I tried to run "fsck" on /home volume before mounting it.
Anyway having mode for make system changes in "init 1" mode (before mounting all volumes and starting most programs) will be very helpful.

Last edited by mikhmv; 2010-01-02 at 04:04.
Reply With Quote
The Following User Says Thank You to mikhmv For This Useful Post:
  #4  
Old 2010-01-02, 03:58
mikhmv mikhmv is offline
 
Join Date: Nov 2009
Location: Pittsburgh, PA, USA
Posts: 207
Thanks!: 88
Thanked 119 Times in 58 Posts
Default Re: "init 1" mode on n900

I had corrupted files in /home/user for fixing this I added line
"fsck -a /home" after line "rm -f $tmp_fstab" and reboot
Reply With Quote
The Following User Says Thank You to mikhmv For This Useful Post:
  #5  
Old 2010-01-02, 09:43
ruskie ruskie is offline
 
Join Date: Aug 2009
Location: Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
Posts: 543
Thanks!: 23
Thanked 181 Times in 104 Posts
Default Re: "init 1" mode on n900

You should be able to use flasher to pass a custom init="sed 'whateverline' file" to get it back.
__________________
For any repos or anything else I might have working on my N900 see:
http://wiki.maemo.org/User:Ruskie
A quick list of what I have in the repos
zsh|xmms2|fcron|gtar|gcoreutils
Reply With Quote
The Following 2 Users Say Thank You to ruskie For This Useful Post:
  #6  
Old 2010-01-02, 16:40
myk myk is offline
 
Join Date: Jan 2008
Location: Fremantle, W. Australia
Posts: 293
Thanks!: 28
Thanked 76 Times in 55 Posts
Default Re: "init 1" mode on n900

Quote:
Originally Posted by ruskie View Post
You should be able to use flasher to pass a custom init="sed 'whateverline' file" to get it back.
Can you use the same approach to get something like single user mode? e.g. start sshd without the GUI, so you can fix any problems that stop it booting normally.
What init arg would you need to start networking without GUI?
Reply With Quote
The Following User Says Thank You to myk For This Useful Post:
  #7  
Old 2010-01-02, 17:33
ruskie ruskie is offline
 
Join Date: Aug 2009
Location: Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
Posts: 543
Thanks!: 23
Thanked 181 Times in 104 Posts
Default Re: "init 1" mode on n900

Most likely you could. but I think you would need to have a separate init process for it all. Sounds like an interesting project. A simple shell script that would try to establish basic networking and access and that could be replaced quickly if needed.
__________________
For any repos or anything else I might have working on my N900 see:
http://wiki.maemo.org/User:Ruskie
A quick list of what I have in the repos
zsh|xmms2|fcron|gtar|gcoreutils
Reply With Quote
The Following User Says Thank You to ruskie For This Useful Post:
  #8  
Old 2010-01-02, 19:12
fanoush fanoush is offline
 
Join Date: Jan 2006
Location: Czech Republic
Posts: 2,152
Thanks!: 102
Thanked 1,490 Times in 589 Posts
Default Re: "init 1" mode on n900

Quote:
Originally Posted by mikhmv View Post
Now when phone start to boot it is hang up and didn't boot completely. I would like to enter in analog of linux "init 1" mode but don't know how to do it.
out of box this works only via serial console, there is no framebuffer console enabled in kernel and the keyboard in not complete enough to enter commands (blue key would not work in pure console)

except serial console I see only one option in current state - compile custom kernel with mmc driver enabled, extract rootfs from firmware image to microsd card and boot such kernel with root set to mmc. then you can start xterm in clean system and fix stuff

or I think it is possible to prepare initrd image with basic stuff (dropbear over usb networking or even basic shell over usb serial gadget) and load and boot it via flasher

also before doing dangerous stuff you could have bootmenu installed and cloned your system to microsd card and either do such experiments there or at least boot from it in case you break system in internal flash.

Hmm, I guess it is time to try that initrd idea :-)
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.

Last edited by fanoush; 2010-01-02 at 19:38. Reason: linkified
Reply With Quote
The Following 4 Users Say Thank You to fanoush For This Useful Post:
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 21:37.