Prepareapt considered harmful...
Henning Sprang
henning_sprang at gmx.de
Mon Jun 30 13:36:58 CEST 2008
I I am in regular occurences wasting time resolving troubles caused by
this line of code in subroutines-linux, in the prepareapt task:
[ -d $FAI_ETC_DIR/apt ] && cp -r $FAI_ETC_DIR/apt/* $FAI_ROOT/etc/apt/
it overwrites, hidden from the user, without logging this action, the
stuff in /apt with whatever there is in the nfsroot - if the user wants
this or not.
It's only for the simplest cases that we can assume a user wants the
same sources.list in the client as on the fai server/nfsroot.
For example I have desktop and testing systems, that must use completely
different repositories than servers. Not to talk about different debian
releases or Ubuntu.
Recent versions of debootstrap put a correct sources.list into the base
chroot, so there's no need to out that stuff right.
And, last but not least - the USER, not the FAI developers must plan the
installation - and a plan also includes to think about and make sure the
right apt repo is uses.
Here we only get in the way with this planning, and especially with the
execution of the plan if we copy over the nfsroot stuff whatever is
there already.
Is there a good argument why this line must be kept there?
If not, please let's remove it!
I rather propose something like
fcopy -ri /etc/apt
in a the hook updatebase.DEFAULT in the simple examples. This gives the
user the files *he defines*, not the ones *we think might be needed* -
and it even sets the right sources list on softupdate, where prepareapt
isn't even run.
(BTW: why? I'd rather think, from the meaning of the words, "prepareapt"
must run always, and updatebase only on fresh installations - but it's
the othr way round!)
Henning
More information about the linux-fai-devel
mailing list