Skip to Content.
Sympa Menu

baslinux - Re: [BL] loadlin with vmlinuz

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: sindi keesan <keesan AT sdf.lonestar.org>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] loadlin with vmlinuz
  • Date: Wed, 1 Jun 2005 13:17:48 +0000 (UTC)

On Tue, 31 May 2005, David Moberg wrote:

----- Original Message -----
From: "sindi keesan" <keesan AT sdf.lonestar.org>

I just chrooted to BL3 partition and ran rc and I can now also run
links2 and startx. inittab refers to rc, sets up three tty's with
sh (did I already do that with chroot /hd /bin/sh? - if not, bash
from BL2 is fine),


If I chroot /hd /bin/sh and then rc, it either adds the parts of the path in /etc/profile or keeps them from BL2, because they are all there, including one directory that I made in BL2 which is not in BL3. If I type 'set' I see that the shell is still /bin/bash. Ash (sh) puts ' ' around things as in SHELL='/bin/bash', whereas bash does SHELL=/bin/bash.
I typed SHELL='/bin/sh' and it is now set to that.

In BL2 IFS=

(followed by a blank line) and in BL3
IFS='
'

Anyway, the script you suggested might need to add SHELL=/bin/sh to run BL3 properly, at least if I want to do shell scripts. I don't know that I really need rc unless I want to use the CD-ROM drive after automatically insmodding the three modules, or run pcmcia/start. chroot /hd /bin/sh ought to be adequate for running Abiword or playmidi or netpbm.


chroot runs the specified program (/bin/sh) with the specified root
directory (/hd) in the current tty for most programs (includes sh).
...................
Probably better is to make a script inside /hd. For instance,
/hd/etc/rootsetup:

#!/bin/sh
/etc/rc.sysinit # Change this to the correct script name(s)
/bin/sh

# SNIP

Then chmod +x and do: chroot /hd /etc/rootsetup


If I chroot from BL3 to BL2 I should probably run only rc.S (insmods things) and rc.M (removes stale locks, makes keyboard changes, calls rc.inetd). Some others seem to shut things down. Or I can just run login instead of any rc's.

The BL3 path is similar enough to the BL2 path that I don't need to set it again, I think. It does not seem to hurt to have on it directories which are not present in BL3 (/bin/busybox). I might have to set PATH when going from BL3 to BL2 if login does not do it.

I wrote these scripts, but the first is lacking a few things:

chrootBL3 (run from BL2)

#!/bin/bash
mount /dev/hdb1 /hd
chroot /hd /bin/sh
/etc/rc
SHELL=/bin/sh (I assume this script is running in BL2 with bash, but I
also tried it with ' ' in case BL3 is running it).

PROBLEMS:

When I run this, my prompt is / # instead of showing which directory I am in. Which file sets the prompt?

I don't have any BL3 aliases, which means profile is not run automatically. Profile is not executable, and making it so and running it did not get me any aliases. Typing alias ed='e3pi' creates that alias, but I might also want the export lines in profile, such as export LESS="-M" (set prompt style).

Abd the shell is still /bin/bash, but if I type
SHELL='/bin/sh'
_after_ running the script it is then /bin/sh.
How is SHELL normally set during login?

rc ran properly (I have two new modules insmodded - isofs will not insmod on this computer in BL3 which is why I can't use the CD-ROM drive - device or resource busy).

What should I add to change the prompt, run profile, and change the shell?

BL2 is simpler since it has login. (I have not tested this one yet).

chrootBL2 (run from BL3)

#!/bin/sh
mount /dev/hdb2 /hd
chroot /hd /bin/bash
login

(Login should run the rcs and profiles).

Sindi




Archive powered by MHonArc 2.6.24.

Top of Page