Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # IF YOUR COPY/ PASTING THIS SCRIPT PLEASE USE THE "RAW" SECTION
- # OTHERWISE THIS SCRIPT WILL FAIL
- #
- apt-get install debootstrap syslinux squashfs-tools genisoimage openssh-server
- if [ ! -f chroot/chroot.sh ]; then
- mkdir -p chroot
- mkdir -p image/casper
- mkdir -p image/isolinux
- mkdir -p image/install
- debootstrap precise chroot
- fi
- mount --bind /dev chroot/dev
- cp /etc/hosts chroot/etc/hosts
- sudo cp /etc/resolv.conf chroot/etc/resolv.conf
- sudo cp /etc/apt/sources.list chroot/etc/apt/sources.list
- mount --bind /dev chroot/dev
- cat > chroot/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 --force-yes dbus
- dbus-uuidgen > /var/lib/dbus/machine-id
- dpkg-divert --local --rename --add /sbin/initctl
- ln -s /bin/true /sbin/initctl
- apt-get --yes --force-yes upgrade
- apt-get install --yes --force-yes casper lupin-casper
- apt-get install --yes --force-yes discover laptop-detect os-prober
- apt-get install --yes --force-yes linux-generic
- apt-get install --yes --force-yes man-db
- echo "Customize your LiveCD now. Enter exit when done."
- bash -i
- rm /var/lib/dbus/machine-id
- rm /sbin/initctl
- dpkg-divert --rename --remove /sbin/initctl
- apt-get clean
- rm -rf /tmp/*
- rm /etc/resolv.conf
- umount -lf /proc
- umount -lf /sys
- umount -lf /dev/pts
- EOT
- chmod 755 chroot/chroot.sh
- chroot chroot "/chroot.sh"
- umount -lf chroot/dev
- cp -v chroot/boot/vmlinuz-* image/casper/vmlinuz
- cp -v chroot/boot/initrd* image/casper/initrd.lz
- cp -v /usr/lib/syslinux/isolinux.bin image/isolinux/
- cat > image/isolinux/isolinux.cfg <<EOT
- DEFAULT live
- LABEL live
- kernel /casper/vmlinuz
- append boot=casper persistent initrd=/casper/initrd.lz noprompt
- EOT
- chroot chroot dpkg-query -W --showformat='${Package} ${Version}\n' | tee image/casper/filesystem.manifest
- cp -v image/casper/filesystem.manifest image/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/casper/filesystem.manifest-desktop
- done
- [ -a image/casper/filesystem.squashfs ] && rm image/casper/filesystem.squashfs
- mksquashfs chroot image/casper/filesystem.squashfs -e boot
- touch image/ubuntu
- mkdir image/.disk
- cd image/.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 ../..
- cd image
- mkisofs -r -V "myBooty" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../ubuntu-remix.iso .
- cd ..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement