Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't run programs in mounted iso file
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Mon Mar 01, 2010 6:43 am    Post subject: Can't run programs in mounted iso file Reply with quote

Code:
tux ~ # mount -t iso9660 -o loop,users mmm.iso /mnt/iso
tux ~ # /mnt/iso/install
bash: /mnt/iso/install: /bin/sh: bad interpreter: Permission denied
tux ~ # umount /mnt/iso
tux ~ # mount -t iso9660 -o loop,users,exec mmm.iso /mnt/iso
tux ~ # /mnt/iso/install
/mnt/iso/install: line 1241: .: /mnt/iso/update/install/: is a directory


It seems from the last message that the install script itself is the problem. However, I have run it without a problem in other Linux machines.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Mon Mar 01, 2010 7:44 am    Post subject: Re: Can't run programs in mounted iso file Reply with quote

xiaweitang wrote:
Code:
tux ~ # mount -t iso9660 -o loop,users mmm.iso /mnt/iso
tux ~ # /mnt/iso/install
bash: /mnt/iso/install: /bin/sh: bad interpreter: Permission denied
tux ~ # umount /mnt/iso
tux ~ # mount -t iso9660 -o loop,users,exec mmm.iso /mnt/iso
tux ~ # /mnt/iso/install
/mnt/iso/install: line 1241: .: /mnt/iso/update/install/: is a directory


It seems from the last message that the install script itself is the problem. However, I have run it without a problem in other Linux machines.


What's the output of these?

Code:
$ ls -l /mnt/iso/install
$ file /mnt/iso/install
$ head /mnt/iso/install
Back to top
View user's profile Send private message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Mon Mar 01, 2010 5:01 pm    Post subject: Reply with quote

Code:
tux ~ # ls -l /mnt/iso/install
-r-xr-xr-x 1 root root 43827 2009-06-29 16:11 /mnt/iso/install
tux ~ # file /mnt/iso/install
/mnt/iso/install: POSIX shell script text executable
tux ~ # head /mnt/iso/install
#!/bin/sh
#
#  Name:
#     install   point of entry for MATLAB installation
#
#  Usage:
#     install -h | [-<arch>] [-debug] [ [-t] | [-x] ]
#
#  Description:
#     "install" is the point of entry for all MATLAB installations.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Mon Mar 01, 2010 10:42 pm    Post subject: Reply with quote

Can you also post the output for this command?

Code:
ls -l /bin/sh


It seems like if your /bin/sh is messed or something. The script itself seems to be fine so it must be the interpreter which is failing.
Back to top
View user's profile Send private message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Tue Mar 02, 2010 1:07 am    Post subject: Reply with quote

Code:
ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2010-02-27 13:22 /bin/sh -> bash


I think that script must be run with sh, but it's linked to bash. Am I right? How can I get sh back? I hate bash!
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Mar 02, 2010 8:19 am    Post subject: Reply with quote

xiaweitang wrote:
Code:
ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2010-02-27 13:22 /bin/sh -> bash


I think that script must be run with sh, but it's linked to bash. Am I right? How can I get sh back? I hate bash!


sh is symlinked to bash in 99% of the modern distros (in the rest it's probably linked to busybox). You have been probably using bash ever since you migrated to linux even if you think you hate it. The original bourne shell is rarely used nowadays, much less in linux. That's not the problem, in any case. Bash will run any sh script without problems, just like most shells around.

Are you sure the iso image is 100% correct? It seems like there's something messed up on it.
Back to top
View user's profile Send private message
boerKrelis
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 241
Location: The Netherlands

PostPosted: Tue Mar 02, 2010 10:14 am    Post subject: Reply with quote

Is your loop device mounted noexec, by any chance? 'mount' will tell you.
Back to top
View user's profile Send private message
xiaweitang
Apprentice
Apprentice


Joined: 26 Feb 2010
Posts: 152

PostPosted: Wed Mar 03, 2010 9:31 pm    Post subject: Reply with quote

My iso file is on usb stick. And I run the following commands
Code:

tux ~ # mount /dev/sdb2 /mnt/usb

tux ~ # ls /mnt/usb
lost+found  mmm.iso

tux ~ # mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (rw,noatime,errors=continue,data=writeback)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/sda1 on /boot type ext2 (rw,noatime,errors=continue)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
none on /proc/bus/usb type usbfs (rw,relatime,devgid=85,devmode=664)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
/dev/sdb2 on /mnt/usb type ext3 (rw)

tux ~  # mount -t iso9660 -o loop,users,exec /mnt/usb/mmm.iso /mnt/iso

tux liang # mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (rw,noatime,errors=continue,data=writeback)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/sda1 on /boot type ext2 (rw,noatime,errors=continue)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
none on /proc/bus/usb type usbfs (rw,relatime,devgid=85,devmode=664)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
/dev/sdb2 on /mnt/usb type ext3 (rw)
/dev/loop0 on /mnt/iso type iso9660 (rw,nosuid,nodev)


The last line says /dev/loop0 is rw, not rwx. Is that the cause of the problem?
Back to top
View user's profile Send private message
sam.reader
n00b
n00b


Joined: 04 Mar 2010
Posts: 20

PostPosted: Thu Mar 04, 2010 8:49 am    Post subject: Reply with quote

I can't explain it in the technical language but it is possible to execute the programs directly from the ISO even without the need for mounting it by using the program Power ISO.
I regularly use it for purposes like this and it is very handy
Let me know if this works for you or not
Back to top
View user's profile Send private message
boerKrelis
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 241
Location: The Netherlands

PostPosted: Thu Mar 04, 2010 12:16 pm    Post subject: Reply with quote

xiaweitang wrote:

The last line says /dev/loop0 is rw, not rwx. Is that the cause of the problem?

No. Neither is the fact that it's mounted nosuid (/mnt/iso/install is not setuid).
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9548
Location: beyond the rim

PostPosted: Fri Mar 05, 2010 4:23 pm    Post subject: Re: Can't run programs in mounted iso file Reply with quote

xiaweitang wrote:
It seems from the last message that the install script itself is the problem.

Correct, but without knowing what the script tries to do at that step it's hard/impossible to say what the problem is. Anyway, the second error has nothing to do with the ISO, permissions or mount options.

Btw, using the "users" mount option on the commandline is rather pointless, it just causes confusion due to the other options implied by it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum