View Single Post

   
  #8 (permalink)  
Old 02-19-2008, 12:54 PM
Mike Denhoff
 
Posts: n/a
Default Re: installing in chroot

On Thu, 24 Jun 2004 17:06:25 -0500, /dev/rob0 wrote:

> Someone here recently talked about chroot'ing to a loop-mounted initrd
> and running the setup therein. Has anyone done this? Is anything other
> than having /proc mounted in the chroot necessary for this?


Well, that would be me. Mark Hill gave a different suggestion so I decided
to try that. I'll give a quick summary.

From my running Slack 9.1 installation, I downloaded the Slack 10 series
that I wanted.
I mounted the target directory for Slackware 10 on /slack10.
I cd'ed into the series 'a' directory and ran
installpkg -root /slack10 *.tgz
The same for series ap l n x xap, after moving some packages that I didn't
want to install.

Then I tried to chroot into the new Slack10 root, but chroot said
something about /bin/bash was not a file. A bit of investigating found
that a bunch of sym links were missing in /slack10/lib. I'm guessing that
on a normal install these would be made by ldconfig during the first
bootup. Anyway, the doinst.sh in the glibc-solibs package has a bunch of
lines which build these links, which didn't get run during my installpkg.
I didn't manage to understand the script well enough to know why. I
copied only the link building lines to a file in /slack10/lib and ran
that. Now with these links in place, I could do

chroot /slack10 /bin/bash -i
mount -t proc /proc /proc

Then using pkgtool I ran the various setup scripts. The only unusual
think here was that the netconfig script did not probe for my network
card. Maybe because I had hotplug enabled? Anyway I added a rc.netdevice
for my old ISA nic.

Then I made a /etc/fstab modelled after the fstab in my Slack 9.1 install.
I exited the chroot, edited lilo.conf in slack 9.1 to add a section for
the new kernel and new partition, and ran lilo.

Rebooted, chose slack10, and it came up running fine.

Hmm, I wonder how I could move my normal users over with their same
passwords.

Mike
Reply With Quote