On Mon, Nov 13, 2017 at 1:17 PM, Nicholas D Steeves <nstee...@gmail.com> wrote:
> On Mon, Nov 13, 2017 at 10:35:19AM -0700, Ben Hildred wrote: > > On Fri, Nov 10, 2017 at 12:50 PM, Cyril Brulebois <[1]k...@debian.org > > > > wrote: > > > > Nicholas D Steeves <[2]nstee...@gmail.com> (2017-11-10): > > > 1) get a list of disks > > > 2) identify the disk used by the installer > > > 3) exclude the disk found at #2 > > > > How do you do 2? > > > > Last I touched this, nothing obvious appeared in d-i to know what > the > > installer was booted from. ISTR having suggested at the time that > > bootloaders could set something to help d-i figure out where it > booted > > from, but I don't think anything happened in this area since then. > > > > OK, This Is a crazy Idea, but . . . When generating Installer images, > they > > get various readmes and so on, and I believe one of them includes > version > > information, so we can parse that file for the version number, > compare it > > with the one in the initrd (to be added). This handles the common > cases of > > cd (overkill as cds are read only) and USB (presumably most > important), > > but fails on net-install (where it is not needed). We can have > installer > > loader scripts copy the version info file to mark the drives they are > > using which should catch most of the rest of the cases. > > A variation of this is to have a pseudo random token in the version > file > > which is passed on the command-line to the installer instead of > modifying > > the initrd. This has the advantage that we could have special case > values > > for net-boot to skip the scan. (ie if the token was a hexadecimal > value > > but the special case was the word netboot. > > > > both cases make identifying and protecting partitions used to store > > archives and iso images easy by manually placing the version file. > > Why does net-boot need to be special cased? By default, shouldn't the > net-boot media be excluded as an installation target--except for the > expert case. > I was not talking about the net-boot cd, (that is cd or in some cases usb) but a tfttp boot or similar where there is no install media at all, and the value would be a speed hack only. > > Another feature that could be piggybacked on the "mount block device > and identify if it's Debian installation media" is OS identification. > It's been so many years since I dual-booted with another OS that I > don't know if this functionality already exists. If it does exist, > I'm guessing that is where this new "Identify installation media" > could be added. > If we do this we might not want to special case netboot > Re: the identification step: > > I don't think it's crazy :-) Do you know if such a magic file already > exists (especially if the installer build was recorded)? > the netboot.tar.gz file has version.info which I was thinking of which is not currently included in mini.iso, but f1.txt has version and build date (lines 3 and 4 in the one I checked). > > Can busybox-provided cat, grep, cksum and cmp provide strong enough > magic file match, or do you think we also need a > /sys/.../something/uuid check as well? > > Cheers, > Nicholas > standard tools should do it. -- -- Ben Hildred Automation Support Services