puca puca puca puca

Posted by: tarkie

puca puca puca puca - 23/07/2002 13:00

Ok, ive tried to install empacman, but i've failed, so before I dig much deeper has anyone else seen this issue?

I've installed preinitv3

The binaries have been put in thus:

empeg:/sbin# ls -l init
-rwxr-xr-x 1 0 0 232092 Feb 8 18:45 init
empeg:/sbin# ls -l hijack
-rwxr-xr-x 1 0 0 231380 Jul 21 22:40 hijack

The preinit.d directory has been created :

empeg:/etc# ls -ld preinit.d
drwxr-xr-x 2 0 0 1024 Jul 21 23:04 preinit.d

I have created the M10empacman script:

empeg:/etc# ls -ld preinit.d
drwxr-xr-x 2 0 0 1024 Jul 21 23:04 preinit.d

and it contains:

empeg:/etc/preinit.d# cat M10empacman
#!/bin/bash
/programs0/empacman/empacman

Now i believe that when preinit runs, that /programs0 isnt mounted, for whatever reason.

Now, I've added /programs0 (and /programs1) to the /etc/fstab:

empeg:/programs0# cat /etc/fstab
#
# /etc/fstab
#
# <device> <mountpoint> <filesystemtype> <options> <dump> <fsckorder>
/dev/hda5 / ext2 defaults,ro 1 1
/dev/hda4 /drive0 ext2 defaults,ro 1 1
/dev/hda2 /programs0 ext2 defaults,ro 1 1
/dev/hdc2 /programs1 ext2 defaults,ro 1 1
none /proc proc defaults

But when I reboot the empeg, I get:

hijack: removed menu entry: "Hard Disk Detection"
khttpd: listening on port 80
kftpd: listening on port 21
player.cpp : 385:empeg-car 2.00-beta11 2002/02/08.
/etc/preinit.d/M10empacman: /programs0/empacman/empacman: No such file or direct
ory
Prolux 4 empeg car - 2.1434 Feb 7 2002

So, at this point I am presuming that HiJack refuses to add a non-existant (because its not mounted) script to the menu's and therefore nothing happens.

Anyone any ideas?

Posted by: tonyc

Re: puca puca puca puca - 23/07/2002 13:14

I think you need to add a command to explicitly mount the filesystem that /programs0 is pointing to. If I remember right, the "M" scripts only guarantee that the *music* partition (/dev/hd[ab]4) is up, not that any other user partitions (/dev/hda2) are mounted.

Something along the lines of changing your M10pacman script to:

#!/bin/bash
mount -n -o remount,ro /programs0
/programs0/empacman/empacman

.

Try that and see if it works.
Posted by: wfaulk

Re: puca puca puca puca - 23/07/2002 13:45

That's correct. In addition, modifying the fstab doesn't really do anything, as the player is the only stock process that ever mounts filesystems (besides the kernel mounting the root filesystem on boot), and it doesn't look at that file; it just has some hard-coded partitions that it mounts, which happen to match the fstab's entries. If you want another filesystem mounted, you have to explicitly use the mount program somewhere.
Posted by: tarkie

Re: puca puca puca puca - 23/07/2002 14:18

That fixed it!

Ta!
Posted by: canuckInOR

Re: puca puca puca puca - 23/07/2002 14:26

Something along the lines of changing your M10pacman script to:

#!/bin/bash
mount -n -o remount,ro /programs0
/programs0/empacman/empacman


A better solution would be to have a script in preinit.d called N01mountdrives:

#!/bin/bash
echo "Mounting /programs0..."
mount -n /programs0


The "N", instead of an "M" causes that script to be run after / is mounted on boot, but before anything else is done. Or something like that. I added the echo line there so you can see exactly where in the boot sequence it runs.

With the introduction of empacman, this topic is probably deserving of an FAQ entry now...
Posted by: wfaulk

Re: puca puca puca puca - 23/07/2002 14:30

Unfortunately, I've been too lazy to actually sort the execution of the scripts based on the numbers (which is what I intended to do). I guess now that there are a good number of things that might want to be executed this way, I should get around to it.

For now, they get executed in the order that they were created, so, for now, just make sure you create your mount script before you create your empacman script and it'll work right. Just make sure to include the numbers, too, so that it'll continue to work right when I fix it.
Posted by: genixia

Re: puca puca puca puca - 23/07/2002 19:09

It also appears as if they scripts executed if they have 000 permissions...although I can't understand why. Can you make it so that this doesn't happen?
Posted by: wfaulk

Re: puca puca puca puca - 23/07/2002 19:38

Sure. I'll do that in the next version, too. In the mean time, I usually just rename them to start with a lowercase letter.

Edit: Oh, and they still get executed because I was initially having intermittent problems with executing files directly (it may have something to do with them happening so early in the startup process), so I changed preinit before the initial release to run the scripts as arguments to /bin/sh, which is also why they must be scripts. Didn't think to check for executability, as Solaris (which is what I based this on) doesn't check, either. But it makes sense, and I can add it.
Posted by: BREmpeg

Re: puca puca puca puca - 24/07/2002 07:25

Can you write down your entire M10empacman script here so I can try it? I'm receiving the "No such File or directory" message and can't make it work.

Thanks in advance
Posted by: AndrewT

Re: puca puca puca puca - 24/07/2002 11:56

My M10empacman looks like:
#!/bin/sh
/drive0/empacman

IIRC, I had that exact same problem due to CR+LF (0x0D+0x0A) pairs in my M10empacman script.
Assuming you created the script on a Windows PC, one simple way to check is to open a DOS window on your PC where you have a copy of the script and issue the following commands:

debug M10empacman<ret>
d<ret>

You should get something like this if everything is ok:
-d
XXXX:0100 23 21 2F 62 69 6E 2F 73-68 0A 2F 64 72 69 76 65 #!/bin/sh./drive
XXXX:0110 30 2F 65 6D 70 61 63 6D-61 6E 0A xx xx xx xx xx 0/empacman.


(ignore the X's)

If you do have this problem you can use a text editor like Textpad and save the file as type 'Unix'.
Posted by: BREmpeg

Re: puca puca puca puca - 24/07/2002 12:27

It worked! Thanks a LOT!!!