mkvmlinuz-36/0000755000000000000000000000000011774666254010250 5ustar mkvmlinuz-36/boot/0000755000000000000000000000000011773466230011202 5ustar mkvmlinuz-36/boot/inftrees.h0000644000000000000000000000526311773177134013202 0ustar /* inftrees.h -- header to use inftrees.c * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ /* Huffman code lookup table entry--this entry is four bytes for machines that have 16-bit pointers (e.g. PC's in the small or medium model). */ #ifndef _INFTREES_H #define _INFTREES_H typedef struct inflate_huft_s inflate_huft; struct inflate_huft_s { union { struct { Byte Exop; /* number of extra bits or operation */ Byte Bits; /* number of bits in this code or subcode */ } what; uInt pad; /* pad structure to a power of 2 (4 bytes for */ } word; /* 16-bit, 8 bytes for 32-bit int's) */ uInt base; /* literal, length base, distance base, or table offset */ }; /* Maximum size of dynamic tree. The maximum found in a long but non- exhaustive search was 1004 huft structures (850 for length/literals and 154 for distances, the latter actually the result of an exhaustive search). The actual maximum is not known, but the value below is more than safe. */ #define MANY 1440 extern int zlib_inflate_trees_bits ( uInt *, /* 19 code lengths */ uInt *, /* bits tree desired/actual depth */ inflate_huft **, /* bits tree result */ inflate_huft *, /* space for trees */ z_streamp); /* for messages */ extern int zlib_inflate_trees_dynamic ( uInt, /* number of literal/length codes */ uInt, /* number of distance codes */ uInt *, /* that many (total) code lengths */ uInt *, /* literal desired/actual bit depth */ uInt *, /* distance desired/actual bit depth */ inflate_huft **, /* literal/length tree result */ inflate_huft **, /* distance tree result */ inflate_huft *, /* space for trees */ z_streamp); /* for messages */ extern int zlib_inflate_trees_fixed ( uInt *, /* literal desired/actual bit depth */ uInt *, /* distance desired/actual bit depth */ inflate_huft **, /* literal/length tree result */ inflate_huft **, /* distance tree result */ inflate_huft *, /* space for trees */ z_streamp); /* for memory allocation */ #endif /* _INFTREES_H */ mkvmlinuz-36/boot/div64.S0000644000000000000000000000354311773177134012271 0ustar /* * Divide a 64-bit unsigned number by a 32-bit unsigned number. * This routine assumes that the top 32 bits of the dividend are * non-zero to start with. * On entry, r3 points to the dividend, which get overwritten with * the 64-bit quotient, and r4 contains the divisor. * On exit, r3 contains the remainder. * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include "ppc_asm.h" .globl __div64_32 __div64_32: lwz r5,0(r3) # get the dividend into r5/r6 lwz r6,4(r3) cmplw r5,r4 li r7,0 li r8,0 blt 1f divwu r7,r5,r4 # if dividend.hi >= divisor, mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor subf. r5,r0,r5 # dividend.hi %= divisor beq 3f 1: mr r11,r5 # here dividend.hi != 0 andis. r0,r5,0xc000 bne 2f cntlzw r0,r5 # we are shifting the dividend right li r10,-1 # to make it < 2^32, and shifting srw r10,r10,r0 # the divisor right the same amount, add r9,r4,r10 # rounding up (so the estimate cannot andc r11,r6,r10 # ever be too large, only too small) andc r9,r9,r10 or r11,r5,r11 rotlw r9,r9,r0 rotlw r11,r11,r0 divwu r11,r11,r9 # then we divide the shifted quantities 2: mullw r10,r11,r4 # to get an estimate of the quotient, mulhwu r9,r11,r4 # multiply the estimate by the divisor, subfc r6,r10,r6 # take the product from the divisor, add r8,r8,r11 # and add the estimate to the accumulated subfe. r5,r9,r5 # quotient bne 1b 3: cmplw r6,r4 blt 4f divwu r0,r6,r4 # perform the remaining 32-bit division mullw r10,r0,r4 # and get the remainder add r8,r8,r0 subf r6,r10,r6 4: stw r7,0(r3) # return the quotient in *r3 stw r8,4(r3) mr r3,r6 # return the remainder in r3 blr mkvmlinuz-36/boot/zutil.h0000644000000000000000000000572011773177134012530 0ustar /* zutil.h -- internal interface and configuration of the compression library * Copyright (C) 1995-1998 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ /* @(#) $Id: zutil.h,v 1.1 2000/01/01 03:32:23 davem Exp $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H #include "zlib.h" #include "string.h" #include typedef unsigned char uch; typedef unsigned short ush; typedef unsigned long ulg; /* common constants */ #ifndef DEF_WBITS # define DEF_WBITS MAX_WBITS #endif /* default windowBits for decompression. MAX_WBITS is for compression only */ #if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 #else # define DEF_MEM_LEVEL MAX_MEM_LEVEL #endif /* default memLevel */ #define STORED_BLOCK 0 #define STATIC_TREES 1 #define DYN_TREES 2 /* The three kinds of block type */ #define MIN_MATCH 3 #define MAX_MATCH 258 /* The minimum and maximum match lengths */ #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ /* target dependencies */ /* Common defaults */ #ifndef OS_CODE # define OS_CODE 0x03 /* assume Unix */ #endif /* functions */ typedef uLong (*check_func) (uLong check, const Byte *buf, uInt len); /* checksum functions */ #define BASE 65521L /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ #define DO1(buf,i) {s1 += buf[i]; s2 += s1;} #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); #define DO16(buf) DO8(buf,0); DO8(buf,8); /* ========================================================================= */ /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster. Usage example: uLong adler = adler32(0L, NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ static inline uLong zlib_adler32(uLong adler, const Byte *buf, uInt len) { unsigned long s1 = adler & 0xffff; unsigned long s2 = (adler >> 16) & 0xffff; int k; if (buf == NULL) return 1L; while (len > 0) { k = len < NMAX ? len : NMAX; len -= k; while (k >= 16) { DO16(buf); buf += 16; k -= 16; } if (k != 0) do { s1 += *buf++; s2 += s1; } while (--k); s1 %= BASE; s2 %= BASE; } return (s2 << 16) | s1; } #endif /* _Z_UTIL_H */ mkvmlinuz-36/boot/page.h0000644000000000000000000000206011773177134012267 0ustar #ifndef _PPC_BOOT_PAGE_H #define _PPC_BOOT_PAGE_H /* * Copyright (C) 2001 PPC64 Team, IBM Corp * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifdef __ASSEMBLY__ #define ASM_CONST(x) x #else #define __ASM_CONST(x) x##UL #define ASM_CONST(x) __ASM_CONST(x) #endif /* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) /* align addr on a size boundary - adjust address up/down if needed */ #define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) #define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) /* align addr on a size boundary - adjust address up if needed */ #define _ALIGN(addr,size) _ALIGN_UP(addr,size) /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) #endif /* _PPC_BOOT_PAGE_H */ mkvmlinuz-36/boot/addnote.c0000644000000000000000000001177511773177134013001 0ustar /* * Program to hack in a PT_NOTE program header entry in an ELF file. * This is needed for OF on RS/6000s to load an image correctly. * Note that OF needs a program header entry for the note, not an * ELF section. * * Copyright 2000 Paul Mackerras. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Usage: addnote zImage */ #include #include #include #include #include /* CHRP note section */ char arch[] = "PowerPC"; #define N_DESCR 6 unsigned int descr[N_DESCR] = { 0xffffffff, /* real-mode = true */ 0x00c00000, /* real-base, i.e. where we expect OF to be */ 0xffffffff, /* real-size */ 0xffffffff, /* virt-base */ 0xffffffff, /* virt-size */ 0x4000, /* load-base */ }; /* RPA note section */ char rpaname[] = "IBM,RPA-Client-Config"; /* * Note: setting ignore_my_client_config *should* mean that OF ignores * all the other fields, but there is a firmware bug which means that * it looks at the splpar field at least. So these values need to be * reasonable. */ #define N_RPA_DESCR 8 unsigned int rpanote[N_RPA_DESCR] = { 0, /* lparaffinity */ 64, /* min_rmo_size */ 0, /* min_rmo_percent */ 40, /* max_pft_size */ 1, /* splpar */ -1, /* min_load */ 0, /* new_mem_def */ 1, /* ignore_my_client_config */ }; #define ROUNDUP(len) (((len) + 3) & ~3) unsigned char buf[512]; #define GET_16BE(off) ((buf[off] << 8) + (buf[(off)+1])) #define GET_32BE(off) ((GET_16BE(off) << 16) + GET_16BE((off)+2)) #define PUT_16BE(off, v) (buf[off] = ((v) >> 8) & 0xff, \ buf[(off) + 1] = (v) & 0xff) #define PUT_32BE(off, v) (PUT_16BE((off), (v) >> 16), \ PUT_16BE((off) + 2, (v))) /* Structure of an ELF file */ #define E_IDENT 0 /* ELF header */ #define E_PHOFF 28 #define E_PHENTSIZE 42 #define E_PHNUM 44 #define E_HSIZE 52 /* size of ELF header */ #define EI_MAGIC 0 /* offsets in E_IDENT area */ #define EI_CLASS 4 #define EI_DATA 5 #define PH_TYPE 0 /* ELF program header */ #define PH_OFFSET 4 #define PH_FILESZ 16 #define PH_HSIZE 32 /* size of program header */ #define PT_NOTE 4 /* Program header type = note */ #define ELFCLASS32 1 #define ELFDATA2MSB 2 unsigned char elf_magic[4] = { 0x7f, 'E', 'L', 'F' }; int main(int ac, char **av) { int fd, n, i; int ph, ps, np; int nnote, nnote2, ns; if (ac != 2) { fprintf(stderr, "Usage: %s elf-file\n", av[0]); exit(1); } fd = open(av[1], O_RDWR); if (fd < 0) { perror(av[1]); exit(1); } nnote = 12 + ROUNDUP(strlen(arch) + 1) + sizeof(descr); nnote2 = 12 + ROUNDUP(strlen(rpaname) + 1) + sizeof(rpanote); n = read(fd, buf, sizeof(buf)); if (n < 0) { perror("read"); exit(1); } if (n < E_HSIZE || memcmp(&buf[E_IDENT+EI_MAGIC], elf_magic, 4) != 0) goto notelf; if (buf[E_IDENT+EI_CLASS] != ELFCLASS32 || buf[E_IDENT+EI_DATA] != ELFDATA2MSB) { fprintf(stderr, "%s is not a big-endian 32-bit ELF image\n", av[1]); exit(1); } ph = GET_32BE(E_PHOFF); ps = GET_16BE(E_PHENTSIZE); np = GET_16BE(E_PHNUM); if (ph < E_HSIZE || ps < PH_HSIZE || np < 1) goto notelf; if (ph + (np + 2) * ps + nnote + nnote2 > n) goto nospace; for (i = 0; i < np; ++i) { if (GET_32BE(ph + PH_TYPE) == PT_NOTE) { fprintf(stderr, "%s already has a note entry\n", av[1]); exit(0); } ph += ps; } /* XXX check that the area we want to use is all zeroes */ for (i = 0; i < 2 * ps + nnote + nnote2; ++i) if (buf[ph + i] != 0) goto nospace; /* fill in the program header entry */ ns = ph + 2 * ps; PUT_32BE(ph + PH_TYPE, PT_NOTE); PUT_32BE(ph + PH_OFFSET, ns); PUT_32BE(ph + PH_FILESZ, nnote); /* fill in the note area we point to */ /* XXX we should probably make this a proper section */ PUT_32BE(ns, strlen(arch) + 1); PUT_32BE(ns + 4, N_DESCR * 4); PUT_32BE(ns + 8, 0x1275); strcpy((char *) &buf[ns + 12], arch); ns += 12 + strlen(arch) + 1; for (i = 0; i < N_DESCR; ++i, ns += 4) PUT_32BE(ns, descr[i]); /* fill in the second program header entry and the RPA note area */ ph += ps; PUT_32BE(ph + PH_TYPE, PT_NOTE); PUT_32BE(ph + PH_OFFSET, ns); PUT_32BE(ph + PH_FILESZ, nnote2); /* fill in the note area we point to */ PUT_32BE(ns, strlen(rpaname) + 1); PUT_32BE(ns + 4, sizeof(rpanote)); PUT_32BE(ns + 8, 0x12759999); strcpy((char *) &buf[ns + 12], rpaname); ns += 12 + ROUNDUP(strlen(rpaname) + 1); for (i = 0; i < N_RPA_DESCR; ++i, ns += 4) PUT_32BE(ns, rpanote[i]); /* Update the number of program headers */ PUT_16BE(E_PHNUM, np + 2); /* write back */ lseek(fd, (long) 0, SEEK_SET); i = write(fd, buf, n); if (i < 0) { perror("write"); exit(1); } if (i < n) { fprintf(stderr, "%s: write truncated\n", av[1]); exit(1); } exit(0); notelf: fprintf(stderr, "%s does not appear to be an ELF file\n", av[1]); exit(1); nospace: fprintf(stderr, "sorry, I can't find space in %s to put the note\n", av[1]); exit(1); } mkvmlinuz-36/boot/infutil.h0000644000000000000000000001601511773177134013032 0ustar /* infutil.h -- types and macros common to blocks and codes * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ #ifndef _INFUTIL_H #define _INFUTIL_H #include "zconf.h" #include "inftrees.h" #include "infcodes.h" typedef enum { TYPE, /* get type bits (3, including end bit) */ LENS, /* get lengths for stored */ STORED, /* processing stored block */ TABLE, /* get table lengths */ BTREE, /* get bit lengths tree for a dynamic block */ DTREE, /* get length, distance trees for a dynamic block */ CODES, /* processing fixed or dynamic block */ DRY, /* output remaining window bytes */ B_DONE, /* finished last block, done */ B_BAD} /* got a data error--stuck here */ inflate_block_mode; /* inflate blocks semi-private state */ struct inflate_blocks_state { /* mode */ inflate_block_mode mode; /* current inflate_block mode */ /* mode dependent information */ union { uInt left; /* if STORED, bytes left to copy */ struct { uInt table; /* table lengths (14 bits) */ uInt index; /* index into blens (or border) */ uInt *blens; /* bit lengths of codes */ uInt bb; /* bit length tree depth */ inflate_huft *tb; /* bit length decoding tree */ } trees; /* if DTREE, decoding info for trees */ struct { inflate_codes_statef *codes; } decode; /* if CODES, current state */ } sub; /* submode */ uInt last; /* true if this block is the last block */ /* mode independent information */ uInt bitk; /* bits in bit buffer */ uLong bitb; /* bit buffer */ inflate_huft *hufts; /* single malloc for tree space */ Byte *window; /* sliding window */ Byte *end; /* one byte after sliding window */ Byte *read; /* window read pointer */ Byte *write; /* window write pointer */ check_func checkfn; /* check function */ uLong check; /* check on output */ }; /* defines for inflate input/output */ /* update pointers and return */ #define UPDBITS {s->bitb=b;s->bitk=k;} #define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} #define UPDOUT {s->write=q;} #define UPDATE {UPDBITS UPDIN UPDOUT} #define LEAVE {UPDATE return zlib_inflate_flush(s,z,r);} /* get bytes and bits */ #define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} #define NEEDBYTE {if(n)r=Z_OK;else LEAVE} #define NEXTBYTE (n--,*p++) #define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} /* output bytes */ #define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) #define LOADOUT {q=s->write;m=(uInt)WAVAIL;} #define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} #define FLUSH {UPDOUT r=zlib_inflate_flush(s,z,r); LOADOUT} #define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} #define OUTBYTE(a) {*q++=(Byte)(a);m--;} /* load local pointers */ #define LOAD {LOADIN LOADOUT} /* masks for lower bits (size given to avoid silly warnings with Visual C++) */ extern uInt zlib_inflate_mask[17]; /* copy as much as possible from the sliding window to the output area */ extern int zlib_inflate_flush ( inflate_blocks_statef *, z_streamp , int); /* inflate private state */ typedef enum { METHOD, /* waiting for method byte */ FLAG, /* waiting for flag byte */ DICT4, /* four dictionary check bytes to go */ DICT3, /* three dictionary check bytes to go */ DICT2, /* two dictionary check bytes to go */ DICT1, /* one dictionary check byte to go */ DICT0, /* waiting for inflateSetDictionary */ BLOCKS, /* decompressing blocks */ CHECK4, /* four check bytes to go */ CHECK3, /* three check bytes to go */ CHECK2, /* two check bytes to go */ CHECK1, /* one check byte to go */ I_DONE, /* finished check, done */ I_BAD} /* got an error--stay here */ inflate_mode; struct internal_state { /* mode */ inflate_mode mode; /* current inflate mode */ /* mode dependent information */ union { uInt method; /* if FLAGS, method byte */ struct { uLong was; /* computed check value */ uLong need; /* stream check value */ } check; /* if CHECK, check values to compare */ uInt marker; /* if BAD, inflateSync's marker bytes count */ } sub; /* submode */ /* mode independent information */ int nowrap; /* flag for no wrapper */ uInt wbits; /* log2(window size) (8..15, defaults to 15) */ inflate_blocks_statef *blocks; /* current inflate_blocks state */ }; /* inflate codes private state */ typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ START, /* x: set up for LEN */ LEN, /* i: get length/literal/eob next */ LENEXT, /* i: getting length extra (have base) */ DIST, /* i: get distance next */ DISTEXT, /* i: getting distance extra */ COPY, /* o: copying bytes in window, waiting for space */ LIT, /* o: got literal, waiting for output space */ WASH, /* o: got eob, possibly still output waiting */ END, /* x: got eob and all data flushed */ BADCODE} /* x: got error */ inflate_codes_mode; struct inflate_codes_state { /* mode */ inflate_codes_mode mode; /* current inflate_codes mode */ /* mode dependent information */ uInt len; union { struct { inflate_huft *tree; /* pointer into tree */ uInt need; /* bits needed */ } code; /* if LEN or DIST, where in tree */ uInt lit; /* if LIT, literal */ struct { uInt get; /* bits to get for extra */ uInt dist; /* distance back to copy from */ } copy; /* if EXT or COPY, where and how much */ } sub; /* submode */ /* mode independent information */ Byte lbits; /* ltree bits decoded per branch */ Byte dbits; /* dtree bits decoder per branch */ inflate_huft *ltree; /* literal/length/eob tree */ inflate_huft *dtree; /* distance tree */ }; /* memory allocation for inflation */ struct inflate_workspace { inflate_codes_statef working_state; struct inflate_blocks_state working_blocks_state; struct internal_state internal_state; unsigned int tree_work_area_1[19]; unsigned int tree_work_area_2[288]; unsigned working_blens[258 + 0x1f + 0x1f]; inflate_huft working_hufts[MANY]; unsigned char working_window[1 << MAX_WBITS]; }; #define WS(z) ((struct inflate_workspace *)(z->workspace)) #endif mkvmlinuz-36/boot/prom.c0000644000000000000000000000730311773177134012330 0ustar /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include #include #include "string.h" #include "stdio.h" #include "prom.h" int (*prom)(void *); phandle chosen_handle; ihandle stdout; int call_prom(const char *service, int nargs, int nret, ...) { int i; struct prom_args { const char *service; int nargs; int nret; unsigned int args[12]; } args; va_list list; args.service = service; args.nargs = nargs; args.nret = nret; va_start(list, nret); for (i = 0; i < nargs; i++) args.args[i] = va_arg(list, unsigned int); va_end(list); for (i = 0; i < nret; i++) args.args[nargs+i] = 0; if (prom(&args) < 0) return -1; return (nret > 0)? args.args[nargs]: 0; } int call_prom_ret(const char *service, int nargs, int nret, unsigned int *rets, ...) { int i; struct prom_args { const char *service; int nargs; int nret; unsigned int args[12]; } args; va_list list; args.service = service; args.nargs = nargs; args.nret = nret; va_start(list, rets); for (i = 0; i < nargs; i++) args.args[i] = va_arg(list, unsigned int); va_end(list); for (i = 0; i < nret; i++) args.args[nargs+i] = 0; if (prom(&args) < 0) return -1; if (rets != (void *) 0) for (i = 1; i < nret; ++i) rets[i-1] = args.args[nargs+i]; return (nret > 0)? args.args[nargs]: 0; } int write(void *handle, void *ptr, int nb) { return call_prom("write", 3, 1, handle, ptr, nb); } /* * Older OF's require that when claiming a specific range of addresses, * we claim the physical space in the /memory node and the virtual * space in the chosen mmu node, and then do a map operation to * map virtual to physical. */ static int need_map = -1; static ihandle chosen_mmu; static phandle memory; /* returns true if s2 is a prefix of s1 */ static int string_match(const char *s1, const char *s2) { for (; *s2; ++s2) if (*s1++ != *s2) return 0; return 1; } static int check_of_version(void) { phandle oprom, chosen; char version[64]; oprom = finddevice("/openprom"); if (oprom == (phandle) -1) return 0; if (getprop(oprom, "model", version, sizeof(version)) <= 0) return 0; version[sizeof(version)-1] = 0; printf("OF version = '%s'\r\n", version); if (!string_match(version, "Open Firmware, 1.") && !string_match(version, "FirmWorks,3.")) return 0; chosen = finddevice("/chosen"); if (chosen == (phandle) -1) { chosen = finddevice("/chosen@0"); if (chosen == (phandle) -1) { printf("no chosen\n"); return 0; } } if (getprop(chosen, "mmu", &chosen_mmu, sizeof(chosen_mmu)) <= 0) { printf("no mmu\n"); return 0; } memory = (ihandle) call_prom("open", 1, 1, "/memory"); if (memory == (ihandle) -1) { memory = (ihandle) call_prom("open", 1, 1, "/memory@0"); if (memory == (ihandle) -1) { printf("no memory node\n"); return 0; } } printf("old OF detected\r\n"); return 1; } void *claim(unsigned long virt, unsigned long size, unsigned long align) { int ret; unsigned int result; if (need_map < 0) need_map = check_of_version(); if (align || !need_map) return (void *) call_prom("claim", 3, 1, virt, size, align); ret = call_prom_ret("call-method", 5, 2, &result, "claim", memory, align, size, virt); if (ret != 0 || result == -1) return (void *) -1; ret = call_prom_ret("call-method", 5, 2, &result, "claim", chosen_mmu, align, size, virt); /* 0x12 == coherent + read/write */ ret = call_prom("call-method", 6, 1, "map", chosen_mmu, 0x12, size, virt, virt); return (void *) virt; } mkvmlinuz-36/boot/stdio.c0000644000000000000000000001511711773177134012477 0ustar /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include #include #include "string.h" #include "stdio.h" #include "prom.h" size_t strnlen(const char * s, size_t count) { const char *sc; for (sc = s; count-- && *sc != '\0'; ++sc) /* nothing */; return sc - s; } extern unsigned int __div64_32(unsigned long long *dividend, unsigned int divisor); /* The unnecessary pointer compare is there * to check for type safety (n must be 64bit) */ # define do_div(n,base) ({ \ unsigned int __base = (base); \ unsigned int __rem; \ (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \ if (((n) >> 32) == 0) { \ __rem = (unsigned int)(n) % __base; \ (n) = (unsigned int)(n) / __base; \ } else \ __rem = __div64_32(&(n), __base); \ __rem; \ }) static int skip_atoi(const char **s) { int i, c; for (i = 0; '0' <= (c = **s) && c <= '9'; ++*s) i = i*10 + c - '0'; return i; } #define ZEROPAD 1 /* pad with zero */ #define SIGN 2 /* unsigned/signed long */ #define PLUS 4 /* show plus */ #define SPACE 8 /* space if plus */ #define LEFT 16 /* left justified */ #define SPECIAL 32 /* 0x */ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ static char * number(char * str, unsigned long long num, int base, int size, int precision, int type) { char c,sign,tmp[66]; const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; int i; if (type & LARGE) digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (type & LEFT) type &= ~ZEROPAD; if (base < 2 || base > 36) return 0; c = (type & ZEROPAD) ? '0' : ' '; sign = 0; if (type & SIGN) { if ((signed long long)num < 0) { sign = '-'; num = - (signed long long)num; size--; } else if (type & PLUS) { sign = '+'; size--; } else if (type & SPACE) { sign = ' '; size--; } } if (type & SPECIAL) { if (base == 16) size -= 2; else if (base == 8) size--; } i = 0; if (num == 0) tmp[i++]='0'; else while (num != 0) { tmp[i++] = digits[do_div(num, base)]; } if (i > precision) precision = i; size -= precision; if (!(type&(ZEROPAD+LEFT))) while(size-->0) *str++ = ' '; if (sign) *str++ = sign; if (type & SPECIAL) { if (base==8) *str++ = '0'; else if (base==16) { *str++ = '0'; *str++ = digits[33]; } } if (!(type & LEFT)) while (size-- > 0) *str++ = c; while (i < precision--) *str++ = '0'; while (i-- > 0) *str++ = tmp[i]; while (size-- > 0) *str++ = ' '; return str; } int vsprintf(char *buf, const char *fmt, va_list args) { int len; unsigned long long num; int i, base; char * str; const char *s; int flags; /* flags to number() */ int field_width; /* width of output field */ int precision; /* min. # of digits for integers; max number of chars for from string */ int qualifier; /* 'h', 'l', or 'L' for integer fields */ /* 'z' support added 23/7/1999 S.H. */ /* 'z' changed to 'Z' --davidm 1/25/99 */ for (str=buf ; *fmt ; ++fmt) { if (*fmt != '%') { *str++ = *fmt; continue; } /* process flags */ flags = 0; repeat: ++fmt; /* this also skips first '%' */ switch (*fmt) { case '-': flags |= LEFT; goto repeat; case '+': flags |= PLUS; goto repeat; case ' ': flags |= SPACE; goto repeat; case '#': flags |= SPECIAL; goto repeat; case '0': flags |= ZEROPAD; goto repeat; } /* get field width */ field_width = -1; if ('0' <= *fmt && *fmt <= '9') field_width = skip_atoi(&fmt); else if (*fmt == '*') { ++fmt; /* it's the next argument */ field_width = va_arg(args, int); if (field_width < 0) { field_width = -field_width; flags |= LEFT; } } /* get the precision */ precision = -1; if (*fmt == '.') { ++fmt; if ('0' <= *fmt && *fmt <= '9') precision = skip_atoi(&fmt); else if (*fmt == '*') { ++fmt; /* it's the next argument */ precision = va_arg(args, int); } if (precision < 0) precision = 0; } /* get the conversion qualifier */ qualifier = -1; if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') { qualifier = *fmt; ++fmt; } /* default base */ base = 10; switch (*fmt) { case 'c': if (!(flags & LEFT)) while (--field_width > 0) *str++ = ' '; *str++ = (unsigned char) va_arg(args, int); while (--field_width > 0) *str++ = ' '; continue; case 's': s = va_arg(args, char *); if (!s) s = ""; len = strnlen(s, precision); if (!(flags & LEFT)) while (len < field_width--) *str++ = ' '; for (i = 0; i < len; ++i) *str++ = *s++; while (len < field_width--) *str++ = ' '; continue; case 'p': if (field_width == -1) { field_width = 2*sizeof(void *); flags |= ZEROPAD; } str = number(str, (unsigned long) va_arg(args, void *), 16, field_width, precision, flags); continue; case 'n': if (qualifier == 'l') { long * ip = va_arg(args, long *); *ip = (str - buf); } else if (qualifier == 'Z') { size_t * ip = va_arg(args, size_t *); *ip = (str - buf); } else { int * ip = va_arg(args, int *); *ip = (str - buf); } continue; case '%': *str++ = '%'; continue; /* integer number formats - set up the flags and "break" */ case 'o': base = 8; break; case 'X': flags |= LARGE; case 'x': base = 16; break; case 'd': case 'i': flags |= SIGN; case 'u': break; default: *str++ = '%'; if (*fmt) *str++ = *fmt; else --fmt; continue; } if (qualifier == 'l') { num = va_arg(args, unsigned long); if (flags & SIGN) num = (signed long) num; } else if (qualifier == 'Z') { num = va_arg(args, size_t); } else if (qualifier == 'h') { num = (unsigned short) va_arg(args, int); if (flags & SIGN) num = (signed short) num; } else { num = va_arg(args, unsigned int); if (flags & SIGN) num = (signed int) num; } str = number(str, num, base, field_width, precision, flags); } *str = '\0'; return str-buf; } int sprintf(char * buf, const char *fmt, ...) { va_list args; int i; va_start(args, fmt); i=vsprintf(buf,fmt,args); va_end(args); return i; } static char sprint_buf[1024]; int printf(const char *fmt, ...) { va_list args; int n; va_start(args, fmt); n = vsprintf(sprint_buf, fmt, args); va_end(args); write(stdout, sprint_buf, n); return n; } mkvmlinuz-36/boot/prom.h0000644000000000000000000000150111773177134012327 0ustar #ifndef _PPC_BOOT_PROM_H_ #define _PPC_BOOT_PROM_H_ typedef void *phandle; typedef void *ihandle; extern int (*prom) (void *); extern phandle chosen_handle; extern ihandle stdout; int call_prom(const char *service, int nargs, int nret, ...); int call_prom_ret(const char *service, int nargs, int nret, unsigned int *rets, ...); extern int write(void *handle, void *ptr, int nb); extern void *claim(unsigned long virt, unsigned long size, unsigned long aln); static inline void exit(void) { call_prom("exit", 0, 0); } static inline phandle finddevice(const char *name) { return (phandle) call_prom("finddevice", 1, 1, name); } static inline int getprop(void *phandle, const char *name, void *buf, int buflen) { return call_prom("getprop", 4, 1, phandle, name, buf, buflen); } #endif /* _PPC_BOOT_PROM_H_ */ mkvmlinuz-36/boot/string.S0000644000000000000000000000650411773177134012643 0ustar /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * NOTE: this code runs in 32 bit mode and is packaged as ELF32. */ #include "ppc_asm.h" .text .globl strcpy strcpy: addi r5,r3,-1 addi r4,r4,-1 1: lbzu r0,1(r4) cmpwi 0,r0,0 stbu r0,1(r5) bne 1b blr .globl strncpy strncpy: cmpwi 0,r5,0 beqlr mtctr r5 addi r6,r3,-1 addi r4,r4,-1 1: lbzu r0,1(r4) cmpwi 0,r0,0 stbu r0,1(r6) bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */ blr .globl strcat strcat: addi r5,r3,-1 addi r4,r4,-1 1: lbzu r0,1(r5) cmpwi 0,r0,0 bne 1b addi r5,r5,-1 1: lbzu r0,1(r4) cmpwi 0,r0,0 stbu r0,1(r5) bne 1b blr .globl strcmp strcmp: addi r5,r3,-1 addi r4,r4,-1 1: lbzu r3,1(r5) cmpwi 1,r3,0 lbzu r0,1(r4) subf. r3,r0,r3 beqlr 1 beq 1b blr .globl strlen strlen: addi r4,r3,-1 1: lbzu r0,1(r4) cmpwi 0,r0,0 bne 1b subf r3,r3,r4 blr .globl memset memset: rlwimi r4,r4,8,16,23 rlwimi r4,r4,16,0,15 addi r6,r3,-4 cmplwi 0,r5,4 blt 7f stwu r4,4(r6) beqlr andi. r0,r6,3 add r5,r0,r5 subf r6,r0,r6 rlwinm r0,r5,32-2,2,31 mtctr r0 bdz 6f 1: stwu r4,4(r6) bdnz 1b 6: andi. r5,r5,3 7: cmpwi 0,r5,0 beqlr mtctr r5 addi r6,r6,3 8: stbu r4,1(r6) bdnz 8b blr .globl memmove memmove: cmplw 0,r3,r4 bgt backwards_memcpy /* fall through */ .globl memcpy memcpy: rlwinm. r7,r5,32-3,3,31 /* r7 = r5 >> 3 */ addi r6,r3,-4 addi r4,r4,-4 beq 3f /* if less than 8 bytes to do */ andi. r0,r6,3 /* get dest word aligned */ mtctr r7 bne 5f andi. r0,r4,3 /* check src word aligned too */ bne 3f 1: lwz r7,4(r4) lwzu r8,8(r4) stw r7,4(r6) stwu r8,8(r6) bdnz 1b andi. r5,r5,7 2: cmplwi 0,r5,4 blt 3f lwzu r0,4(r4) addi r5,r5,-4 stwu r0,4(r6) 3: cmpwi 0,r5,0 beqlr mtctr r5 addi r4,r4,3 addi r6,r6,3 4: lbzu r0,1(r4) stbu r0,1(r6) bdnz 4b blr 5: subfic r0,r0,4 cmpw cr1,r0,r5 add r7,r0,r4 andi. r7,r7,3 /* will source be word-aligned too? */ ble cr1,3b bne 3b /* do byte-by-byte if not */ mtctr r0 6: lbz r7,4(r4) addi r4,r4,1 stb r7,4(r6) addi r6,r6,1 bdnz 6b subf r5,r0,r5 rlwinm. r7,r5,32-3,3,31 beq 2b mtctr r7 b 1b .globl backwards_memcpy backwards_memcpy: rlwinm. r7,r5,32-3,3,31 /* r7 = r5 >> 3 */ add r6,r3,r5 add r4,r4,r5 beq 3f andi. r0,r6,3 mtctr r7 bne 5f andi. r0,r4,3 bne 3f 1: lwz r7,-4(r4) lwzu r8,-8(r4) stw r7,-4(r6) stwu r8,-8(r6) bdnz 1b andi. r5,r5,7 2: cmplwi 0,r5,4 blt 3f lwzu r0,-4(r4) subi r5,r5,4 stwu r0,-4(r6) 3: cmpwi 0,r5,0 beqlr mtctr r5 4: lbzu r0,-1(r4) stbu r0,-1(r6) bdnz 4b blr 5: cmpw cr1,r0,r5 subf r7,r0,r4 andi. r7,r7,3 ble cr1,3b bne 3b mtctr r0 6: lbzu r7,-1(r4) stbu r7,-1(r6) bdnz 6b subf r5,r0,r5 rlwinm. r7,r5,32-3,3,31 beq 2b mtctr r7 b 1b .globl memcmp memcmp: cmpwi 0,r5,0 blelr mtctr r5 addi r6,r3,-1 addi r4,r4,-1 1: lbzu r3,1(r6) lbzu r0,1(r4) subf. r3,r0,r3 bdnzt 2,1b blr /* * Flush the dcache and invalidate the icache for a range of addresses. * * flush_cache(addr, len) */ .global flush_cache flush_cache: addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */ rlwinm. 4,4,27,5,31 mtctr 4 beqlr 1: dcbf 0,3 icbi 0,3 addi 3,3,0x20 bdnz 1b sync isync blr mkvmlinuz-36/boot/install.sh0000644000000000000000000000206711773177134013213 0ustar #!/bin/sh # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. # # Copyright (C) 1995 by Linus Torvalds # # Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen # # "make install" script for ppc64 architecture # # Arguments: # $1 - kernel version # $2 - kernel image file # $3 - kernel map file # $4 - default install path (blank if root directory) # $5 - kernel boot file, the zImage # # User may have a custom install script if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi # Default install # this should work for both the pSeries zImage and the iSeries vmlinux.sm image_name=`basename $2` if [ -f $4/$image_name ]; then mv $4/$image_name $4/$image_name.old fi if [ -f $4/System.map ]; then mv $4/System.map $4/System.old fi cat $2 > $4/$image_name cp $3 $4/System.map mkvmlinuz-36/boot/infblock.h0000644000000000000000000000246011773177134013146 0ustar /* infblock.h -- header to use infblock.c * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ #ifndef _INFBLOCK_H #define _INFBLOCK_H struct inflate_blocks_state; typedef struct inflate_blocks_state inflate_blocks_statef; extern inflate_blocks_statef * zlib_inflate_blocks_new ( z_streamp z, check_func c, /* check function */ uInt w); /* window size */ extern int zlib_inflate_blocks ( inflate_blocks_statef *, z_streamp , int); /* initial return code */ extern void zlib_inflate_blocks_reset ( inflate_blocks_statef *, z_streamp , uLong *); /* check value on output */ extern int zlib_inflate_blocks_free ( inflate_blocks_statef *, z_streamp); #if 0 extern void zlib_inflate_set_dictionary ( inflate_blocks_statef *s, const Byte *d, /* dictionary */ uInt n); /* dictionary length */ #endif /* 0 */ #if 0 extern int zlib_inflate_blocks_sync_point ( inflate_blocks_statef *s); #endif /* 0 */ #endif /* _INFBLOCK_H */ mkvmlinuz-36/boot/dummy.c0000644000000000000000000000003611773177134012502 0ustar int main(void) { return 0; } mkvmlinuz-36/boot/inffast.c0000644000000000000000000001211211773177134012777 0ustar /* inffast.c -- process literals and length/distance pairs fast * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "inftrees.h" #include "infblock.h" #include "infcodes.h" #include "infutil.h" #include "inffast.h" struct inflate_codes_state; /* simplify the use of the inflate_huft type with some defines */ #define exop word.what.Exop #define bits word.what.Bits /* macros for bit input with no checking and for returning unused bytes */ #define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;} /* Called with number of bytes left to write in window at least 258 (the maximum string length) and number of input bytes available at least ten. The ten bytes are six bytes for the longest length/ distance pair plus four bytes for overloading the bit buffer. */ int zlib_inflate_fast( uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, /* need separate declaration for Borland C++ */ inflate_blocks_statef *s, z_streamp z ) { inflate_huft *t; /* temporary pointer */ uInt e; /* extra bits or operation */ uLong b; /* bit buffer */ uInt k; /* bits in bit buffer */ Byte *p; /* input data pointer */ uInt n; /* bytes available there */ Byte *q; /* output window write pointer */ uInt m; /* bytes to end of window or read pointer */ uInt ml; /* mask for literal/length tree */ uInt md; /* mask for distance tree */ uInt c; /* bytes to copy */ uInt d; /* distance back to copy from */ Byte *r; /* copy source pointer */ /* load input, output, bit values */ LOAD /* initialize masks */ ml = zlib_inflate_mask[bl]; md = zlib_inflate_mask[bd]; /* do until not enough input or output space for fast loop */ do { /* assume called with m >= 258 && n >= 10 */ /* get literal/length code */ GRABBITS(20) /* max bits for literal/length code */ if ((e = (t = tl + ((uInt)b & ml))->exop) == 0) { DUMPBITS(t->bits) *q++ = (Byte)t->base; m--; continue; } do { DUMPBITS(t->bits) if (e & 16) { /* get extra bits for length */ e &= 15; c = t->base + ((uInt)b & zlib_inflate_mask[e]); DUMPBITS(e) /* decode distance base of block to copy */ GRABBITS(15); /* max bits for distance code */ e = (t = td + ((uInt)b & md))->exop; do { DUMPBITS(t->bits) if (e & 16) { /* get extra bits to add to distance base */ e &= 15; GRABBITS(e) /* get extra bits (up to 13) */ d = t->base + ((uInt)b & zlib_inflate_mask[e]); DUMPBITS(e) /* do the copy */ m -= c; r = q - d; if (r < s->window) /* wrap if needed */ { do { r += s->end - s->window; /* force pointer in window */ } while (r < s->window); /* covers invalid distances */ e = s->end - r; if (c > e) { c -= e; /* wrapped copy */ do { *q++ = *r++; } while (--e); r = s->window; do { *q++ = *r++; } while (--c); } else /* normal copy */ { *q++ = *r++; c--; *q++ = *r++; c--; do { *q++ = *r++; } while (--c); } } else /* normal copy */ { *q++ = *r++; c--; *q++ = *r++; c--; do { *q++ = *r++; } while (--c); } break; } else if ((e & 64) == 0) { t += t->base; e = (t += ((uInt)b & zlib_inflate_mask[e]))->exop; } else { z->msg = (char*)"invalid distance code"; UNGRAB UPDATE return Z_DATA_ERROR; } } while (1); break; } if ((e & 64) == 0) { t += t->base; if ((e = (t += ((uInt)b & zlib_inflate_mask[e]))->exop) == 0) { DUMPBITS(t->bits) *q++ = (Byte)t->base; m--; break; } } else if (e & 32) { UNGRAB UPDATE return Z_STREAM_END; } else { z->msg = (char*)"invalid literal/length code"; UNGRAB UPDATE return Z_DATA_ERROR; } } while (1); } while (m >= 258 && n >= 10); /* not enough input or output--restore pointers and return */ UNGRAB UPDATE return Z_OK; } mkvmlinuz-36/boot/hack-coff.c0000644000000000000000000000453511773177134013200 0ustar /* * hack-coff.c - hack the header of an xcoff file to fill in * a few fields needed by the Open Firmware xcoff loader on * Power Macs but not initialized by objcopy. * * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include #include #include #include #include #include "rs6000.h" #define AOUT_MAGIC 0x010b #define get_16be(x) ((((unsigned char *)(x))[0] << 8) \ + ((unsigned char *)(x))[1]) #define put_16be(x, v) (((unsigned char *)(x))[0] = (v) >> 8, \ ((unsigned char *)(x))[1] = (v) & 0xff) #define get_32be(x) ((((unsigned char *)(x))[0] << 24) \ + (((unsigned char *)(x))[1] << 16) \ + (((unsigned char *)(x))[2] << 8) \ + ((unsigned char *)(x))[3]) int main(int ac, char **av) { int fd; int i, nsect; int aoutsz; struct external_filehdr fhdr; AOUTHDR aout; struct external_scnhdr shdr; if (ac != 2) { fprintf(stderr, "Usage: hack-coff coff-file\n"); exit(1); } if ((fd = open(av[1], 2)) == -1) { perror(av[2]); exit(1); } if (read(fd, &fhdr, sizeof(fhdr)) != sizeof(fhdr)) goto readerr; i = get_16be(fhdr.f_magic); if (i != U802TOCMAGIC && i != U802WRMAGIC && i != U802ROMAGIC) { fprintf(stderr, "%s: not an xcoff file\n", av[1]); exit(1); } aoutsz = get_16be(fhdr.f_opthdr); if (read(fd, &aout, aoutsz) != aoutsz) goto readerr; nsect = get_16be(fhdr.f_nscns); for (i = 0; i < nsect; ++i) { if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr)) goto readerr; if (strcmp(shdr.s_name, ".text") == 0) { put_16be(aout.o_snentry, i+1); put_16be(aout.o_sntext, i+1); } else if (strcmp(shdr.s_name, ".data") == 0) { put_16be(aout.o_sndata, i+1); } else if (strcmp(shdr.s_name, ".bss") == 0) { put_16be(aout.o_snbss, i+1); } } put_16be(aout.magic, AOUT_MAGIC); if (lseek(fd, (long) sizeof(struct external_filehdr), 0) == -1 || write(fd, &aout, aoutsz) != aoutsz) { fprintf(stderr, "%s: write error\n", av[1]); exit(1); } close(fd); exit(0); readerr: fprintf(stderr, "%s: read error or file too short\n", av[1]); exit(1); } mkvmlinuz-36/boot/infblock.c0000644000000000000000000002461411773177134013146 0ustar /* infblock.c -- interpret and process block types to last block * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "infblock.h" #include "inftrees.h" #include "infcodes.h" #include "infutil.h" struct inflate_codes_state; /* simplify the use of the inflate_huft type with some defines */ #define exop word.what.Exop #define bits word.what.Bits /* Table for deflate from PKZIP's appnote.txt. */ static const uInt border[] = { /* Order of the bit length code lengths */ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; /* Notes beyond the 1.93a appnote.txt: 1. Distance pointers never point before the beginning of the output stream. 2. Distance pointers can point back across blocks, up to 32k away. 3. There is an implied maximum of 7 bits for the bit length table and 15 bits for the actual data. 4. If only one code exists, then it is encoded using one bit. (Zero would be more efficient, but perhaps a little confusing.) If two codes exist, they are coded using one bit each (0 and 1). 5. There is no way of sending zero distance codes--a dummy must be sent if there are none. (History: a pre 2.0 version of PKZIP would store blocks with no distance codes, but this was discovered to be too harsh a criterion.) Valid only for 1.93a. 2.04c does allow zero distance codes, which is sent as one code of zero bits in length. 6. There are up to 286 literal/length codes. Code 256 represents the end-of-block. Note however that the static length tree defines 288 codes just to fill out the Huffman codes. Codes 286 and 287 cannot be used though, since there is no length base or extra bits defined for them. Similarily, there are up to 30 distance codes. However, static trees define 32 codes (all 5 bits) to fill out the Huffman codes, but the last two had better not show up in the data. 7. Unzip can check dynamic Huffman blocks for complete code sets. The exception is that a single code would not be complete (see #4). 8. The five bits following the block type is really the number of literal codes sent minus 257. 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits (1+6+6). Therefore, to output three times the length, you output three codes (1+1+1), whereas to output four times the same length, you only need two codes (1+3). Hmm. 10. In the tree reconstruction algorithm, Code = Code + Increment only if BitLength(i) is not zero. (Pretty obvious.) 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) 12. Note: length code 284 can represent 227-258, but length code 285 really is 258. The last length deserves its own, short code since it gets used a lot in very redundant files. The length 258 is special since 258 - 3 (the min match length) is 255. 13. The literal/length and distance code bit lengths are read as a single stream of lengths. It is possible (and advantageous) for a repeat code (16, 17, or 18) to go across the boundary between the two sets of lengths. */ void zlib_inflate_blocks_reset( inflate_blocks_statef *s, z_streamp z, uLong *c ) { if (c != NULL) *c = s->check; if (s->mode == CODES) zlib_inflate_codes_free(s->sub.decode.codes, z); s->mode = TYPE; s->bitk = 0; s->bitb = 0; s->read = s->write = s->window; if (s->checkfn != NULL) z->adler = s->check = (*s->checkfn)(0L, NULL, 0); } inflate_blocks_statef *zlib_inflate_blocks_new( z_streamp z, check_func c, uInt w ) { inflate_blocks_statef *s; s = &WS(z)->working_blocks_state; s->hufts = WS(z)->working_hufts; s->window = WS(z)->working_window; s->end = s->window + w; s->checkfn = c; s->mode = TYPE; zlib_inflate_blocks_reset(s, z, NULL); return s; } int zlib_inflate_blocks( inflate_blocks_statef *s, z_streamp z, int r ) { uInt t; /* temporary storage */ uLong b; /* bit buffer */ uInt k; /* bits in bit buffer */ Byte *p; /* input data pointer */ uInt n; /* bytes available there */ Byte *q; /* output window write pointer */ uInt m; /* bytes to end of window or read pointer */ /* copy input/output information to locals (UPDATE macro restores) */ LOAD /* process input based on current state */ while (1) switch (s->mode) { case TYPE: NEEDBITS(3) t = (uInt)b & 7; s->last = t & 1; switch (t >> 1) { case 0: /* stored */ DUMPBITS(3) t = k & 7; /* go to byte boundary */ DUMPBITS(t) s->mode = LENS; /* get length of stored block */ break; case 1: /* fixed */ { uInt bl, bd; inflate_huft *tl, *td; zlib_inflate_trees_fixed(&bl, &bd, &tl, &td, s->hufts, z); s->sub.decode.codes = zlib_inflate_codes_new(bl, bd, tl, td, z); if (s->sub.decode.codes == NULL) { r = Z_MEM_ERROR; LEAVE } } DUMPBITS(3) s->mode = CODES; break; case 2: /* dynamic */ DUMPBITS(3) s->mode = TABLE; break; case 3: /* illegal */ DUMPBITS(3) s->mode = B_BAD; z->msg = (char*)"invalid block type"; r = Z_DATA_ERROR; LEAVE } break; case LENS: NEEDBITS(32) if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) { s->mode = B_BAD; z->msg = (char*)"invalid stored block lengths"; r = Z_DATA_ERROR; LEAVE } s->sub.left = (uInt)b & 0xffff; b = k = 0; /* dump bits */ s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); break; case STORED: if (n == 0) LEAVE NEEDOUT t = s->sub.left; if (t > n) t = n; if (t > m) t = m; memcpy(q, p, t); p += t; n -= t; q += t; m -= t; if ((s->sub.left -= t) != 0) break; s->mode = s->last ? DRY : TYPE; break; case TABLE: NEEDBITS(14) s->sub.trees.table = t = (uInt)b & 0x3fff; #ifndef PKZIP_BUG_WORKAROUND if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) { s->mode = B_BAD; z->msg = (char*)"too many length or distance symbols"; r = Z_DATA_ERROR; LEAVE } #endif { s->sub.trees.blens = WS(z)->working_blens; } DUMPBITS(14) s->sub.trees.index = 0; s->mode = BTREE; case BTREE: while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) { NEEDBITS(3) s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; DUMPBITS(3) } while (s->sub.trees.index < 19) s->sub.trees.blens[border[s->sub.trees.index++]] = 0; s->sub.trees.bb = 7; t = zlib_inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, &s->sub.trees.tb, s->hufts, z); if (t != Z_OK) { r = t; if (r == Z_DATA_ERROR) s->mode = B_BAD; LEAVE } s->sub.trees.index = 0; s->mode = DTREE; case DTREE: while (t = s->sub.trees.table, s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) { inflate_huft *h; uInt i, j, c; t = s->sub.trees.bb; NEEDBITS(t) h = s->sub.trees.tb + ((uInt)b & zlib_inflate_mask[t]); t = h->bits; c = h->base; if (c < 16) { DUMPBITS(t) s->sub.trees.blens[s->sub.trees.index++] = c; } else /* c == 16..18 */ { i = c == 18 ? 7 : c - 14; j = c == 18 ? 11 : 3; NEEDBITS(t + i) DUMPBITS(t) j += (uInt)b & zlib_inflate_mask[i]; DUMPBITS(i) i = s->sub.trees.index; t = s->sub.trees.table; if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) { s->mode = B_BAD; z->msg = (char*)"invalid bit length repeat"; r = Z_DATA_ERROR; LEAVE } c = c == 16 ? s->sub.trees.blens[i - 1] : 0; do { s->sub.trees.blens[i++] = c; } while (--j); s->sub.trees.index = i; } } s->sub.trees.tb = NULL; { uInt bl, bd; inflate_huft *tl, *td; inflate_codes_statef *c; bl = 9; /* must be <= 9 for lookahead assumptions */ bd = 6; /* must be <= 9 for lookahead assumptions */ t = s->sub.trees.table; t = zlib_inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), s->sub.trees.blens, &bl, &bd, &tl, &td, s->hufts, z); if (t != Z_OK) { if (t == (uInt)Z_DATA_ERROR) s->mode = B_BAD; r = t; LEAVE } if ((c = zlib_inflate_codes_new(bl, bd, tl, td, z)) == NULL) { r = Z_MEM_ERROR; LEAVE } s->sub.decode.codes = c; } s->mode = CODES; case CODES: UPDATE if ((r = zlib_inflate_codes(s, z, r)) != Z_STREAM_END) return zlib_inflate_flush(s, z, r); r = Z_OK; zlib_inflate_codes_free(s->sub.decode.codes, z); LOAD if (!s->last) { s->mode = TYPE; break; } s->mode = DRY; case DRY: FLUSH if (s->read != s->write) LEAVE s->mode = B_DONE; case B_DONE: r = Z_STREAM_END; LEAVE case B_BAD: r = Z_DATA_ERROR; LEAVE default: r = Z_STREAM_ERROR; LEAVE } } int zlib_inflate_blocks_free( inflate_blocks_statef *s, z_streamp z ) { zlib_inflate_blocks_reset(s, z, NULL); return Z_OK; } #if 0 void zlib_inflate_set_dictionary( inflate_blocks_statef *s, const Byte *d, uInt n ) { memcpy(s->window, d, n); s->read = s->write = s->window + n; } #endif /* 0 */ /* Returns true if inflate is currently at the end of a block generated * by Z_SYNC_FLUSH or Z_FULL_FLUSH. * IN assertion: s != NULL */ #if 0 int zlib_inflate_blocks_sync_point( inflate_blocks_statef *s ) { return s->mode == LENS; } #endif /* 0 */ mkvmlinuz-36/boot/zconf.h0000644000000000000000000000274711773177134012506 0ustar /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-1998 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef _ZCONF_H #define _ZCONF_H /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # define MAX_MEM_LEVEL 8 #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* Type declarations */ typedef unsigned char Byte; /* 8 bits */ typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ typedef void *voidp; #endif /* _ZCONF_H */ mkvmlinuz-36/boot/infcodes.h0000644000000000000000000000147111773177134013152 0ustar /* infcodes.h -- header to use infcodes.c * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ #ifndef _INFCODES_H #define _INFCODES_H #include "infblock.h" struct inflate_codes_state; typedef struct inflate_codes_state inflate_codes_statef; extern inflate_codes_statef *zlib_inflate_codes_new ( uInt, uInt, inflate_huft *, inflate_huft *, z_streamp ); extern int zlib_inflate_codes ( inflate_blocks_statef *, z_streamp , int); extern void zlib_inflate_codes_free ( inflate_codes_statef *, z_streamp ); #endif /* _INFCODES_H */ mkvmlinuz-36/boot/main.c0000644000000000000000000002067111773177134012302 0ustar /* * Copyright (C) Paul Mackerras 1997. * * Updates for PPC64 by Todd Inglett, Dave Engebretsen & Peter Bergner. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include #include #include "elf.h" #include "page.h" #include "string.h" #include "stdio.h" #include "prom.h" #include "zlib.h" extern void flush_cache(void *, unsigned long); /* Value picked to match that used by yaboot */ #define PROG_START 0x01400000 /* only used on 64-bit systems */ #define RAM_END (512<<20) /* Fixme: use OF */ #define ONE_MB 0x100000 extern char _start[]; extern char __bss_start[]; extern char _end[]; extern char _vmlinux_start[]; extern char _vmlinux_end[]; extern char _initrd_start[]; extern char _initrd_end[]; struct addr_range { unsigned long addr; unsigned long size; unsigned long memsize; }; static struct addr_range vmlinux; static struct addr_range vmlinuz; static struct addr_range initrd; static unsigned long elfoffset; static char scratch[46912]; /* scratch space for gunzip, from zlib_inflate_workspacesize() */ static char elfheader[256]; typedef void (*kernel_entry_t)( unsigned long, unsigned long, void *, void *); #undef DEBUG static unsigned long claim_base; #define HEAD_CRC 2 #define EXTRA_FIELD 4 #define ORIG_NAME 8 #define COMMENT 0x10 #define RESERVED 0xe0 static void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) { z_stream s; int r, i, flags; /* skip header */ i = 10; flags = src[3]; if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) { printf("bad gzipped data\n\r"); exit(); } if ((flags & EXTRA_FIELD) != 0) i = 12 + src[10] + (src[11] << 8); if ((flags & ORIG_NAME) != 0) while (src[i++] != 0) ; if ((flags & COMMENT) != 0) while (src[i++] != 0) ; if ((flags & HEAD_CRC) != 0) i += 2; if (i >= *lenp) { printf("gunzip: ran out of data in header\n\r"); exit(); } if (zlib_inflate_workspacesize() > sizeof(scratch)) { printf("gunzip needs more mem\n"); exit(); } memset(&s, 0, sizeof(s)); s.workspace = scratch; r = zlib_inflateInit2(&s, -MAX_WBITS); if (r != Z_OK) { printf("inflateInit2 returned %d\n\r", r); exit(); } s.next_in = src + i; s.avail_in = *lenp - i; s.next_out = dst; s.avail_out = dstlen; r = zlib_inflate(&s, Z_FULL_FLUSH); if (r != Z_OK && r != Z_STREAM_END) { printf("inflate returned %d msg: %s\n\r", r, s.msg); exit(); } *lenp = s.next_out - (unsigned char *) dst; zlib_inflateEnd(&s); } static unsigned long try_claim(unsigned long size) { unsigned long addr = 0; for(; claim_base < RAM_END; claim_base += ONE_MB) { #ifdef DEBUG printf(" trying: 0x%08lx\n\r", claim_base); #endif addr = (unsigned long)claim(claim_base, size, 0); if ((void *)addr != (void *)-1) break; } if (addr == 0) return 0; claim_base = PAGE_ALIGN(claim_base + size); return addr; } static int is_elf64(void *hdr) { Elf64_Ehdr *elf64 = hdr; Elf64_Phdr *elf64ph; unsigned int i; if (!(elf64->e_ident[EI_MAG0] == ELFMAG0 && elf64->e_ident[EI_MAG1] == ELFMAG1 && elf64->e_ident[EI_MAG2] == ELFMAG2 && elf64->e_ident[EI_MAG3] == ELFMAG3 && elf64->e_ident[EI_CLASS] == ELFCLASS64 && elf64->e_ident[EI_DATA] == ELFDATA2MSB && elf64->e_type == ET_EXEC && elf64->e_machine == EM_PPC64)) return 0; elf64ph = (Elf64_Phdr *)((unsigned long)elf64 + (unsigned long)elf64->e_phoff); for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++) if (elf64ph->p_type == PT_LOAD) break; if (i >= (unsigned int)elf64->e_phnum) return 0; elfoffset = (unsigned long)elf64ph->p_offset; vmlinux.size = (unsigned long)elf64ph->p_filesz + elfoffset; vmlinux.memsize = (unsigned long)elf64ph->p_memsz + elfoffset; #if defined(PROG_START) /* * Maintain a "magic" minimum address. This keeps some older * firmware platforms running. */ if (claim_base < PROG_START) claim_base = PROG_START; #endif return 1; } static int is_elf32(void *hdr) { Elf32_Ehdr *elf32 = hdr; Elf32_Phdr *elf32ph; unsigned int i; if (!(elf32->e_ident[EI_MAG0] == ELFMAG0 && elf32->e_ident[EI_MAG1] == ELFMAG1 && elf32->e_ident[EI_MAG2] == ELFMAG2 && elf32->e_ident[EI_MAG3] == ELFMAG3 && elf32->e_ident[EI_CLASS] == ELFCLASS32 && elf32->e_ident[EI_DATA] == ELFDATA2MSB && elf32->e_type == ET_EXEC && elf32->e_machine == EM_PPC)) return 0; elf32 = (Elf32_Ehdr *)elfheader; elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff); for (i = 0; i < elf32->e_phnum; i++, elf32ph++) if (elf32ph->p_type == PT_LOAD) break; if (i >= elf32->e_phnum) return 0; elfoffset = elf32ph->p_offset; vmlinux.size = elf32ph->p_filesz + elf32ph->p_offset; vmlinux.memsize = elf32ph->p_memsz + elf32ph->p_offset; return 1; } void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) { int len; kernel_entry_t kernel_entry; memset(__bss_start, 0, _end - __bss_start); prom = (int (*)(void *)) promptr; chosen_handle = finddevice("/chosen"); if (chosen_handle == (void *) -1) exit(); if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4) exit(); printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp); /* * The first available claim_base must be above the end of the * the loaded kernel wrapper file (_start to _end includes the * initrd image if it is present) and rounded up to a nice * 1 MB boundary for good measure. */ claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB); vmlinuz.addr = (unsigned long)_vmlinux_start; vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start); /* gunzip the ELF header of the kernel */ if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { len = vmlinuz.size; gunzip(elfheader, sizeof(elfheader), (unsigned char *)vmlinuz.addr, &len); } else memcpy(elfheader, (const void *)vmlinuz.addr, sizeof(elfheader)); if (!is_elf64(elfheader) && !is_elf32(elfheader)) { printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r"); exit(); } /* We need to claim the memsize plus the file offset since gzip * will expand the header (file offset), then the kernel, then * possible rubbish we don't care about. But the kernel bss must * be claimed (it will be zero'd by the kernel itself) */ printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize); vmlinux.addr = try_claim(vmlinux.memsize); if (vmlinux.addr == 0) { printf("Can't allocate memory for kernel image !\n\r"); exit(); } /* * Now we try to claim memory for the initrd (and copy it there) */ initrd.size = (unsigned long)(_initrd_end - _initrd_start); initrd.memsize = initrd.size; if ( initrd.size > 0 ) { printf("Allocating 0x%lx bytes for initrd ...\n\r", initrd.size); initrd.addr = try_claim(initrd.size); if (initrd.addr == 0) { printf("Can't allocate memory for initial ramdisk !\n\r"); exit(); } a1 = initrd.addr; a2 = initrd.size; printf("initial ramdisk moving 0x%lx <- 0x%lx (0x%lx bytes)\n\r", initrd.addr, (unsigned long)_initrd_start, initrd.size); memmove((void *)initrd.addr, (void *)_initrd_start, initrd.size); printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd.addr)); } /* Eventually gunzip the kernel */ if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { printf("gunzipping (0x%lx <- 0x%lx:0x%0lx)...", vmlinux.addr, vmlinuz.addr, vmlinuz.addr+vmlinuz.size); len = vmlinuz.size; gunzip((void *)vmlinux.addr, vmlinux.memsize, (unsigned char *)vmlinuz.addr, &len); printf("done 0x%lx bytes\n\r", len); } else { memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size); } /* Skip over the ELF header */ #ifdef DEBUG printf("... skipping 0x%lx bytes of ELF header\n\r", elfoffset); #endif vmlinux.addr += elfoffset; flush_cache((void *)vmlinux.addr, vmlinux.size); kernel_entry = (kernel_entry_t)vmlinux.addr; #ifdef DEBUG printf( "kernel:\n\r" " entry addr = 0x%lx\n\r" " a1 = 0x%lx,\n\r" " a2 = 0x%lx,\n\r" " prom = 0x%lx,\n\r" " bi_recs = 0x%lx,\n\r", (unsigned long)kernel_entry, a1, a2, (unsigned long)prom, NULL); #endif kernel_entry(a1, a2, prom, NULL); printf("Error: Linux kernel returned to zImage bootloader!\n\r"); exit(); } mkvmlinuz-36/boot/infcodes.c0000644000000000000000000001250211773177134013142 0ustar /* infcodes.c -- process literals and length/distance pairs * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "inftrees.h" #include "infblock.h" #include "infcodes.h" #include "infutil.h" #include "inffast.h" /* simplify the use of the inflate_huft type with some defines */ #define exop word.what.Exop #define bits word.what.Bits inflate_codes_statef *zlib_inflate_codes_new( uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, /* need separate declaration for Borland C++ */ z_streamp z ) { inflate_codes_statef *c; c = &WS(z)->working_state; { c->mode = START; c->lbits = (Byte)bl; c->dbits = (Byte)bd; c->ltree = tl; c->dtree = td; } return c; } int zlib_inflate_codes( inflate_blocks_statef *s, z_streamp z, int r ) { uInt j; /* temporary storage */ inflate_huft *t; /* temporary pointer */ uInt e; /* extra bits or operation */ uLong b; /* bit buffer */ uInt k; /* bits in bit buffer */ Byte *p; /* input data pointer */ uInt n; /* bytes available there */ Byte *q; /* output window write pointer */ uInt m; /* bytes to end of window or read pointer */ Byte *f; /* pointer to copy strings from */ inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ /* copy input/output information to locals (UPDATE macro restores) */ LOAD /* process input and output based on current state */ while (1) switch (c->mode) { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ case START: /* x: set up for LEN */ #ifndef SLOW if (m >= 258 && n >= 10) { UPDATE r = zlib_inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); LOAD if (r != Z_OK) { c->mode = r == Z_STREAM_END ? WASH : BADCODE; break; } } #endif /* !SLOW */ c->sub.code.need = c->lbits; c->sub.code.tree = c->ltree; c->mode = LEN; case LEN: /* i: get length/literal/eob next */ j = c->sub.code.need; NEEDBITS(j) t = c->sub.code.tree + ((uInt)b & zlib_inflate_mask[j]); DUMPBITS(t->bits) e = (uInt)(t->exop); if (e == 0) /* literal */ { c->sub.lit = t->base; c->mode = LIT; break; } if (e & 16) /* length */ { c->sub.copy.get = e & 15; c->len = t->base; c->mode = LENEXT; break; } if ((e & 64) == 0) /* next table */ { c->sub.code.need = e; c->sub.code.tree = t + t->base; break; } if (e & 32) /* end of block */ { c->mode = WASH; break; } c->mode = BADCODE; /* invalid code */ z->msg = (char*)"invalid literal/length code"; r = Z_DATA_ERROR; LEAVE case LENEXT: /* i: getting length extra (have base) */ j = c->sub.copy.get; NEEDBITS(j) c->len += (uInt)b & zlib_inflate_mask[j]; DUMPBITS(j) c->sub.code.need = c->dbits; c->sub.code.tree = c->dtree; c->mode = DIST; case DIST: /* i: get distance next */ j = c->sub.code.need; NEEDBITS(j) t = c->sub.code.tree + ((uInt)b & zlib_inflate_mask[j]); DUMPBITS(t->bits) e = (uInt)(t->exop); if (e & 16) /* distance */ { c->sub.copy.get = e & 15; c->sub.copy.dist = t->base; c->mode = DISTEXT; break; } if ((e & 64) == 0) /* next table */ { c->sub.code.need = e; c->sub.code.tree = t + t->base; break; } c->mode = BADCODE; /* invalid code */ z->msg = (char*)"invalid distance code"; r = Z_DATA_ERROR; LEAVE case DISTEXT: /* i: getting distance extra */ j = c->sub.copy.get; NEEDBITS(j) c->sub.copy.dist += (uInt)b & zlib_inflate_mask[j]; DUMPBITS(j) c->mode = COPY; case COPY: /* o: copying bytes in window, waiting for space */ f = q - c->sub.copy.dist; while (f < s->window) /* modulo window size-"while" instead */ f += s->end - s->window; /* of "if" handles invalid distances */ while (c->len) { NEEDOUT OUTBYTE(*f++) if (f == s->end) f = s->window; c->len--; } c->mode = START; break; case LIT: /* o: got literal, waiting for output space */ NEEDOUT OUTBYTE(c->sub.lit) c->mode = START; break; case WASH: /* o: got eob, possibly more output */ if (k > 7) /* return unused byte, if any */ { k -= 8; n++; p--; /* can always return one */ } FLUSH if (s->read != s->write) LEAVE c->mode = END; case END: r = Z_STREAM_END; LEAVE case BADCODE: /* x: got error */ r = Z_DATA_ERROR; LEAVE default: r = Z_STREAM_ERROR; LEAVE } #ifdef NEED_DUMMY_RETURN return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ #endif } void zlib_inflate_codes_free( inflate_codes_statef *c, z_streamp z ) { } mkvmlinuz-36/boot/inffast.h0000644000000000000000000000075111773177134013012 0ustar /* inffast.h -- header to use inffast.c * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ extern int zlib_inflate_fast ( uInt, uInt, inflate_huft *, inflate_huft *, inflate_blocks_statef *, z_streamp ); mkvmlinuz-36/boot/zImage.lds0000644000000000000000000000124411773177134013125 0ustar OUTPUT_ARCH(powerpc:common) ENTRY(_zimage_start) SECTIONS { . = (4*1024*1024); _start = .; .text : { *(.text) *(.fixup) } _etext = .; . = ALIGN(4096); .data : { *(.rodata*) *(.data*) *(.sdata*) __got2_start = .; *(.got2) __got2_end = .; } . = ALIGN(4096); _vmlinux_start = .; .kernel:vmlinux.strip : { *(.kernel:vmlinux.strip) } _vmlinux_end = .; . = ALIGN(4096); _initrd_start = .; .kernel:initrd : { *(.kernel:initrd) } _initrd_end = .; . = ALIGN(4096); _edata = .; . = ALIGN(4096); __bss_start = .; .bss : { *(.sbss) *(.bss) } . = ALIGN(4096); _end = . ; } mkvmlinuz-36/boot/string.h0000644000000000000000000000122011773177134012656 0ustar #ifndef _PPC_BOOT_STRING_H_ #define _PPC_BOOT_STRING_H_ #include extern char *strcpy(char *dest, const char *src); extern char *strncpy(char *dest, const char *src, size_t n); extern char *strcat(char *dest, const char *src); extern int strcmp(const char *s1, const char *s2); extern size_t strlen(const char *s); extern size_t strnlen(const char *s, size_t count); extern void *memset(void *s, int c, size_t n); extern void *memmove(void *dest, const void *src, unsigned long n); extern void *memcpy(void *dest, const void *src, unsigned long n); extern int memcmp(const void *s1, const void *s2, size_t n); #endif /* _PPC_BOOT_STRING_H_ */ mkvmlinuz-36/boot/ppc_asm.h0000644000000000000000000000217511773177134013004 0ustar #ifndef _PPC64_PPC_ASM_H #define _PPC64_PPC_ASM_H /* * * Definitions used by various bits of low-level assembly code on PowerPC. * * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ /* Condition Register Bit Fields */ #define cr0 0 #define cr1 1 #define cr2 2 #define cr3 3 #define cr4 4 #define cr5 5 #define cr6 6 #define cr7 7 /* General Purpose Registers (GPRs) */ #define r0 0 #define r1 1 #define r2 2 #define r3 3 #define r4 4 #define r5 5 #define r6 6 #define r7 7 #define r8 8 #define r9 9 #define r10 10 #define r11 11 #define r12 12 #define r13 13 #define r14 14 #define r15 15 #define r16 16 #define r17 17 #define r18 18 #define r19 19 #define r20 20 #define r21 21 #define r22 22 #define r23 23 #define r24 24 #define r25 25 #define r26 26 #define r27 27 #define r28 28 #define r29 29 #define r30 30 #define r31 31 #endif /* _PPC64_PPC_ASM_H */ mkvmlinuz-36/boot/inftrees.c0000644000000000000000000003506711773177134013202 0ustar /* inftrees.c -- generate Huffman trees for efficient decoding * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "inftrees.h" #include "infutil.h" static const char inflate_copyright[] = " inflate 1.1.3 Copyright 1995-1998 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot include such an acknowledgment, I would appreciate that you keep this copyright string in the executable of your product. */ struct internal_state; /* simplify the use of the inflate_huft type with some defines */ #define exop word.what.Exop #define bits word.what.Bits static int huft_build ( uInt *, /* code lengths in bits */ uInt, /* number of codes */ uInt, /* number of "simple" codes */ const uInt *, /* list of base values for non-simple codes */ const uInt *, /* list of extra bits for non-simple codes */ inflate_huft **, /* result: starting table */ uInt *, /* maximum lookup bits (returns actual) */ inflate_huft *, /* space for trees */ uInt *, /* hufts used in space */ uInt * ); /* space for values */ /* Tables for deflate from PKZIP's appnote.txt. */ static const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; /* see note #13 above about 258 */ static const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */ static const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const uInt cpdext[30] = { /* Extra bits for distance codes */ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; /* Huffman code decoding is performed using a multi-level table lookup. The fastest way to decode is to simply build a lookup table whose size is determined by the longest code. However, the time it takes to build this table can also be a factor if the data being decoded is not very long. The most common codes are necessarily the shortest codes, so those codes dominate the decoding time, and hence the speed. The idea is you can have a shorter table that decodes the shorter, more probable codes, and then point to subsidiary tables for the longer codes. The time it costs to decode the longer codes is then traded against the time it takes to make longer tables. This results of this trade are in the variables lbits and dbits below. lbits is the number of bits the first level table for literal/ length codes can decode in one step, and dbits is the same thing for the distance codes. Subsequent tables are also less than or equal to those sizes. These values may be adjusted either when all of the codes are shorter than that, in which case the longest code length in bits is used, or when the shortest code is *longer* than the requested table size, in which case the length of the shortest code in bits is used. There are two different values for the two tables, since they code a different number of possibilities each. The literal/length table codes 286 possible values, or in a flat code, a little over eight bits. The distance table codes 30 possible values, or a little less than five bits, flat. The optimum values for speed end up being about one bit more than those, so lbits is 8+1 and dbits is 5+1. The optimum values may differ though from machine to machine, and possibly even between compilers. Your mileage may vary. */ /* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ #define BMAX 15 /* maximum bit length of any code */ static int huft_build( uInt *b, /* code lengths in bits (all assumed <= BMAX) */ uInt n, /* number of codes (assumed <= 288) */ uInt s, /* number of simple-valued codes (0..s-1) */ const uInt *d, /* list of base values for non-simple codes */ const uInt *e, /* list of extra bits for non-simple codes */ inflate_huft **t, /* result: starting table */ uInt *m, /* maximum lookup bits, returns actual */ inflate_huft *hp, /* space for trees */ uInt *hn, /* hufts used in space */ uInt *v /* working area: values in order of bit length */ ) /* Given a list of code lengths and a maximum table size, make a set of tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR if the given code set is incomplete (the tables are still built in this case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of lengths), or Z_MEM_ERROR if not enough memory. */ { uInt a; /* counter for codes of length k */ uInt c[BMAX+1]; /* bit length count table */ uInt f; /* i repeats in table every f entries */ int g; /* maximum code length */ int h; /* table level */ register uInt i; /* counter, current code */ register uInt j; /* counter */ register int k; /* number of bits in current code */ int l; /* bits per table (returned in m) */ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ register uInt *p; /* pointer into c[], b[], or v[] */ inflate_huft *q; /* points to current table */ struct inflate_huft_s r; /* table entry for structure assignment */ inflate_huft *u[BMAX]; /* table stack */ register int w; /* bits before this table == (l * h) */ uInt x[BMAX+1]; /* bit offsets, then code stack */ uInt *xp; /* pointer into x */ int y; /* number of dummy codes added */ uInt z; /* number of entries in current table */ /* Generate counts for each bit length */ p = c; #define C0 *p++ = 0; #define C2 C0 C0 C0 C0 #define C4 C2 C2 C2 C2 C4 /* clear c[]--assume BMAX+1 is 16 */ p = b; i = n; do { c[*p++]++; /* assume all entries <= BMAX */ } while (--i); if (c[0] == n) /* null input--all zero length codes */ { *t = NULL; *m = 0; return Z_OK; } /* Find minimum and maximum length, bound *m by those */ l = *m; for (j = 1; j <= BMAX; j++) if (c[j]) break; k = j; /* minimum code length */ if ((uInt)l < j) l = j; for (i = BMAX; i; i--) if (c[i]) break; g = i; /* maximum code length */ if ((uInt)l > i) l = i; *m = l; /* Adjust last length count to fill out codes, if needed */ for (y = 1 << j; j < i; j++, y <<= 1) if ((y -= c[j]) < 0) return Z_DATA_ERROR; if ((y -= c[i]) < 0) return Z_DATA_ERROR; c[i] += y; /* Generate starting offsets into the value table for each length */ x[1] = j = 0; p = c + 1; xp = x + 2; while (--i) { /* note that i == g from above */ *xp++ = (j += *p++); } /* Make a table of values in order of bit lengths */ p = b; i = 0; do { if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); n = x[g]; /* set n to length of v */ /* Generate the Huffman codes and for each, make the table entries */ x[0] = i = 0; /* first Huffman code is zero */ p = v; /* grab values in bit order */ h = -1; /* no tables yet--level -1 */ w = -l; /* bits decoded == (l * h) */ u[0] = NULL; /* just to keep compilers happy */ q = NULL; /* ditto */ z = 0; /* ditto */ /* go through the bit lengths (k already is bits in shortest code) */ for (; k <= g; k++) { a = c[k]; while (a--) { /* here i is the Huffman code of length k bits for value *p */ /* make tables up to required level */ while (k > w + l) { h++; w += l; /* previous table always l bits */ /* compute minimum size table less than or equal to l bits */ z = g - w; z = z > (uInt)l ? l : z; /* table size upper limit */ if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ { /* too few codes for k-w bit table */ f -= a + 1; /* deduct codes from patterns left */ xp = c + k; if (j < z) while (++j < z) /* try smaller tables up to z bits */ { if ((f <<= 1) <= *++xp) break; /* enough codes to use up j bits */ f -= *xp; /* else deduct codes from patterns */ } } z = 1 << j; /* table entries for j-bit table */ /* allocate new table */ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ return Z_DATA_ERROR; /* overflow of MANY */ u[h] = q = hp + *hn; *hn += z; /* connect to last table, if there is one */ if (h) { x[h] = i; /* save pattern for backing up */ r.bits = (Byte)l; /* bits to dump before this table */ r.exop = (Byte)j; /* bits in this table */ j = i >> (w - l); r.base = (uInt)(q - u[h-1] - j); /* offset to this table */ u[h-1][j] = r; /* connect to last table */ } else *t = q; /* first table is returned result */ } /* set up table entry in r */ r.bits = (Byte)(k - w); if (p >= v + n) r.exop = 128 + 64; /* out of values--invalid code */ else if (*p < s) { r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ r.base = *p++; /* simple code is just the value */ } else { r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */ r.base = d[*p++ - s]; } /* fill code-like entries with r */ f = 1 << (k - w); for (j = i >> w; j < z; j += f) q[j] = r; /* backwards increment the k-bit code i */ for (j = 1 << (k - 1); i & j; j >>= 1) i ^= j; i ^= j; /* backup over finished tables */ mask = (1 << w) - 1; /* needed on HP, cc -O bug */ while ((i & mask) != x[h]) { h--; /* don't need to update q */ w -= l; mask = (1 << w) - 1; } } } /* Return Z_BUF_ERROR if we were given an incomplete table */ return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; } int zlib_inflate_trees_bits( uInt *c, /* 19 code lengths */ uInt *bb, /* bits tree desired/actual depth */ inflate_huft **tb, /* bits tree result */ inflate_huft *hp, /* space for trees */ z_streamp z /* for messages */ ) { int r; uInt hn = 0; /* hufts used in space */ uInt *v; /* work area for huft_build */ v = WS(z)->tree_work_area_1; r = huft_build(c, 19, 19, NULL, NULL, tb, bb, hp, &hn, v); if (r == Z_DATA_ERROR) z->msg = (char*)"oversubscribed dynamic bit lengths tree"; else if (r == Z_BUF_ERROR || *bb == 0) { z->msg = (char*)"incomplete dynamic bit lengths tree"; r = Z_DATA_ERROR; } return r; } int zlib_inflate_trees_dynamic( uInt nl, /* number of literal/length codes */ uInt nd, /* number of distance codes */ uInt *c, /* that many (total) code lengths */ uInt *bl, /* literal desired/actual bit depth */ uInt *bd, /* distance desired/actual bit depth */ inflate_huft **tl, /* literal/length tree result */ inflate_huft **td, /* distance tree result */ inflate_huft *hp, /* space for trees */ z_streamp z /* for messages */ ) { int r; uInt hn = 0; /* hufts used in space */ uInt *v; /* work area for huft_build */ /* allocate work area */ v = WS(z)->tree_work_area_2; /* build literal/length tree */ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); if (r != Z_OK || *bl == 0) { if (r == Z_DATA_ERROR) z->msg = (char*)"oversubscribed literal/length tree"; else if (r != Z_MEM_ERROR) { z->msg = (char*)"incomplete literal/length tree"; r = Z_DATA_ERROR; } return r; } /* build distance tree */ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); if (r != Z_OK || (*bd == 0 && nl > 257)) { if (r == Z_DATA_ERROR) z->msg = (char*)"oversubscribed distance tree"; else if (r == Z_BUF_ERROR) { #ifdef PKZIP_BUG_WORKAROUND r = Z_OK; } #else z->msg = (char*)"incomplete distance tree"; r = Z_DATA_ERROR; } else if (r != Z_MEM_ERROR) { z->msg = (char*)"empty distance tree with lengths"; r = Z_DATA_ERROR; } return r; #endif } /* done */ return Z_OK; } int zlib_inflate_trees_fixed( uInt *bl, /* literal desired/actual bit depth */ uInt *bd, /* distance desired/actual bit depth */ inflate_huft **tl, /* literal/length tree result */ inflate_huft **td, /* distance tree result */ inflate_huft *hp, /* space for trees */ z_streamp z /* for memory allocation */ ) { int i; /* temporary variable */ unsigned l[288]; /* length list for huft_build */ uInt *v; /* work area for huft_build */ /* set up literal table */ for (i = 0; i < 144; i++) l[i] = 8; for (; i < 256; i++) l[i] = 9; for (; i < 280; i++) l[i] = 7; for (; i < 288; i++) /* make a complete, but wrong code set */ l[i] = 8; *bl = 9; v = WS(z)->tree_work_area_1; if ((i = huft_build(l, 288, 257, cplens, cplext, tl, bl, hp, &i, v)) != 0) return i; /* set up distance table */ for (i = 0; i < 30; i++) /* make an incomplete code set */ l[i] = 5; *bd = 5; if ((i = huft_build(l, 30, 0, cpdist, cpdext, td, bd, hp, &i, v)) > 1) return i; return Z_OK; } mkvmlinuz-36/boot/stdio.h0000644000000000000000000000037211773177134012501 0ustar #ifndef _PPC_BOOT_STDIO_H_ #define _PPC_BOOT_STDIO_H_ extern int printf(const char *fmt, ...); extern int sprintf(char *buf, const char *fmt, ...); extern int vsprintf(char *buf, const char *fmt, va_list args); #endif /* _PPC_BOOT_STDIO_H_ */ mkvmlinuz-36/boot/elf.h0000644000000000000000000000734011773177134012127 0ustar #ifndef _PPC_BOOT_ELF_H_ #define _PPC_BOOT_ELF_H_ /* 32-bit ELF base types. */ typedef unsigned int Elf32_Addr; typedef unsigned short Elf32_Half; typedef unsigned int Elf32_Off; typedef signed int Elf32_Sword; typedef unsigned int Elf32_Word; /* 64-bit ELF base types. */ typedef unsigned long long Elf64_Addr; typedef unsigned short Elf64_Half; typedef signed short Elf64_SHalf; typedef unsigned long long Elf64_Off; typedef signed int Elf64_Sword; typedef unsigned int Elf64_Word; typedef unsigned long long Elf64_Xword; typedef signed long long Elf64_Sxword; /* These constants are for the segment types stored in the image headers */ #define PT_NULL 0 #define PT_LOAD 1 #define PT_DYNAMIC 2 #define PT_INTERP 3 #define PT_NOTE 4 #define PT_SHLIB 5 #define PT_PHDR 6 #define PT_TLS 7 /* Thread local storage segment */ #define PT_LOOS 0x60000000 /* OS-specific */ #define PT_HIOS 0x6fffffff /* OS-specific */ #define PT_LOPROC 0x70000000 #define PT_HIPROC 0x7fffffff #define PT_GNU_EH_FRAME 0x6474e550 #define PT_GNU_STACK (PT_LOOS + 0x474e551) /* These constants define the different elf file types */ #define ET_NONE 0 #define ET_REL 1 #define ET_EXEC 2 #define ET_DYN 3 #define ET_CORE 4 #define ET_LOPROC 0xff00 #define ET_HIPROC 0xffff /* These constants define the various ELF target machines */ #define EM_NONE 0 #define EM_PPC 20 /* PowerPC */ #define EM_PPC64 21 /* PowerPC64 */ #define EI_NIDENT 16 typedef struct elf32_hdr { unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; Elf32_Half e_machine; Elf32_Word e_version; Elf32_Addr e_entry; /* Entry point */ Elf32_Off e_phoff; Elf32_Off e_shoff; Elf32_Word e_flags; Elf32_Half e_ehsize; Elf32_Half e_phentsize; Elf32_Half e_phnum; Elf32_Half e_shentsize; Elf32_Half e_shnum; Elf32_Half e_shstrndx; } Elf32_Ehdr; typedef struct elf64_hdr { unsigned char e_ident[16]; /* ELF "magic number" */ Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; Elf64_Addr e_entry; /* Entry point virtual address */ Elf64_Off e_phoff; /* Program header table file offset */ Elf64_Off e_shoff; /* Section header table file offset */ Elf64_Word e_flags; Elf64_Half e_ehsize; Elf64_Half e_phentsize; Elf64_Half e_phnum; Elf64_Half e_shentsize; Elf64_Half e_shnum; Elf64_Half e_shstrndx; } Elf64_Ehdr; /* These constants define the permissions on sections in the program header, p_flags. */ #define PF_R 0x4 #define PF_W 0x2 #define PF_X 0x1 typedef struct elf32_phdr { Elf32_Word p_type; Elf32_Off p_offset; Elf32_Addr p_vaddr; Elf32_Addr p_paddr; Elf32_Word p_filesz; Elf32_Word p_memsz; Elf32_Word p_flags; Elf32_Word p_align; } Elf32_Phdr; typedef struct elf64_phdr { Elf64_Word p_type; Elf64_Word p_flags; Elf64_Off p_offset; /* Segment file offset */ Elf64_Addr p_vaddr; /* Segment virtual address */ Elf64_Addr p_paddr; /* Segment physical address */ Elf64_Xword p_filesz; /* Segment size in file */ Elf64_Xword p_memsz; /* Segment size in memory */ Elf64_Xword p_align; /* Segment alignment, file & memory */ } Elf64_Phdr; #define EI_MAG0 0 /* e_ident[] indexes */ #define EI_MAG1 1 #define EI_MAG2 2 #define EI_MAG3 3 #define EI_CLASS 4 #define EI_DATA 5 #define EI_VERSION 6 #define EI_OSABI 7 #define EI_PAD 8 #define ELFMAG0 0x7f /* EI_MAG */ #define ELFMAG1 'E' #define ELFMAG2 'L' #define ELFMAG3 'F' #define ELFMAG "\177ELF" #define SELFMAG 4 #define ELFCLASSNONE 0 /* EI_CLASS */ #define ELFCLASS32 1 #define ELFCLASS64 2 #define ELFCLASSNUM 3 #define ELFDATANONE 0 /* e_ident[EI_DATA] */ #define ELFDATA2LSB 1 #define ELFDATA2MSB 2 #define EV_NONE 0 /* e_version, EI_VERSION */ #define EV_CURRENT 1 #define EV_NUM 2 #define ELFOSABI_NONE 0 #define ELFOSABI_LINUX 3 #endif /* _PPC_BOOT_ELF_H_ */ mkvmlinuz-36/boot/zlib.h0000644000000000000000000007344611773177134012333 0ustar /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.1.3, July 9th, 1998 Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). */ #ifndef _ZLIB_H #define _ZLIB_H #include "zconf.h" #define ZLIB_VERSION "1.1.3" /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough (for example if an input file is mmap'ed), or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input. */ struct internal_state; typedef struct z_stream_s { Byte *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total nb of input bytes read so far */ Byte *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total nb of bytes output so far */ char *msg; /* last error message, NULL if no error */ struct internal_state *state; /* not visible by applications */ void *workspace; /* memory allocated for this stream */ int data_type; /* best guess about the data type: ascii or binary */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream *z_streamp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use in the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ #define Z_PACKET_FLUSH 2 #define Z_SYNC_FLUSH 3 #define Z_FULL_FLUSH 4 #define Z_FINISH 5 /* Allowed flush values; see deflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative * values are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_ASCII 1 #define Z_UNKNOWN 2 /* Possible values of the data_type field */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ /* basic functions */ extern const char * zlib_zlibVersion (void); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ extern int zlib_deflate_workspacesize (void); /* Returns the number of bytes that needs to be allocated for a per- stream workspace. A pointer to this number of bytes should be returned in stream->workspace before calling zlib_deflateInit(). */ /* extern int deflateInit (z_streamp strm, int level); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to NULL, deflateInit updates them to use default allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ extern int zlib_deflate (z_streamp strm, int flush); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary (in interactive applications). Some output may be provided even if flush is not set. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade the compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space; if deflate returns with Z_OK, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used immediately after deflateInit if all the compression is to be done in a single step. In this case, avail_out must be at least 0.1% larger than avail_in plus 12 bytes. If deflate does not return Z_STREAM_END, then it must be called again as described above. deflate() sets strm->adler to the adler32 checksum of all input read so far (that is, total_in bytes). deflate() may update data_type if it can make a good guess about the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). */ extern int zlib_deflateEnd (z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ extern int zlib_inflate_workspacesize (void); /* Returns the number of bytes that needs to be allocated for a per- stream workspace. A pointer to this number of bytes should be returned in stream->workspace before calling zlib_inflateInit(). */ /* extern int zlib_inflateInit (z_streamp strm); Initializes the internal stream state for decompression. The fields next_in, avail_in, and workspace must be initialized before by the caller. If next_in is not NULL and avail_in is large enough (the exact value depends on the compression method), inflateInit determines the compression method from the zlib header and allocates all data structures accordingly; otherwise the allocation will be deferred to the first call of inflate. If zalloc and zfree are set to NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller. msg is set to null if there is no error message. inflateInit does not perform any decompression apart from reading the zlib header if present: this will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unchanged.) */ extern int zlib_inflate (z_streamp strm, int flush); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may some introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in is updated and processing will resume at this point for the next call of inflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much output as possible to the output buffer. The flushing behavior of inflate is not specified for values of the flush parameter other than Z_SYNC_FLUSH and Z_FINISH, but the current implementation actually flushes as much output as possible anyway. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all the uncompressed data. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The next operation on this stream must be inflateEnd to deallocate the decompression state. The use of Z_FINISH is never required, but can be used to inform inflate that a faster routine may be used for the single inflate() call. If a preset dictionary is needed at this point (see inflateSetDictionary below), inflate sets strm-adler to the adler32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed adler32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR case, the application may then call inflateSync to look for a good compression block. */ extern int zlib_inflateEnd (z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent. In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* Advanced functions */ /* The following functions are needed only in some special applications. */ /* extern int deflateInit2 (z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy); This is another version of deflateInit with more compression options. The fields next_in, zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is slow and reduces compression ratio; memLevel=9 uses maximum memory for optimal speed. The default value is 8. See zconf.h for total memory usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no string match). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid method). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ #if 0 extern int zlib_deflateSetDictionary (z_streamp strm, const Byte *dictionary, uInt dictLength); #endif /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. This function must be called immediately after deflateInit, deflateInit2 or deflateReset, before any call of deflate. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size in deflate or deflate2. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. Upon return of this function, strm->adler is set to the Adler32 value of the dictionary; the decompressor may later use this value to determine which dictionary has been used by the compressor. (The Adler32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (such as NULL dictionary) or the stream state is inconsistent (for example if deflate has already been called for this stream or if the compression method is bsort). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ #if 0 extern int zlib_deflateCopy (z_streamp dest, z_streamp source); #endif /* Sets the destination stream as a complete copy of the source stream. This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd. Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory. deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being NULL). msg is left unchanged in both source and destination. */ extern int zlib_deflateReset (z_streamp strm); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. The stream will keep the same compression level and any other attributes that may have been set by deflateInit2. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). */ static inline unsigned long deflateBound(unsigned long s) { return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11; } #if 0 extern int zlib_deflateParams (z_streamp strm, int level, int strategy); #endif /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2. This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression level is changed, the input available so far is compressed with the old level (and may be flushed); the new level will take effect only at the next call of deflate(). Before the call of deflateParams, the stream state must be set as for a call of deflate(), since the currently available input may have to be compressed and flushed. In particular, strm->avail_out must be non-zero. deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if strm->avail_out was zero. */ /* extern int inflateInit2 (z_streamp strm, int windowBits); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative memLevel). msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from reading the zlib header if present: this will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unchanged.) */ extern int zlib_inflateSetDictionary (z_streamp strm, const Byte *dictionary, uInt dictLength); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate if this call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the Adler32 value returned by this call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (such as NULL dictionary) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect Adler32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ #if 0 extern int zlib_inflateSync (z_streamp strm); #endif /* Skips invalid compressed data until a full flush point (see above the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ extern int zlib_inflateReset (z_streamp strm); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). */ extern int zlib_inflateIncomp (z_stream *strm); /* This function adds the data at next_in (avail_in bytes) to the output history without performing any output. There must be no pending output, and the decompressor must be expecting to see the start of a block. Calling this function is equivalent to decompressing a stored block containing the data at next_in (except that the data is not output). */ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ extern int zlib_deflateInit_ (z_streamp strm, int level, const char *version, int stream_size); extern int zlib_inflateInit_ (z_streamp strm, const char *version, int stream_size); extern int zlib_deflateInit2_ (z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size); extern int zlib_inflateInit2_ (z_streamp strm, int windowBits, const char *version, int stream_size); #define zlib_deflateInit(strm, level) \ zlib_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) #define zlib_inflateInit(strm) \ zlib_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) #define zlib_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ zlib_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, sizeof(z_stream)) #define zlib_inflateInit2(strm, windowBits) \ zlib_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) #if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) struct internal_state {int dummy;}; /* hack for buggy compilers */ #endif extern const char * zlib_zError (int err); #if 0 extern int zlib_inflateSyncPoint (z_streamp z); #endif extern const uLong * zlib_get_crc_table (void); #endif /* _ZLIB_H */ mkvmlinuz-36/boot/rs6000.h0000644000000000000000000001577511773177134012326 0ustar /* IBM RS/6000 "XCOFF" file definitions for BFD. Copyright (C) 1990, 1991 Free Software Foundation, Inc. FIXME: Can someone provide a transliteration of this name into ASCII? Using the following chars caused a compiler warning on HIUX (so I replaced them with octal escapes), and isn't useful without an understanding of what character set it is. Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM and John Gilmore of Cygnus Support. */ /********************** FILE HEADER **********************/ struct external_filehdr { char f_magic[2]; /* magic number */ char f_nscns[2]; /* number of sections */ char f_timdat[4]; /* time & date stamp */ char f_symptr[4]; /* file pointer to symtab */ char f_nsyms[4]; /* number of symtab entries */ char f_opthdr[2]; /* sizeof(optional hdr) */ char f_flags[2]; /* flags */ }; /* IBM RS/6000 */ #define U802WRMAGIC 0730 /* writeable text segments **chh** */ #define U802ROMAGIC 0735 /* readonly sharable text segments */ #define U802TOCMAGIC 0737 /* readonly text segments and TOC */ #define BADMAG(x) \ ((x).f_magic != U802ROMAGIC && (x).f_magic != U802WRMAGIC && \ (x).f_magic != U802TOCMAGIC) #define FILHDR struct external_filehdr #define FILHSZ 20 /********************** AOUT "OPTIONAL HEADER" **********************/ typedef struct { unsigned char magic[2]; /* type of file */ unsigned char vstamp[2]; /* version stamp */ unsigned char tsize[4]; /* text size in bytes, padded to FW bdry */ unsigned char dsize[4]; /* initialized data " " */ unsigned char bsize[4]; /* uninitialized data " " */ unsigned char entry[4]; /* entry pt. */ unsigned char text_start[4]; /* base of text used for this file */ unsigned char data_start[4]; /* base of data used for this file */ unsigned char o_toc[4]; /* address of TOC */ unsigned char o_snentry[2]; /* section number of entry point */ unsigned char o_sntext[2]; /* section number of .text section */ unsigned char o_sndata[2]; /* section number of .data section */ unsigned char o_sntoc[2]; /* section number of TOC */ unsigned char o_snloader[2]; /* section number of .loader section */ unsigned char o_snbss[2]; /* section number of .bss section */ unsigned char o_algntext[2]; /* .text alignment */ unsigned char o_algndata[2]; /* .data alignment */ unsigned char o_modtype[2]; /* module type (??) */ unsigned char o_cputype[2]; /* cpu type */ unsigned char o_maxstack[4]; /* max stack size (??) */ unsigned char o_maxdata[4]; /* max data size (??) */ unsigned char o_resv2[12]; /* reserved */ } AOUTHDR; #define AOUTSZ 72 #define SMALL_AOUTSZ (28) #define AOUTHDRSZ 72 #define RS6K_AOUTHDR_OMAGIC 0x0107 /* old: text & data writeable */ #define RS6K_AOUTHDR_NMAGIC 0x0108 /* new: text r/o, data r/w */ #define RS6K_AOUTHDR_ZMAGIC 0x010B /* paged: text r/o, both page-aligned */ /********************** SECTION HEADER **********************/ struct external_scnhdr { char s_name[8]; /* section name */ char s_paddr[4]; /* physical address, aliased s_nlib */ char s_vaddr[4]; /* virtual address */ char s_size[4]; /* section size */ char s_scnptr[4]; /* file ptr to raw data for section */ char s_relptr[4]; /* file ptr to relocation */ char s_lnnoptr[4]; /* file ptr to line numbers */ char s_nreloc[2]; /* number of relocation entries */ char s_nlnno[2]; /* number of line number entries*/ char s_flags[4]; /* flags */ }; /* * names of "special" sections */ #define _TEXT ".text" #define _DATA ".data" #define _BSS ".bss" #define _PAD ".pad" #define _LOADER ".loader" #define SCNHDR struct external_scnhdr #define SCNHSZ 40 /* XCOFF uses a special .loader section with type STYP_LOADER. */ #define STYP_LOADER 0x1000 /* XCOFF uses a special .debug section with type STYP_DEBUG. */ #define STYP_DEBUG 0x2000 /* XCOFF handles line number or relocation overflow by creating another section header with STYP_OVRFLO set. */ #define STYP_OVRFLO 0x8000 /********************** LINE NUMBERS **********************/ /* 1 line number entry for every "breakpointable" source line in a section. * Line numbers are grouped on a per function basis; first entry in a function * grouping will have l_lnno = 0 and in place of physical address will be the * symbol table index of the function name. */ struct external_lineno { union { char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ char l_paddr[4]; /* (physical) address of line number */ } l_addr; char l_lnno[2]; /* line number */ }; #define LINENO struct external_lineno #define LINESZ 6 /********************** SYMBOLS **********************/ #define E_SYMNMLEN 8 /* # characters in a symbol name */ #define E_FILNMLEN 14 /* # characters in a file name */ #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ struct external_syment { union { char e_name[E_SYMNMLEN]; struct { char e_zeroes[4]; char e_offset[4]; } e; } e; char e_value[4]; char e_scnum[2]; char e_type[2]; char e_sclass[1]; char e_numaux[1]; }; #define N_BTMASK (017) #define N_TMASK (060) #define N_BTSHFT (4) #define N_TSHIFT (2) union external_auxent { struct { char x_tagndx[4]; /* str, un, or enum tag indx */ union { struct { char x_lnno[2]; /* declaration line number */ char x_size[2]; /* str/union/array size */ } x_lnsz; char x_fsize[4]; /* size of function */ } x_misc; union { struct { /* if ISFCN, tag, or .bb */ char x_lnnoptr[4]; /* ptr to fcn line # */ char x_endndx[4]; /* entry ndx past block end */ } x_fcn; struct { /* if ISARY, up to 4 dimen. */ char x_dimen[E_DIMNUM][2]; } x_ary; } x_fcnary; char x_tvndx[2]; /* tv index */ } x_sym; union { char x_fname[E_FILNMLEN]; struct { char x_zeroes[4]; char x_offset[4]; } x_n; } x_file; struct { char x_scnlen[4]; /* section length */ char x_nreloc[2]; /* # relocation entries */ char x_nlinno[2]; /* # line numbers */ } x_scn; struct { char x_tvfill[4]; /* tv fill value */ char x_tvlen[2]; /* length of .tv */ char x_tvran[2][2]; /* tv range */ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ struct { unsigned char x_scnlen[4]; unsigned char x_parmhash[4]; unsigned char x_snhash[2]; unsigned char x_smtyp[1]; unsigned char x_smclas[1]; unsigned char x_stab[4]; unsigned char x_snstab[2]; } x_csect; }; #define SYMENT struct external_syment #define SYMESZ 18 #define AUXENT union external_auxent #define AUXESZ 18 #define DBXMASK 0x80 /* for dbx storage mask */ #define SYMNAME_IN_DEBUG(symptr) ((symptr)->n_sclass & DBXMASK) /********************** RELOCATION DIRECTIVES **********************/ struct external_reloc { char r_vaddr[4]; char r_symndx[4]; char r_size[1]; char r_type[1]; }; #define RELOC struct external_reloc #define RELSZ 10 #define DEFAULT_DATA_SECTION_ALIGNMENT 4 #define DEFAULT_BSS_SECTION_ALIGNMENT 4 #define DEFAULT_TEXT_SECTION_ALIGNMENT 4 /* For new sections we havn't heard of before */ #define DEFAULT_SECTION_ALIGNMENT 4 mkvmlinuz-36/boot/crt0.S0000644000000000000000000000253611773177134012206 0ustar /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * NOTE: this code runs in 32 bit mode and is packaged as ELF32. */ #include "ppc_asm.h" .text /* a procedure descriptor used when booting this as a COFF file */ _zimage_start_opd: .long _zimage_start, 0, 0, 0 .globl _zimage_start _zimage_start: /* Work out the offset between the address we were linked at and the address where we're running. */ bl 1f 1: mflr r0 lis r9,1b@ha addi r9,r9,1b@l subf. r0,r9,r0 beq 3f /* if running at same address as linked */ /* The .got2 section contains a list of addresses, so add the address offset onto each entry. */ lis r9,__got2_start@ha addi r9,r9,__got2_start@l lis r8,__got2_end@ha addi r8,r8,__got2_end@l subf. r8,r9,r8 beq 3f srwi. r8,r8,2 mtctr r8 add r9,r0,r9 2: lwz r8,0(r9) add r8,r8,r0 stw r8,0(r9) addi r9,r9,4 bdnz 2b /* Do a cache flush for our text, in case OF didn't */ 3: lis r9,_start@ha addi r9,r9,_start@l add r9,r0,r9 lis r8,_etext@ha addi r8,r8,_etext@l add r8,r0,r8 4: dcbf r0,r9 icbi r0,r9 addi r9,r9,0x20 cmplw cr0,r9,r8 blt 4b sync isync mr r6,r1 b start mkvmlinuz-36/boot/inflate.c0000644000000000000000000001361611773177134013001 0ustar /* inflate.c -- zlib interface to inflate modules * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "infblock.h" #include "infutil.h" int zlib_inflate_workspacesize(void) { return sizeof(struct inflate_workspace); } int zlib_inflateReset( z_streamp z ) { if (z == NULL || z->state == NULL || z->workspace == NULL) return Z_STREAM_ERROR; z->total_in = z->total_out = 0; z->msg = NULL; z->state->mode = z->state->nowrap ? BLOCKS : METHOD; zlib_inflate_blocks_reset(z->state->blocks, z, NULL); return Z_OK; } int zlib_inflateEnd( z_streamp z ) { if (z == NULL || z->state == NULL || z->workspace == NULL) return Z_STREAM_ERROR; if (z->state->blocks != NULL) zlib_inflate_blocks_free(z->state->blocks, z); z->state = NULL; return Z_OK; } int zlib_inflateInit2_( z_streamp z, int w, const char *version, int stream_size ) { if (version == NULL || version[0] != ZLIB_VERSION[0] || stream_size != sizeof(z_stream) || z->workspace == NULL) return Z_VERSION_ERROR; /* initialize state */ z->msg = NULL; z->state = &WS(z)->internal_state; z->state->blocks = NULL; /* handle undocumented nowrap option (no zlib header or check) */ z->state->nowrap = 0; if (w < 0) { w = - w; z->state->nowrap = 1; } /* set window size */ if (w < 8 || w > 15) { zlib_inflateEnd(z); return Z_STREAM_ERROR; } z->state->wbits = (uInt)w; /* create inflate_blocks state */ if ((z->state->blocks = zlib_inflate_blocks_new(z, z->state->nowrap ? NULL : zlib_adler32, (uInt)1 << w)) == NULL) { zlib_inflateEnd(z); return Z_MEM_ERROR; } /* reset state */ zlib_inflateReset(z); return Z_OK; } /* * At the end of a Deflate-compressed PPP packet, we expect to have seen * a `stored' block type value but not the (zero) length bytes. */ static int zlib_inflate_packet_flush(inflate_blocks_statef *s) { if (s->mode != LENS) return Z_DATA_ERROR; s->mode = TYPE; return Z_OK; } int zlib_inflateInit_( z_streamp z, const char *version, int stream_size ) { return zlib_inflateInit2_(z, DEF_WBITS, version, stream_size); } #undef NEEDBYTE #undef NEXTBYTE #define NEEDBYTE {if(z->avail_in==0)goto empty;r=trv;} #define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) int zlib_inflate( z_streamp z, int f ) { int r, trv; uInt b; if (z == NULL || z->state == NULL || z->next_in == NULL) return Z_STREAM_ERROR; trv = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; r = Z_BUF_ERROR; while (1) switch (z->state->mode) { case METHOD: NEEDBYTE if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED) { z->state->mode = I_BAD; z->msg = (char*)"unknown compression method"; z->state->sub.marker = 5; /* can't try inflateSync */ break; } if ((z->state->sub.method >> 4) + 8 > z->state->wbits) { z->state->mode = I_BAD; z->msg = (char*)"invalid window size"; z->state->sub.marker = 5; /* can't try inflateSync */ break; } z->state->mode = FLAG; case FLAG: NEEDBYTE b = NEXTBYTE; if (((z->state->sub.method << 8) + b) % 31) { z->state->mode = I_BAD; z->msg = (char*)"incorrect header check"; z->state->sub.marker = 5; /* can't try inflateSync */ break; } if (!(b & PRESET_DICT)) { z->state->mode = BLOCKS; break; } z->state->mode = DICT4; case DICT4: NEEDBYTE z->state->sub.check.need = (uLong)NEXTBYTE << 24; z->state->mode = DICT3; case DICT3: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE << 16; z->state->mode = DICT2; case DICT2: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE << 8; z->state->mode = DICT1; case DICT1: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE; z->adler = z->state->sub.check.need; z->state->mode = DICT0; return Z_NEED_DICT; case DICT0: z->state->mode = I_BAD; z->msg = (char*)"need dictionary"; z->state->sub.marker = 0; /* can try inflateSync */ return Z_STREAM_ERROR; case BLOCKS: r = zlib_inflate_blocks(z->state->blocks, z, r); if (f == Z_PACKET_FLUSH && z->avail_in == 0 && z->avail_out != 0) r = zlib_inflate_packet_flush(z->state->blocks); if (r == Z_DATA_ERROR) { z->state->mode = I_BAD; z->state->sub.marker = 0; /* can try inflateSync */ break; } if (r == Z_OK) r = trv; if (r != Z_STREAM_END) return r; r = trv; zlib_inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); if (z->state->nowrap) { z->state->mode = I_DONE; break; } z->state->mode = CHECK4; case CHECK4: NEEDBYTE z->state->sub.check.need = (uLong)NEXTBYTE << 24; z->state->mode = CHECK3; case CHECK3: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE << 16; z->state->mode = CHECK2; case CHECK2: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE << 8; z->state->mode = CHECK1; case CHECK1: NEEDBYTE z->state->sub.check.need += (uLong)NEXTBYTE; if (z->state->sub.check.was != z->state->sub.check.need) { z->state->mode = I_BAD; z->msg = (char*)"incorrect data check"; z->state->sub.marker = 5; /* can't try inflateSync */ break; } z->state->mode = I_DONE; case I_DONE: return Z_STREAM_END; case I_BAD: return Z_DATA_ERROR; default: return Z_STREAM_ERROR; } empty: if (f != Z_PACKET_FLUSH) return r; z->state->mode = I_BAD; z->msg = (char *)"need more for packet flush"; z->state->sub.marker = 0; /* can try inflateSync */ return Z_DATA_ERROR; } mkvmlinuz-36/boot/infutil.c0000644000000000000000000000364611773177134013033 0ustar /* inflate_util.c -- data and routines common to blocks and codes * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "infblock.h" #include "inftrees.h" #include "infcodes.h" #include "infutil.h" struct inflate_codes_state; /* And'ing with mask[n] masks the lower n bits */ uInt zlib_inflate_mask[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff }; /* copy as much as possible from the sliding window to the output area */ int zlib_inflate_flush( inflate_blocks_statef *s, z_streamp z, int r ) { uInt n; Byte *p; Byte *q; /* local copies of source and destination pointers */ p = z->next_out; q = s->read; /* compute number of bytes to copy as far as end of window */ n = (uInt)((q <= s->write ? s->write : s->end) - q); if (n > z->avail_out) n = z->avail_out; if (n && r == Z_BUF_ERROR) r = Z_OK; /* update counters */ z->avail_out -= n; z->total_out += n; /* update check information */ if (s->checkfn != NULL) z->adler = s->check = (*s->checkfn)(s->check, q, n); /* copy as far as end of window */ memcpy(p, q, n); p += n; q += n; /* see if more to copy at beginning of window */ if (q == s->end) { /* wrap pointers */ q = s->window; if (s->write == s->end) s->write = s->window; /* compute bytes to copy */ n = (uInt)(s->write - q); if (n > z->avail_out) n = z->avail_out; if (n && r == Z_BUF_ERROR) r = Z_OK; /* update counters */ z->avail_out -= n; z->total_out += n; /* update check information */ if (s->checkfn != NULL) z->adler = s->check = (*s->checkfn)(s->check, q, n); /* copy */ memcpy(p, q, n); p += n; q += n; } /* update pointers */ z->next_out = p; s->read = q; /* done */ return r; } mkvmlinuz-36/boot/Makefile0000644000000000000000000000204011773466230012636 0ustar GCC := gcc -m32 CFLAGS := -Wall -Wstrict-prototypes -O2 -g -fomit-frame-pointer -fno-builtin \ -nostdinc -isystem $(shell $(GCC) -print-file-name=include) -fPIC \ -fno-stack-protector AFLAGS := -D__ASSEMBLY__ $(CFLAGS) -traditional -nostdinc FLAGS := $(shell dpkg-buildflags --get CPPFLAGS) FLAGS += $(shell dpkg-buildflags --get CFLAGS) FLAGS += $(shell dpkg-buildflags --get LDFLAGS) src := crt0.S string.S prom.c stdio.c main.c div64.S src += infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c src += mkvmlinuz-kernel-initrd.c mkvmlinuz-kernel-vmlinux.strip.c obj := $(addsuffix .o, $(basename $(src))) progs := addnote all: $(obj) $(progs) $(patsubst %.c,%.o, $(filter %.c, $(src))): %.o: %.c $(GCC) $(CFLAGS) -c -o $@ $< $(patsubst %.S,%.o, $(filter %.S, $(src))): %.o: %.S $(GCC) $(AFLAGS) -c -o $@ $< mkvmlinuz-kernel-initrd.c mkvmlinuz-kernel-vmlinux.strip.c: touch $@ addnote: addnote.c $(GCC) $(FLAGS) -o addnote addnote.c clean: rm -f $(obj) mkvmlinuz-kernel-initrd.c mkvmlinuz-kernel-vmlinux.strip.c $(progs) mkvmlinuz-36/output0000644000000000000000000000176311773177134011533 0ustar # This is a shell script fragment that is sourced by mkvmlinuz(8) in # order to determine the output file for the compressed kernel image. # if the output file is not specified on the command line. Therefore, # it should set the shell variable "output" at some point. # When this fragment is sourced, the following shell variables are set # and may be used to construct the filename: # # arch - PowerPC sub-architecture # kernel - path to kernel image file in uncompressed ELF format # sysmap - path to System.map file # initrd - path to ramdisk (initrd) image file # objdir - path to directory with additional object files # release - kernel release number # Example: output=/boot/vmlinuz-$release # Simple example: #output=/vmlinuz # Sophisticated example: #if test -z "$initrd"; then #output=/boot/vmlinuz-$release.$arch #else #output=/boot/vmlinuz-initrd-$release.$arch #fi # Let's define also the name of the symlink here. # An empty $linkname means no symlink created. linkname=/boot/vmlinuz mkvmlinuz-36/debian/0000755000000000000000000000000011776017037011461 5ustar mkvmlinuz-36/debian/kernel-image/0000755000000000000000000000000011773177131014020 5ustar mkvmlinuz-36/debian/kernel-image/postinst0000755000000000000000000000025411773177131015632 0ustar #!/bin/sh set -e . /usr/share/debconf/confmodule db_get mkvmlinuz/bootloaders bootloader="$RET" if [ "$bootloader" = mkvmlinuz ]; then /usr/sbin/mkvmlinuz $1 $2 fi mkvmlinuz-36/debian/kernel-image/postrm0000755000000000000000000000051411773177131015272 0ustar #!/bin/sh set -e . /usr/share/debconf/confmodule db_get mkvmlinuz/bootloaders bootloader="$RET" # Let's erase the kernel created by mkvmlinuz too. if [ "$bootloader" = mkvmlinuz ]; then vmlinuz=`echo $2 | sed -e 's/vmlinux/vmlinuz/'` rm -f $vmlinuz if [ -e "$vmlinuz.old" ]; then mv $vmlinuz.old $vmlinuz fi fi mkvmlinuz-36/debian/copyright0000644000000000000000000000605111773463510013414 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Files: * Copyright: 2004 Jens Schmalzing 2005, 2006 Sven Luther 2007, 2008 Aurélien GÉRÔME 2012 Milan Kupcevic License: GPL-2+ Files: debian/po/* Copyright: 2006 Holger Wansing 2006 Cyril Brulebois 2006 Jacobo Tarrio 2006 Felipe Augusto van de Wiel (faw) 2006 Rui Branco 2006 Eddy Petrișor 2006 Yuri Kozlov 2006 Daniel Nylander 2006 Clytie Siddall 2007 Noritada Kobayashi 2007 Bart Cornelis 2008 Software in the Public Interest 2008 Luca Monducci 2008 Łukasz Paździora 2008 Francisco Javier Cuadrado 2008 Piarres Beobide 2008 Esko Arajärvi 2010 Joe Hansen 2012 Mahyuddin Susanto License: GPL-2+ Files: boot/* Copyright: 1990, 1991 Free Software Foundation, Inc. 1997, 2000, 2002 Paul Mackerras, IBM Corp. 1995 Linus Torvalds 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan 2001 PPC64 Team, IBM Corp Comment: Files originally obtained from arch/powerpc/boot of Linux kernel 2.6.17 License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Files: boot/inf* boot/z* Copyright: 1995-1998 Mark Adler 1995-1998 Jean-loup Gailly License: Zlib This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. . Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: . 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. License: GPL-2+ On Debian systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. mkvmlinuz-36/debian/changelog0000644000000000000000000002456211774665123013347 0ustar mkvmlinuz (36) unstable; urgency=low * New maintainer. (Closes: #677760) * Remove Sven Luther and Aurélien GÉRÔME from Uploaders, many thanks for your contributions. * Add myself to Uploaders. * Conform to Debian Policy standards version 3.9.3 * Switch to dpkg-source 3.0 (native) format. * Add build-arch and buld-indep targets to debian/rules. * Bump debhelper compatibility to 8, use dh_prep. * Add ${misc:Depends} to Depends field. * Revise debian/copyright. * Switch package section from devel to utils. * Use hardening compiler flags * Compress initrd with xz to significantly reduce vmlinuz size. (Closes: #549681) * Add -fno-stack-protector, thanks to Colin Watson. (Closes: #509007) * Debconf translations: - Add Danish, thanks to Joe Hansen. (Closes: #600132) - Add Indonesian, thanks to Mahyuddin Susanto. (Closes: #658443) * Kill lintian warnings. - Spelling error in mkvmlinuz manpage - Fix lintian overrides -- Milan Kupcevic Tue, 03 Jul 2012 17:55:04 -0400 mkvmlinuz (35) unstable; urgency=low * Add debconf translations: + Spanish, thanks to Francisco Javier Cuadrado. (Closes: #497530) + Polish, thanks to Łukasz Paździora. (Closes: #505866) * Bump Standards-Version to 3.8.0. -- Aurélien GÉRÔME Wed, 10 Dec 2008 12:24:06 +0100 mkvmlinuz (34) unstable; urgency=low * Add debconf translations: + Dutch, thanks to Bart Cornelis. (Closes: #415493) + Italian, thanks to Luca Monducci. (Closes: #460131) + Finnish, thanks to Esko Arajärvi. (Closes: #475638) + Galician, thanks to Jacobo Tarrio. (Closes: #475759) + Basque, thanks to Piarres Beobide. (Closes: #476073) * Change my email address in the Uploaders field. * Bump Standards-Version to 3.7.3. * Use the Vcs-Svn field. * Add the Vcs-Browser. * Add ppc64 architecture support, thanks to Andreas Jochens. (Closes: #476805) * Fix lintian error "missing-dependency-on-libc needed by ./usr/lib/mkvmlinuz/addnote". + Add dh_shlibdeps to debian/rules. + Add ${shlibs:Depends} to debian/control. -- Aurélien GÉRÔME Thu, 24 Apr 2008 16:51:55 +0200 mkvmlinuz (33) unstable; urgency=low * Add Japanese translation thanks to Kobayashi Noritada. (Closes: #401384) -- Aurélien GÉRÔME Mon, 5 Mar 2007 18:05:01 +0100 mkvmlinuz (32) unstable; urgency=medium * Fix failure on PReP induced by fixing #381787. (Closes: #408385) * Add checks for possible silent failures. -- Aurélien GÉRÔME Thu, 25 Jan 2007 16:33:33 +0100 mkvmlinuz (31) unstable; urgency=medium * Fix long description thanks to Steve Langasek. -- Aurélien GÉRÔME Mon, 22 Jan 2007 10:55:02 +0100 mkvmlinuz (30) unstable; urgency=low * Fix arithmetic syntax error. (Closes: #374185) * Add myself to the Uploaders field. * Bump Standards-Version to 3.7.2. * Fix some expressions in long description. * Fix lintian errors and warnings. + Add po-debconf to the Build-Depends field. + Depend explicitly on bash (>= 3) to avoid a simple dependency on an essential package. + Add dh_strip in debian/rules, because a binary was left unstripped. + Remove debian/conffiles as debhelper (>= 4) adds conffiles under /etc automatically. + Add the #DEBHELPER# token to debian/postinst. + Move debian/kernel-image.postinst to debian/kernel-image/postinst and debian/kernel-image.postrm to debian/kernel-image/postrm, because it prevents lintian from believing they are maintainer scripts for the packaging system. + Add debian/lintian.overrides for debconf-is-not-a-registry, because we need a debconf setting from mkvmlinuz in kernel scripts. * Fix silent failure by adding some checks. (Closes: #381787) * Add the XS-Vcs-Svn field. * Add Portuguese translation thanks to Rui Branco. (Closes: #401384) * Add debugging symbols during build process. -- Aurélien GÉRÔME Sun, 14 Jan 2007 14:41:03 +0100 mkvmlinuz (29) unstable; urgency=high * Added Efika support. -- Sven Luther Sat, 16 Dec 2006 02:18:19 +0100 mkvmlinuz (28) unstable; urgency=low * Added support for 2.6.19 kernels. * Added portuguese translation. (Closes: #401384) -- Sven Luther Tue, 5 Dec 2006 17:20:48 +0100 mkvmlinuz (27) unstable; urgency=low * Corrected typo. (Closes: #399768) -- Sven Luther Tue, 21 Nov 2006 22:43:28 +0100 mkvmlinuz (26) unstable; urgency=low * Fixed -prep support. -- Sven Luther Sat, 18 Nov 2006 21:41:01 +0100 mkvmlinuz (25) unstable; urgency=low [ Christian Perrier ] * Switch to po-debconf for debconf templates. (Closes: #298972) * Debconf translations: - Add Swedish (updated during the l10n update campaign) (Closes: #331020) - Add Vietnamese. Sent during the l10n update campaign - Add Czech. Sent during the l10n update campaign - Add Romanian. Sent during the l10n update campaign - Add French. Sent during the l10n update campaign - Add German. Sent during the l10n update campaign - Add Russian. Sent during the l10n update campaign - Add Brazilian Portuguese. Sent during the l10n update campaign -- Sven Luther Thu, 9 Nov 2006 22:13:12 +0100 mkvmlinuz (24) unstable; urgency=low * Adapted uncompressor object list to 2.6.18. * Re-enabled -prep support. -- Sven Luther Sat, 23 Sep 2006 21:51:52 +0200 mkvmlinuz (23) unstable; urgency=low * Fallback arch/powerpc/boot object files for chrp kernels without mkvmlinuz support. This uses the 2.6.16+ code, but should work with any 2.6 kernel. * Now supports the creation of a /boot/vmlinuz symlink to the last created vmlinuz kernel. (Closes: #260219) * Now uses /bin/bash as interpeter, as we use bashisms. (Closes: #374185) -- Sven Luther Tue, 4 Jul 2006 22:04:50 +0200 mkvmlinuz (22) unstable; urgency=high * Fixed broken 2.6.16+ support. -- Sven Luther Wed, 31 May 2006 17:40:37 +0200 mkvmlinuz (21) unstable; urgency=low * Fixed commented out cleanup call, now doesn't fill /tmp with cruft anymore. Thanks to Colin Watson for noticing this. (Closes: #365978) -- Sven Luther Mon, 8 May 2006 19:32:16 +0000 mkvmlinuz (20) unstable; urgency=low * Ported to 2.6.16 powerpc kernels. * Added powerpc64 support. -- Sven Luther Thu, 20 Apr 2006 18:42:41 +0000 mkvmlinuz (19) unstable; urgency=low * Added debconf dependency. (Closes: #342372) -- Sven Luther Fri, 6 Jan 2006 16:25:10 +0100 mkvmlinuz (18) unstable; urgency=low * Now look at $STEM-image, linux-image and then only kernel-image for the objdir. -- Sven Luther Sat, 31 Dec 2005 18:25:19 +0000 mkvmlinuz (17) unstable; urgency=low * Fixed lame typo in version 16 :/ -- Sven Luther Sat, 26 Nov 2005 14:07:45 +0000 mkvmlinuz (16) unstable; urgency=low * Added -l option, enabling the caller to specify the elf link address. -- Sven Luther Mon, 7 Nov 2005 14:47:22 +0000 mkvmlinuz (15) unstable; urgency=high * Generates a striped compressed vmlinuz on apus and miboot. -- Sven Luther Mon, 10 Oct 2005 10:01:33 +0200 mkvmlinuz (14) unstable; urgency=low * Now autodetects if the initrd is gzip compressed. This will allow to do the right thing for initrds (not compressed by default) and initramfs (compressed by default), since the kernel was none too happy with doubly compressed initramfs initrds :) -- Sven Luther Fri, 16 Sep 2005 10:22:09 +0200 mkvmlinuz (13) unstable; urgency=high * Added debconf magic to kernel-image postinst/postrm hooks. -- Sven Luther Fri, 25 Feb 2005 14:47:52 +0100 mkvmlinuz (12) unstable; urgency=high * Fixed PReP support for recent kernel versions (including vanilla 2.6.9-rc2 and Debian revision 2.6.8-7). -- Jens Schmalzing Mon, 4 Oct 2004 22:37:02 +0200 mkvmlinuz (11) unstable; urgency=high * Fixed NewWorld PowerMac support. -- Jens Schmalzing Sun, 3 Oct 2004 09:59:41 +0200 mkvmlinuz (10) unstable; urgency=low * Fixed miBoot support. * Changed the internal name for NewWorld PowerMacs from newworld to the slightly inaccurate pmac, since this is what the kernel Makefiles use. * Documented the possible subarchitectures in the manpage. -- Jens Schmalzing Sat, 11 Sep 2004 21:09:55 +0200 mkvmlinuz (9) unstable; urgency=low * Added PPCBug support (closes: #269146). * Added miBoot support. * Made quiet operation the default, previous default is now activated by asking for verbose operation. * Added an option to prevent guessing the name of an initrd. -- Jens Schmalzing Tue, 31 Aug 2004 13:51:15 +0200 mkvmlinuz (8) unstable; urgency=low * Fixed spurious output when not using an initrd. * Discard command output if verbose flag is not set (closes: Bug#263452). -- Jens Schmalzing Wed, 4 Aug 2004 17:33:19 +0200 mkvmlinuz (7) unstable; urgency=low * Set a default output file location in /etc/mkvmlinuz/output. * Added PReP support (closes: #252427, #256074). -- Jens Schmalzing Thu, 8 Jul 2004 09:23:38 +0200 mkvmlinuz (6) unstable; urgency=low * Added an option to prevent compressing an already compressed ramdisk image (closes: Bug#252489). -- Jens Schmalzing Tue, 15 Jun 2004 20:01:23 +0200 mkvmlinuz (5) unstable; urgency=low * Fixed a typo (closes: Bug#252036). -- Jens Schmalzing Tue, 1 Jun 2004 10:38:00 +0200 mkvmlinuz (4) unstable; urgency=low * Fixed CHRP support by adding the directory to the addnote call (closes: Bug#251043). -- Jens Schmalzing Wed, 26 May 2004 21:36:39 +0200 mkvmlinuz (3) unstable; urgency=low * Added Pegasos support. -- Jens Schmalzing Fri, 21 May 2004 08:42:45 +0200 mkvmlinuz (2) unstable; urgency=low * Added a missing option to the getopts call. -- Jens Schmalzing Thu, 13 May 2004 21:55:37 +0200 mkvmlinuz (1) unstable; urgency=low * Initial Release. -- Jens Schmalzing Fri, 23 Apr 2004 10:19:35 +0200 mkvmlinuz-36/debian/postinst0000644000000000000000000000010011773177132013256 0ustar #!/bin/sh set -e . /usr/share/debconf/confmodule #DEBHELPER# mkvmlinuz-36/debian/source/0000755000000000000000000000000011773444455012766 5ustar mkvmlinuz-36/debian/source/format0000644000000000000000000000001511773444444014173 0ustar 3.0 (native) mkvmlinuz-36/debian/control0000644000000000000000000000216611773471240013066 0ustar Source: mkvmlinuz Section: utils Priority: optional Maintainer: Debian Kernel Team Uploaders: Milan Kupcevic Build-Depends: docbook-to-man, debhelper (>= 8.0.0), po-debconf, gcc-multilib [ppc64] Standards-Version: 3.9.3 Vcs-Svn: svn://svn.debian.org/svn/kernel/dists/trunk/utils/mkvmlinuz/ Vcs-Browser: http://svn.debian.org/wsvn/kernel/dists/trunk/utils/mkvmlinuz/ Package: mkvmlinuz Architecture: powerpc ppc64 Depends: bash (>= 3), binutils, debconf | debconf-2.0, ${shlibs:Depends}, ${misc:Depends} Description: create a kernel to boot a PowerPC machine from Open Firmware This little program takes a PowerPC Linux kernel as an uncompressed ELF image file (usually called vmlinux or such) and adds boot code and possibly a ramdisk to create a compressed kernel image that can be booted directly from Open Firmware, thus eliminating the need for a second-stage bootloader such as yaboot or quik. This is especially useful on PowerPC sub-architectures which do not have a bootloader at all, but may also come in handy for install kernels, netboot systems, and the like. mkvmlinuz-36/debian/po/0000755000000000000000000000000011776017037012077 5ustar mkvmlinuz-36/debian/po/POTFILES.in0000644000000000000000000000005611773177132013655 0ustar [type: gettext/rfc822deb] mkvmlinuz.templates mkvmlinuz-36/debian/po/ru.po0000644000000000000000000000325011774670316013070 0ustar # translation of mkvmlinuz_debconf_ru.po to Russian # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans# # Developers do not need to manually edit POT or PO files. # # Yuri Kozlov , 2006. msgid "" msgstr "" "Project-Id-Version: 24\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-11-06 20:25+0300\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.2\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Используемый загрузчик:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Для субархитектуры вашего PowerPC поддерживается несколько загрузчиков; " "выберите тот, который хотите использовать." mkvmlinuz-36/debian/po/ja.po0000644000000000000000000000212211774670316013031 0ustar # Japanese debconf templates translation for mkvmlinuz. # Copyright (C) 2007 Noritada Kobayashi # This file is distributed under the same license as the mkvmlinuz package. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz (debconf) 32\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2007-03-06 00:45+0900\n" "Last-Translator: Noritada Kobayashi \n" "Language-Team: Japanese \n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "使用するブートローダ:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "この PowerPC サブアーキテクチャでは 1 つ以上のブートローダがサポートされてい" "ます。使用したいものを選択してください。" mkvmlinuz-36/debian/po/pt_BR.po0000644000000000000000000000303611774670316013452 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # # Felipe Augusto van de Wiel (faw) , 2006. # Licensed under the same terms of the mkvmlinuz package. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz (20061109)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-11-09 16:30-0200\n" "Last-Translator: Felipe Augusto van de Wiel (faw) \n" "Language-Team: l10n portuguese \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "pt_BR utf-8\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Carregador de inicialização a ser usado:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Sua sub-arquitetura PowerPC suporta mais de um carregador de inicialização, " "por favor selecione aquele que você quer usar." mkvmlinuz-36/debian/po/da.po0000644000000000000000000000203711774670316013030 0ustar # Danish translation mkvmlinuz. # Copyright (C) 2010 mkvmlinuz & nedenstående oversættere. # This file is distributed under the same license as the mkvmlinuz package. # Joe Hansen , 2010. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2010-10-13 17:30+01:00\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Opstartsindlæser at bruge:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Din PowerPC-underarkitektur understøtter mere end en opstartsindlæser, vælg " "venligst den du ønsker at bruge." mkvmlinuz-36/debian/po/sv.po0000644000000000000000000000251611774670316013076 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans# # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-11-01 07:39+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Välj din starthanterare:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Din PowerPC-underarkitektur har stöd för fler än en starthanterare, välj en " "som du vill använda." mkvmlinuz-36/debian/po/eu.po0000644000000000000000000000270711774670316013061 0ustar # translation of mkvmlinuz-eu.po to Euskara # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans# # Developers do not need to manually edit POT or PO files. # # Piarres Beobide , 2008. msgid "" msgstr "" "Project-Id-Version: mkvmlinuz-eu\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2008-04-14 12:08+0200\n" "Last-Translator: Piarres Beobide \n" "Language-Team: Euskara \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Erabiliko nahi den abio-kargatzailea:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Zure PowerPC azpi-arkitekturak abio kargatzaile bat baino gehiago onartzen " "du, mesedez hautatu erabili nahi duzuna." mkvmlinuz-36/debian/po/templates.pot0000644000000000000000000000222611773177132014623 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" mkvmlinuz-36/debian/po/es.po0000644000000000000000000000332411774670316013053 0ustar # mkvmlinuz translation to Spanish # Copyright (C) 2008 # This file is distributed under the same license as the lurker package. # Changes: # - Initial translation # Francisco Javier Cuadrado # # Traductores, si no conoce el formato PO, merece la pena leer la # documentación de gettext, especialmente las secciones dedicadas a este # formato, por ejemplo ejecutando: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # Equipo de traducción al español, por favor lean antes de traducir # los siguientes documentos: # - El proyecto de traducción de Debian al español # http://www.debian.org/intl/spanish/coordinacion # especialmente las notas de traducción en # http://www.debian.org/intl/spanish/notas # - La guía de traducción de po's de debconf: # /usr/share/doc/po-debconf/README-trans # http://www.debian.org/intl/l10n/po-debconf/README-trans # # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz_34\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2008-08-22 20:48+0100\n" "Last-Translator: Francisco Javier Cuadrado \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Cargador de arranque a usar:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Su subarquitectura de PowerPC es compatible con más de un cargador de " "arranque, por favor seleccione el que quiere usar." mkvmlinuz-36/debian/po/cs.po0000644000000000000000000000250411774670316013050 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-11-01 20:32+0100\n" "Last-Translator: Miroslav Kure \n" "Language-Team: Czech \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Zavaděč, který se má použít:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Vaše PowerPC podarchitektura podporuje více zavaděčů. Vyberte si prosím ten, " "který chcete použít." mkvmlinuz-36/debian/po/pt.po0000644000000000000000000000173511774670316013073 0ustar # Portuguese translation for mkvmlinuz's debconf messages # Rui Branco , 2006. # 2006-12-03 - Rui Branco - Initial translation # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz 27\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-12-03 01:10+0000\n" "Last-Translator: Rui Branco \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Gestor de arranque a utilizar:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "A sua sub-arquitectura PowerPC suporta mais do que um gestor de arranque, " "por favor escolha aquele que quer utilizar." mkvmlinuz-36/debian/po/gl.po0000644000000000000000000000175511774670316013054 0ustar # Galician translation of mkvmlinuz's debconf templates # This file is distributed under the same license as the mkvmlinuz package. # Jacobo Tarrio , 2008. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2008-04-12 20:17+0100\n" "Last-Translator: Jacobo Tarrio \n" "Language-Team: Galician \n" "Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Cargador de inicio a empregar:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "A súa sub-arquitectura PowerPC ten soporte de máis dun cargador de inicio; " "escolla o que quere empregar." mkvmlinuz-36/debian/po/fi.po0000644000000000000000000000164311774670316013044 0ustar msgid "" msgstr "" "Project-Id-Version: mkvmlinuz\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2008-04-12 08:14+0200\n" "Last-Translator: Esko Arajärvi \n" "Language-Team: Finnish \n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-Language: Finnish\n" "X-Poedit-Country: FINLAND\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Käytettävä alkulatausohjelma:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Käytetty PowerPC-aliarkkitehtuuri tukee useampia alkulatausohjelmia. Valitse " "niistä yksi." mkvmlinuz-36/debian/po/ro.po0000644000000000000000000000304411774670316013063 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # # Eddy Petrișor , 2006. msgid "" msgstr "" "Project-Id-Version: ro\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-11-01 18:56+0200\n" "Last-Translator: Eddy Petrișor \n" "Language-Team: Romanian \n" "Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3;plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" "2:1))\n" "X-Generator: KBabel 1.11.4\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Încărcătorul de sistem folosit:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Sub-arhitectura PowerPC folosită de dumneavoastră suportă mai mult de un " "încărcător de sistem; selectaţi-l pe cel care doriţi să-l utilizaţi." mkvmlinuz-36/debian/po/vi.po0000644000000000000000000000211211774670316013054 0ustar # Vietnamese translation for MK VM Linux. # Copyright © 2006 Gnome i18n Project for Vietnamese. # Clytie Siddall , 2006. # msgid "" msgstr "" "Project-Id-Version: mkvmlinux\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-11-01 16:26+1030\n" "Last-Translator: Clytie Siddall \n" "Language-Team: Vietnamese \n" "Language: vi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: LocFactoryEditor 1.6fc1\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Bộ tải khởi động cần dùng:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Kiến trúc phụ PowerPC này hỗ trợ nhiều bộ tải khởi động: hãy chọn điều nào " "bạn muốn sử dụng." mkvmlinuz-36/debian/po/id.po0000644000000000000000000000261411774670316013041 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz 35\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2012-02-03 09:15+0700\n" "Last-Translator: Mahyuddin Susanto \n" "Language-Team: Debian Indonesia Translators \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Indonesian\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Bootloader yang akan digunakan:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Sub-arsitektur PowerPC anda mendukung lebih dari satu bootloader, mohon " "pilih salah satu yang akan digunakan." mkvmlinuz-36/debian/po/pl.po0000644000000000000000000000203611774670316013056 0ustar # debconf templates for mkvmlinuz package # Polish translation # Copyright (C) # Łukasz Paździora, 2008 # # This file is distributed under the same license as the mkvmlinuz package. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz 34\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2008-11-16 00:47+0200\n" "Last-Translator: Łukasz Paździora \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Którego programu rozruchowego użyć:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Podstruktura Twojego PowerPC obsługuje więcej niż jeden program rozruchowy. " "Proszę wybrać którego chcesz użyć." mkvmlinuz-36/debian/po/fr.po0000644000000000000000000000254511774670316013057 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-11-01 16:53+0100\n" "Last-Translator: Cyril Brulebois \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Programme de démarrage à utiliser :" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Plusieurs programmes de démarrage gèrent cette sous-architecture PowerPC. " "Veuillez sélectionner lequel utiliser." mkvmlinuz-36/debian/po/de.po0000644000000000000000000000262111774670316013033 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # # Holger Wansing , 2006. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz 24\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2006-11-03 21:13+0100\n" "Last-Translator: Holger Wansing \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Zu verwendender Bootloader:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Ihre PowerPC-Unterarchitektur unterstützt mehr als einen Bootloader; wählen " "Sie bitte aus, welchen Sie verwenden möchten." mkvmlinuz-36/debian/po/nl.po0000644000000000000000000000253211774670316013055 0ustar # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2007-03-09 19:18+0100\n" "Last-Translator: Bart Cornelis \n" "Language-Team: debian-l10n-dutch \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Dutch\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Te gebruiken opstartlader:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "Uw PowerPC sub-architectuur ondersteunt meer dan één opstartlader, welke " "wilt u gebruiken?" mkvmlinuz-36/debian/po/it.po0000644000000000000000000000212611774670316013057 0ustar # Italian (it) translation of debconf templates for mkvmlinuz # Copyright (C) 2008 Software in the Public Interest # This file is distributed under the same license as the mkvmlinuz package. # Luca Monducci , 2008. # msgid "" msgstr "" "Project-Id-Version: mkvmlinuz 33 italian debconf templates\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-10-31 08:09+0100\n" "PO-Revision-Date: 2008-01-08 21:02+0100\n" "Last-Translator: Luca Monducci \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "Bootloader to use:" msgstr "Bootloader da usare:" #. Type: select #. Description #: ../mkvmlinuz.templates:1001 msgid "" "Your PowerPC sub-architecture supports more than one bootloader, please " "select the one you want to use." msgstr "" "La sottoarchitettura PowerPC della macchina supporta più di un bootloader, " "selezionare quello che si desidera usare." mkvmlinuz-36/debian/compat0000644000000000000000000000000211773444307012660 0ustar 8 mkvmlinuz-36/debian/dirs0000644000000000000000000000020211773177132012337 0ustar etc/mkvmlinuz usr/sbin usr/share/man/man8 etc/kernel/postinst.d etc/kernel/postrm.d usr/lib/mkvmlinuz usr/share/lintian/overrides mkvmlinuz-36/debian/rules0000755000000000000000000000320111773451240012530 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 INSTALL_DATA = install -m 644 -o root -g root INSTALL_EXEC = install -m 755 -o root -g root build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: mkvmlinuz.8 dh_testdir touch build-stamp make -C boot %.8: debian/%.sgml /usr/bin/docbook-to-man $< > $@ clean: dh_testdir dh_testroot rm -f build-stamp rm -f mkvmlinuz.8 debconf-updatepo make -C boot clean dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs $(INSTALL_EXEC) mkvmlinuz $(CURDIR)/debian/mkvmlinuz/usr/sbin $(INSTALL_EXEC) debian/kernel-image/postinst $(CURDIR)/debian/mkvmlinuz/etc/kernel/postinst.d/mkvmlinuz $(INSTALL_EXEC) debian/kernel-image/postrm $(CURDIR)/debian/mkvmlinuz/etc/kernel/postrm.d/mkvmlinuz $(INSTALL_DATA) debian/lintian.overrides $(CURDIR)/debian/mkvmlinuz/usr/share/lintian/overrides/mkvmlinuz $(INSTALL_EXEC) mkvmlinuz $(CURDIR)/debian/mkvmlinuz/usr/sbin $(INSTALL_DATA) mkvmlinuz.8 $(CURDIR)/debian/mkvmlinuz/usr/share/man/man8 $(INSTALL_DATA) output $(CURDIR)/debian/mkvmlinuz/etc/mkvmlinuz $(INSTALL_EXEC) boot/addnote $(CURDIR)/debian/mkvmlinuz/usr/lib/mkvmlinuz $(INSTALL_DATA) boot/*.o boot/zImage.lds $(CURDIR)/debian/mkvmlinuz/usr/lib/mkvmlinuz binary-indep: build install binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installman dh_installdebconf dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install mkvmlinuz-36/debian/config0000755000000000000000000000176011773177132012660 0ustar #!/bin/sh set -e . /usr/share/debconf/confmodule case $(grep ^machine /proc/cpuinfo) in *PReP*Blackhawk*) arch=ppcbug ;; *PReP*) arch=prep ;; *CHRP*Pegasos*|*EFIKA*CHRP*) arch=chrp_pegasos ;; *CHRP*) arch=chrp ;; *Amiga*) arch=apus ;; *iSeries*) arch=iseries ;; *) case $(grep ^pmac-generation /proc/cpuinfo) in *NewWorld) arch=pmac_newworld ;; *OldWorld) arch=pmac_oldworld ;; *NuBus) arch=pmac_nubus ;; *) arch=unknown ;; esac ;; esac # List of bootloader per subarch. case $arch in chrp|pmac_newworld) bootloaders="yaboot, mkvmlinuz" ;; pmac_oldworld) bootloaders="quik, mkvmlinuz" ;; apus|ppcbug|prep|chrp_pegasos) bootloaders="mkvmlinuz" ;; *) bootloaders="unknown" ;; esac # If there is more than one bootloader present, ask the user # at medium priority db_subst mkvmlinuz/bootloaders choices "$bootloaders" db_subst mkvmlinuz/bootloaders default "${bootloaders%, *}" db_input medium mkvmlinuz/bootloaders || true db_go || true mkvmlinuz-36/debian/mkvmlinuz.templates0000644000000000000000000000034011773177132015432 0ustar Template: mkvmlinuz/bootloaders Type: select Choices: ${choices} Default: ${default} _Description: Bootloader to use: Your PowerPC sub-architecture supports more than one bootloader, please select the one you want to use. mkvmlinuz-36/debian/mkvmlinuz.sgml0000644000000000000000000002446311773466642014421 0ustar Jens"> Schmalzing"> Sep 11, 2004"> 8"> jensen@debian.org"> MKVMLINUZ"> Debian"> GNU"> GPL"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2004 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; create a kernel to boot a PowerPC machine from Open Firmware &dhpackage; release kernel DESCRIPTION This manual page documents briefly the &dhpackage; command. &dhpackage; is a program that takes a PowerPC Linux kernel as an uncompressed ELF image file (usually called vmlinux or somesuch) and adds boot code and possibly a ramdisk to create a compressed kernel image that can be booted directly from Open Firmware, thus eliminating the need for a second-stage bootloader such as yaboot or quik. OPTIONS Specify the path to the output file for the compressed kernel image. If this option is not set, the file /etc/mkvmlinuz/output is sourced, in the hope that it will set the shell variable output to something useful. If this doesn't work either, the program stops with a non-zero exit code. Specify the PowerPC sub-architecture to build for. If this option is not set, the program will guess based on the contents of /proc/cpuinfo. At the moment, the following values are supported: chrp This build a compressed kernel for CHRP machines. coff The COFF format is understood by the Open Firmware of many OldWorld PowerMacs. You will need it if you intend to boot a Linux kernel directly from Open Firmware. Note that you can also choose between a variety of boot loaders for that platform, such as quik, BootX, and miBoot. miboot This prepares the Linux kernel for booting from a miBoot floppy. pmac While most NewWorld PowerMacs use the bootloader yaboot, they can also start directly from Open Firmware. prep The PReP sub-architecture is mainly found on old RS/6000 systems. After creating the compressed kernel, you have to move it to a bootable location, either by dding it onto the PReP boot partition of a hard disk, or writing it to a CD using the option of mkisofs. ppcbug PPCBug is strictly a sub-sub-architecture of the above-mentioned PReP. It uses a slightly different wrapper around the compressed kernel, though. Specify the path to the Linux kernel as an uncompressed ELF image file. Usually, this filename contains vmlinux in some form. If this option is not set, the program will make guesses based on the release number and the currently running kernel. Specify the path to the System.map file. This will greatly enlarge the resulting image, and is only needed if you intend to use the in-kernel debugger xmon. Specify the path to a ramdisk (initrd) image to include in the compressed kernel image. If this option is not set, the program will look in a location analogous to the kernel image location, but will continue without a ramdisk if nothing is found there. This guess can be turned off with the option. Specify the directory containing boot code. If this option is not set, the program will try a default directory and the current directory. Specify the release of the kernel. This option is only used for guessing path names that have not been specified explicitly. Do not attempt to find an initrd image file if none was specified with the option. Assume the initrd image file is already compressed. The default is to autodetect if the initrd is compressed or not. Assume the initrd image file is not already compressed. The default is to autodetect if the initrd is compressed or not. Set the elf link address where the kernel will be relocated inside the firmware. Print progress messages, and echo commands as they are executed. It is also possible to specify the release number and the kernel image file as the first and second non-option arguments, respectively. However, the values are only used if they are not already given as option arguments. FILES /etc/mkvmlinuz/output A shell script fragment that specifies the output file for the compressed kernel image. It is sourced by &dhpackage; if the output file is not specified on the command line, and therefore should set the shell variable output at some point. The shell variables arch, kernel, sysmap, initrd, objdir, and release are all set at this point and can be used to construct the filename. AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the &gnu; General Public License can be found in /usr/share/common-licenses/GPL.
mkvmlinuz-36/debian/lintian.overrides0000644000000000000000000000021011773470571015037 0ustar mkvmlinuz: debconf-is-not-a-registry etc/kernel/postinst.d/mkvmlinuz mkvmlinuz: debconf-is-not-a-registry etc/kernel/postrm.d/mkvmlinuz mkvmlinuz-36/mkvmlinuz0000755000000000000000000003630411774666254012240 0ustar #!/bin/bash # usage information usage() { echo 'usage:' echo ' -o - path to output file for compressed kernel image' echo ' -a - PowerPC sub-architecture' echo ' -k - path to kernel image file in ELF format' echo ' -s - path to System.map file' echo ' -i - path to initrd image file' echo ' -d - path to directory with additional object files' echo ' -r - kernel release number' echo ' -l
- Address where the kernel should be relocated' echo ' -n - do not use an initrd' echo ' -z - assume the initrd image file is already compressed' echo ' -u - assume the initrd image file is not compressed' echo ' -v - verbose operation (print commands)' exit 0 } # echo a shell command if desired, and execute it do_cmd() { if test -n "$verbose"; then echo $@ eval $@ else eval $@ > /dev/null 2>&1 fi return } # parse command line while getopts o:k:s:i:d:r:a:l:nuzv option; do case "$option" in o) output=$OPTARG ;; k) kernel=$OPTARG ;; s) sysmap=$OPTARG ;; i) initrd=$OPTARG ;; d) objdir=$OPTARG ;; r) release=$OPTARG ;; a) arch=$OPTARG ;; l) linkaddr=$OPTARG ;; n) noinitrd="Yes" ;; z) compressed="Yes" ;; u) compressed="No" ;; v) verbose="Yes" ;; *) usage; exit 0 ;; esac done # Let's provide some subarch dependent defaults case $arch in apus|miboot) # miboot and apus don't use builtin initrds, # and need to stay elf kernels, as we don't use a wrapper. elf="Yes" noinitrd="Yes" ;; esac # use non-option arguments as release version and kernel image file if needed shift $(( $OPTIND - 1 )) if test -z "$release" -a -n "$1"; then release=$1 fi if test -z "$kernel" -a -n "$2"; then kernel=$2 fi # if no sub-architecture was specified, read it from /proc if test -z "$arch"; then case $(grep ^machine /proc/cpuinfo) in *PReP*Blackhawk*) arch=ppcbug ;; *PReP*) arch=prep ;; *CHRP*) arch=chrp ;; *Amiga*) arch=apus ;; *) case $(grep ^pmac-generation /proc/cpuinfo) in *NewWorld) arch=pmac ;; *OldWorld) arch=coff ;; esac ;; esac fi test -z "$verbose" || echo === Building for sub-architecture $arch. # if no kernel was specified, try to find one if test -z "$kernel"; then # guess the location of a kernel if kernel=/boot/vmlinux-$release; test -n "$release" -a -r $kernel; then : elif kernel=/boot/vmlinux-$(uname -r); test -r $kernel; then : else kernel="" fi # we couldn't find a kernel, and therefore give up if test -z "$kernel"; then echo Could not find a kernel image file, please specify one. exit 1 fi # sanitize the location of the kernel kernel=$(readlink -f $kernel) fi test -z "$verbose" || echo === Using kernel image file $kernel. # if no initrd was specified, try to find one that goes with the kernel if test -z "$noinitrd" -a -z "$initrd"; then # guess the location of an initrd, but don't try too hard if initrd=${kernel/vmlinux/initrd.img}; test -r $initrd; then : else initrd="" fi # sanitize the location of the initrd if test -n "$initrd"; then initrd=$(readlink -f $initrd) fi fi test -z "$verbose" -o -z "$initrd" || echo === Using initrd image file $initrd. # if no release was specified, extract it from the kernel image name if test -z "$release"; then release=$(echo $kernel | sed s/.*vmlinux-//) fi test -z "$verbose" || echo === Release version seems to be $release. if dpkg --compare-versions $release ge 2.6.16 && test "$arch" != "prep" ; then post_2_6_16=Yes else post_2_6_16= fi if dpkg --compare-versions $release ge 2.6.18 && test "$arch" != "prep" ; then post_2_6_18=Yes else post_2_6_18= fi if dpkg --compare-versions $release ge 2.6.19 && test "$arch" != "prep" ; then post_2_6_19=Yes else post_2_6_19= fi if grep -q CONFIG_RD_XZ=y /boot/config-$release ; then is_xz_supported=Yes fi # if no object file directory was specified, try to find one if test -z "$objdir"; then # try using $STEM-image, then linux-image, then kernel-image # in a default location, then use the current directory if objdir=/usr/lib/$STEM-image-$release; test -d $objdir; then : elif objdir=/usr/lib/linux-image-$release; test -d $objdir; then : elif objdir=/usr/lib/kernel-image-$release; test -d $objdir; then : # /usr/lib/mkvmlinuz is a copy of arch/powerpc/boot taken from 2.6.17. # It is used as a fallback when a kernel package is not present # or when it does not provide the tools. elif objdir=/usr/lib/mkvmlinuz; test -d $objdir && test "$arch" = "chrp"; then post_2_6_16=Yes else objdir="$PWD" fi fi if test \! -d "$objdir"; then echo Object directory does not exist. exit 1 fi test -z "$verbose" || echo === Using object files from $objdir. # if no output file was specified, source the configuration file if test -z "$output" -a -r /etc/mkvmlinuz/output; then . /etc/mkvmlinuz/output fi # we absolutely need an output file, and won't attempt guesses if test -z "$output"; then echo Please specify an output file. exit 1 fi test -z "$verbose" || echo === Building a bootable compressed kernel image in $output. # create a work directory work=$(mktemp -d) test -z "$verbose" || echo === Doing build in $work. # utilities if test "$is_xz_supported"; then XZ="xz --check=crc32 -4" else XZ=false fi if test "$post_2_6_16"; then ADDNOTE=$objdir/addnote # must be present in mkvmlinuz fallback tools if test \! -f "$ADDNOTE"; then echo "Missing utility: $ADDNOTE" exit 1 fi ADDRAMDISK=$objdir/addRamDisk # unseen in mkvmlinuz fallback tools objs=$objdir STRIP="strip -s -R .comment" GZIP="gzip --force --best" else ADDNOTE=$objdir/utils/addnote # unseen in -prep kernel package, but present in -powerpc kernel package if test \! -f "$ADDNOTE" && echo "$release"|grep -q -- '-powerpc$'; then # addnote must exist if we use a -powerpc kernel package echo "Missing utility: $ADDNOTE" exit 1 fi HACKOFF=$objdir/utils/hack-coff # unseen in kernel package tools MKNOTE=$objdir/utils/mknote # unseen in kernel package tools MKPREP=$objdir/utils/mkprep # must be present in kernel package tools if test \! -f "$MKPREP"; then echo "Missing utility: $MKPREP" exit 1 fi MKBUGBOOT=$objdir/utils/mkbugboot # must be present in kernel package tools if test \! -f "$MKBUGBOOT"; then echo "Missing utility: $MKBUGBOOT" exit 1 fi libs=$objdir/lib objs=$objdir/obj GZIP=gzip STRIP=strip fi LD=ld OBJCOPY=objcopy MV=mv case "$arch","$post_2_6_16","$release" in apus,Yes,*|miboot,Yes,*|prep,Yes,*|ppcbug,Yes,*) ;; chrp,Yes,*|pmac,Yes,*) dummy_kernel=$objs/mkvmlinuz-kernel-vmlinux.strip.o dummy_initrd=$objs/mkvmlinuz-kernel-initrd.o OBJS="$objs/crt0.o $objs/string.o $objs/prom.o $objs/stdio.o $objs/main.o $objs/div64.o" if test "$post_2_6_18"; then OBJS="$OBJS $objs/inffast.o $objs/inflate.o $objs/inftrees.o" else OBJS="$OBJS $objs/infblock.o $objs/infcodes.o $objs/inffast.o $objs/inflate.o $objs/inftrees.o $objs/infutil.o" fi ;; apus,,*|miboot,,*|*,Yes,*) ;; prep,,2.6*|ppcbug,,2.6*) test -d $objs/simple && objs=$objs/simple if test -r $objs/legacy.o; then prepmap=legacy; else prepmap=prepmap; fi OBJS="$objs/head.o $objs/relocate.o $objs/$prepmap.o $objs/misc.o $objs/misc-prep.o $objs/mpc10x_memory.o" LIBS="$libs/common.a $libs/ppc.a $libs/of.a" dummy=$objs/dummy.o ;; pmac,,2.6*) test -d $objs/openfirmware && objs=$objs/openfirmware OBJS="$objs/start.o $objs/misc.o $objs/common.o $objs/newworldmain.o" LIBS="$libs/lib.a $libs/ppc.a $libs/of.a $libs/common.a" dummy=$objs/dummy.o ;; *,,2.6*) test -d $objs/openfirmware && objs=$objs/openfirmware OBJS="$objs/start.o $objs/misc.o $objs/common.o $objs/${arch}main.o" LIBS="$libs/lib.a $libs/ppc.a $libs/of.a $libs/common.a" dummy=$objs/dummy.o ;; chrp,,2.4*) test -d $objs/chrp && objs=$objs/chrp OBJS="$objs/start.o $objs/main.o $objs/misc.o" OBJS="$OBJS $objs/../common/string.o $objs/../common/ofcommon.o" LIBS="$libs/lib.a $libs/zlib.a $libs/of1275.a" dummy=$objs/../common/dummy.o ;; esac # off we go... # create the compressed initrd image file if test -n "$initrd"; then test -z "$verbose" || echo === Creating compressed initrd image if test -z "$compressed"; then if test "`xxd -p -l2 $initrd`" = "1f8b"; then test -z "$verbose" || echo === $initrd is already gzip compressed do_cmd cp -p $initrd $work/initrd.gz if test "$is_xz_supported" && test "$arch" != "prep"; then test -z "$verbose" || echo === recompressing to xz zcat $initrd | $XZ - > $work/initrd.xz fi elif test "`xxd -p -l6 $initrd`" = "fd377a585a00"; then test -z "$verbose" || echo === $initrd is already xz compressed do_cmd cp -p $initrd $work/initrd.xz else test -z "$verbose" || echo === assuming $initrd was not compressed compressed="No" fi fi case "$compressed" in Yes) do_cmd cp -p $initrd $work/initrd.gz do_cmd ln -s $work/initrd.gz $work/initrd.xz ;; No) do_cmd cp -p $initrd $work/initrd if test "$is_xz_supported" && test "$arch" != "prep"; then do_cmd $XZ $work/initrd else do_cmd $GZIP $work/initrd fi ;; esac fi # If we are on ARCH=powerpc and 2.6.19 or higher, we just call the provided wrapper script. if test -n "$post_2_6_19" && test "$arch" != "prep"; then WRAPPER=$objdir/wrapper vmlinuz=$work/vmlinuz.$arch if test -n "$initrd"; then if test "$is_xz_supported"; then INITRD="-i $work/initrd.xz" else INITRD="-i $work/initrd.gz" fi fi $WRAPPER -c -o $vmlinuz -p $arch $INITRD -D $objdir -W $work $kernel else # create the compressed kernel image file test -z "$verbose" || echo === Creating compressed kernel image vmlinux.gz... if test -n "$elf" || test -n "$post_2_6_16"; then do_cmd $STRIP $kernel -o $work/vmlinux else do_cmd $OBJCOPY -O binary $kernel $work/vmlinux fi do_cmd $GZIP $work/vmlinux # create the raw ELF image file; this is not needed for the miBoot image if test -z "$elf"; then test -z "$verbose" || echo === Putting everything into ELF image file image.o... if test -n "$post_2_6_16"; then do_cmd $OBJCOPY $dummy_kernel $work/dummy_kernel.o \ --add-section=.kernel:vmlinux.strip=$work/vmlinux.gz \ --set-section-flags=.kernel:vmlinux.strip=contents,alloc,load,readonly,data if test -n "$initrd"; then do_cmd $OBJCOPY $dummy_initrd $work/dummy_initrd.o \ --add-section=.kernel:initrd=$work/initrd.gz \ --set-section-flags=.kernel:initrd=contents,alloc,load,readonly,data fi else do_cmd $OBJCOPY -R .comment $dummy $work/image.o do_cmd $OBJCOPY $work/image.o $work/image.o \ --add-section=.image=$work/vmlinux.gz \ --set-section-flags=.image=contents,alloc,load,readonly,data if test -n "$sysmap"; then do_cmd $OBJCOPY $work/image.o $work/image.o \ --add-section=.sysmap=$sysmap \ --set-section-flags=.sysmap=contents,alloc,load,readonly,data fi if test -n "$initrd"; then do_cmd $OBJCOPY $work/image.o $work/image.o \ --add-section=.ramdisk=$work/initrd.gz \ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data fi fi else do_cmd $MV $work/vmlinux.gz $work/vmlinuz.$arch.tmp fi # link everything into the final image file and make it bootable vmlinuz=$work/vmlinuz.$arch if test "$post_2_6_16"; then LD_ARGS="-m elf32ppc -T $objs/zImage.lds" else LD_ARGS="-T $objdir/boot/ld.script" fi OBJCOPY_ARGS="-R .comment" test -z "$verbose" || echo === Creating bootable kernel image file vmlinuz.$arch... case "$arch","$post_2_6_16","$release" in chrp,Yes,*|pmac,Yes,*) if test -n "$initrd"; then do_cmd $LD $LD_ARGS -o $vmlinuz $OBJS $work/dummy_kernel.o $work/dummy_initrd.o else do_cmd $LD $LD_ARGS -o $vmlinuz $OBJS $work/dummy_kernel.o fi do_cmd $ADDNOTE $vmlinuz ;; chrp,,2.6*) if [ -z "$linkaddr" ]; then linkaddr=0x00800000; fi LD_ARGS="$LD_ARGS -e _start -Ttext $linkaddr" do_cmd $LD -o $vmlinuz $LD_ARGS $objs/crt0.o $OBJS $work/image.o $LIBS do_cmd $OBJCOPY $OBJCOPY_ARGS $vmlinuz $vmlinuz do_cmd cp -p $objdir/boot/note $work do_cmd $ADDNOTE $vmlinuz ;; chrp,,2.4*) if [ -z "$linkaddr" ]; then linkaddr=0x00800000; fi LD_ARGS="$LD_ARGS -e _start -Ttext $linkaddr" do_cmd $LD -o $vmlinuz $LD_ARGS $objs/../common/crt0.o $OBJS $work/image.o $LIBS do_cmd $OBJCOPY $OBJCOPY_ARGS $vmlinuz $vmlinuz do_cmd $ADDNOTE $vmlinuz ;; coff,,2.6*) if [ -z "$linkaddr" ]; then linkaddr=0x00500000; fi LD_ARGS="$LD_ARGS -e _start -Ttext $linkaddr -Bstatic" OBJCOPY_ARGS="-O aixcoff-rs6000 -R .stab -R .stabstr $OBJCOPY_ARGS" do_cmd $LD -o $vmlinuz $LD_ARGS $objs/coffcrt0.o $OBJS $work/image.o $LIBS do_cmd $OBJCOPY $OBJCOPY_ARGS $vmlinuz $vmlinuz do_cmd $HACKOFF $vmlinuz ;; pmac,,2.6*) if [ -z "$linkaddr" ]; then linkaddr=0x01000000; fi LD_ARGS="$LD_ARGS -e _start -Ttext $linkaddr" OBJCOPY_ARGS="--add-section=.note=$work/note $OBJCOPY_ARGS" do_cmd $LD -o $vmlinuz $LD_ARGS $objs/crt0.o $OBJS $LIBS $work/image.o do_cmd $MKNOTE > $work/note do_cmd $OBJCOPY $OBJCOPY_ARGS $vmlinuz $vmlinuz ;; ppcbug,*,2.6*) if [ -z "$linkaddr" ]; then linkaddr=0x00800000; fi LD_ARGS="$LD_ARGS -Ttext $linkaddr -Bstatic" OBJCOPY_ARGS="-O elf32-powerpc $OBJCOPY_ARGS -R .stab -R .stabstr -R .sysmap" do_cmd $LD -o $vmlinuz $LD_ARGS $OBJS $work/image.o $LIBS do_cmd $OBJCOPY $OBJCOPY_ARGS $vmlinuz $vmlinuz.tmp do_cmd $MKBUGBOOT $vmlinuz.tmp $vmlinuz ;; prep,*,2.6*) if [ -z "$linkaddr" ]; then linkaddr=0x00800000; fi LD_ARGS="$LD_ARGS -Ttext $linkaddr -Bstatic" OBJCOPY_ARGS="-O elf32-powerpc $OBJCOPY_ARGS -R .stab -R .stabstr -R .sysmap" do_cmd $LD -o $vmlinuz $LD_ARGS $OBJS $work/image.o $LIBS do_cmd $OBJCOPY $OBJCOPY_ARGS $vmlinuz $vmlinuz.tmp do_cmd $MKPREP -pbp $vmlinuz.tmp $vmlinuz ;; miboot,,2.6*|apus,,2.6*) do_cmd $MV $vmlinuz.tmp $vmlinuz ;; *) echo Sorry, I do not know how to handle PowerPC sub-architecture $arch in version $release. esac fi # move bootable kernel image to its final location and creating symlinks. if test -e $vmlinuz; then if test -n "$linkname"; then oldlink="`readlink $linkname`" fi test -z "$verbose" || echo === Moving bootable kernel image file to $output... if test -e $output; then echo Output file $output exists, attempting to back it up... mv $output $output.old 2> /dev/null if test -n "$linkname" && test "$oldlink" = "`basename $output`"; then oldlink=$output.old fi fi cat $vmlinuz > $output if test -n "$linkname"; then test -z "$verbose" || echo Creating symlink : $linkname -\> $output if test -L "$linkname"; then unlink $linkname fi ln -sf "`basename $output`" $linkname if test -n "$oldlink"; then test -z "$verbose" || echo Creating backup symlink : $linkname.old -\> $oldlink if test -L "$linkname.old"; then unlink $linkname.old fi ln -sf $oldlink $linkname.old fi fi fi # clean up test -z "$verbose" || echo === Cleaning up... rm -rf $work