Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- DIRNAME=greenhouse
- mkdir $DIRNAME
- # if you don't have your own apt-cacher instance, change the mirror url on the line below
- debootstrap --include=ca-certificates wily $DIRNAME http://archive.ubuntu.com/ubuntu
- cp /etc/resolv.conf $DIRNAME/etc/resolv.conf
- cp /etc/apt/sources.list $DIRNAME/etc/apt/sources.list
- cat > /tmp/cookbook.b64 <<'EOT6'
- IyEvYmluL3NoCmNkIC9tbnQKY2F0ID4+L3Vzci9zaGFyZS9iaW5mbXRzL3FlbXUtYXJtIDw8J0VP
- VDk5JwpwYWNrYWdlIHFlbXUtdXNlci1zdGF0aWMKaW50ZXJwcmV0ZXIgL3Vzci9iaW4vcWVtdS1h
- cm0tc3RhdGljCm1hZ2ljIFx4N2ZceDQ1XHg0Y1x4NDZceDAxXHgwMVx4MDFceDAwXHgwMFx4MDBc
- eDAwXHgwMFx4MDBceDAwXHgwMFx4MDBceDAyXHgwMFx4MjhceDAwCm1hc2sgXHhmZlx4ZmZceGZm
- XHhmZlx4ZmZceGZmXHhmZlx4MDBceGZmXHhmZlx4ZmZceGZmXHhmZlx4ZmZceGZmXHhmZlx4ZmVc
- eGZmXHhmZlx4ZmYKRU9UOTkKY2F0ID4+L3Vzci9zaGFyZS9iaW5mbXRzL3FlbXUtYXJtZWIgPDwn
- RU9UMTAwJwpwYWNrYWdlIHFlbXUtdXNlci1zdGF0aWMKaW50ZXJwcmV0ZXIgL3Vzci9iaW4vcWVt
- dS1hcm1lYi1zdGF0aWMKbWFnaWMgXHg3Zlx4NDVceDRjXHg0Nlx4MDFceDAyXHgwMVx4MDBceDAw
- XHgwMFx4MDBceDAwXHgwMFx4MDBceDAwXHgwMFx4MDBceDAyXHgwMFx4MjgKbWFzayBceGZmXHhm
- Zlx4ZmZceGZmXHhmZlx4ZmZceGZmXHgwMFx4ZmZceGZmXHhmZlx4ZmZceGZmXHhmZlx4ZmZceGZm
- XHhmZlx4ZmVceG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3VyYXRpb24KCWRwa2ctcmVjb25maWd1
- cmUgdHpkYXRhCgllY2hvIENoZWNrIGZzdGFiLCBpbnRlcmZhY2VzIGFuZCBzcGVjaWZ5IGEgcm9v
- dC1wYXNzd29yZCB1c2luZyBwYXNzd2QuCgllY2hvIEFkZCBwYWNrYWdhZ2VzIGFzIHlvdSBsaWtl
- LCB0aGVuIHR5cGUgJ2V4aXQnIHRvIGZpbmFsaXNlIGluc3RhbGxhdGlvbi4KCWJhc2ggLWkKRU9U
- MwpjaG1vZCA3NTUgcm9vdGZzL2Nocm9vdC5zaApjaHJvb3Qgcm9vdGZzLyAvY2hyb290LnNoCnVt
- b3VudCAtbGYgcm9vdGZzL3Byb2MKdW1vdW50IC1sZiByb290ZnMvc3lzCnVtb3VudCAtbGYgcm9v
- dGZzL2Rldi9wdHMKdW1vdW50IC1sZiByb290ZnMvZGV2Cg==
- EOT6
- base64 -d </tmp/cookbook.b64 >$DIRNAME/mnt/cookbook.sh
- 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 casper lupin-casper discover laptop-detect os-prober iptraf htop vim qemu-user-static binfmt-support fakeroot debootstrap git unzip wireless-tools firefox xfdesktop4 open-vm-tools xserver-xorg xserver-xorg-video-all x11vnc rdesktop xinit xterm htop xfonts-100dpi xfonts-75dpi python-software-properties nano gnome-terminal xfwm4 wicd
- 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/mnt/cookbook.sh
- mkdir -p $DIRNAME/mnt/rootfs
- mkdir -p $DIRNAME/mnt/bootfs
- chmod 755 $DIRNAME/chroot.sh
- chroot $DIRNAME "/chroot.sh"
- umount -lf $DIRNAME/proc
- umount -lf $DIRNAME/sys
- umount -lf $DIRNAME/dev/pts
- umount -lf $DIRNAME/dev
- #rm $DIRNAME/chroot.sh
- rm $DIRNAME/etc/resolv.conf
- chroot $DIRNAME ln -s /var/run/resolvconf/resolv.conf /etc/resolv.conf
- cat >> $DIRNAME/etc/wpa_supplicant/wpa_supplicant.conf <<'EOT11'
- ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
- update_config=1
- EOT11
- #cat >> /tmp/shortcut << 'EOT7'
- #W0Rlc2t0b3AgRW50cnldClZlcnNpb249MS4wClR5cGU9QXBwbGljYXRpb24KTmFtZT13aWZpCkNv
- #bW1lbnQ9CkV4ZWM9d2ljZC1ndGsKSWNvbj1nY3Ita2V5ClBhdGg9L3Jvb3QKVGVybWluYWw9ZmFs
- #c2UKU3RhcnR1cE5vdGlmeT1mYWxzZQo=
- #EOT7
- #mkdir -p $DIRNAME/root/Desktop
- #base64 -d </tmp/shortcut >$DIRNAME/root/Desktop/wifi.desktop
- cp $DIRNAME/etc/dhcp/dhclient.conf $DIRNAME/etc/dhcp/dhclient.conf.bkup
- sed 's/#require/require/' $DIRNAME/etc/dhcp/dhclient.conf.bkup > $DIRNAME/etc/dhcp/dhclient.conf
- cat >> $DIRNAME/root/.xinitrc <<'EOT8'
- xfwm4&
- xfdesktop
- EOT8
- mkdir -p image/$DIRNAME/{casper,isolinux,install}
- cp /usr/lib/ISOLINUX/isolinux.bin image/$DIRNAME/isolinux/
- cp /usr/lib/syslinux/modules/bios/ldlinux.c32 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 ../..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement