Kickstart support info
Colin Watson
cjwatson at ubuntu.com
Tue Apr 12 06:38:08 CDT 2005
On Mon, Apr 11, 2005 at 03:46:59PM -0700, Marc MERLIN wrote:
> On Mon, Apr 11, 2005 at 10:57:59PM +0100, Colin Watson wrote:
> > %pre worked fine in Array CD 6, as far as I know, so I don't know what
> > that comment was about. %post in the chroot was broken, and %packages
> > sort of worked although it didn't support groups yet.
>
> %pre seems to work fine
> %post seems to be problematic since the CD install reboots and installs
> most of the debs after the reboot.
> I take it %post would work be run before the reboot when all the software
> is still missing, wouldn't it (not too good for me)?
Right, %post is run at the end of the first stage. I couldn't see any
other way to do it, as %post and %post --nochroot are meant to happen at
the same time, and by the time the system reboots and installs remaining
packages the installation root has gone away.
There's a preseeding workaround, though; write a post-installation
script into some executable file in /target, and set the location of
that file (without "/target") as the value of base-config/late_command.
I guess one option for the future might be to allow the second-stage
package installation step to be optionally pulled back to the first
stage. (I think the current behaviour's right for the default install
mode, since you get to find out whether your system actually boots as
early as possible.)
> > > Can I use %packages too?
> >
> > Yes. The only package groups you can use are "Ubuntu Desktop" (or
> > "ubuntu-desktop") and "Kubuntu Desktop" (or "kubuntu-desktop"),
> > depending on your installation source.
>
> I indeed found out those seemed to be the only two ubuntu task packages,
> thanks for confirming.
> As general feedback, ubuntu should have more tasks like RH does. At least
> one task should have sshd installed by default, along with all the regular
> server stuff.
I agree (and always have, FWIW; I lost the argument about using tasksel
in the Warty installer :-)). We'll be discussing this in Sydney as part
of this BOF session:
http://udu.wiki.ubuntu.com/UbuntuDownUnder/BOFs/UbuntuDevelopment/PackageSelection
> For that matter, for stuff like postfix (not an ubuntu-desktop dependency),
> if I want exim4 by default do I have to let the installer put it, and then
> remove it myself and put exim or is there a way to seed negative packages
> compared to the default install?
At the moment, postfix is hardcoded in debootstrap, and ubuntu-base
depends on it. It will probably be easiest to let that happen and then
include exim4 in %packages, which will automatically remove postfix
(and, unfortunately, ubuntu-base as well).
We plan to take postfix out of the base system in Breezy, which will
make this a lot nicer.
> > > As long as I can work around it, it's a whole lot better than nothing :)
> > > I do realize that it's hard to get right, even RH doesn't have it working
> > > perfectly after 5-6 years of having come up with kickstart.
> >
> > Let me know about problems; I'm interested in how things work out in
> > practice.
>
> Well, here's my current list:
>
> - ks will not default to the first hda/sda/whatever drive like RH.
> In other words, this doesn't work:
> # Clear all partitions
> clearpart --drives=hda,sda --initlabel
> part / --fstype ext3 --size -1 --grow --maxsize=45000
> part swap --fstype swap --size=1024
>
> - installer still stops and asks me hda or hdc when I have two drives.
> Is --ondisk unsupported?
> # Clear all partitions
> clearpart --drives=hda,sda --initlabel
> part / --fstype ext3 --ondisk=hda --size -1 --grow --maxsize=45000
> part swap --fstype swap --ondisk=hda --size=1024
These two problems are due to pre-existing annoying limitations in
partman-auto, which can currently only deal with one disk. As a result,
kickseed only lets you specify one disk in 'clearpart --drives', and
doesn't support --ondisk. (It should spit out warnings to
/var/log/syslog about either of the above constructions.)
Taking advantage of devfs-style paths and using 'clearpart
--drives=discs/disc0/disc' may help here.
> - how do I get/see debug output for the installer outside of F4 or whatever
> VT it was?
VT4 is /var/log/syslog; VT3 also has a few useful things, and is
/var/log/messages. The installation root has nc if you want to copy
those to another system.
> - More generally, how do I tell the name of the d-i question I need to
> preseed with an answer after the installer hangs on it?
The quick answer is "look up the text of the question in
/var/lib/cdebconf/templates.dat". The longer though possibly more
elegant answer is to boot with the DEBCONF_DEBUG=5 argument, which will
give you a trace of the debconf protocol in syslog.
> (and how do I get the list of valid preseed answers? :)
Sadly, either read the source or ask me (although in the case of select
or multiselect questions, you'll often find useful information in the
Choices: field in /var/lib/cdebconf/templates.dat). Ideally, this would
be in the installation manual, but nobody's written d-i documentation at
that level of detail yet.
> - how do I tell d-i to install all my packages and reboot by itself without
> prompting after running %post?
> (right now, it first tells me it's done with the install and stops with
> a prompt, then does stuff, then reboots, and then installs a lots of apt
> packages :)
Use the 'reboot' Kickstart command.
> - Can I safely use a chvt equivalent (works in the RH installer) when I want
> my pre or post to output stuff on the screen?
The installer doesn't have chvt or openvt or any equivalent that I can
think of. It would be a simple matter of enabling them in busybox,
though.
> - the installer has a bug where if I happen to be on VT2 typing stuff when
> it outputs a screen (asking for partitions for instance): it then starts
> outputting screens on VT2 but still takes answers on VT1
Hmm. I do this often in non-automatic mode (editing stuff while the base
system installation is running, usually), and haven't noticed any
problems. I'll try again. Anything special about this system?
> - I don't want the default user (which I get prompted for and can't seem
> to preseed in kickstart, I probably need d-i for that too).
> I'd like a default root password, does:
> rootpw --iscrypted "$1$Q3fKveE4$xxxxxxxxxxxxxxx"
> work?
Yes.
> How do I make the default user part of the install go away?
A Kickstart extension, 'user --disabled' (which I now realise I
neglected to document in the manual; added to my to-do list).
> > > Actually, is there a generic way to preseed a question disable: can I tell
> > > xorg: don't generate config file?
> >
> > No generic way, since packages generally don't ask debconf questions of
> > the form "may I set this package up so that it actually works". :-) I
> > don't think xserver-xorg will overwrite an existing customised
> > /etc/X11/xorg.conf, though.
>
> Aaah, so I could just touch /etc/X11/xorg.conf in %pre and fix it up later
> in %post. That works for me :)
Right, that general approach; although when %pre runs, /target hasn't
been created or mounted yet (unless you're creating and mounting it
yourself, I guess). However, since %post runs before the first reboot
and xserver-xorg is installed in the second stage, you don't actually
need to do anything in %pre; writing out the xorg.conf you want in %post
would be fine.
Cheers,
--
Colin Watson [cjwatson at flatline.org.uk]
More information about the ubuntu-devel
mailing list