Bug 20643

Summary: /usr/bin/kzip is obsolete; remove it?
Product: Base System Reporter: Peter Pentchev <roam>
Component: binAssignee: dwmalone
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   

Description Peter Pentchev 2000-08-16 13:10:01 UTC
In an ELF-based, ELF-kernel FreeBSD 4.x system, /usr/bin/kzip cannot
do anything meaningful, ever - AFAICS, it only works on a.out kernels.
We have /usr/sbin/kgzip now, which does the right thing.

I have classed this PR as a sw-bug, because there is a program in
the tree which absolutely fails to fulfill its purpose.  (My sincere
apologies and thanks to phk - kzip worked perfectly fine in the a.out
days :)

Fix: 

One of the following:
- remove /usr/bin/kzip from the build tree (possibly symlink
  /usr/sbin/kgzip to it);  or
- add a big red-letter warning to kzip's manpage that it cannot process
  ELF kernels;  and/or
- add a reference to kgzip in kzip's manpage.

(Sorry, my knowledge of troff is VERY poor, or I would have included patches
 for the latter two options.)
How-To-Repeat: 
[root@ringwraith ~]# kzip /kernel
real kernel start address will be: 0x1
real kernel end   address will be: 0x6eaac68a
kzip: bad magic in file /kernel, probably not a kernel
kzip: extract returned 200
[root@ringwraith ~]#

..as opposed to..

[root@ringwraith ~]# kgzip /kernel
[root@ringwraith ~]#
Comment 1 Sheldon Hearn 2000-08-16 14:33:22 UTC
On 16 Aug 2000 09:51:05 GMT, Peter Pentchev wrote:

> >Number:         20643
> >Category:       bin
> >Synopsis:       /usr/bin/kzip is obsolete; remove it?

Poul-Henning, what do you think about this?

Ciao,
Sheldon.
Comment 2 dwmalone 2000-08-16 19:17:47 UTC
On Wed, Aug 16, 2000 at 09:51:05AM -0000, Peter Pentchev wrote:

> One of the following:
> - remove /usr/bin/kzip from the build tree (possibly symlink
>   /usr/sbin/kgzip to it);  or
> - add a big red-letter warning to kzip's manpage that it cannot process
>   ELF kernels;  and/or
> - add a reference to kgzip in kzip's manpage.

I have some patches to kgzip which allow it to produce a.out executables,
which will properly obsolete kzip. I'll try and clean them up and commit
them. One complication is that it requires an a.out object file, which
I guess could be added to the aout compatibility stuff.

	David.
Comment 3 dwmalone freebsd_committer freebsd_triage 2000-08-16 19:19:00 UTC
Responsible Changed
From-To: freebsd-bugs->dwmalone

I have some patches in this area.
Comment 4 Poul-Henning Kamp 2000-10-26 09:39:26 UTC
In message <957.966432802@axl.ops.uunet.co.za>, Sheldon Hearn writes:
>
>
>On 16 Aug 2000 09:51:05 GMT, Peter Pentchev wrote:
>
>> >Number:         20643
>> >Category:       bin
>> >Synopsis:       /usr/bin/kzip is obsolete; remove it?
>
>Poul-Henning, what do you think about this?

Found this in my mailbox, sorry about the delay.

kill it.

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Comment 5 dwmalone 2000-10-26 20:18:05 UTC
We've been using this patch to kgzip to produce a.out gzipped ELF
kernels. This is very useful, as it means we don't have to reburn
about 40 EPROMS that only know how to load a.out images. It is
based on the code in kzip, which could be completly obsolete if
kgzip had this patch.

Naturally, it requires a.out version of kgzldr.o and the a.out
linker.  I've included a uuencoded copy of the loader we've been
using (it's just the regular kgzldr with underscores added in the
necesary places). Maybe this could be added to the a.out compatability
libs?

	David.

diff -u -r /usr/src/usr.sbin/kgzip/kgzcmp.c kgzip/kgzcmp.c
--- /usr/src/usr.sbin/kgzip/kgzcmp.c	Thu Aug  3 12:57:02 2000
+++ kgzip/kgzcmp.c	Fri Aug  4 22:51:35 2000
@@ -42,13 +42,11 @@
 #include "elfhdr.h"
 #include "kgzip.h"
 
-#define KGZOFF (sizeof(struct kgz_elfhdr) + sizeof(struct kgz_hdr))
-
 #define F_AOUT	1		/* Input format: a.out */
 #define F_ELF	2		/* Input format: ELF32 */
 
 static void mk_data(const struct iodesc *i, const struct iodesc *,
-		    struct kgz_hdr *);
+		    struct kgz_hdr *,size_t);
 static int ld_elf(const struct iodesc *, const struct iodesc *,
 		  struct kgz_hdr *, const Elf32_Ehdr *);
 static int ld_aout(const struct iodesc *, const struct iodesc *,
@@ -72,8 +70,8 @@
     kh->ident[1] = KGZ_ID1;
     kh->ident[2] = KGZ_ID2;
     kh->ident[3] = KGZ_ID3;
-    xseek(&ido, KGZOFF);
-    mk_data(&idi, &ido, kh);
+    xseek(&ido, sizeof(ehdr) + sizeof(*kh));
+    mk_data(&idi, &ido, kh, sizeof(ehdr) + sizeof(*kh));
     kh->dload &= 0xffffff;
     kh->entry &= 0xffffff;
     xseek(&ido, 0);
@@ -86,12 +84,59 @@
     xclose(&idi);
 }
 
+char string_names[] = {"_kgz\0_kgz_ndata\0"};
+
+struct nlist var_names[2] = {                           /* Symbol table */
+	{ { (char*)  4 }, N_EXT|N_TEXT, 0, 0, 0 },      /* _kgz  */
+	{ { (char*)  9 }, N_EXT|N_TEXT, 0, 0, 0 },      /* _kgz_ndata */
+};
+
+void
+aoutkgzcmp(struct kgz_hdr *kh, const char *f1, const char *f2)
+{
+    struct iodesc idi, ido;
+    struct exec hdr;
+    unsigned long len;
+
+    if ((idi.fd = open(idi.fname = f1, O_RDONLY)) == -1)
+	err(1, "%s", idi.fname);
+    if ((ido.fd = open(ido.fname = f2, O_CREAT | O_TRUNC | O_WRONLY,
+		       0666)) == -1)
+	err(1, "%s", ido.fname);
+    kh->ident[0] = KGZ_ID0;
+    kh->ident[1] = KGZ_ID1;
+    kh->ident[2] = KGZ_ID2;
+    kh->ident[3] = KGZ_ID3;
+    xseek(&ido, sizeof(hdr) + sizeof(*kh));
+    mk_data(&idi, &ido, kh, sizeof(hdr) + sizeof(*kh));
+    kh->dload &= 0xffffff;
+    kh->entry &= 0xffffff;
+    /* Symbol table */
+    var_names[0].n_value = 0;		/* At start of text segment */
+    var_names[1].n_value = sizeof(*kh);	/* Offset of gzipped data */
+    xwrite (&ido, &var_names, sizeof(var_names));
+    /* String table */
+    len = sizeof(string_names) + sizeof(len);
+    xwrite(&ido, &len, sizeof(len));
+    xwrite(&ido, string_names, sizeof(string_names));
+    /* Go back and write header */
+    xseek(&ido, 0);
+    memset(&hdr, 0, sizeof(hdr));
+    hdr.a_magic = OMAGIC;
+    hdr.a_text = kh->nsize + sizeof(*kh);
+    hdr.a_syms = sizeof(var_names);
+    xwrite(&ido, &hdr, sizeof(hdr));
+    xwrite(&ido, kh, sizeof(*kh));
+    xclose(&ido);
+    xclose(&idi);
+}
+
 /*
  * Make encoded (compressed) data.
  */
 static void
 mk_data(const struct iodesc * idi, const struct iodesc * ido,
-	struct kgz_hdr * kh)
+	struct kgz_hdr * kh, size_t hdr_off)
 {
     union {
 	struct exec ex;
@@ -143,7 +188,7 @@
 	errx(1, "%s: Invalid format", idi->fname);
     if (fstat(ido->fd, &sb))
 	err(1, "%s", ido->fname);
-    kh->nsize = sb.st_size - KGZOFF;
+    kh->nsize = sb.st_size - hdr_off;
 }
 
 /*
diff -u -r /usr/src/usr.sbin/kgzip/kgzip.8 kgzip/kgzip.8
--- /usr/src/usr.sbin/kgzip/kgzip.8	Thu Aug  3 12:57:02 2000
+++ kgzip/kgzip.8	Thu Oct 26 20:08:31 2000
@@ -32,7 +32,7 @@
 .Nd compress a kernel
 .Sh SYNOPSIS
 .Nm kgzip
-.Op Fl cv
+.Op Fl acv
 .Op Fl l Ar loader
 .Op Fl o Ar output
 .Ar file
@@ -58,7 +58,8 @@
 .El
 .Pp
 Supported input formats are ELF and a.out ZMAGIC; the output format
-is always ELF.	Only 32-bit objects are supported.
+is ELF by default, a.out can be produced.
+Only 32-bit objects are supported.
 .Pp
 If the
 .Ar file
@@ -69,6 +70,13 @@
 .Pp
 The options are:
 .Bl -tag -width Fl
+.It Fl a
+Produce a.out output instead of ELF.
+Note,
+you will need an to specify an a.out version of the loader
+and
+have the a.out linker installed
+for this to be successful.
 .It Fl c
 Omit the link phase.
 .It Fl v
diff -u -r /usr/src/usr.sbin/kgzip/kgzip.c kgzip/kgzip.c
--- /usr/src/usr.sbin/kgzip/kgzip.c	Thu Aug  3 12:57:02 2000
+++ kgzip/kgzip.c	Thu Oct 26 19:55:22 2000
@@ -64,7 +64,7 @@
     static char *fn[FN_CNT];
     struct kgz_hdr kh;
     const char *output;
-    int cflag, vflag, c;
+    int aflag, cflag, vflag, c;
 
     if (getenv("TMPDIR") == NULL)
 	tname = strdup("/tmp/kgzXXXXXXXXXX");
@@ -73,9 +73,12 @@
 	    errx(1, "Out of memory");
 
     output = NULL;
-    cflag = vflag = 0;
-    while ((c = getopt(argc, argv, "cvl:o:")) != -1)
+    aflag = cflag = vflag = 0;
+    while ((c = getopt(argc, argv, "acvl:o:")) != -1)
 	switch (c) {
+	case 'a':
+	    aflag = 1;
+	    break;
 	case 'c':
 	    cflag = 1;
 	    break;
@@ -98,10 +101,14 @@
     atexit(cleanup);
     mk_fn(cflag, *argv, output, fn);
     memset(&kh, 0, sizeof(kh));
-    if (fn[FN_SRC])
-	kgzcmp(&kh, fn[FN_SRC], fn[FN_OBJ]);
+    if (fn[FN_SRC]) {
+	if(aflag)
+	    aoutkgzcmp(&kh, fn[FN_SRC], fn[FN_OBJ]);
+	else
+	    kgzcmp(&kh, fn[FN_SRC], fn[FN_OBJ]);
+    }
     if (!cflag)
-	kgzld(&kh, fn[FN_OBJ], fn[FN_KGZ]);
+	kgzld(&kh, fn[FN_OBJ], fn[FN_KGZ], aflag);
     if (vflag)
 	printf("dload=%#x dsize=%#x isize=%#x entry=%#x nsize=%#x\n",
 	       kh.dload, kh.dsize, kh.isize, kh.entry, kh.nsize);
@@ -159,6 +166,6 @@
 usage(void)
 {
     fprintf(stderr,
-	    "usage: kgzip [-cv] [-l file] [-o filename] file\n");
+	    "usage: kgzip [-acv] [-l file] [-o filename] file\n");
     exit(1);
 }
diff -u -r /usr/src/usr.sbin/kgzip/kgzip.h kgzip/kgzip.h
--- /usr/src/usr.sbin/kgzip/kgzip.h	Thu Aug  3 12:57:02 2000
+++ kgzip/kgzip.h	Fri Aug  4 21:38:22 2000
@@ -37,7 +37,8 @@
 extern const char *loader;	/* Default loader */
 
 void kgzcmp(struct kgz_hdr *, const char *, const char *);
-void kgzld(struct kgz_hdr *, const char *, const char *);
+void aoutkgzcmp(struct kgz_hdr *, const char *, const char *);
+void kgzld(struct kgz_hdr *, const char *, const char *,int);
 
 void xclose(const struct iodesc *);
 void xcopy(const struct iodesc *, const struct iodesc *, size_t, off_t);
diff -u -r /usr/src/usr.sbin/kgzip/kgzld.c kgzip/kgzld.c
--- /usr/src/usr.sbin/kgzip/kgzld.c	Thu Aug  3 12:57:02 2000
+++ kgzip/kgzld.c	Fri Aug  4 21:43:34 2000
@@ -47,7 +47,7 @@
  * Link KGZ file and loader.
  */
 void
-kgzld(struct kgz_hdr * kh, const char *f1, const char *f2)
+kgzld(struct kgz_hdr * kh, const char *f1, const char *f2,int aout)
 {
     char addr[16];
     struct iodesc idi;
@@ -68,7 +68,10 @@
     case -1:
 	err(1, NULL);
     case 0:
-	execlp("ld", "ld", "-Ttext", addr, "-o", f2, loader, f1, NULL);
+	if(aout)
+	    execlp("ld", "ld", "-aout", "-Bstatic", "-Z", "-T", addr, "-o", f2, loader, f1, NULL);
+	else
+	    execlp("ld", "ld", "-Ttext", addr, "-o", f2, loader, f1, NULL);
 	warn(NULL);
 	_exit(1);
     default:



begin 755 kgzldr.o
M!P&&`"`8````````Q`0!`!@#````````6`(```````#\OP````"Y`````"GY
M,<#SJO]T)`3H:@```%G_)1````````````````````````!9````2@```#P`
M``!O=70@;V8@;65M;W)Y`&EN=F%L:60@9F]R;6%T`&1O;F4`56YC;VUP<F5S
M<VEN9R`N+BX@``H`4WES=&5M(&AA;'1E9`"0D)!5B>6#[!13]D4)$'0/QP7@
M'`$``@```.L-D)"0QP7@'`$``0```(/$]&A>````Z)T6``#H1````(G#@\3T
M_S2=,````.B'%@``@\0@@\3T:'$```#H=Q8``(/$$(7;=!2#Q/1H<P```.AC
M%@``D)"0Z_Z0D(G8BUWHR<.058GE@^P(QP4@F```"@```*$$````HR28``#'
M!2R8``!D`0``QP4PF```E`$``,<%4)@``"`8``"#Q/1H*)@``.AG%0``A<!T
M$[H!````@_@#=0NZ`@```.L$D)`QTHG0R<.0D%6)Y8L5()@``(G0+0````"#
MP`@[!10```!W#0^V`O\%()@``.L'D)"X_____\G#D%6)Y5.+70R+31"A!```
M`(L5))@``"G"B=`!R#L%"````'89N/_____K&Y"0H228``"*$X@00_\%))@`
M`(G(287`=>DQP%O)PP``````````$````!$````2``````````@````'````
M"0````8````*````!0````L````$````#`````,````-`````@````X````!
M````#P````,`!``%``8`!P`(``D`"@`+``T`#P`1`!,`%P`;`!\`(P`K`#,`
M.P!#`%,`8P!S`(,`HP##`.,``@$```````````````````````````$``0`!
M``$``@`"``(``@`#``,``P`#``0`!``$``0`!0`%``4`!0```&,`8P`!``(`
M`P`$``4`!P`)``T`$0`9`"$`,0!!`&$`@0#!``$!@0$!`@$#`00!!@$(`0P!
M$`$8`2`!,`%``6````````````$``0`"``(``P`#``0`!``%``4`!@`&``<`
M!P`(``@`"0`)``H`"@`+``L`#``,``T`#0````$``P`'``\`'P`_`'\`_P#_
M`?\#_P?_#_\?_S__?___D)`)````!@```%6)Y8'LW`4``%=64XV%?/___XF%
M6/K__\>%;/K__Q````"!?1```0``=@^+50R+D@`$``")E6SZ___'A6#Z__\`
M````C56\BXU@^O__QP2*`````/^%8/K__X.]8/K__Q!VX8M=#(F=5/K__XM%
M$(F%8/K__Y"0D(N-5/K__XL!P>`"_P00@X54^O__!/^-8/K__W7CBUT0.5V\
M=1N+12#'``````"+523'`@`````QP.D"!@``D)"[`0```(-]P`!U#9!#@_L0
M=P:#/)H`=/2)G5SZ__^+320Y&7,"B1G'A6#Z__\0````@WW\`'48D/^-8/K_
M_W0/C46\BY5@^O__@SR0`'3IBXU@^O__B8UH^O__BT4D.0AV`HD(QX5(^O__
M`0```(G9TZ5(^O__.YUH^O__<Q^0D(U%O(L4F"F52/K__W@F0]&E2/K__SN=
M8/K__W+CBY5@^O__P>("C4V\BP0**85(^O__>0RX`@```.E"!0``D)`#A4CZ
M__^)!`HQV\>%>/K__P````"-3<")C53Z__^-C7SZ____C6#Z__]T'(N%5/K_
M_P,8B1F#A53Z__\$@\$$_XU@^O__=>2+50R)E53Z___'A6#Z__\`````D(N-
M5/K__XL9@X54^O__!(7;="&)V,'@`HV5=/K__XL,$,'A`HN=8/K__XF<*;CZ
M____!!#_A6#Z__^+11`YA6#Z__]RN\>%8/K__P````#'A73Z__\`````C96X
M^O__B954^O__QX5D^O_______XN-6/K__\=!_`````#'A4SZ__\`````QX4X
M____`````,>%4/K__P````#'A43Z__\`````BYUH^O__.9U<^O__#X\)!```
MD)"+A5SZ__^)A4#Z___!I4#Z__\"C56\B94\^O__BXU`^O__BQP12XF=</K_
M_X/[_P^$N@,``)"0D(N%9/K__XN-6/K__XL4@8N%3/K__P'0.85<^O__#XXZ
M`@``BYUD^O__B9TP^O__P:4P^O__`I"0`95,^O__@X4P^O__!/^%9/K__XN%
M:/K__XF%1/K__XN53/K__RF51/K__XM-)(L!BYU$^O__B9TX^O__.<-V!HF%
M./K__XN%./K__XF%1/K__XN=7/K__RN=3/K__[H!````B=G3XHN%</K__T`Y
MPG8T2BN5</K__XN-//K__P.-0/K__T,[G43Z__]S&.L+*<)#.YTX^O__<PL!
MTH/!!(L!.<)WZHN%3/K__P'8.X5L^O__=A:+A6SZ__\YA4SZ__]S"(G#*YU,
M^O__QX5$^O__`0```(G9TZ5$^O__BX4P^O__BY58^O__B1P"@\3TBXU$^O__
MC03-"````%#HP0\``(F%4/K__X/$$(7`=2B#O63Z__\`=!*#Q/C_M3C___^+
M70A3Z)T"``"X`P```.F'`@``D)"0BU4(BT(40`.%1/K__XE"%(N%4/K__X/`
M"(M-((D!BY50^O__@\($B54@BXU0^O__QT$$`````(V5./___XF5-/K__XF%
M4/K__XN-,/K__XD$$8.]9/K__P!T;XN%8/K__XF$*73Z__^+E5CZ__\/MD0*
M_,'@"(GR,/:)U@G&C4,0B?&(P8G.B[U0^O__N`$```"+C4SZ___3X$@CA6#Z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?R+10B)2"R)<`R)
M6!`QP(UEZ%M>7\G#D%6)Y8/L$%93BW4(@WX8``^%_P```#';D+A8F```QP28
M"````$.!^X\```!^ZX'[_P```'\CD)"0QP28"0```$.!^_\```!^\.L.D)#'
M!)U8F```!P```$.!^Q<!``!^[('['P$``'\4QP2=6)@```@```!#@?L?`0``
M?NS'1B`'````C48@4(U&&%!H;@(``&@P`@``:`$!``!H(`$``&A8F```5N@B
M]/__B<.#Q""%VW0)QT88`````.MUNEB8``#'!)H%````0X/['7[NQT8D!0``
M`(U&)%"-1AQ0:.@"``!HK`(``&H`:AY25NC:\___B<.#Q""#^P%^&(/$^/]V
M&%;HB/K__\=&&`````")V.L>D(/$]/]V)/]V(/]V'/]V&%;HE_K__X7`#Y7`
M#[;`C67H6U[)PRAI;F-O;7!L971E(&PM=')E92D@(``H:6YC;VUP;&5T92!D
M+71R964I("``58GE@>P\!0``5U93BT4(BW@,BU@0@_L$=RF0D(/$](M5"/\R
MBT($_]"#Q!"#^/\/A$<%``")V=/@"<>#PPB#^P1VV8GX@^`?!0$!``")A=CZ
M___![P6#P_N#^P1W*Y"0@\3TBT4(_S")PHM"!/_0@\00@_C_#X0!!0``B=G3
MX`G'@\,(@_L$=M>)^(/@'T")A=3Z___![P6#P_N#^P-W*8/$](M%"/\PB<*+
M0@3_T(/$$(/X_P^$P00``(G9T^`)QX/#"(/[`W;7B?B#X`^#P`2)A=SZ___!
M[P2#P_R!O=CZ__\@`0``#X>/!```@[W4^O__(`^'@@0``#'V.[7<^O__<VKK
M)I"0@\3TBT4(_S")PHM"!/_0@\00@_C_#X19!```B=G3X`G'@\,(@_L"=M>+
M!+7D`0``P>`"B?J#X@>)E"@`^___P>\#@\/]1CNUW/K__W+6ZQ:+!+7D`0``
MP>`"QX0H`/O__P````!&@_X2=N7'A?SZ__\'````C8W\^O__B8W0^O__48V%
M^/K__XF%S/K__U!J`&H`:A-J$XV%`/O__U"+50A2Z+GQ__^)A>SZ__^#Q""%
MP'0<@_@!#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`#\Z6P(+%0\V:K
MMAAFB1-APP````!FNOT#,<FU0.RH(.'[=`B*1"0$@.H%[L,``````````!T`
M```-```,%@````0```4'````#```#`(````+```,S`$```@```3!`0``"```
M!+$!```-```,I0$```@```2?`0``#0``#(0!```(```$>0$```T```QP`0``
M#@``#&D!```(```$00$```0```4\`0``"```!#0!```(```$,`$```@```0J
M`0``!```!"8!```(```$(`$```0```0<`0``"```!!8!```(```$$0$```T`
M``P,`0``#@``#`@!```(```$[0````0```7H````!```!-D````$```%U```
M``0```3)````!```!<0````$```$LP````0```6N````!```!*(````(```$
MDP````@```0X````!```!#0````$```$,`````0```0)%0``!```!005```$
M```$SA0```0```3)%```!```!(X4```$```%B10```0```13%```!```!$X4
M```$```$W1$```0```1#$0``!```!!P1```$```$9P\```0```1B#P``!```
M!$$/```(```$)`\```@```05#P``!```!!`/```$```$[PX```@```33#@``
M"```!)T.```(```$GPP```0```0[#```!```!*L+```$```$_PH```0```1C
M"@``!```!"\*```$```%2P<```0```6'%P``!```!7L7```(```$<A<```0`
M``5F%P``"```!$D7```(```$01<```@```0R%P``"```!"P7```(```$)A<`
M``@```04%P``"```!`0````%`@``A`````H````%`@``5!<``!(````%`@``
MK!8``!L````%`````!@``"<````%`````!@``#(````%`@``/!<``#P````%
M`@``$!<``$@````%````H!<``%,````%`````````%H````)````X!P!`&,`
M```%````H!<``&\````!`````````'8````!`````````'L````!````````
M`(`````!`````````(L````?`````````),````"````$````)D````?````
M,````*`````$````,````*\````$`0``,````+0````$`@````$``+P````(
M````(!@``,4````(````()@``,D````(````))@``,T````$`@``9`$``-0`
M```(````*)@``-H````$`@``E`$``.(````?````X`$``.P````$````X`$`
M`/L````$`0``X`$```(!```$`0``Y`$```H!```$`0``,`(``!(!```$`0``
M;@(``!H!```$`0``K`(``"(!```$`0``Z`(``"H!```$`0``)`,``#`!```$
M`0``2`,``#<!```$`0``3`,``#X!```$`@``4`,``$H!```$`@``%`H``%4!
M```$`@``1`H``&0!```$`@``1`T``'0!```(````6)@``'H!```$`@``A`X`
M`(D!```$`@``Z`\``)H!```$`@``=!4``*D!```$`@``.!8``+,!```?````
M$!<``+D!```$````$!<``,@!```(````V)P``,\!```(````V!P!`-<!```(
M````W!P!`-\!```?````H!<``.4!```"````!P```.T!```"````4````/4!
M```"````&0```/T!```"````200```4"```"````4`0```T"```$````OA<`
M`!H"```$````V1<``"<"```$````W1<``#0"```$````]Q<``$$"```?````
M`!@``$<"```"````^`,``$\"```$````"!@``%P"```$````%Q@``&D"``!?
M8F]O=`!?<'5T<W1R`%]I;F9L871E`%]S:6]?<'5T8VAR`'-I;U]P=71C:'(`
M7VMZ:7!F<F5E`%]K>FEP;6%L;&]C`&-R=%]P=71C:'(`7W-T87)T`%]K9WI?
M8V]N`%]C<G1?<'5T8VAR`%]E9&%T80!?96YD`%]K9WH`7VMG>E]N9&%T80!S
M=&%R="YO`&5N=')Y`&)O;W0N;P!G8V,R7V-O;7!I;&5D+@!?;7-G`%]D96-O
M9&4`7W-L:61E+C8`7VEP`%]O<`!?:6YP=70`7VEN9FP`7V]U='!U=`!I;F9L
M871E+F\`9V-C,E]C;VUP:6QE9"X`7W%F;&%G`%]B;W)D97(`7V-P;&5N<P!?
M8W!L97AT`%]C<&1I<W0`7V-P9&5X=`!?;6%S:P!?;&)I=',`7V1B:71S`%]H
M=69T7V)U:6QD`%]H=69T7V9R964`7VEN9FQA=&5?8V]D97,`7VEN9FQA=&5?
M<W1O<F5D`%]L+C$U`%]I;F9L871E7V9I>&5D`%]I;F9L871E7V1Y;F%M:6,`
M7VEN9FQA=&5?8FQO8VL`7WAI;F9L871E`&QI8BYO`&=C8S)?8V]M<&EL960N
M`%]M96TN,P!?;65M=&]T`%]M96UC;G0`8W)T+F\`4T-27TU!5`!30U)?0T],
M`%-#4E]23U<`0D1!7U-#4@!"1$%?4$]3`&-R=%]P=71C:'(N,0!C<G1?<'5T
M8VAR+C(`8W)T7W!U=&-H<BXS`&-R=%]P=71C:'(N-`!S:6\N;P!324]?4%)4
;`'-I;U]P=71C:'(N,0!S:6]?<'5T8VAR+C(`
`
end
Comment 6 rnordier 2000-10-30 19:02:07 UTC
David Malone wrote:
 
> We've been using this patch to kgzip to produce a.out gzipped ELF
> kernels. This is very useful, as it means we don't have to reburn
> about 40 EPROMS that only know how to load a.out images. It is
> based on the code in kzip, which could be completly obsolete if
> kgzip had this patch.
> 
> Naturally, it requires a.out version of kgzldr.o and the a.out
> linker.  I've included a uuencoded copy of the loader we've been
> using (it's just the regular kgzldr with underscores added in the
> necesary places). Maybe this could be added to the a.out compatability
> libs?
 
Just wanted to acknowledge receipt of this.  It seems a reasonable
idea, but I haven't finished looking at it.  That should be sometime
later in the week.

-- 
Robert Nordier

rnordier@nordier.com
rnordier@FreeBSD.org
Comment 7 Sheldon Hearn 2000-11-02 15:06:26 UTC
On Thu, 26 Oct 2000 10:39:26 +0200, Poul-Henning Kamp wrote:

> kill it.

Okay, kzip is no more in HEAD and will disappear from RELENG_4 shortly
after 4.2-RELEASE.

Ciao,
Sheldon.
Comment 8 rnordier 2000-11-04 13:08:50 UTC
David Malone wrote:
 
> We've been using this patch to kgzip to produce a.out gzipped ELF
> kernels. This is very useful, as it means we don't have to reburn
> about 40 EPROMS that only know how to load a.out images. It is
> based on the code in kzip, which could be completly obsolete if
> kgzip had this patch.
> 
> Naturally, it requires a.out version of kgzldr.o and the a.out
> linker.  I've included a uuencoded copy of the loader we've been
> using (it's just the regular kgzldr with underscores added in the
> necesary places). Maybe this could be added to the a.out compatability
> libs?

I've committed changes to kgzip and kgzldr which add a.out support.

As you mentioned that the supplied patch was based on kzip, I
thought it best just to write the new code from scratch rather than
have to address potential copyright issues (adding Linus' name to
kgzip for a few lines of code seemed a bit over the top).  However,
I added in at least one better idea of yours (dispensing with
KGZOFF) when I went over the patch afterwards.

For kgzldr, there's an m4 function which uses ${OBJFORMAT} to decide
whether external identifiers get an underscore, so one can

    make
    make OBJFORMAT=aout

to get dual versions of kgzldr.o.  I haven't done anything about
adding kgzldr.o to the compatibility libs: please go ahead with
that yourself, if you think it should be done.

Robert
-- 
Robert Nordier

rnordier@nordier.com
rnordier@FreeBSD.org
Comment 9 dwmalone 2000-11-04 13:13:17 UTC
> As you mentioned that the supplied patch was based on kzip, I
> thought it best just to write the new code from scratch rather than
> have to address potential copyright issues (adding Linus' name to
> kgzip for a few lines of code seemed a bit over the top).

The kzip I based it on was by phk, so there shouldn't have been
a huge problem ;-)

> However,
> I added in at least one better idea of yours (dispensing with
> KGZOFF) when I went over the patch afterwards.

Yep - that stuff was a bit icky. Most of the patch was thrown together
late one evening; we were our diskless xterms to boot after upgrading
to 4.1.

	David.
Comment 10 rnordier 2000-11-04 13:25:07 UTC
David Malone wrote:
 
> > As you mentioned that the supplied patch was based on kzip, I
> > thought it best just to write the new code from scratch rather than
> > have to address potential copyright issues (adding Linus' name to
> > kgzip for a few lines of code seemed a bit over the top).
> 
> The kzip I based it on was by phk, so there shouldn't have been
> a huge problem ;-)

I thought I saw the Torvalds name in there somewhere, but I was
probably being over-scrupulous.
 
> > However,
> > I added in at least one better idea of yours (dispensing with
> > KGZOFF) when I went over the patch afterwards.
> 
> Yep - that stuff was a bit icky. Most of the patch was thrown together
> late one evening; we were our diskless xterms to boot after upgrading
> to 4.1.
 
Well, thanks for the stuff; I'm glad it's in now, anyway.

Robert
-- 
Robert Nordier

rnordier@nordier.com
rnordier@FreeBSD.org
Comment 11 dwmalone freebsd_committer freebsd_triage 2000-12-25 21:05:35 UTC
State Changed
From-To: open->closed

I forgot to close this one after Robert committed the patches.