PDA

View Full Version : remastering while booted from harddrive



John
02-07-2003, 07:52 PM
Thought I'd share my approach to remastering. This works for me partly because the ISOs I am working with are small, but you probably could do the same with the full Knoppix iso if you have a powerful enough computer. There is nothing new here, I borrowed form the howto on this site and from one floating around about remastering lnx-bbc.

Using this approach the parent environment is your hard drive, not the CD -- which has a lot of advantages.

You need cloop-utils and rsync to do this.

I start out by making a directory, '~/knp/' in this case, and sticking the iso I am working off of in there.
mkdir tmp-cdrom
mount -o loop vsmall-x.iso tmp-cdrom/
cd tmp-cdrom/
extract_compressed_fs KNOPPIX/KNOPPIX > ../UNCOMPRESSED_KNOPPIX
cd ..
mkdir tmp-cloop
mount -o loop UNCOMPRESSED_KNOPPIX tmp-cloop/
rsync -plarv tmp-cloop/ cloop/
rsync -plarv tmp-cdrom/ cdrom/
umount tmp-cloop
umount tmp-cdrom
rm UNCOMPRESSED_KNOPPIX
rm -r tmp-cloop tmp-cdrom
chroot cloop/
do what you want...
(apt-get, hack, delete, etc)
**I've found that it isn't necessary to mount and unmount proc/ when you are working off of the hard drive**
Ctrl + D
cd cloop/
rm -r rr_moved/
cd ..
mkisofs -R -U -V "KNOPPIX filesystem" -P "KNOPPIX" -hide-rr-moved -cache-inodes -no-bak -pad /home/john/knp/cloop/ | nice -5 /usr/bin/create_compressed_fs - 65536 > KNOPPIX
cp KNOPPIX cdrom/KNOPPIX/
cd cdrom/
mkisofs -pad -l -r -J -v -V "KNOPPIX" -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -hide-rr-moved -o /home/john/vsmall-x.iso /home/john/knp/cdrom


After you are done, leave the cloop/ and cdrom/ behind, then you can chroot in and out when you want and skip most of the above steps next time.