Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- DIRNAME=client
- mkdir $DIRNAME
- # if you don't have your own apt-cacher instance, change the mirror url on the line below
- debootstrap precise $DIRNAME http://127.0.0.1:1234/apt-cacher/ubuntu
- cp /etc/resolv.conf $DIRNAME/etc/resolv.conf
- cp /etc/apt/sources.list $DIRNAME/etc/apt/sources.list
- mount --bind /dev $DIRNAME/dev
- cat > $DIRNAME/chroot.sh <<'EOT'
- #!/bin/sh
- mount none -t proc /proc
- mount none -t sysfs /sys
- mount none -t devpts /dev/pts
- export HOME=/root
- export LC_ALL=C
- apt-get update
- apt-get install --yes dbus
- dbus-uuidgen > /var/lib/dbus/machine-id
- dpkg-divert --local --rename --add /sbin/initctl
- ln -s /bin/true /sbin/initctl
- apt-get upgrade --yes --force-yes
- apt-get install --yes --force-yes linux-image-generic openvpn casper lupin-casper discover laptop-detect os-prober iptraf
- apt-get install --yes --force-yes firefox xfdesktop4 open-vm-tools xserver-xorg xserver-xorg-video-all x11vnc rdesktop xinit xterm htop xfonts-100dpi xfonts-75dpi xfs python-software-properties vi
- apt-get install --yes --force-yes --no-install-recommends network-manager
- apt-get clean
- rm /usr/share/initramfs-tools/scripts/casper-bottom/25configure_init
- rm /usr/share/initramfs-tools/scripts/casper-bottom/15autologin
- rm /usr/share/initramfs-tools/scripts/casper-bottom/25adduser
- echo "Please set passwords for root and ubuntu"
- echo "using the passwd command"
- bash -i
- rm /var/lib/dbus/machine-id
- rm /sbin/initctl
- dpkg-divert --rename --remove /sbin/initctl
- rm -rf /tmp/*
- rm /etc/resolv.conf
- umount -lf /proc
- umount -lf /sys
- umount -lf /dev/pts
- EOT
- chmod 755 $DIRNAME/chroot.sh
- chroot $DIRNAME "/chroot.sh"
- umount -lf $DIRNAME/dev
- rm $DIRNAME/chroot.sh
- sed '/^exec/d' $DIRNAME/etc/init/tty1.conf >$DIRNAME/etc/init/tty1.conf.tmp
- cat >> $DIRNAME/etc/init/tty1.conf <<'EOT'
- exec /bin/login -f root </dev/tty1 > /dev/tty1 2>&1
- EOT
- mkdir -p image/$DIRNAME/{casper,isolinux,install}
- cp /usr/lib/syslinux/isolinux.bin image/$DIRNAME/isolinux/
- cp $DIRNAME/boot/initrd.img* image/$DIRNAME/casper/initrd.img
- cp $DIRNAME/boot/vmlinuz-* image/$DIRNAME/casper/vmlinuz
- cat > image/$DIRNAME/isolinux/isolinux.cfg <<EOT
- DEFAULT live
- LABEL live
- menu label ^Start or install Ubuntu Remix
- kernel /casper/vmlinuz
- append boot=casper persistent initrd=/casper/initrd.img nomodeset
- EOT
- touch image/$DIRNAME/ubuntu
- mkdir image/$DIRNAME/.disk
- cd image/$DIRNAME/.disk
- touch base_installable
- echo "full_cd/single" > cd_type
- echo "Ubuntu Remix" > info
- echo "http//your-release-notes-url.com" > release_notes_url
- cd ../../..
- chroot $DIRNAME dpkg-query -W --showformat='${Package} ${Version}\n' | tee image/$DIRNAME/casper/filesystem.manifest
- cp -v image/$DIRNAME/casper/filesystem.manifest image/$DIRNAME/casper/filesystem.manifest-desktop
- REMOVE='ubiquity ubiquity-frontend-gtk ubiquity-frontend-kde casper lupin-casper live-initramfs user-setup discover1 xresprobe os-prober libdebian-installer4'
- for i in $REMOVE
- do
- sudo sed -i "/${i}/d" image/$DIRNAME/casper/filesystem.manifest-desktop
- done
- rm image/$DIRNAME/casper/filesystem.squashfs
- mksquashfs $DIRNAME image/$DIRNAME/casper/filesystem.squashfs -e boot
- (cd image/$DIRNAME && find . -type f -print0 | xargs -0 md5sum | grep -v "\./md5sum.txt" > md5sum.txt)
- cd image/$DIRNAME
- mkisofs -r -V "$DIRNAMENAME_boot" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../$DIRNAME.iso .
- cd ../..
Add Comment
Please, Sign In to add comment