'make zlilo' as non-root

dewell@woods.net
Thu, 14 Mar 1996 20:24:23 GMT


I usually make these modifications by hand after I get a new
kernel, but I got the strange idea that it might be useful.
This just uses a variable in the Makefile for a method of
obtaining root without su. In my case, I use su1, I would use
'make ROOT_ME=su1 zlilo' (probably most people would use sudo
instead). This way, I can be me and never have to log in as
root, and, more to the point, the compile runs as me and shows
that I'm the one who compiled it (very important :).

I tested it and it doesn't affect anything if it isn't set
(there is an extra space in that case, which bash/sh ignores).
Maybe someone else who finds this useful could try it out to
make absolutely sure that it works?

--- arch/i386/boot/Makefile.orig Thu Mar 14 19:55:32 1996
+++ arch/i386/boot/Makefile Thu Mar 14 20:08:08 1996
@@ -44,11 +44,11 @@
dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0

zlilo: $(CONFIGURE) $(BOOTIMAGE)
- if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
- if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
- cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
- cp $(TOPDIR)/System.map $(INSTALL_PATH)/
- if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
+ if [ -f $(INSTALL_PATH)/vmlinuz ]; then $(ROOT_ME) mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
+ if [ -f $(INSTALL_PATH)/System.map ]; then $(ROOT_ME) mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
+ $(ROOT_ME) sh -c 'cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz'
+ $(ROOT_ME) cp $(TOPDIR)/System.map $(INSTALL_PATH)/
+ if [ -x /sbin/lilo ]; then $(ROOT_ME) /sbin/lilo; else $(ROOT_ME) /etc/lilo/install; fi

install: $(CONFIGURE) zImage
sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)"

------------------------------------------------------------------------
Aaron Dewell dewell@woods.net
My .sig has left on vacation outside of the U.S. until the CDA is
declared unconstitutional (Microsoft opposes it -- one or the other will
die, doesn't really matter which).