Blog Forum Wiki Links Contact Us NetbookUser
RunCore Pro IV SSD Transforms your ASUS EEE PC by increasing 
performance 5-40X. Your satistfaction guaranteed RunCore Pro 70mm SATA Mini PCI-e SSD
RunCore Pro IV 70mm SATA II Mini PCI-e SSD
RunCore Pro IV 2.5 Inch SATA II SSD

You are not logged in.

#26 2007-11-06 5:43:37 pm

Scooby
Member
Registered: 2007-11-04
Posts: 57

Re: leaving sd card in permanently

It's going to take a bit of experimentation. The first thing I'm wondering is if the SD card comes up with it's own device file naming convention or does it use the same one as external USB drives, like /dev/sdc*. If it's on its own, no problem. If it uses the same as USB thumb drives or external hard drives, we'd have to know if having them plugged in simultaneously with the SD card at the time of bootup has a chance of displacing it in the numbering order scheme, i.e.: does it always come up as /dev/sdc1 and all other USB drives come up as /dev/sdc2, sdc3 and so on. This has to do with the hardware discovery process and at which order things are detected.
Typically you do this by typing 'df' and looking under the Filesystem column.
Mind you, I'm not convinced this is the best way of doing things, but I'm willing to give it a shot until someone comes up with a better idea.

Offline

 

#27 2007-11-07 2:15:01 am

kentsin
Member
Registered: 2007-10-23
Posts: 15

Re: leaving sd card in permanently

Can we modify the script such that if it see a file in root of the device, may be .dont_popup, then it will not pop up asking for what to do?

Offline

 

#28 2007-11-07 2:31:53 am

netomx
Senior Member
From: Monterrey, NL, Mexico
Registered: 2007-09-03
Posts: 269
Website

Re: leaving sd card in permanently

Scooby wrote:

It's going to take a bit of experimentation. The first thing I'm wondering is if the SD card comes up with it's own device file naming convention or does it use the same one as external USB drives, like /dev/sdc*. If it's on its own, no problem. If it uses the same as USB thumb drives or external hard drives, we'd have to know if having them plugged in simultaneously with the SD card at the time of bootup has a chance of displacing it in the numbering order scheme, i.e.: does it always come up as /dev/sdc1 and all other USB drives come up as /dev/sdc2, sdc3 and so on. This has to do with the hardware discovery process and at which order things are detected.
Typically you do this by typing 'df' and looking under the Filesystem column.
Mind you, I'm not convinced this is the best way of doing things, but I'm willing to give it a shot until someone comes up with a better idea.

Do the SD card arrived already ??


Overclock you EEE HERE!

Offline

 

#29 2007-11-07 3:51:12 am

darrylmg
Member
From: United Kingdom
Registered: 2007-11-06
Posts: 85

Re: leaving sd card in permanently

My Xubuntu install just mounts the SD card by default as another drive.
When I load up the OS I just see the drive icon on the desktop.
I don't get prompted or anything.

It's quite slick if you are planning on using the SD card to store your data/work files on.


eeepc 701 (+PCIe) - virgin white - running the gutsy with xubuntu - pimped with a neat mini laptop style man-bag (nice!)

Offline

 

#30 2007-11-08 4:34:31 pm

Buxton
Member
From: Fareham, UK
Registered: 2007-11-04
Posts: 29

Re: leaving sd card in permanently

I've got what seems to be a working solution for this now. (Or, rather, I worked out how to implement Kempston's earlier suggestion.)

Be warned that I'm not a linux expert - but this seems to work for me, and doesn't appear to have broken anything. You won't get the annoying popup window with an SD card in at boot, but if you put one in later, it'll still come up as normal.

Create a copy of xandros_device_detection_dialog called xandros_device_detection_dialog.copy
(sudo cp /usr/bin/xandros_device_detection_dialog /usr/bin/xandros_device_detection_dialog.copy)

Then make a new file in your user space, called xandros_device_detection_dialog and put this in it:
(i.e. you could just open a console and "nano xandros_device_detection_dialog" to create the file in /home/user)

Code:

#! /bin/sh
uptime | grep -q "up 0 min" || xandros_device_detection_dialog.copy

Now, as root, copy that script over the top of the original xandros_device_detection_dialog and then make it executable.

sudo cp /home/user/xandros_device_detection_dialog /usr/bin/xandros_device_detection_dialog
sudo chmod uog+rx /usr/bin/xandros_device_detection_dialog

As I said, I'm not a super-expert. There might be some ways this could be improved upon or refined, but it's solved the issue for me so I figured I'd share it.

Offline

 

#31 2007-11-08 8:06:49 pm

o2smartphone
Senior Member
Registered: 2007-10-28
Posts: 569

Re: leaving sd card in permanently

Buxton wrote:

I've got what seems to be a working solution for this now. (Or, rather, I worked out how to implement Kempston's earlier suggestion.)

Be warned that I'm not a linux expert - but this seems to work for me, and doesn't appear to have broken anything. You won't get the annoying popup window with an SD card in at boot, but if you put one in later, it'll still come up as normal.

Create a copy of xandros_device_detection_dialog called xandros_device_detection_dialog.copy
(sudo cp /usr/bin/xandros_device_detection_dialog /usr/bin/xandros_device_detection_dialog.copy)

Then make a new file in your user space, called xandros_device_detection_dialog and put this in it:
(i.e. you could just open a console and "nano xandros_device_detection_dialog" to create the file in /home/user)

Code:

#! /bin/sh
uptime | grep -q "up 0 min" || xandros_device_detection_dialog.copy

Now, as root, copy that script over the top of the original xandros_device_detection_dialog and then make it executable.

sudo cp /home/user/xandros_device_detection_dialog /usr/bin/xandros_device_detection_dialog
sudo chmod uog+rx /usr/bin/xandros_device_detection_dialog

As I said, I'm not a super-expert. There might be some ways this could be improved upon or refined, but it's solved the issue for me so I figured I'd share it.

Good suggestion, thx.


windows or linux, who cares !  I just want to use eeePC My Way

Offline

 

#32 2007-11-09 1:24:55 am

RogueStar
Member
Registered: 2007-10-31
Posts: 93

Re: leaving sd card in permanently

it worked for me, you should put it in the wiki

Offline

 

#33 2007-11-09 10:03:14 am

MarkS
Senior Member
Registered: 2007-10-30
Posts: 150

Re: leaving sd card in permanently

Is this now considered a tested solution?  If I do this, would I still get the box asking me what to do if I were to remove, then reinsert, the card or if I were to insert another card or if I were to put a usb storage device (e.g., thumb drive) into the system? 

I want to make sure I understand what I am doing before I give this a try.  This little issue is my second to last minor issue with the eee pc in advanced mode.

Offline

 

#34 2007-11-09 11:40:11 am

RogueStar
Member
Registered: 2007-10-31
Posts: 93

Re: leaving sd card in permanently

Maybe the instruction could be written in a more step-like fashion to avoid any user errors following them, but the mod seems to work for me. Maybe having more people go through the mod might find any error prone steps, but it should work if you follow them properly.

What it does is it just prevents the dialog from popping up when you first boot, but after that it works normally. I confirmed this by booting (no dialog shows up) and then popping in and out the SDHC card (the dialog then comes up). Going to stand-by and restoring won't trigger it either (can't remember if it did or not before the mod). I only tested it in easy mode, but should work the same in advanced mode.

Offline

 

#35 2007-11-09 12:42:15 pm

aburt
New member
Registered: 2007-11-09
Posts: 2

Re: leaving sd card in permanently

Nice script, Buxton.  Here's a slight improvement:

Code:

#!/bin/sh
awk '$1 < 30 { exit 1 }' /proc/uptime && xandros_device_detection_dialog.copy "$@" &

We noticed that file manager wasn't starting in the newly inserted directory, but in the user's home directory, and this fixes that.  (The system passes parameters telling the dialog in which directory File Manager should start, so the "$@" passes that info onward.)

We also noticed if you insert a card or USB drive too quickly after boot it won't pop up the dialog, since it's still within the "don't bug me" time window.  The "uptime" program only reports minutes, and needs a full 60 seconds before it quits saying "0 min" after boot.  So this version uses the file /proc/uptime to get the number of seconds since boot.  The script above uses 30 seconds, but you can set the number of seconds to however many you want -- it's the "30" right near the start of the line.

Offline

 

#36 2007-11-09 2:19:06 pm

deadDuck
Senior Member
From: Calgary, AB, Canada
Registered: 2007-07-19
Posts: 916
Website

Re: leaving sd card in permanently

I found this really helpful, so I added it to the wiki:
http://wiki.eeeuser.com/howto:tempdisab … edetection

Please correct any errors or omissions. Thanks for the help!

Offline

 

#37 2007-11-12 1:29:45 am

catlike
Member
Registered: 2007-11-04
Posts: 13

Re: leaving sd card in permanently

deadDuck wrote:

I found this really helpful, so I added it to the wiki:
http://wiki.eeeuser.com/howto:tempdisab … edetection

Please correct any errors or omissions. Thanks for the help!

I tried this and it works if I stay in Easy mode. However, whenever I switch to Advanced mode, the dialog box reappears at startup. This continues when I return to Easy Mode. Is there a reason why going to Advanced mode would end up undoing my change?

I ended up having to recopy the script over the original xandros_device_detection_dialog and avoiding advanced mode.

Last edited by catlike (2007-11-12 1:30:08 am)

Offline

 

#38 2007-11-12 5:36:53 am

polocanada
Senior Member
Registered: 2007-11-11
Posts: 116

Re: leaving sd card in permanently

You might want to change the SD card from removable to internal. I read somewhere the same can be done in Windows. I believe some setting needs to be done in the boot sector of the drive as well as in system config.. Sorry I forgot.... But I remember that changing that will make your disk from removable (and thus with the dialog) to an internal (without dialog).

- Polo -

Last edited by polocanada (2007-11-12 5:37:34 am)

Offline

 

#39 2007-11-12 9:51:59 am

deadDuck
Senior Member
From: Calgary, AB, Canada
Registered: 2007-07-19
Posts: 916
Website

Re: leaving sd card in permanently

catlike wrote:

I tried this and it works if I stay in Easy mode. However, whenever I switch to Advanced mode, the dialog box reappears at startup. This continues when I return to Easy Mode. Is there a reason why going to Advanced mode would end up undoing my change?

I ended up having to recopy the script over the original xandros_device_detection_dialog and avoiding advanced mode.

I believe what you're saying is that if you boot into easy mode, then press the power button and choose the Full Desktop option, when it starts the advanced desktop, it'll detect the SD card again.

In my experience, the reason for that is that it doesn't do a full shutdown, so some of the software stays in memory. That must include the "uptime" timer, which this script is based on. One solution might be to boot directly into advanced desktop and not switch back smile.

Offline

 

#40 2007-11-12 1:26:53 pm

catlike
Member
Registered: 2007-11-04
Posts: 13

Re: leaving sd card in permanently

deadDuck wrote:

catlike wrote:

I tried this and it works if I stay in Easy mode. However, whenever I switch to Advanced mode, the dialog box reappears at startup. This continues when I return to Easy Mode. Is there a reason why going to Advanced mode would end up undoing my change?

I ended up having to recopy the script over the original xandros_device_detection_dialog and avoiding advanced mode.

I believe what you're saying is that if you boot into easy mode, then press the power button and choose the Full Desktop option, when it starts the advanced desktop, it'll detect the SD card again.

In my experience, the reason for that is that it doesn't do a full shutdown, so some of the software stays in memory. That must include the "uptime" timer, which this script is based on. One solution might be to boot directly into advanced desktop and not switch back smile.

I'm not sure that's the problem, because when I later do a full shutdown and reboot into easy desktop, the changes revert and the dialog window appears. So, it seems as if the old script reverts.

Anyway, it's not a big deal. I stay in easy mode most of the time. With the start button enabled, it's not bad, and it boots a faster.

Offline

 

#41 2007-11-12 8:38:05 pm

nathan
Member
From: college park, md
Registered: 2007-10-22
Posts: 28

Re: leaving sd card in permanently

deadDuck wrote:

I found this really helpful, so I added it to the wiki:
http://wiki.eeeuser.com/howto:tempdisab … edetection

Please correct any errors or omissions. Thanks for the help!

Can someone make this a little more stepwise for complete noobs?

When I put the first two commands in, it just brings up an empty file.

Do I put those last two commands in the empty space?
I'm not clear.

help?

Offline

 

#42 2007-11-12 8:47:41 pm

shabicht
Member
Registered: 2007-11-03
Posts: 72

Re: leaving sd card in permanently

yaa that should be empty and you are writing in the script and saving it.  then follow the last step to make it executable.

Offline

 

#43 2007-11-12 9:11:58 pm

nathan
Member
From: college park, md
Registered: 2007-10-22
Posts: 28

Re: leaving sd card in permanently

shabicht wrote:

yaa that should be empty and you are writing in the script and saving it.  then follow the last step to make it executable.

Thanks!

(this forum is darn near perfect...besides the creepy thread about using this device to get women)

Offline

 

#44 2007-11-12 9:45:15 pm

Scooby
Member
Registered: 2007-11-04
Posts: 57

Re: leaving sd card in permanently

I'm thinking I should either continue with my original plan to allow myself to mount the SD card wherever I want instead of /home/user/<device name> because ultimately I want to mount it at "/home/user/My Documents" and store all files on it, or be lazy and use a symbolic link in combination with the Buxton/aburt technique.

Offline

 

#45 2007-11-17 6:58:02 pm

pai
Member
Registered: 2007-11-06
Posts: 18

Re: leaving sd card in permanently

this will sound ****
but how do i save it

coz after i type it
i close the session
ti did nothing so i guess its coz i didnt save the script...

Offline

 

#46 2007-11-18 9:13:45 am

Buxton
Member
From: Fareham, UK
Registered: 2007-11-04
Posts: 29

Re: leaving sd card in permanently

pai: If you're using the "nano" editor as per my walkthrough, hold Ctrl and press X to quit the editor properly - it will prompt you to save your changes at that point ("Save modified buffer?"), just press Y for Yes and then hit enter when prompted for the filename (it will default to the filename you opened nano with).

Offline

 

#47 2007-11-18 11:59:25 am

gam3r
Senior Member
Registered: 2007-10-03
Posts: 327
Website

Re: leaving sd card in permanently

sorry for this stupid question but just wanting to learn. whats the significance of all the " ' ", "$", "@", and "&" stuff which just looks like a bunch of **** to me.

#!/bin/sh
awk '$1 < 30 { exit 1 }' /proc/uptime && xandros_device_detection_dialog.copy "$@" &

Last edited by gam3r (2007-11-18 11:59:59 am)


www.stompergames.com - STOMP MODE GAMING

Offline

 

#48 2007-11-18 12:05:52 pm

pai
Member
Registered: 2007-11-06
Posts: 18

Re: leaving sd card in permanently

thanks buxton
sorry for the need of exact directions..

Offline

 

#49 2007-11-20 11:12:01 am

mrmot
ExtrEmE User
From: Berkshire, UK
Registered: 2007-11-15
Posts: 1933

Re: leaving sd card in permanently

So, if I use an empty script for xandros_device_detection_dialog instead of the one mentioned elsethread, I will permanently disable a pop-up dialog for inserted media, but it will still be mounted, right?

Thanks!


Search and Wiki first, Question later!

Offline

 

#50 2007-11-20 10:52:36 pm

aburt
New member
Registered: 2007-11-09
Posts: 2

Re: leaving sd card in permanently

gam3r wrote:

sorry for this stupid question but just wanting to learn. whats the significance of all the " ' ", "$", "@", and "&" stuff which just looks like a bunch of **** to me.

#!/bin/sh
awk '$1 < 30 { exit 1 }' /proc/uptime && xandros_device_detection_dialog.copy "$@" &

Gam3r, yeah, it can get pretty arcane.  But for your edification...

Line 1:
The first line (#!/bin/sh) says "this is a program; and you need to send this to the program called /bin/sh (in this case, "the shell") so it can make sense of it and execute the commands inside.

Line 2:
The file /proc/uptime is a special file the operating system supplies that, if you read from it, it gives you two numbers -- number of seconds since boot and the amount of time the CPU has spent doing nothing ("idle").  We need that first number.  Awk is a nifty little programming language.  (The name is the initials of the guys who wrote it, Aho, Weinberger, and Kernighan.)  In awk, each line has a test to make, followed by an action to take if the test is true.  The action part is inside "{}".  The test here is whether the first number on the line ("$1") that we got from /proc/uptime is less than 30 (meaning 30 seconds since boot).  If it's been less than 30 seconds since boot, we tell awk to exit (quit running) with an exit status code of 1.  So, if it's been less than 30 sec. since boot, awk exits with a status code of 1.

This goes inside single quotes '...' so the shell doesn't see the magic "$" and other symbols and try to interpret them (since we want awk to see them as is).

If it's more than 30 seconds since boot, awk will exit with a status code of 0. (An exit status code of 0 is considered "all is well" and is the normal case.)

Now the funny "&&" symbol means "if the program on the LEFT side of the '&&' executed with an exit status code of 0, then and only then run the program on the RIGHT side."

The program on the right side of the '&&' is the original program that pops up the dialog asking if you want to run file manager.  So that all means "if it's more than 30 seconds since boot, run the file manager pop up."

The funny "$@" bit tells the shell to pass along any command line parameters that were given when this whole process started -- in our case, it will be the path to the folder to open file manager in.  (Otherwise, without "$@", it would open file manager in your home directory all the time, instead of showing the SD or USB files you just inserted.)  Technically "$@" means "pass all command line parameters, and quote them as they were originally.  (In case the path has any space characters in it; otherwise they'd get broken into separate words and it wouldn't work right.  Also note that we have to use double quotes in this case, not single quotes, since we want the magic "$" character to be seen by the shell.  Double quotes are like single quotes in that they turn off the special meaning of special symbols, but single quotes turn off more symbols than double quotes do.)

The final '&' means "run this in the background" -- run it and immediately continue with the next line.  Which in this case means, the /bin/sh program that made sense of all this doesn't hang around while file manager runs.  It isn't really needed, but is microscopically more efficient.

So, there's your semester's worth of shell programming condensed into 30 seconds. :-)

Bear in mind that Unix (and thus Linux) was originally written by mathematically inclined guys at Bell Labs using really slow terminals, with limited memory and disk space (and maybe hunt & peck typists :-) ) so they kept everything to as few symbols as they could.  They also never had any idea it was going to be this wildly popular -- they created Unix back in the day just so they could play a particular game. :-)

Last edited by aburt (2007-11-20 10:57:01 pm)

Offline

 

Board footer

Powered by PunBB 1.2.15
© Copyright 2002–2005 Rickard Andersson