Posts: 1
Threads: 1
Joined: Apr 2004
Reputation:
0
How do i make a custom fedora linux install cd? Linux Kickstart documentation talks about installing from ftp or http but not off a cd. I want to make 1 cd with the whole isntall on it. Does Fedora Core1 come with documentation on how to do this?
Posts: 10
Threads: 0
Joined: Apr 2004
Reputation:
0
You ask, aeio answers. Hold on to your hats folks, because this ain't for those with heart or back conditions or those who think they might be pregnant. As with any CD compilation making, you should first consult your physician.
Well with that out of the way!
1. Download all the ISOs for Fedora (just the 3 binary rpm ones)
2. Create /mnt/fedora_c1.
3. Create /mnt/fedora_c1/1, 2 and 3.
4. Mount each of the isos on those stubs (mount -o loop /path/yarrow-i386-disc1 /mnt/fedora_c1/1 for example, repeat for the other 2).
5. Make a directory where you'll build your distro. I use /root/fedora.
6. Under this directory make the following directories:
./iso
./scripts
./i386
./i386/images
./i386/RedHat
./i386/RedHat/base
./i386/RedHat/RPMS
./build_necessary_rpms
./configs
The builders don't behave if you name the directory 'Fedora', I've never really tried to figgure out why. If it bothers you that much then you debug and let me know =)
7. Install the following RPM packages (there are updates for some already, so watch out): anaconda, anaconda-runtime, anaconda-images and anaconda-help.
8. Under /root/fedora make a script called build.sh with this in it:
#!/bin/bash -x
# build it
cd /root/fedora
./scripts/makecomps.sh
ln -s /root/fedora/build_necessary_rpms/*.rpm /root/fedora/i386/RedHat/RPMS
./scripts/gen.sh
# clean it
cd /root/fedora/i386
find -type l -exec rm -vf {} \;
rm -rvf ./dosutils
rm -rvf ./isolinux/
rm -vf ./rpmorder
rm -rvf ./images/pxeboot/
rm -vf ./images/README
rm -vf ./images/pcmciadd.img
rm -vf ./images/boot.iso
rm -rvf /tmp/hdstg2.img.* /tmp/instimage.mnt.* /tmp/keymaps-i386.* /tmp/netstg2.img.* /tmp/pkgorder-* /tmp/treedir.*
# boot it
mkdir tmp
mount -o loop ./images/bootdisk.img ./tmp
rm -vf ./tmp/*.msg
rm -vf ./tmp/syslinux.cfg
rm -vf ./tmp/splash.lss
cp /root/fedora/configs/syslinux.cfg ./tmp
cp /root/fedora/configs/boot.msg ./tmp
umount tmp
rmdir tmp
# iso it
mkisofs -v -r -T -J -V 'MYBURN RC1 Fedora Core 1' -b images/bootdisk.img -c boot.cat -l -R -o /root/fedora/iso/fedora-rc1.iso .
9. Under /root/fedora/build_necessary_rpms copy the latest RPMs of these packages: anaconda, anaconda-runtime, bogl, booty, busybox, gtk2, kernel-BOOT, libxml2, pango and parted.
10. Under configs make 4 files:
boot.msg: This text will display when you boot the CD.
comps.top:
<?xml version="1.0"?>
<!DOCTYPE comps PUBLIC "-//Red Hat, Inc.//DTD Comps info//EN" "comps.dtd">
<comps>
<!-- <meta> -->
<!-- Meta information will go here eventually -->
<!-- </meta> -->
<group>
<id>core</id>
<name>Core</name>
<default>true</default>
<description>MYDIST Default Burn</description>
<uservisible>true</uservisible>
<packagelist>
comps.bottom:
</packagelist>
</group>
<group>
<id>base</id>
<name>Base Package</name>
<default>true</default>
<description>MYDIST Default Supplementary Entry</description>
<uservisible>false</uservisible>
<packagelist>
<packagereq type="mandatory">zip</packagereq>
</packagelist>
</group>
<grouphierarchy>
<category>
<name>MYDIST Default Burn</name>
<subcategories>
<subcategory>core</subcategory>
<subcategory>base</subcategory>
</subcategories>
</category>
</grouphierarchy>
</comps>
syslinux.cfg:
default linux
display boot.msg
prompt 1
timeout 600
label linux
kernel vmlinuz
append ks=cdrom:/ks.cfg initrd=initrd.img ramdisk_size=8192
11. Under scripts make the following scripts:
makecomps.sh:
#!/bin/bash
CONFIGDIR=/root/fedora/configs
RELEASEDIR=/root/fedora/i386/RedHat
echo "Making the package list."
rpm --nosignature --queryformat="%{name}\n" -qp $RELEASEDIR/RPMS/*.rpm | sort | uniq > /tmp/pkglist.tmp
echo "Picking out the ones not to be installed."
for i in `cat /tmp/pkglist.tmp` ; do if [ "`grep -c ^$i\$ $CONFIGDIR/excluderpm.txt`" = "0" ] ; then echo $i >> /tmp/pkglist ; fi ; done
echo "Writing comps.xml file."
cat $CONFIGDIR/comps.top > $RELEASEDIR/base/comps.xml
for i in `cat /tmp/pkglist` ; do echo " <packagereq type=\"mandatory\">$i</packagereq>" ; done >> $RELEASEDIR/base/comps.xml
rm -f /tmp/pkglist /tmp/pkglist.tmp
cat $CONFIGDIR/comps.bottom >> $RELEASEDIR/base/comps.xml
gen.sh:
#!/bin/bash -x
export PATH="$PATH:/usr/lib/anaconda-runtime"
export BASE=/root/fedora/i386
export PYTHONPATH=/usr/lib/anaconda
export PRODUCT=RedHat
# generate hdlists*
echo "Generating hdlists..."
/bin/cat /dev/null > $BASE/$PRODUCT/base/hdlist
/bin/cat /dev/null > $BASE/$PRODUCT/base/hdlist2
/usr/lib/anaconda-runtime/genhdlist $BASE
# generate the package ordering
echo "Generating package ordering..."
/usr/lib/anaconda-runtime/pkgorder $BASE i386 > $BASE/rpmorder
# Building images...
# If you use this, the boot*img files are created. Hence, you'll need
# to use the images created by this script just to perform a kickstart.
# So, I never use this part of the script. I just keep using the original
# boot images from the ftp site or cdrom... :)
/usr/lib/anaconda-runtime/buildinstall --pkgorder $BASE/rpmorder --product $PRODUCT --version 1 --release 1 $BASE
echo "Regenerating hdlists..."
# now generate hdlists* with the correct ordering
/usr/lib/anaconda-runtime/genhdlist --withnumbers --fileorder $BASE/rpmorder $BASE
echo "Done..."
# done!
12. Under i386 make your kickstart file named ks.cfg (see the RedHat/Fedora Documentation). Be sure to put these commands in there:
%packages --resolvedeps
@ Core
%pre
%post
13. Now the fun part. Under /root/fedora/i386/RedHat/RPMS put the RPMS you want to install. You'll have to put in those you want, run the following commands, satisfy dependencies and repeat.
mkdir /tmp/testdb (only has to be done once)
rpm --initdb --dbpath /tmp/testdb (only has to be done once)
rpm --test --dbpath /tmp/testdb -Uvh *.rpm (this is the important one)
14. Run the build.sh script! This should create a bootble single disc fedora burn that will impress your friends and shock your neighbors. The iso is obviously located in the /root/fedora/iso directory.
Enjoy!
- aeio
Posts: 1
Threads: 0
Joined: Sep 2006
Reputation:
0
quite a good explanatory way..
i tried it but my cd did noot booted at all.. i am using vmware to test the same and as soon it start got hanged not even reaching to boot steps. .. any idea where may be i am wrong.
cheers,