#!/bin/bash
# finish_compilation

DIR_LFS=/mnt/lfs

chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter6/configuring_vim
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter6/configuring_glibc
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter6/configuring_dynamic_loader
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter6/configuring_sysklogd
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter6/configuring_shadow_password
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter6/configuring_sysvinit
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter6/creating_var_run
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter6/creating_root_password
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter7/configuring_setclock_script
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter7/configuring_localnet_script
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter7/creating_etc_hosts
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter8/creating_etc_fstab
chroot $DIR_LFS /tmp/lfs-install/lfs-commands-3.3/chapter8/linux-2.4.18

../lfs-commands-3.3/chapter8/making_lfs_system_bootable
../lfs-commands-3.3/chapter9/the_end

cd $DIR_LFS/usr/src
mv linux-2.4.18 lfs-3.3
rm -rf a* b* c* d* e* f* g* h* i* j* k* less* lfs-bootscripts* libtool* lilo* m* n* o* p* q* r* s* t* u* v* w* x* y* z* *.patch MAKEDEV-1.4
ln -s lfs-3.3/linux-2.4.18 linux

rm -rf $DIR_LFS/tmp/lfs-install

echo "Finish:"
echo ". Please edit /mnt/lfs/etc/fstab, /etc/lilo.conf and run lilo"
echo ". Do a 'make clean' or 'make dist-clean' to clean up"
echo ". Reboot the system, login and set a password for root"
echo ""
echo "Happy hacking!"
