I now have a working system for creating minimal installations of Fedora Core (6), and CentOS (4.5 & 5).
I've updated xen-tools to make use of this, via --install-method=rinse - and now I can create new Xen guests :)
There were several false starts:
- Have a static list of .rpm names + versions
This is precisely what rpmstrap does, and it is a broken approach. I'm happy to have a static list of packages, but restricting the packages to specific versions is fragile and broken.
- Use Yum
- yum is used by many RPM based distributions, but unfortunately each distro uses slightly different versions to the one in Debian - so whilst I could run:
mkdir /tmp/fc6 yum -c /tmp/yum.conf --installroot /tmp/fc6 install yum
This results in a system which cannot be updated:
chroot /tmp/fc6 /usr/bin/yum update [errors about yum database formats]
I suspect this is because the versions of the Berkeley database are different .. but I'm not sure.
- Parse Dependencies
This would be a neat approach, however it is difficult. Too difficult.
Abandoned after several fruitless hours.
- Cheating
I cheated in the end.
- Download a list of packages which are known to be required to produce a working yum, and unpack them.
- Copy those downloaded packages into the yum cache tree.
- Run yum install yum - to make the local Yum + RPM database match what we fetched manually
- Unfortunately "rpm rebuilddb" couldn't do that for us.
Worst case? I download each package twice. Once for the initial download, and once again when the Yum process runs. I can live with that.
I'll talk about something else next time. Promise.