--- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-server.postrm +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-server.postrm @@ -0,0 +1,58 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +SHARE="/var/cache/mythbuntu-diskless/overlay/" +SHAREOPTS="rw,no_root_squash,async" +# if $HOST is empty, $SHARE is exported to the world +HOST="" + +db_get mythbuntu-diskless/share_host || true +HOST="$RET" + + +if [ -z "$HOST" ]; then + # export to world + HOST='*' +fi + + +db_get mythbuntu-diskless/create_share || true +NFSENABLE="$RET" + +TMPFILE=`mktemp` + +case "$1" in + purge|remove) + if (grep "$SHARE" /etc/exports > /dev/null) && [ "x${NFSENABLE}" = "xtrue" ]; then + sed -e "\%${SHARE}% d" /etc/exports >> $TMPFILE || true + chmod --reference=/etc/exports $TMPFILE || true + cp $TMPFILE /etc/exports || true + chmod --reference=${TMPFILE} /etc/exports || true + rm $TMPFILE || true + # note: not using exportfs here. if the user changes $HOST (eg + # using dpkg-reconfigure), we probably don't remove all exports + # exportfs -u "${HOST}:${SHARE}" > /dev/null || true + + # less elegant but more robust: + invoke-rc.d nfs-kernel-server restart || true + fi + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + +db_stop + +exit 0 + --- mythbuntu-diskless-0.9.orig/debian/rules +++ mythbuntu-diskless-0.9/debian/rules @@ -0,0 +1,88 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +BZR_REVISION+=77 +VERSION+=0.9 +BZR_BRANCH+=http://bazaar.launchpad.net/~mythbuntu/mythbuntu/mb-diskless +TARFILE+=mythbuntu-diskless_$(VERSION).orig.tar.gz + +get-orig-source:: + bzr export -r $(BZR_REVISION) mythbuntu-diskless-$(VERSION) $(BZR_BRANCH) + tar czf $(CURDIR)/../$(TARFILE) mythbuntu-diskless-$(VERSION) --exclude debian + rm -rf $(CURDIR)/mythbuntu-diskless-$(VERSION) + +configure: configure-stamp +configure-stamp: + dh_testdir + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs -pmythbuntu-diskless-server var/cache/mythbuntu-diskless/overlay/ + + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installdebconf + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_installinit -u"defaults 25" --no-start + dh_installman + dh_install + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-client.templates +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-client.templates @@ -0,0 +1,6 @@ +Template: mythbuntu-diskless-client/abort-installation +Type: note +_Description: Package can't be installed on a normal Ubuntu installation! + This package is only meant to be installed inside a Mythbuntu-diskless chroot. + . + Installing it on a normal Ubuntu installation will break your system. --- mythbuntu-diskless-0.9.orig/debian/changelog +++ mythbuntu-diskless-0.9/debian/changelog @@ -0,0 +1,126 @@ +mythbuntu-diskless (0.9-0ubuntu2) quantal; urgency=low + + * Switch Depends: to isc-dhcp-server following dhcp3-server to + isc-dhcp-server transition. + * Switch mythbuntu-diskless-client-builder.postinst to install + isc-dhcp-server. + + -- Andy Whitcroft Tue, 31 Jul 2012 14:50:57 +0100 + +mythbuntu-diskless (0.9-0ubuntu1) hardy; urgency=low + + * mythbuntu-diskless-client-builder.postinst + - the priority of some questions needs to be raised. Otherwise, the + postinst will fail, resulting in a scary d-i error. (LP: #219356) + - also remove the password from the debconf database + + -- Michael Haas Fri, 18 Apr 2008 22:42:20 +0200 + +mythbuntu-diskless (0.8-0ubuntu1) hardy; urgency=low + + * mythbuntu-diskless-client-builder.postinst (LP: #218262) + - create /target/etc/ltsp/ + - fix syntax error + + -- Michael Haas Wed, 16 Apr 2008 18:24:30 +0200 + +mythbuntu-diskless (0.7-0ubuntu1) hardy; urgency=low + + * in mythbuntu-diskless-client.init: nbd-client shouldn't be killed by + /etc/init.d/sendsigs + + -- Michael Haas Sun, 06 Apr 2008 00:33:59 +0200 + +mythbuntu-diskless (0.6-0ubuntu1) hardy; urgency=low + + * debian/control: make mythbuntu-diskless-client-builder 'Priority: + standard' so it gets installed by d-i on the Mythbuntu alternate disks + * mythbuntu-diskless-client-builder: do not install + m-d-server-standalone if the user wants a DHCP server, + just install m-d-s and dhcp3-server. /etc/ltsp/dhcpd.conf is copied into + place manually to avoid dpkg questioning the user about changed config + files when updating. + + -- Michael Haas Fri, 28 Mar 2008 22:23:00 +0100 + +mythbuntu-diskless (0.5-0ubuntu1) hardy; urgency=low + + * debian/control: + - mythbuntu-diskless-server-standalone doesn't depend on + ltsp-server-standalone anymore, dhcp3-server is used instead + - make mythbuntu-diskless-server-standalone conflict with + ltsp-server-standalone + - Pre-Depend on debconf for mythbuntu-diskless-client because debconf is + used in the preinst + * Add debian/dhcpd.conf from LTSP project to + mythbuntu-diskless-standalone-server + - install dhcpd.conf into /etc/ltsp/dhcpd.conf + * fix mythbuntu-diskless-client-builder.postinst + * make sure mythbuntu-diskless-client does not install unless + /etc/ltsp_chroot exists (taken from LTSP packages) + + -- Michael Haas Wed, 26 Mar 2008 01:17:22 +0100 + + +mythbuntu-diskless (0.4-0ubuntu2) hardy; urgency=low + + * Add syslinux to depends for m-d-s. + + -- Mario Limonciello Mon, 10 Mar 2008 09:35:36 -0500 + +mythbuntu-diskless (0.4-0ubuntu1) hardy; urgency=low + + * divert /usr/bin/update-notifier, install a dummy script instead + * divert /usr/bin/nm-applet, install a dummy script instead + * fix nbdport auto detection + * remove IPCONFIGARGS variable from initramfs, add DHCPPORT instead (see + ) + * if the DHCP server tells us about the DNS servers for that network, make + sure we update /etc/resolv.conf accordingly + * actually ship postinst and templates for mythbuntu-diskless-client-builder + udeb this time + + -- Michael Haas Mon, 05 Mar 2008 02:00:06 +0100 + +mythbuntu-diskless (0.3-0ubuntu1) hardy; urgency=low + + * Use /usr/lib/ltsp/configure-x.sh instead of + xdebconfigurator/dexconf + * Add --no-start to dh_installinit because /usr/lib/ltsp/configure-x.sh + shouldn't ever be started in the chroot (when installing packages) + * Add mythbuntu-diskless-client-builder udeb for alternate disks + * Add Readme.debian + + -- Michael Haas Fri, 02 Mar 2008 00:44:13 +0100 + +mythbuntu-diskless (0.2-0ubuntu1) hardy; urgency=low + + * Rename initramfs/conf.d/mythbuntu to initramfs/conf.d/ltsp to make + sure the config provided by ltsp-client-core is overridden properly + * Update initramfs/conf.d/ltsp_nbd: make sure the NFS overlay is + auto-detected + * Set host name on boot to MAC address (colons are stripped) + * Add scripts/mythbuntu_nbd, hooks/wol and hooks/ltsp_nbd which were + not accepted for the LTSP packages for hardy. These files are derived + from LTSP. + * Add IPCONFIGARGS variable which is used to pass additional arguments to + ipconfig. + * Update copyright for new files + * Add hal/20thirdparty/10-mythbuntu-diskless-ignore-network.fdi to ignore + network devices in HAL (networkmanager breaks connectivity if we don't) + * Update overlay directory to /var/cache/mythbuntu-diskless/overlay/ + * Add debconf magic: if the user agrees, this package can now add + the export for the overlay directory to /etc/exports + * Add diversion for /etc/udev/rules.d/50-ltspfsd.rules on client - we don't + need it (this can be removed after the next LTSP upload which + fixes this problem in the build script) + * Add HOSTNAMEOVERRIDE variable + + -- Michael Haas Thu, 28 Feb 2008 01:28:06 +0100 + +mythbuntu-diskless (0.1-0ubuntu1) hardy; urgency=low + + * Initial release (LP: #188169) + + -- Michael Haas Thu, 31 Jan 2008 00:15:37 +0100 + --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-server-standalone.postrm +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-server-standalone.postrm @@ -0,0 +1,27 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +case "$1" in + purge) + + rm -f /etc/ltsp/dhcpd.conf + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear|remove) + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + +db_stop + +exit 0 + --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-client.init +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-client.init @@ -0,0 +1,53 @@ +#!/bin/sh +# /etc/init.d/mythbuntu-diskless-client: set up various things on mythbuntu-diskless clients + +# technically, we require the root system to be mounted before this scripted is +# started +# practically, it doesn't matter because init is never started if / is not mounted + +### BEGIN INIT INFO +# Provides: mythbuntu-diskless-client +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: mythbuntu-diskless-client setup +# Description: set up various things on mythbuntu-diskless clients, eg xorg.conf +### END INIT INFO + +# borrowed from ltsp-client-core +test -f /etc/ltsp_chroot || exit 0 + +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +case "$1" in start|restart|force-reload) + + + # this is really -diskless-specific: + # if the overlay directory has an xorg.conf, we can assume that it's valid + # we used to check for /etc/X11/xorg.conf, but that does not work in case + # the squashfs already contains one (which might be invalid) + if [ ! -e "/cow/etc/X11/xorg.conf" ]; then + # run ltsp configure script + /usr/lib/ltsp/configure-x.sh + fi + + # nbd-client shouldn't be killed by /etc/init.d/sendsigs + mkdir -p /var/run/sendsigs.omit.d/ + # just ignore any nbd-client instances in sendsigs + pidof nbd-client > /var/run/sendsigs.omit.d/nbd-client + + +;; + +status|stop) + # do nothing +;; + +*) + echo "$0: invalid arguments. Use 'start', 'restart', 'force-reload', 'stop' or 'status'." + echo "$0: 'stop' and 'status' don't do anything and are just there for compatibility reasons." + +;; + +esac --- mythbuntu-diskless-0.9.orig/debian/dhcpd.conf +++ mythbuntu-diskless-0.9/debian/dhcpd.conf @@ -0,0 +1,22 @@ +# +# Default LTSP dhcpd.conf config file. +# + +authoritative; + +subnet 192.168.0.0 netmask 255.255.255.0 { + range 192.168.0.20 192.168.0.250; + option domain-name "example.com"; + option domain-name-servers 192.168.0.1; + option broadcast-address 192.168.0.255; + option routers 192.168.0.1; +# next-server 192.168.0.1; +# get-lease-hostnames true; + option subnet-mask 255.255.255.0; + option root-path "/opt/ltsp/i386"; + if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" { + filename "/ltsp/i386/pxelinux.0"; + } else { + filename "/ltsp/i386/nbi.img"; + } +} --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-client.install +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-client.install @@ -0,0 +1,7 @@ +initramfs/conf.d/ltsp etc/initramfs-tools/conf.d/ +initramfs/hooks/wol etc/initramfs-tools/hooks/ +initramfs/hooks/ltsp_nbd etc/initramfs-tools/hooks/ +initramfs/scripts/mythbuntu_nbd etc/initramfs-tools/scripts/ +hal/20thirdparty/10-mythbuntu-diskless-ignore-network.fdi usr/share/hal/fdi/preprobe/20thirdparty/ +bin/update-notifier usr/bin/ +bin/nm-applet usr/bin/ --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-client.postrm +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-client.postrm @@ -0,0 +1,28 @@ +#!/bin/sh -e + +case "$1" in + remove) + if [ -f "/etc/udev/rules.d/50-ltspfsd.rules.diverted" ]; then + dpkg-divert --package mythbuntu-diskless-client --rename --remove /etc/udev/rules.d/50-ltspfsd.rules || true + fi + dpkg-divert --package mythbuntu-diskless-client --rename --remove /usr/bin/update-notifier || true + dpkg-divert --package mythbuntu-diskless-client --rename --remove /usr/bin/nm-applet || true + + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear|purge) + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + + +exit 0 + --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-client.preinst +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-client.preinst @@ -0,0 +1,35 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +case "$1" in + install|upgrade) + + # taken from LTSP package + if [ ! -f /etc/ltsp_chroot ]; then + db_fset mythbuntu-diskless-client/abort-installation seen false + db_input critical mythbuntu-diskless-client/abort-installation || true + db_go || true + exit 1 + fi + + dpkg-divert --package mythbuntu-diskless-client --rename --add /usr/bin/update-notifier || true + dpkg-divert --package mythbuntu-diskless-client --rename --add /usr/bin/nm-applet || true + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + + +exit 0 + --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-server-standalone.install +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-server-standalone.install @@ -0,0 +1 @@ +debian/dhcpd.conf /etc/ltsp/ --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-server.config +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-server.config @@ -0,0 +1,18 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +db_input low mythbuntu-diskless/create_share || true +db_go + +db_get mythbuntu-diskless/create_share || true +CREATE="$RET" + +if [ "x$CREATE" = "xtrue" ]; then + db_input high mythbuntu-diskless/share_host || true + db_go +fi + + +exit 0 + --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-client-builder.templates +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-client-builder.templates @@ -0,0 +1,63 @@ +Template: mythbuntu-diskless-client-builder/run +Type: boolean +Default: false +_Description: Set up an mythbuntu-diskless chroot environment? + This will set up an Mythbuntu LTSP chroot environment on the machine, to act + as a mythbuntu-diskless server. + +Template: debian-installer/mythbuntu-diskless-client-builder/title +Type: text +# Item in the main menu to select this package +_Description: Build mythbuntu-diskless chroot + +Template: mythbuntu-diskless-client-builder/progress +Type: text +_Description: Building mythbuntu-diskless system ... + +Template: mythbuntu-diskless-client-builder/compress +Type: text +_Description: Compressing mythbuntu-diskless image ... + +Template: mythbuntu-diskless-client-builder/build-client-opts +Type: string +Default: --mirror file:///cdrom --security-mirror none --skipimage --mythbuntu +# Only used for preseeding arguments to mythbuntu-diskless-client-builder. +Description: arguments for ltsp-build-client: + this option is meant to be used with debconf preseeding. + +Template: mythbuntu-diskless-client-builder/dhcp-manual +Type: note +_Description: No Interface for Mythbuntu LTSP dhcpd configuration found + mythbuntu-diskless needs a configured network interface on your system. + . + No usable interfaces were found. Please configure the file + /etc/ltsp/dhcpd.conf manually to point to a valid static interface after the + installation finished. + +Template: mythbuntu-diskless-client-builder/dhcp-interface +Type: select +Choices: ${choices} +_Description: Interface for the mythbuntu-diskless clients: + There were multiple configured interfaces found in this system. + +Template: mythbuntu-diskless-client-builder/username +Type: string +_Description: User name for diskless client environment: + Here you can enter the user name you'll use to log in to your client. + +Template: mythbuntu-diskless-client-builder/password +Type: string +_Description: Password for diskless client environment: + Here you can enter the password you'll use to log in to your client. + +Template: mythbuntu-diskless-client-builder/install-dhcp +Type: boolean +_Description: Install DHCP server? + A DHCP server will make it easier to boot your clients. + . + If you already have a DHCP server on your network, for example on a SOHO + routing device, you shouldn't enable this option. + . + Instead, you can configure your existing DHCP server according to the + mythbuntu-diskless documentation or simply use other means of loading the + kernel on your client, eg using a USB drive or a CD-ROM. --- mythbuntu-diskless-0.9.orig/debian/copyright +++ mythbuntu-diskless-0.9/debian/copyright @@ -0,0 +1,82 @@ +This package was debianized by Michael Haas on +Thu, 31 Jan 2008 00:15:37 +0100. + +It can be downloaded from https://code.launchpad.net/~mythbuntu/mythbuntu/mb-diskless + +Many files were originally derived from the LTSP package found in Ubuntu. + +Copyright: + initramfs/conf.d/ltsp: + Copyright (C) 2008 Michael Haas + + initramfs/scripts/mythbuntu_nbd, initramfs/hooks/ltsp_nbd: + Copyright (C) 2005 Canonical Ltd. + Copyright (C) 2008 Michael Haas + (see ) + + initramfs/hooks/wol: + Copyright (C) 2005 Canonical Ltd. + Copyright (C) 2008 Michael Haas + + debian/mythbuntu-diskless-client-builder.postinst, + debian/mythbuntu-diskless-client-builder.templates: + Copyright (C) 2005 Canonical Ltd. + Copyright (C) 2008 Michael Haas + + debian/dhcpd.conf: + taken from ltsp-5.0.40~bzr20080212 ubuntu package + +License: + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + +Copyright: + + hal/20thirdparty/10-mythbuntu-diskless-ignore-network.fdi: + Copyright (C) 2007 Doug Goldstein + + +License: 2-clause BSD style + + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +The Debian packaging is (C) 2008, Michael Haas and +is licensed under the GPL-3, see `/usr/share/common-licenses/GPL-3'. + --- mythbuntu-diskless-0.9.orig/debian/Readme.debian +++ mythbuntu-diskless-0.9/debian/Readme.debian @@ -0,0 +1,195 @@ + +== How does it work / architecture == + +Clients will boot from a read-only compressed file system (squashfs) which is +shared out by the server via nbd (network block device). A writeable overlay +directory is put on top of the squashfs using aufs ("another unionfs"). The +overlay directory is a NFS share exported by the server. Any changes you make +on the client are stored in that NFS share and are available across reboots. +The client can identify its overlay directory using the MAC address of the +network card which was used to boot the system. + +The compressed file system is created using a plugin for ltsp-build-image +which adds the mythbuntu-specifics bits. + + +== Prerequisites == + +You need: + +* a server. Any computer running hardy will do, but keep in mind that it should + be the same architecture as your client. While it's possible to generate a + diskless image on ppc for i386 clients, it won't be described here. + It's ok if your server is amd64, though. + +* a DHCP server. This can be on the same computer as your server or on a + different box on your network. It's possible that you already have a DHCP + server on your network. If it's one of these SOHO routers/cable modems, you + need to make sure you can modify its configuration sufficiently. It's + probably easier to disable its dhcpd while you're testing. + As a special case, you can live without a (configurable) DHCP server if you + find a different way to load the kernel and its initramfs, eg using a USB pen + drive. However, this is not yet documented. + +* a client. Any box capable of running mythfrontend should be OK. Having a lot + of RAM can be beneficial because swapping over network is slow. Network + swapping is enabled if you have less than 320M RAM. However, the default + configuration will not give you a lot of swap space. + Additionally, the client should be capable of booting over PXE. If your + network card does not support PXE, you can use etherboot (see below) to get + a PXE stack or a USB pen drive (or anything you can boot from) to bootstrap + your client. + +* a fast internet connection or a local mirror which holds all relevant + packages. The build script downloads a lot of data. + +== Getting started == + +Make yourself comfortable in front of your server. + +* Install mythbuntu-diskless-server: + $ sudo aptitude install mythbuntu-diskless-server + This package will automatically pull in everything that's needed to build + the diskless image. + + If you want to install a DHCP server as well, install + mythbuntu-diskless-server-standalone instead. + $ sudo apt-get install mythbuntu-diskless-server-standalone + We'll configure it later. + +* Configure the overlay NFS export: + $ sudo dpkg-reconfigure mythbuntu-diskless-server + Answer both questions. + +* Download an updated version of the mythbuntu-diskless LTSP plugin: + $ wget http://laga.ath.cx/030-mythbuntu + and copy it into the right place: + $ sudo cp 030-mythbuntu /usr/share/ltsp/plugins/ltsp-build-client/Ubuntu/030-mythbuntu + I realize it's unclean to overwrite files in /usr/share, but in this case + the update will also be shipped in the next LTSP upload. Consider it some kind + of time travel. + +* Create the mythbuntu-diskless image + $ sudo ltsp-build-client --mythbuntu --mythbuntu-copy-user-credentials + This is going to take a while because it's downloading a lot of packages, + installing all of these packages into the chroot (usually /opt/ltsp/i386) + and turning the chroot into a compressed file system. + + Make sure you read the output of + $ ltsp-build-client --extra--help + There are a lot of interesting options, eg --copy-sourceslist. + If your server is amd64 and your clients are i386, you should add + --arch i386 to the ltsp-build-client command line. + +* Configure the DHCP server + + If you installed mythbuntu-diskless-server-standalone, the configuration + file for your dhcpd is located at /etc/ltsp/dhcpd.conf. + Open this file in your favorite editor, eg + $ sudo editor /etc/ltsp/dhcpd.conf + and edit it to suit your network. + This step is a bit complicated. The Edubuntu people have some documentation + to help you understand what you want to do here: + http://doc.ubuntu.com/edubuntu/edubuntu/handbook/C/ch03s06.html + However, please note that mythbuntu-diskless, unlike Edubuntu, + will not detect and configure any unused interfaces automatically. This + part of the Edubuntu handbook does not apply. + + If you want to use another computer on your network to handle DHCP requests, + you can find some example configuration files in + /usr/share/doc/ltsp-server/examples/. You might have to modify some entries + to point to your mythbuntu-diskless server. + + In case you're using a SOHO router or any other setup, you'll have to figure + out how to configure it correctly. Be warned that it's probably impossible + to do that with some of these SOHO devices. + +* Boot your client + You'll need to configure your client to use its PXE stack. + For devices with onboard network cards, the BIOS setup is usually the right + place to look. The same probably applies too regular PCI cards, too. + Some cards might require configuration using a card-specific utility, + although that's probably rare these days. + + If you use etherboot, you'll need to configure your computer to boot from the + boot medium you've chosen. + + Once you get to the login screen, you can log in using your user name and + password from your server (the one you were using when you built the image) + +== Etherboot == +See http://www.etherboot.org +If you'd like to generate an image, go to www.rom-o-matic.net, +select your network card, select your way of booting and dowload +the resulting file. + +I'd probably for one of the "ISO bootable image" formats and put it +on a CD-RW for testing. "Floppy bootable ROM image" can also be a good choice +if you've still got a floppy disk. It's probably not the fastest method +of loading etherboot, but it's good for testing purposes. + + +== Cool! It works! What can I do now? == + +On the client: +* Watch TV +* run mythbuntu-control-centre and set up LIRC +* do anything else in mythbuntu-control-centre +* do _not_ install new packages. + It is certainly possible to install new + packages, but doing so means diverging from the original client environment. + It's better to install new packages on the server, see below. + There are a few exceptions to the rule: for some client-specific packages + like proprietary drivers which would conflict with other clients, + it is certainly acceptable to install these on the client. + + + +On the server: +Switch to client environment first: + $ sudo chroot /opt/ltsp/i386 + You probably also want to have /proc in there: + $ sudo mount -o bind /proc /opt/ltsp/i386/proc/ +* Install additional packages: + # aptitude install your-package +* Update packages + # aptitude update && aptitude upgrade + aptitude safe-upgrade might be even better. + +When you're done, type "exit" to exit the client environment. +* If you installed new packages, you have to update the compressed file system: + $ sudo ltsp-update-image +* If you only updated the kernel, run + $ sudo ltsp-update-kernels + + + + +== Help! It doesn't work! == + ++ Help! My client doesn't boot! + + To find out why it's failing, you should edit + /var/lib/tftpboot/ltsp/i386/pxelinux.cfg/default on the server and remove + "quiet splash" from the kernel options. + Please gather as much information as possible and file a bug at + https://bugs.launchpad.net/ubuntu/+source/mythbuntu-diskless/ + ++ Help! My client doesn't start X correctly! + + Bulletproof X should have avoided that. If it hasn't, there was probably + an error when creating the X config for your system. + On the server, you can review and modify the client's xorg.conf in + /var/cache/mythbuntu-diskless/overlay/$KEY/etc/X11/. + $KEY will usually be the MAC address of your client without colons. + + ++ Help! There was an error while running ltsp-build-client! + + Please file a bug report at + https://bugs.launchpad.net/ubuntu/+source/mythbuntu-diskless/ + and provide as much information as possible, including the exact error message. + + + + --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-client-builder.postinst +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-client-builder.postinst @@ -0,0 +1,181 @@ +#! /bin/sh + +# this file originally comes from the LTSP package (ltsp-client-builder.postinst) + +set -e + +. /usr/share/debconf/confmodule + +log () { + logger -t mythbuntu-diskless-client-builder "$@" +} + +# check if we have a valid CD-ROM mounted +if [ ! -f /cdrom/.disk/info ]; then + log "no CD-ROM found ! Not installing ltsp chroot" + exit 0 +fi + +# get the ok from the user to build the ltsp chroot +db_input medium mythbuntu-diskless-client-builder/run || [ $? -eq 30 ] +if ! db_go; then + exit 10 # back up to menu +fi + +db_get mythbuntu-diskless-client-builder/run +if [ "$RET" = false ]; then + log "user requested no ltsp chroot" + exit 0 +fi + +db_input high mythbuntu-diskless-client-builder/install-dhcp + +# FIXME: add sanity checks for empty password/user name +db_input high mythbuntu-diskless-client-builder/username +db_input high mythbuntu-diskless-client-builder/password + +db_go + +db_get mythbuntu-diskless-client-builder/username +USER="$RET" +db_get mythbuntu-diskless-client-builder/password +PASS="$RET" + +# reset password +db_set mythbuntu-diskless-client-builder/password '' || true + +db_get mythbuntu-diskless-client-builder/install-dhcp +MAKEDHCPD="$RET" + +#load and use generic arguments +if db_get mythbuntu-diskless-client-builder/build-client-opts && [ -n "$RET" ] ; then + BUILD_CLIENT_OPTS="$RET" + log "ltsp-build-client options: $BUILD_CLIENT_OPTS --mythbuntu-user-credentials :" +fi + +# build the chroot +db_progress START 0 2 mythbuntu-diskless-client-builder/progress + +if [ "$MAKEDHCPD" = "true" ]; then + apt-install mythbuntu-diskless-server isc-dhcp-server +else + apt-install mythbuntu-diskless-server +fi + +db_progress STEP 1 + +# workaround for: http://bugs.debian.org/390647 +in-target /bin/touch /etc/resolv.conf + +DEBIAN_PRIORITY=critical +in-target ltsp-build-client $BUILD_CLIENT_OPTS --mythbuntu-user-credentials "$USER:$PASS" 2>&1 + +db_progress SET 1800 + +db_progress STOP + +if [ "$MAKEDHCPD" = "true" ]; then + # configure a default interface for usage with LTSP + + # copy dhcpd.conf into place + mkdir -p /target/etc/ltsp/ + cp /target/usr/share/doc/ltsp-server/examples/dhcpd.conf /target/etc/ltsp/dhcpd.conf + + NET=192.168.0 + DEFAULTROUTE_IFACE="$(route -n|grep ^0|sed -e 's/.* //')" + IFACE_LIST="$(cat /proc/net/dev|sed -e 's/^ *//' -e 's/:.*//'|grep -Ev '(\||lo|sit)')" + +# interfaces_entry() { +# cat <>/target/etc/network/interfaces + +#auto $IFACE_LIST +#iface $IFACE_LIST inet static +# address $NET.254 +# netmask 255.255.255.0 +# network $NET.0 +# broadcast $NET.255 + +#EOF + +# chroot /target ifconfig $IFACE_LIST $NET.254 +# } + + # modify dhcpd.conf to match the interface we've detected + modify_dhcpd() { + LC_ALL=C IPADDR=`ifconfig $IFACE_LIST | grep 'inet addr' | cut -d : -f 2 | sed 's/ *Bcast//'` + LC_ALL=C NET=`echo $IPADDR | cut -d . -f 1-3` + sed -i /target/etc/ltsp/dhcpd.conf -e "s/192.168.0/$NET/g" + } + + # if we already have a matching interface, there is no need to go on + if [ -n "$(ifconfig|grep $NET)" ];then + exit 0 + fi + + # build list of configured interfaces + IFACE_TMP="" + for iface in $IFACE_LIST; do + if (LC_ALL=C ifconfig $iface | grep 'inet addr' > /dev/null); then + IFACE_TMP="${IFACE_TMP:+$IFACE_TMP}$iface" + fi + done + IFACE_LIST=$IFACE_TMP + + # check if we still have more than one possible interface. + # if thats the case, show a selector with the detected ones + if [ "$(echo ${IFACE_LIST}|wc -w)" -gt 1 ]; then + db_subst mythbuntu-diskless-client-builder/dhcp-interface choices "$(echo "$IFACE_LIST" | sed 's/ /, /g')" + db_fset mythbuntu-diskless-client-builder/dhcp-interface seen false + db_input high mythbuntu-diskless-client-builder/dhcp-interface || true + db_go || true + + db_get mythbuntu-diskless-client-builder/dhcp-interface || true + IFACE_LIST="$RET" + + modify_dhcpd + elif [ -z "$IFACE_LIST" ];then + # we didnt get a proper interface, tell the user about it + db_fset mythbuntu-diskless-client-builder/dhcp-manual seen false + db_input high mythbuntu-diskless-client-builder/dhcp-manual || true + db_go || true + else + modify_dhcpd + fi + +fi + +# compress the image +# (we need the percentage of mksquashfs' output +# need to pipe through a file ...) + +COMPRESS_LOG=/var/log/ltsp-image-build.log + +db_progress START 0 100 mythbuntu-diskless-client-builder/compress + +chroot /target ltsp-update-image >$COMPRESS_LOG 2>&1 & +OLDVAL=0 +while [ -z ${LOOP} ]; do + rawval=$(tail -1 $COMPRESS_LOG |sed -e 's/^.* //') + if [ "$(echo $rawval|grep '[0-9]\%$')" ];then + val=$(echo $rawval|tr -d %) + if [ "$val" -gt 95 ]; then + db_progress SET 100 + sleep 3 + LOOP="False" + else + if [ "$val" -gt "${OLDVAL}" ];then + db_progress SET $val + OLDVAL=$val + fi + fi + fi +done + +# save compression log +if [ -e $COMPRESS_LOG ]; then + mv $COMPRESS_LOG /target/var/log/ +fi + +db_progress STOP + +exit 0 --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-server.templates +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-server.templates @@ -0,0 +1,24 @@ +Template: mythbuntu-diskless/create_share +Type: boolean +Default: false +_Description: Enable NFS export for overlay directory? + By default, Mythbuntu-diskless uses a NFS share to store any changes + made on the clients, eg your LIRC config and other files. + . + This option adds /var/cache/mythbuntu-diskless/overlay/ + to /etc/exports. + . + Note: this entry will be removed again if you remove this package. + +Template: mythbuntu-diskless/share_host +Type: string +Default: * +_Description: Hosts allowed to mount the overlay share: + Here you can set which hosts can mount the overlay share. + See man 5 exports for details. + . + Default is * which will allow every host to mount the share. + This setting is not recommended because it's very insecure. + . + Example: 192.168.0.0/24 + --- mythbuntu-diskless-0.9.orig/debian/compat +++ mythbuntu-diskless-0.9/debian/compat @@ -0,0 +1 @@ +5 --- mythbuntu-diskless-0.9.orig/debian/control +++ mythbuntu-diskless-0.9/debian/control @@ -0,0 +1,55 @@ +Source: mythbuntu-diskless +Section: misc +Priority: optional +Maintainer: Ubuntu MythTV Team +XSBC-Original-Maintainer: Michael Haas +XS-Vcs-Bzr: http://bazaar.launchpad.net/~mythbuntu/mythbuntu/mythbuntu-diskless +XS-Vcs-Browser: http://codebrowse.launchpad.net/~mythbuntu/mythbuntu/mythbuntu-diskless +Build-Depends: debhelper (>= 5) +Standards-Version: 3.7.3 + +Package: mythbuntu-diskless-client +Architecture: all +Pre-Depends: debconf (>= 0.5) | debconf-2.0 +Depends: ${shlibs:Depends}, ${misc:Depends}, ltsp-client-core, etherwake +Description: Mythbuntu-diskless client environment + Needed to configure and boot a mythbuntu-diskless client + . + Meta-package which pulls in ltsp-client-core and installs + a config file. + . + DO NOT install on a regular machine, it is intended only + for installation inside a Mythbuntu-diskless client filesystem. + +Package: mythbuntu-diskless-server +Architecture: all +Pre-Depends: nfs-kernel-server +Depends: ${shlibs:Depends}, ${misc:Depends}, ltsp-server, syslinux +Description: Basic Mythbuntu-diskless server environment + Basic environment for a Mythbuntu-diskless server. + It is commonly used with a DHCP server, but you can also bootstrap + the clients from other boot media. See Mythbuntu documentation. + . + If you want a pre-configured dhcp server, install the + mythbuntu-diskless-server-standalone package. + +Package: mythbuntu-diskless-server-standalone +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, mythbuntu-diskless-server, isc-dhcp-server +Conflicts: ltsp-server-standalone +Description: Mythbuntu-diskless server environment with DHCP server + Installs a complete Mythbuntu-diskless server environment + consisting of the mythbuntu-diskless-server package and a DHCP server + + +Package: mythbuntu-diskless-client-builder +Section: debian-installer +XC-Package-Type: udeb +Architecture: all +Depends: ${misc:Depends}, ${shlibs:Depends}, pkgsel +XB-Installer-Menu-Item: 7000 +Priority: standard +Description: Build a mythbuntu-diskless environment in the installer target + This udeb bootstraps the Mythbuntu LTSP client chroot in the installer target + while the cdrom is still mounted. + --- mythbuntu-diskless-0.9.orig/debian/mythbuntu-diskless-server.postinst +++ mythbuntu-diskless-0.9/debian/mythbuntu-diskless-server.postinst @@ -0,0 +1,72 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +SHARE="/var/cache/mythbuntu-diskless/overlay/" +SHAREOPTS="rw,no_root_squash,async,no_subtree_check" +# if $HOST is empty, $SHARE is exported to the world +HOST="" + +db_get mythbuntu-diskless/share_host || true +HOST="$RET" + +if [ -z "$HOST" ]; then + # export to world + HOST='*' +fi + +TMPFILE=`mktemp` + + +case "$1" in + configure) + + db_get mythbuntu-diskless/create_share || true + NFSENABLE="$RET" + + # this part is taken from postrm (note: we don't restart the nfs-server here) + # here's the plan: clean up /etc/exports first to make sure + # new debconf settings like $HOST are written to /etc/exports properly + if (grep "$SHARE" /etc/exports > /dev/null) && [ "x${NFSENABLE}" = "xtrue" ]; then + sed -e "\%${SHARE}% d" /etc/exports >> $TMPFILE || true + chmod --reference=/etc/exports $TMPFILE || true + cp $TMPFILE /etc/exports || true + chmod --reference=${TMPFILE} /etc/exports || true + rm $TMPFILE || true + fi + + + # actually write something + if [ "x${NFSENABLE}" = "xtrue" ] && (! grep "$SHARE" /etc/exports > /dev/null); then + # FIXME: should really add the network + # we can probably use ip.ad.re.0/sub.net.mask + echo "$SHARE ${HOST}(${SHAREOPTS})" >> /etc/exports + # it's not too critical if we fail here + # note: not using exportfs here. if the user changes $HOST (eg + # using dpkg-reconfigure), we might end up with too many exports + # exportfs -o "$SHAREOPTS" "${HOST}:${SHARE}" > /dev/null || true + + # less elegant but more robust: + invoke-rc.d nfs-kernel-server restart || true + fi + + + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +db_stop + +exit 0 + --- mythbuntu-diskless-0.9.orig/debian/po/templates.pot +++ mythbuntu-diskless-0.9/debian/po/templates.pot @@ -0,0 +1,72 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: Source: mythbuntu-diskless@packages.debian.org\n" +"POT-Creation-Date: 2008-02-28 19:22-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mythbuntu-diskless-server.templates:1001 +msgid "Enable NFS export for overlay directory?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mythbuntu-diskless-server.templates:1001 +msgid "" +"By default, Mythbuntu-diskless uses a NFS share to store any changes made on " +"the clients, eg your LIRC config and other files." +msgstr "" + +#. Type: boolean +#. Description +#: ../mythbuntu-diskless-server.templates:1001 +msgid "" +"This option adds /var/cache/mythbuntu-diskless/overlay/ to /etc/exports." +msgstr "" + +#. Type: boolean +#. Description +#: ../mythbuntu-diskless-server.templates:1001 +msgid "Note: this entry will be removed again if you remove this package." +msgstr "" + +#. Type: string +#. Description +#: ../mythbuntu-diskless-server.templates:2001 +msgid "Hosts allowed to mount the overlay share:" +msgstr "" + +#. Type: string +#. Description +#: ../mythbuntu-diskless-server.templates:2001 +msgid "" +"Here you can set which hosts can mount the overlay share. See man 5 exports " +"for details." +msgstr "" + +#. Type: string +#. Description +#: ../mythbuntu-diskless-server.templates:2001 +msgid "" +"Default is * which will allow every host to mount the share. This setting is " +"not recommended because it's very insecure." +msgstr "" + +#. Type: string +#. Description +#: ../mythbuntu-diskless-server.templates:2001 +msgid "Example: 192.168.0.0/24" +msgstr "" --- mythbuntu-diskless-0.9.orig/debian/po/POTFILES.in +++ mythbuntu-diskless-0.9/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] mythbuntu-diskless-server.templates