[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: diskless-image-*



>>>>> "Joey" == Joey Hess <joeyh@debian.org> writes:

    Joey> I'd like to step forward and do some work on this. I
    Joey> understand that Randolph has finally gotten debconf-tiny
    Joey> into the base tarball, so this is practical now. I'd limit
    Joey> myself to the set of questions that it asks on the initial
    Joey> reboot before entering task selection.

In this case, it may not help my diskless package, as the problem is
that there are the steps that occur before the initial reboot (which
never occurs for diskless-images, as no boot disk is involved).

For instance, my package currently has in its postinst routine
(not tested yet, so I don't know if it works properly or not):

(side note: debconf-tiny doesn't seem to be in my base2_2.tgz I just
downloaded from my local mirror :-(. What version do I need for this?
Will it be in when potato is released?)

#!/bin/sh -e

#DEBHELPER#

. /usr/share/debconf/confmodule
if [ configure = "$1" ]; then
	db_get diskless-image/master; master="$RET";
	db_get diskless-image/nfsserver; nfsserver="$RET";
	db_get diskless-image/nfsimagedir; nfsimagedir="$RET";
	db_get diskless-image/nfshostsdir; nfshostsdir="$RET";
	db_get diskless-image/nfshomedir; nfshomedir="$RET";
	db_get diskless-image/nameserver; nameserver="$RET";
	db_get diskless-image/domain; domain="$RET";
	db_get diskless-image/maildomain; maildomain="$RET";
	db_get diskless-image/mailroute; mailroute="$RET";
	db_get diskless-image/devfs; devfs="$RET";

	cat > /etc/diskless-image/config << EOF
master=$master
nfsserver=$nfsserver
nfsimagedir=$nfsimagedir
nfshostsdir=$nfshostsdir
nfshomedir=$nfshomedir
nameserver=nameserver
domain=$domain
maildomain=$maildomain
mailroute=$mailroute
devfs=$devfs
EOF

	cat > /etc/diskless-image/config.m4 <<EOF
divert(-1)dnl
define(<[image_master]>,<[$master]>)
define(<[image_nfsserver]>,<[$nfsserver]>)
define(<[image_nfsimagedir]>,<[$nfsimagedir]>)
define(<[image_nfshostsdir]>,<[$nfshostsdir]>)
define(<[image_nfshomedir]>,<[$nfshomedir]>)
define(<[image_nameserver]>,<[$nameserver]>)
define(<[image_domain]>,<[$domain]>)
define(<[image_maildomain]>,<[$maildomain]>)
define(<[image_mailroute]>,<[$mailroute]>)
define(<[image_devfs]>,<[$devfs]>)
divert(0)dnl
EOF

	cat > /etc/diskless-image/exports" << EOF
$nfsimagedir <ipaddress>(rw no_root_squash)
EOF

	cat > /etc/fstab << EOF
none	/proc	proc	defaults	1	0
$nfsserver:$nfsimagedir	/	nfs	defaults,nolock	0	1
EOF

	cat > /etc/resolv.conf << EOF
nameserver $nameserver
domain $domain
search $domain
EOF

	cat > /etc/hostname << EOF
$master
EOF

	# the following code should belong on base image - currently
	# talking to boot disk maintainers about this.

	if [ -f /sbin/unconfigured.sh ]; then
		echo "WARNING: you may have to manually configure the timezone"

		#currently broken on potato
		#/var/lib/dpkg/info/timezones.postinst configure

		ldconfig
		rm /sbin/unconfigured.sh
	fi
fi
-- 
Brian May <bam@debian.org>

Reply to: