Using pccard-launch with removable Kingston HDD

Hi:

pccard-launch starts Fsys.eide when I insert my Kingston DataPak 5GB card,
and terminates it when I remove the card. So far so good. The problem is
that /dev/hd1.0 remains in the namespace after Fsys.eide terminates, which
later causes problems.

The docs say that pccard-launch sends a SIGTERM to the driver when the card
is removed. However, the Fsys docs (QNX 4.25D) say you should not slay
(SIGTERM) a filesystem driver, but should perform a shutdown procedure
(unmount, rm /dev/hd1.0).

What is the proper way to use pccard-launch with a removable hard drive? For
reference, here is my command:

pccard-launch -v ‘0x400,/bin/Fsys.eide fsys -Nbackup -n0=hd1.
eide -a$IOPORT -i$IRQ’ &

Is there an Fsys.eide option that would help? I also somehow need to mount
it, and unmount it when the card is removed.

The only idea I have is to write (or find) a program to use like this:

pccard-launch -v ‘0x400,FSYS-REMOVABLE -a$IOPORT -i$IRQ’ &

The (hypothetical) FSYS-REMOVABLE program runs as root and would do this:

  • Startup:
  • Load Fsys.eide, mount the drive /dev/hd1.0, mount the partition(s),
    sleep until SIGTERM
  • Trap SIGTERM
  • Shutdown:
  • Unmount the partition(s), unmount the drive, delete /dev/hd1.0,
    terminate

This seems pretty elaborate, so I probably don’t grok the process. Any
ideas?

->>>–Sherwood–>

No, you cannot slay Fsys.eide, as this will leave the file system in an
indeterminate state. If the flash is /dev/hd1, then the proper way to
remove it would first be to do a ‘umount /dev/hd1t77’ (assuming that you
have a QNX4 type partition on the flash) and then a ‘umount /dev/hd1’.
The unmount of the physical device will also slay the driver.

Previously, Dale Sherwood, NYAB wrote in qdn.public.qnx4:

Hi:

pccard-launch starts Fsys.eide when I insert my Kingston DataPak 5GB card,
and terminates it when I remove the card. So far so good. The problem is
that /dev/hd1.0 remains in the namespace after Fsys.eide terminates, which
later causes problems.

The docs say that pccard-launch sends a SIGTERM to the driver when the card
is removed. However, the Fsys docs (QNX 4.25D) say you should not slay
(SIGTERM) a filesystem driver, but should perform a shutdown procedure
(unmount, rm /dev/hd1.0).

What is the proper way to use pccard-launch with a removable hard drive? For
reference, here is my command:

pccard-launch -v ‘0x400,/bin/Fsys.eide fsys -Nbackup -n0=hd1.
eide -a$IOPORT -i$IRQ’ &

Is there an Fsys.eide option that would help? I also somehow need to mount
it, and unmount it when the card is removed.

The only idea I have is to write (or find) a program to use like this:

pccard-launch -v ‘0x400,FSYS-REMOVABLE -a$IOPORT -i$IRQ’ &

The (hypothetical) FSYS-REMOVABLE program runs as root and would do this:

  • Startup:
  • Load Fsys.eide, mount the drive /dev/hd1.0, mount the partition(s),
    sleep until SIGTERM
  • Trap SIGTERM
  • Shutdown:
  • Unmount the partition(s), unmount the drive, delete /dev/hd1.0,
    terminate

This seems pretty elaborate, so I probably don’t grok the process. Any
ideas?

->>>–Sherwood–

Hugh Brown <hsbrown@qnx.com> wrote:

No, you cannot slay Fsys.eide, as this will leave the file system in an
indeterminate state. If the flash is /dev/hd1, then the proper way to
remove it would first be to do a ‘umount /dev/hd1t77’ (assuming that you
have a QNX4 type partition on the flash) and then a ‘umount /dev/hd1’.
The unmount of the physical device will also slay the driver.

I think, you have to do a ‘rm /dev/hd1’ to get rid of the driver …


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Previously, Karsten.Hoffmann@mbs-software.de wrote in qdn.public.qnx4:

Hugh Brown <> hsbrown@qnx.com> > wrote:
No, you cannot slay Fsys.eide, as this will leave the file system in an
indeterminate state. If the flash is /dev/hd1, then the proper way to
remove it would first be to do a ‘umount /dev/hd1t77’ (assuming that you
have a QNX4 type partition on the flash) and then a ‘umount /dev/hd1’.
The unmount of the physical device will also slay the driver.

I think, you have to do a ‘rm /dev/hd1’ to get rid of the driver …

Right!


| / | __ ) | > Karsten.Hoffmann@mbs-software.de > MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

Dale Sherwood, NYAB <dsherwoo@nyab.com> wrote:

The docs say that pccard-launch sends a SIGTERM to the driver when the card
is removed. However, the Fsys docs (QNX 4.25D) say you should not slay
(SIGTERM) a filesystem driver, but should perform a shutdown procedure
(unmount, rm /dev/hd1.0).

It’s been a while since I did this, and then with PcmciaLaunch, but it
sounds the same. You are on exactly the right track though regarding
the use of a program to start Fsys.eide and then wait for the SIGTERM
and then perform the shutdown (others have posted the umount/rm needed).

I did this with a shell script and the “trap” command … this is a bit
rusty from memory, but try (something like) this (and make it the script
invoked by the launch utility):

terminate()
{

will also need to unmount any filesystems too

umount /dev/hd1.0
rm /dev/hd1.0
}

trap terminate TERM
Fsys.eide -Nbackup -n0=hd1 eide -a$IOPORT -i$IRQ &
mount -p /dev/hd1.0

may want to mount filesystems

wait