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

Kernel-image pre rm scripts (wasRe: Inclusion of kernel version ...)



Hi,

	I seem to have started quite a thread here.  I'll try to
 address the points that came up there, but please, I'd rather be
 coding the script than talking about it (we seem to have hashed out
 the points once already). 

	I'm trying to provide remove the Essential flag from
 kernel-image, so that one may actually be able to delete
 kernel-images once they have been installed.  However, the Essential
 flag served a purpose: it prevented one from accidentally removing
 the last kernel on the machine using dpkg/dselect.

 
	The prerm script is the safety net for people who are not used
 to unix, or who hit the wrong key in dselect, so they get a last
 chance to abort deleting the image package. I strongly believe not
 preventing people from doing stupid things, 'cause that will also
 prevent them from doing clever things (like, in this case, using
 loadlin, or more esoteric methods [not that I'm accusing loadlin of
 being esoteric])

	/vmlinuz should *not* be a conffile, as was suggested, 
  a) because it would make it harder to install kernels as well as to
     remove them 
  b) It still is possible to remove conffiles if the user has not
     changed it (how often do we edit the kernel binary?)

	As to non standard places for the kernel, well, all the postrm
 script does is _ask_ you to confirm that you really want to delete
 the kernel image packet.  If it can find a kernel, the _default_
 answer is Yes, or else, the _default_ is No, but you can answer as
 you wish. I does not prevent you from removing the image, or from
 keeping the kernel wherever you want to.

	The intent of the kernel-image package is not just for people
 who don't want to be troubled with configuring and compiling their
 own kernels, when the overlay/drop-in debian files are released, I
 think a lot of people will switch (I like having dpkg support for
 `my' kernels as well (I haven't run a distributed kernel since 1.2.13
 days))

 The algorithm is roughly:
----------------------------------------------------------------------
   check if we are running the kernel-image being removed (uname), if
     so, refuse to remove (this is to emulate the "Essential" behaviour)
   look for lilo.conf, if present
	note the paths in lilo.conf, and see if the files exist
	                             (following symlinks). 
        if not, set LILO_INVALID=1
        if our version is mentioned in the file, LILO_WILLBE_INVALID=1
        or else set LILO_VALID.
    
   if no lilo.conf or not LILO_VALID,
        look for kernels in / and /boot (if the dir exists)
	search pattern: /^zimage.*|^vmlinux.*/ 
        remove our version from the list (again, following symlinks as
                                          needed)
       if no other images are present, set NO_OTHER

  if LILO_VALID, say that we are removing image, mentioning valid lilo.conf
        confirm [Yes]
  else warn about invalid lilo, or that lilo will be invalid, or that
             no other images were found (or name images found)
        confirm [NO]

  
   abort unless the user said yes
----------------------------------------------------------------------
   
   manoj
	
--
vi is [[13~^[[15~^[[15~^[[19~^[[18~^ a muk[^[[29~^[[34~^[[26~^[[32~^ch
better editor than this emacs.  I know I^[[14~'ll get flamed for this
but the truth has to be said.  ^[[D^[[D^[[D^[[D ^[[D^[^[[D^[[D^[[B^ --
Jesper Lauridsen (rorschak@daimi.aau.dk), from alt.religion.emacs %%
Manoj Srivastava               Systems Research Programmer, Project Pilgrim,
Phone: (413) 545-3918                A143B Lederle Graduate Research Center,
Fax:   (413) 545-1249         University of Massachusetts, Amherst, MA 01003
<srivasta@pilgrim.umass.edu> <URL:http://www.pilgrim.umass.edu/%7Esrivasta/>









Reply to: