Answers to: Kickstart and customized Ubuntu installshttp://linuxexchange.org/questions/1251/kickstart-and-customized-ubuntu-installs<p>I'm looking at making a way where I can do installs of Ubuntu systems with as little work as possible.</p> <p>I'm just starting to use Kickstart so I want to do the unattended install; but I also want to have it pull the install-script.sh from the Internet (Dropbox right now, but maybe a PPA??) and then install some repos, applications, deb files for which there is no repo, and some wallpaper images, etc. I also want to be able to change, remove, update the install-scetup.sh on my Internet site and whatever deb files, images, etc, all at-will; -- so putting these things on the ISO image of the alternate install CD isn't really a viable option.</p> <p>By pulling from the Internet, I don't need to constantly update the CD itself until a new point release comes out, ala 10.04.1LTS, 10.04.2LTS, etc, so anything that I change (like adding/removing applications from the install-script.sh and/or *.deb files, wallpapers, etc) would instantly be updated. So of John installs and now a few months later I add some new backgrounds, remove a few applications from the install-setup.sh, so when Suzy installs, she will get those changes.</p> <p>It'd be a nice bonus if Johnny would get those changes too. I know that would require a PPA repo vs Dropbox. One thing about that though... I'm not a packager, so I don't know how to package *.deb files, etc.</p> <p>Some sites (and code....) I've ran across are below..... as for the code, will it work "as is"? How do I incorporate it into the ks.cg (Kickstart) file as a %post ? Can I even do that?</p> <p><a href="http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/ch-kickstart2.html" rel="nofollow">http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/ch-kickstart2.html</a> http://nerdnotes.org/2006/02/kickstart-for-ubuntu-live-cd/</p> <p><a href="http://www.ubuntugeek.com/unattended-ubuntu-installations-made-easy.html" rel="nofollow">http://www.ubuntugeek.com/unattended-ubuntu-installations-made-easy.html</a></p> <pre><code> #!/bin/sh # determine the mac address of the first network adapter mac=`/sbin/ifconfig | awk '/HWaddr/ { print $5 }' | head -1` # download and execute livecd init script wget -q -O - http://dl.dropbox.com/u/914191/install-script.sh?mac=$mac | /bin/sh </code></pre> <p>( Anyone who researches my posts on here will see the install-script.sh I'm talking about.) ( You can also get it at: <a href="http://dl.dropbox.com/u/914191/install-script.sh" rel="nofollow">http://dl.dropbox.com/u/914191/install-script.sh</a> )</p>enMon, 23 Aug 2010 14:45:31 -0400Answer by Ronhttp://linuxexchange.org/questions/1251/kickstart-and-customized-ubuntu-installs/1274<p>It's too long to post the actual code here... but here it is laid out in how to do it...</p> <p>1) Download ks.cfg and install it to the alternate Ubuntu ISO wget <a href="http://dl.dropbox.com/u/914191/install-setup/ks.cfg" rel="nofollow">http://dl.dropbox.com/u/914191/install-setup/ks.cfg</a></p> <p>2) Recompile the ISO, burn it to CD and then run it from there on reboot.</p> <p>What this does it it loads the Ubuntu on the PC and as part of the kickstart configuration file, on %post (after the Ubuntu install), it does a wget command like so:</p> <p>wget -q <a href="http://dl.dropbox.com/u/914191/install-setup/ks-install-script.sh" rel="nofollow">http://dl.dropbox.com/u/914191/install-setup/ks-install-script.sh</a> -O- | sh</p> <p>This downloads and runs the bash shell script and it installs various programs, removes others, downloads other files, etc. This ks-install-script.sh differs from my normal one because the sudo command is coded into each line.</p> <p>The old way I was doing this was to just use a normal Ubuntu CD and install it that way, then just wget <a href="http://dl.dropbox.com/u/914191/install-setup/install-script.sh" rel="nofollow">http://dl.dropbox.com/u/914191/install-setup/install-script.sh</a> to the desktop. After that, cd Desktop and then chmod +x install-script.sh and then finally sudo ./install-script.sh</p> <p>This method DOES still work by the way, so use whichever one you want.</p> <p>The install-script is still under development as I want to tweak the iptables section and also maybe do an actual PPA repo instead, but for now, this solution using Dropbox works for me. I'd also like to develop a LAN version that pulls from an apt-cache server perhaps,as that would save WAN bandwidth on multiple installs.</p> <p>I'd really like to just have a DEB file if that would work, but I'm not a programmer/developer/packager really, so I'm not sure on if that's the best way to do this or not. If it is, how would I do it? No idea. Feel free to use the code, but do share your changes with me and others; and do please give me credit as the originator.</p> <p>wget -c -t0 <a href="http://dl.dropbox.com/u/914191/rons-ubuntu-v13-autoinstall.iso" rel="nofollow">http://dl.dropbox.com/u/914191/rons-ubuntu-v13-autoinstall.iso</a></p> <p><strong>UPDATE - I posted the following on the Ubuntu Forums and figured I'd post it here as well.</strong></p> <p>New Install / Customized Packaging Does anyone here know about packaging deb files?</p> <p>I'm in the process of reading <a href="https://wiki.ubuntu.com/PackagingGuide/Complete" rel="nofollow">https://wiki.ubuntu.com/PackagingGuide/Complete</a> but this is more of a question of, "is this the best way to do it?" than anything else.</p> <p>I want to find the best way to distribute images for wallpapers, fonts, document files, and also a customized install-setup.sh as well. Right now I have an alternative Ubuntu ISO with a kickstart file that does a wget to.dropbox.com -O- | sh after Ubuntu is installed -- and while it works, it's crude. I don't really need to change the ISO image, only the script which resides on the Dropbox location.</p> <p>The install-script.sh installs 3rd party applications, PPAs, sets up iptables, downloads some images files, a customized aliases file and imports it into the .bashrc and /etc/skel .bashrc, and a few other tasks as well.</p> <p>Basically the idea I want to do is to do a new Ubuntu install, add the PPA, sudo apt-get update and then the deb file downloads and does all of the work.</p> <p>Is this the best way to do that? One issue that may arise is the shell script does require some user input to it. Forgive me. I am not a programmer, new to packaging, etc. Just want some feedback on my method really.</p> <p>If you want to see the ks.cfg and the ks-install-script.sh they are at:</p> <p><a href="http://dl.dropbox.com/u/914191/ks-install-script.sh" rel="nofollow">http://dl.dropbox.com/u/914191/ks-install-script.sh</a> http://dl.dropbox.com/u/914191/install-script/ks.cfg</p> <p><a href="http://ubuntuforums.org/showthread.php?p=9758363#post9758363" rel="nofollow">http://ubuntuforums.org/showthread.php?p=9758363#post9758363</a></p>RonMon, 23 Aug 2010 14:45:31 -0400http://linuxexchange.org/questions/1251/kickstart-and-customized-ubuntu-installs/1274