You are not logged in.
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
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
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 ??
Offline
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.
Offline
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)
#! /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
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.copyNow, 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.
Offline
it worked for me, you should put it in the wiki
Offline
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
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
Nice script, Buxton. Here's a slight improvement:
#!/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
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
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
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
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
.
Offline
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.
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
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
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
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
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
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
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
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)
Offline
thanks buxton
sorry for the need of exact directions..
Offline
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!
Offline
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