Bootable CD - change root directory

Is there a way to change the root directory with sinit -r ? I want to
build a rescue cd and all relevant files are stored in the /qnx
directory. At the Moment I have a floppy for testing and mount
/dev/fd0 as / . But change root ist not so easy.

micha141 <metanet141@gmx-dot-net.no-spam.invalid> wrote:

Is there a way to change the root directory with sinit -r ? I want to
build a rescue cd and all relevant files are stored in the /qnx
directory. At the Moment I have a floppy for testing and mount
/dev/fd0 as / . But change root ist not so easy.

Um… sinit -r can be used to specify the root, yes. But you can only
run the sinit command once, as part of the boot sequence.

If you want to change the root prefix later, it can be done with the
prefix utility:

prefix -R /=/qnx/

would do what you want, if you need it later in the process.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

You do it in the boot image via Iso9660fsys

Here’s the boot/build file we use for our boot/install/rescue CD …


sys/boot
$ boot -v

sys/Proc32
$ Proc32 -l 29 -p 1500 -t 300 -D

sys/Slib32
$ Slib32

sys/Slib16
$ Slib16

/bin/Fsys
$ Fsys -Hdisk550 -r 1440

/bin/Fsys.eide
$ Fsys.eide -v

/bin/Iso9660fsys
$ Iso9660fsys /=/dev/cd0

/bin/sinit
$ sinit -s /bin/sh -i /etc/config/sysinit.cd TERM=qnx


BTW, the -r 1440 option to Fsys is so a dd’ed floppy image of our old
style QNX4 licenses can be loaded on to a RAM disk. This is done in
sysinit.cd. It’s the same floppy image that is used for the CD boot
I.E. /boot/boot.img

Here’s an excerpt …

dd if=/boot/boot.img of=/dev/ram
mount /dev/ram /r
prefix -A /etc/licenses=/r/licenses
license -r

-Rob

micha141 wrote:

Is there a way to change the root directory with sinit -r ? I want to
build a rescue cd and all relevant files are stored in the /qnx
directory. At the Moment I have a floppy for testing and mount
/dev/fd0 as / . But change root ist not so easy.

Yes I have try to change root with prefix -R at the begin of sysinit
on a testfloppy. I became this error: prefix: Can´t detach prefix
(/) : Resource busy. That is the problem.

micha141 <metanet141@gmx-dot-net.no-spam.invalid> wrote:

Yes I have try to change root with prefix -R at the begin of sysinit
on a testfloppy. I became this error: prefix: Can’t detach prefix
(/) : Resource busy. That is the problem.

Ah, yes. You’re likely running the prefix utility from the device
who’s prefix you’re removing. (And, maybe, other things?)

Can you run the prefix command from the new location – that is,
assuming you’re replacing the floppy image with a cd mounted as,
say, /cd, try:

/cd/path/to/prefix -R /=/cd/

If that doesn’t work, you may have to stick prefix in somewhere
temporary like a ram disk (see Fsys options for creating one)
and run it from there.

cp /path/to/prefix /ram/prefix
/ram/prefix -R /=/cd/

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com