Blog Forum Wiki Links Contact Us
 
Translations of this page:

Execute Applications on SD or USB

Edit /sbin/probedevice

[NB. The modification will only work for early 70x models without updates]

Files in the SD or USB are owned by ROOT and have the default permission set to 666 which everybody can read or write but not execute.

To change this behaviour,

  1. start the console (Ctrl+Alt+T)
  2. type sudo nano /sbin/probedevice
  3. on line 43,44 change noexec to exec, fmask from 111 to 0 (line says *FAT* and *msdos* at the beginning)
  4. save and reboot

http://forum.eeeuser.com/viewtopic.php?id=954 credit goes to Damaniel

Edit /usr/bin/usbstorageapplet

For later EeePC models and early 70x models after updates, the above modification will no longer work. The only solution is to edit the binary file /usr/bin/usbstorageapplet. This can be done with KHexEdit.

Basically, we are doing the same thing: replace “noexec” to ” exec” and fmask from “111” to “000” for the lines with *FAT* and *msdos* at the beginning. However, for executable binaries, the size of the string is VERY important. So you do not just delete the “no”, but has to replace it with 2 spaces. Likewise, we do not replace “111” with “0”, but with “000”. So, it is important you back up this file first before you proceed to edit it. [NB. In addition, you can also edit the same for the line beginning “ufsd”. This is for ntfs partitions.]

Backing up the original usbstorageapplet is done with the following command:

sudo cp /usr/bin/usbstorageapplet /usr/bin/usbstorageapplet.bak

If you mess up, restore the original with the command:

sudo cp /usr/bin/usbstorageapplet.bak /usr/bin/usbstorageapplet

Here are some screenshots of steps how to do this with KHexEdit:

1) Open KHexEdit as root:

sudo khexedit /usr/bin/usbstorageapplet

Or if you have icewm start menu enabled and Debian Program Menu installed, KHexEdit can be run from : [Start] > [Programs] > [Apps] > [Tools] > [KHexEdit].

2) Use the search function to locate “Regular Text” vfat

3) Replace the string “n” and “o” in “noexec” with 2 spaces

4) Change fmask=111 to fmask=000

5) Scroll down a little bit and do the same to the “noexec” at address 0001:2890.

6) Again, scroll down one line and do the same to the “fmask=111” at address 0001:28a0.

7) Now save the file. [NB. Please note that sometimes the system will not allow you to overwrite the existing file, then you have to “Save As” another name and then overwrite the original later by running a root File Manager with this command in a terminal:

sudo XandrosFileManager &

[NB. Linux commands are case sensitive]

Now, very important: you should verify if the original and new usbstorageapplet file are of the same file size. If they differs, then your hacking has failed somewhere and you will need to do it all over again.

To verify if you have actually achieved this, type “mount” in a terminal, and see if you can see the option “noexec” in any DOS, FAT32 or NTFS partitions mounted.

Credit goes to scarpia31 as discussed in this thread.

If you still have trouble

by zedkatuf

  1. You might have to reformat the card as ext2 to allow applications to run properly. The forum link above shows that many users have had issues with trying a fat-formatted card to run excecutable files. If your USB or SD card is big enough, you could reformat it with two partitions (back-up first!!), one which is vfat, the other ext2. Then, put all your applications on the ext2 partition & mp3's other files on the vfat partition.
  2. Instructions below for how to do this, if you want to divide up your sd card in this manner. The instructions end up with you splitting the sd card in two, the first partition is windows-based, the second linux. Making the first parition windows-based (FAT16 or FAT32) helps for when you put the card in an sd card reader for reading on a Windows machine - it will hunt the first partition, and if it's not FAT, then Windows won't see it (if the FAT partition is the 2nd one).
  3. Before you go rushing out to buy a high capacity SDHC card to use as a secondary drive, check on the forum as to whether your sdhc card will work (Patriot 8 & 6Gb SDHC cards seem to work for example).

Instructions for re-partitioning & re-formatting

BACKUP USB/SD card first!!!

ASSUMES SD card is on /dev/sdb1 for the sake of these instructions - you'll almost certainly need to check. Assumes card is 4Gbytes.

FORMATTING SD CARD

  1. Open up a terminal (CTRL-ALT T)
  2. df -h (check the mounted device)
  3. sudo fdisk /dev/sdb
  4. Press d then 1 (This deletes the first partition)
  5. Press n then p (New partition, primary)
  6. Press enter (to accept the start block)
  7. Type +2G then press enter (to make primary partition 2Gybtes)
  8. Now type t then 1 (allows you to set the primary partition type)
  9. Now type c followed by enter (sets primary partition to vfat)
  10. Next, type n then p (New partition primary) then press enter twice to accept the start and end blocks
  11. Now type t then 2 (setting 2nd partition type)
  12. Next type 83 (sets 2nd partition to linux)
  13. Finally, press w then q to make the changes

MAKING FILE SYSTEMS

  1. sudo mkfs.vfat -F 16 /dev/sdb1 (makes first partition windows-based, and FAT16. NB: If you're partition is >2Gbytes, you should type sudo mkfs.vfat -F 32 /dev/sdb1 instead)
  2. sudo mkfs.ext2 /dev/sdb2

MOUNTING FILESYSTEMS

  1. sudo mkdir -p /mnt/sd1
  2. sudo mkdir /mnt/sd2
  3. sudo mount -t vfat /dev/sdb1 /mnt/sd1
  4. sudo mount -t ext2 /dev/sdb2 /mnt/sd2
  5. (or eject and re-insert)

At first the file system is own by root you need to change that

  1. cd /mnt/sd2
  2. sudo chown user:user partition1 (that's my folder name)

Now, when you install software, you should be able to specify installation to /mnt/sd2

I'm not sure how to do that using synaptic, or the EEE software installer, as I don't yet have my Eee (should be arriving next week)

rio b and you sfr

 
execute_apps_off_sd.txt · Last modified: 2012/01/28 10:29 by hello
 
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki