Frans Pop wrote: > Thanks for your comments. > > On Wednesday 05 April 2006 00:06, Joey Hess wrote: > > > 1) Add a boolean preseedable option debian-installer/no_net > > [...] > > > For netcfg, what is the advantage of skipping the short dhcp test? A > > static config would also not be very useful if there is really no > > NIC. > > Yes, but it can be useful if there is a NIC that is just not connected > during the install but will be later. I think this matches the old > behavior. base-config/apt-setup didn't change anything in this area, so what old behavior? > > If the aim is to streamline this class of installs to the same degress > > as it was pre-beta2, I don't think these changes manage it. Remember, > > sarge's behavior on a full CD is that is still let the user do normal > > network configuration -- because they will want a network after their > > install > > The no_net option is not intended for this use case, but only for the use > case where the system is unconnected to the net. So the user will still > configure the network normally. At this point I'm confused, because I had thought the point of this was to get back closer to the old behavior for installs from CD. If the point is instead to make it easier/possible to install without touching the network then what you're proposing might make sense, but it doesn't seem to really solve things for the install from CD case in the best way. And I suspect the number of people wanting to install without touching the network even for things like DHCP is quite low. It's certianly a minor subset of the people who want to be able to install easily from CD. So I'm more interested in working on that larger set. > I considered that option as well. Fine by me. > > > Wouldn't d-i fail anyway later if the CD didn't contain base and the > > user said to skip choosing a mirror? Seems that failing early in > > choose-mirror is only a convenience. I don't know that this convenence > > is really worth the nastiness of making choose-mirror know about CDs. > > Did you see the patch? I don't think it is that nasty and I do feel that > failing early is more user friendly in general. Especially as you prevent > the user from getting frustrated _after_ having scratched his partitions. > > Also, I already committed a change today that needs the same check in > order to avoid asking the suite question (r36098) when changing the suite > can lead to failed installs. The reason this kind of thing is ugly is not because of the code, which is quite clean, but because it spreads out logic about dealing with CDs into multiple places, including places where any good design would not put them (such as the mirror setup program). The core problem behind #356105 is that d-i uses the same mirror/suite (and mirror/codename) settings for both mirrors and CDs, which lets choose-mirror and cdrom-detect fight over the setting of it and break things. One way to fix that would be to split off a cdrom/suite for CDs. I've attached an untested patch that does so. (Hmm, that patch also solves the problem of keeping the mirror/suite text and translations in sync between choose-mirror, iso-scan, and cdrom-detect.) > > Counterproposal: > > * Add "don't use a network mirror" to choose-mirror and make > > choose-mirror unset mirror/http/hostname and mirror/http/directory > > when that is selected. > > Ack. > > > * Test to make sure that things fail appropriately in cases where no > > mirror is configured and the CD doesn't contain base. From my reading > > of base-installer, it will already display > > base-installer/cannot_install in this case, and the user can go back > > and choose a mirror then. > > Not sure. debootstrap fails in a fairly nasty way if the mirror is there > but the architecture is not supported on it for example (a case that is > now tested for in choose-mirror). postinst line 115: base_installable does not exist, so it will use mirror settings postinst line 151: if mirror/protocol/hostname and mirror/protocol/directory are empty, it fails with an error. Looks fine. > > (base-installer could even invoke choose-mirror for the user in this > > case.) > > Good idea. Anna does the same I noticed today. Personally I prefer > checking for correct/consistent setup at the point where the selections > are made though (when possible). The nice thing about re-invoking choose-mirror on failure is that it lets the installer cleanly recover from issues such as a mirror dying in the middle of the install, or choose-mirror not noticing that a mirror is actually broken. apt-setup also does this. > > * Make apt-setup DTRT and skip mirror generator in this case (which it > > currently does not). > > Ack. Done. > > * Give cdrom-detect some way to determine if a CD is a full CD or a > > netinst. If it's a full CD, it can set choose-mirror to default to > > "don't use a network mirror" (being careful about preseeding of > > course). > > - base-config used the heuristic of > 200 or whatever packages > > being on the CD meant it was a full CD, and we could test that in > > choose-mirror. > > - Maybe a better way to go would be to add a .disk/self_contained > > flag file that is set for full CDs and other CDs that don't need > > network to be generally useful, and have choose-mirror test for > > that. Especially since apt-setup could also test for it and avoid > > adding semi-useless sources.list lines for netinst CDs. > > I like the second option. A flag like that will be useful anyway. Maybe we > should also have a flag that tells is the default tasksel tasks are fully > present (to catch the powerpc CD case where these are partly on CD 2)? Unfortunatly, "default tasksel tasks are fully present" is hard to define. Our full CDs don't include all the tasks, or the complete content of all tasks. It basically comes down to what tasks whoever created the CD intends to be present. I was thinking a CONF.sh setting that could be flipped to 0 for netinst CDs. Perhaps slightly nicer, but a lot more code, would be to list in CONF.sh the tasks that are planned to be on the CD and mark it incomplete if there are none or if some don't get on. We'd probably list desktop, print server and web server for the full CD then. > I'm still not convinced that we should default to "don't use" though. It's what base-config defaulted to if presented with a full CD. Seems reasonable to me, people who want a mirror can still select one from the list of course.. -- see shy jo
Index: apt-setup/generators/90security =================================================================== --- apt-setup/generators/90security (revision 36161) +++ apt-setup/generators/90security (working copy) @@ -20,9 +20,12 @@ fi done -# mirror/codename is also set by cdrom methods -db_get mirror/codename +db_get mirror/codename || true codename="$RET" +if [ -z "$codename" ]; then + db_get cdrom/codename + codename="$RET" +fi # No updates for sid (unstable). Never mind. if [ "$codename" = sid ]; then Index: cdrom-detect/debian/cdrom-detect.templates =================================================================== --- cdrom-detect/debian/cdrom-detect.templates (revision 35497) +++ cdrom-detect/debian/cdrom-detect.templates (working copy) @@ -97,16 +97,12 @@ If you do not want the system to automatically eject the CD-ROM before the system is rebooted, you may disable this. -Template: mirror/suite +Template: cdrom/suite Type: select -_Choices: stable, testing, unstable -_Description: Debian version to install: - Debian comes in several flavors. Stable is well-tested and rarely changes. - Unstable is untested and frequently changing. Testing is a middle ground, - that receives many of the new versions from unstable if they are not too - buggy. +Choices: stable, testing, unstable +Description: Debian version to install -Template: mirror/codename +Template: cdrom/codename Type: string Description: Codename for the selected suite (internal use) Index: cdrom-detect/debian/cdrom-detect.postinst =================================================================== --- cdrom-detect/debian/cdrom-detect.postinst (revision 35497) +++ cdrom-detect/debian/cdrom-detect.postinst (working copy) @@ -166,8 +166,8 @@ suite=$(sed -n 's/^Suite: *//p' $relfile) codename=$(sed -n 's/^Codename: *//p' $relfile) log "Detected CD with '$suite' ($codename) distribution" - db_set mirror/suite $suite - db_set mirror/codename $codename + db_set cdrom/suite $suite + db_set cdrom/codename $codename break fi Index: iso-scan/debian/iso-scan.templates =================================================================== --- iso-scan/debian/iso-scan.templates (revision 35497) +++ iso-scan/debian/iso-scan.templates (working copy) @@ -3,16 +3,12 @@ # Main menu item _Description: Scan hard drives for an installer ISO image -Template: mirror/suite +Template: cdrom/suite Type: select -_Choices: stable, testing, unstable -_Description: Debian version to install: - Debian comes in several flavors. Stable is well-tested and rarely changes. - Unstable is untested and frequently changing. Testing is a middle ground, - that receives many of the new versions from unstable if they are not too - buggy. +Choices: stable, testing, unstable +Description: Suite to install (internal use) -Template: mirror/codename +Template: cdrom/codename Type: string Description: Codename for the selected suite (internal use) Index: iso-scan/debian/iso-scan.postinst =================================================================== --- iso-scan/debian/iso-scan.postinst (revision 35497) +++ iso-scan/debian/iso-scan.postinst (working copy) @@ -42,8 +42,8 @@ suite=$(sed -n 's/^Suite: *//p' $relfile) codename=$(sed -n 's/^Codename: *//p' $relfile) log "Detected ISO with '$suite' ($codename) distribution" - db_set mirror/suite $suite - db_set mirror/codename $codename + db_set cdrom/suite $suite + db_set cdrom/codename $codename db_subst iso-scan/success SUITE $suite description=`sed -n 's/^Description: *//p' $relfile` Index: base-installer/debian/postinst =================================================================== --- base-installer/debian/postinst (revision 35645) +++ base-installer/debian/postinst (working copy) @@ -106,13 +106,13 @@ } get_mirror_info () { - if db_get mirror/codename && [ "$RET" ] ; then - DISTRIBUTION=$RET - else - exit_error base-installer/no_codename - fi + if [ -f /cdrom/.disk/base_installable ]; then + if db_get cdrom/codename && [ "$RET" ] ; then + DISTRIBUTION=$RET + else + exit_error base-installer/no_codename + fi - if [ -f /cdrom/.disk/base_installable ]; then PROTOCOL=file MIRROR="" DIRECTORY="/cdrom/" @@ -135,6 +135,12 @@ exit_error base-installer/cannot_install fi else + if db_get mirror/codename && [ "$RET" ] ; then + DISTRIBUTION=$RET + else + exit_error base-installer/no_codename + fi + mirror_error="" db_get mirror/protocol || mirror_error=1 Index: cdrom-retriever/debian/load-cdrom.postinst =================================================================== --- cdrom-retriever/debian/load-cdrom.postinst (revision 35497) +++ cdrom-retriever/debian/load-cdrom.postinst (working copy) @@ -5,6 +5,6 @@ # If a -support udeb is available for the selected release, install it # This will mostly be used to preserve backwards compatibility with stable . /usr/share/debconf/confmodule -if db_get mirror/codename && [ "$RET" ]; then +if db_get cdrom/codename && [ "$RET" ]; then anna-install $RET-support || true fi Index: cdrom-retriever/cdrom-retriever =================================================================== --- cdrom-retriever/cdrom-retriever (revision 35497) +++ cdrom-retriever/cdrom-retriever (working copy) @@ -47,7 +47,7 @@ info "Retrieving package list." rm -f "$1" touch "$1" - if db_get mirror/codename && [ "$RET" ]; then + if db_get cdrom/codename && [ "$RET" ]; then codename=$RET else # Not really nice defaulting codename to a suite...
Attachment:
signature.asc
Description: Digital signature