Table of Contents
Rebuild Ubuntu LiveCD with online search results disabled by default
- What?
- Rebuilding official Ubuntu LiveCD and build-in the following packages:
- Why?
- Links:
- Applies:
- Ubuntu Desktop 12.10 and later
- Requirements:
- Running Ubuntu (LiveCD is okay)
- 5Gb of free space for temporary files
make-ubuntu-privacy-friendly.sh
- make-ubuntu-privacy-friendly.sh
#!/bin/bash -e [[ $# -ge 1 ]] || { echo "Usage: $0 filename.iso \"package1.deb [ package2.deb ]\" [ temp_dir_path ]"; exit 0; } # packages that have to be installed PACKAGES="$2" # ISO file path ISOFILE=$1 # Ubuntu LiveCD version # set temporary directory [[ -n $3 ]] && TMPDIR=$3 || TMPDIR=/tmp # create temporary directories EXT4IMG=$(mktemp -p $TMPDIR) # Image file EXT4MNT=$(mktemp -d) # Mounting point for building ISOMNT=$(mktemp -d) # Mounting point for ISO image # set ISO paths ISOFILE=$(readlink -e "$ISOFILE") ISOFILENEW="${ISOFILE%.iso}-privacy-friendly.iso" ISOVOLUMEID="$(isoinfo -d -i $ISOFILE | grep -i '^volume id:' | sed -r 's/^volume id:\s+//i') pf" # clean up on stop trap "exit 1" INT trap "echo 'Clean up ...'; umount $ISOMNT || true; umount $EXT4MNT || true; rmdir $ISOMNT; rm $EXT4IMG; rmdir $EXT4MNT; exit 0" EXIT # install required tools apt-get install squashfs-tools rsync genisoimage xorriso # create ext4 image file and mount truncate -s 5G $EXT4IMG mkfs.ext4 -F $EXT4IMG mount $EXT4IMG $EXT4MNT -o loop # create temporary directories inside ext4 image ISODATADIR=$EXT4MNT/isodata; mkdir $ISODATADIR SQUASHFSDIR=$EXT4MNT/squashfs # mount livecd mount -o loop,ro "$ISOFILE" $ISOMNT # extract squashfs rsync --exclude=/casper/filesystem.squashfs -a $ISOMNT/ $ISODATADIR unsquashfs -d $SQUASHFSDIR $ISOMNT/casper/filesystem.squashfs # install packages PKGDIR=$SQUASHFSDIR/tmp/packages mkdir $PKGDIR cp $PACKAGES $PKGDIR echo 'dpkg -i /tmp/packages/*.deb' | chroot $SQUASHFSDIR rm -r $PKGDIR # add packages to manifest for pkg in $PACKAGES; do dpkg -I $pkg | awk '/Package:/ {package=$2} /Version:/ {version=$2} END {print package"\t"version}' >> \ $ISODATADIR/casper/filesystem.manifest done # update filesystem.size du -sx --block-size=1 $SQUASHFSDIR | cut -f1 > $ISODATADIR/casper/filesystem.size # compress filesystem mksquashfs $SQUASHFSDIR $ISODATADIR/casper/filesystem.squashfs # remove old md5sum.txt and calculate new md5 sums pushd $ISODATADIR find -type f | grep -vE '(\./isolinux/|\./md5sum.txt)' | xargs -l md5sum | tee md5sum.txt popd # build iso xorrisofs -D -r -V "$ISOVOLUMEID" -J -l -b \ isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \ -boot-load-size 4 -boot-info-table -o \ "$ISOFILENEW" $ISODATADIR # postprocess image for hybrid mode isohybrid $ISOFILENEW
Download Ubuntu privacy friendly ISO (ready to use)
- ubuntu-13.10-desktop-amd64-privacy-friendly.iso
- MD5SUM: b410b4b46fdebf7e6f6b4d68ecd7b58d
- Direct link1: http://yadi.sk/d/1OjjiYsVFcZsq
- ubuntu-14.04-desktop-amd64-privacy-friendly.iso
- MD5SUM: c60a99a854451af55cdd7854b184c565
- Direct link1: http://yadi.sk/d/k6DzPIPuMo2Np