定制 bt4 frefinal live cd ( ubuntu)

Customising the BackTrack 4 PreFinal ISO

<!-- Begin Entry Div -->

One of the downsides of leaving the linux live scripts and moving to non lzma enabled squashfs, is that we loose the wonderful and convenient setup for modifying the BackTrack LiveCD on our own. We use to be able to pop in a LZM file into the “optional” directory, and that’s it – but no more.

Actually, customizing a casper based ISO isn’t that difficult, just different.  I put up this quick guide on how to edit your own livecd and add various tools, drivers and scripts to it.

 

First, install BT4 and get a copy of the BT4 iso. As root, create the build environment, and chroot into it:

mkdir -p /root/BUILD
mv bt4.iso /root/BUILD
cd /root/BUILD/
mkdir mnt
mount -o loop bt4.iso mnt/
mkdir extract-cd
rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
mkdir squashfs
mount -t squashfs -o loop mnt/casper/filesystem.squashfs squashfs
mkdir edit
cp -a squashfs/* edit/
cp /etc/resolv.conf edit/etc/
cp /etc/hosts edit/etc/
cp /etc/fstab edit/etc/
mount --bind /dev/ edit/dev
chroot edit

You are now in the livecd environment, and can alter the build in any way you like. This is where you add your scripts, drivers and whatnots. At minimum, i’de suggest updating your iso with the current repo, which can be done with :

apt-get update
apt-get upgrade
apt-get clean

exit

Once all the changes are made, close the build and create an iso out of it :

umount edit/dev
chmod +w extract-cd/casper/filesystem.manifest
chroot edit dpkg-query -W --showformat='${Package} ${Version}n' > extract-cd/casper/filesystem.manifest
REMOVE='ubiquity casper live-initramfs user-setup discover xresprobe os-prober libdebian-installer4'
for i in $REMOVE
do
sed -i "/${i}/d" extract-cd/casper/filesystem.manifest-desktop
done
cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop

sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop

rm -rf extract-cd/casper/filesystem.squashfs

mksquashfs edit extract-cd/casper/filesystem.squashfs

rm extract-cd/md5sum.txt

(cd extract-cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)

find /boot /usr/lib/grub/ -iname 'stage2_eltorito' -exec cp -v {} extract-cd/boot/grub \;

cd extract-cd

mkisofs -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 \
-boot-info-table -V "BT4" -cache-inodes -r -J -l -o ~/bt4-mod.iso .
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值