# Based on scripts by Nick Hudson # If this breaks something dont come bitchin' at me # # This will help with mounting and moving stuff # around on an Ubuntu Live CD. # You must be root to do this # You will need squashfs for this script to work # # This was mostly written by hand some parts came from # Ubuntu Wiki and the Gnome Live CD Project # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -include config.conf all: copy_disk pure extract_compressed prepare_chroot update_packages brand zero_out build_fs checksums iso # Copy contents of image to disk copy_disk: $(LIVENAME) $(LIVENAME): @mkdir -p ${ISOMNT} @mount -t iso9660 -o loop $1 ${ISOMNT} @mkdir ${LIVENAME} @cp -a ${ISOMNT}/. ${LIVENAME} @chmod -R u+w ${LIVENAME} @umount ${ISOMNT} # Removing windows apps pure: $(LIVENAME)/no-programs $(LIVENAME)/no-programs: @rm -fr ${LIVENAME}/programs @touch $(LIVENAME)/no-programs # extract compressed filesystem extract_compressed: copy_disk new new: @mkdir -p old @mount -t squashfs -o loop,ro ${LIVENAME}/casper/filesystem.squashfs old @dd if=/dev/zero of=ubuntu-fs.ext2 bs=1M count=2147 @mke2fs -q ubuntu-fs.ext2 @mkdir new @mount -o loop ubuntu-fs.ext2 new @cp -a old/. new @umount old prepare_chroot: extract_compressed new/proc/cpuinfo new/proc/cpuinfo: @cp /etc/resolv.conf new/etc/ @cp ${BRAND}/sources.list new/etc/apt/ @mount -t proc -o bind /proc new/proc update_packages: prepare_chroot @${CHROOT} apt-get update @${CHROOT} apt-get -y upgrade @${CHROOT} apt-get -y remove ${REMOVELIST} @${CHROOT} apt-get -y install ${ADDLIST} @${CHROOT} dpkg-query -W --showformat='${Package} ${Version}\n' > ${LIVENAME}/casper/filesystem.manifest @sudo umount new/proc @sudo rm new/etc/resolv.conf # Add branding to image brand: update_packages @cp ${BRAND}/gnome-splash1.png new/usr/share/pixmaps/splash/ubuntu-slick.png @rm -fr new/usr/share/backgrounds/* @cp ${BRAND}/gnome-background.png new/usr/share/backgrounds/warty-final-ubuntu.png @cp -r ${BRAND}/home new/home/ubuntu @cp ${BRAND}/bookmarks.html new/etc/firefox/profile/ @${CHROOT} chown -R 999:999 /home/ubuntu zero_out: @dd if=/dev/zero of=new/dummyfile @rm new/dummyfile # Build compressed fs - Go get some [beer,coffee,tea] build_fs: zero_out @rm ${LIVENAME}/casper/filesystem.squashfs @cd new @mksquashfs . ${LIVENAME}/casper/filesystem.squashfs @cd .. @umount new # Crate new Live CD checksums: new @cd ${WORK}/${LIVENAME} @find . -type f -print0 | xargs -0 md5sum | tee md5sum.txt iso: checksums @mkisofs -o balu-livecd-`date +%F`.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -r -V "BALUG Live Linux CD" -cache-inodes -J -l ${LIVENAME}