wok rev 3919

linux: fix build
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 18 19:22:04 2009 +0200 (2009-08-18)
parents 0cd931b3cd79
children bea1fdc6a26e
files linux/receipt linux/stuff/linux-unlzma-2.6.30.4.u
line diff
     1.1 --- a/linux/receipt	Tue Aug 18 18:45:48 2009 +0200
     1.2 +++ b/linux/receipt	Tue Aug 18 19:22:04 2009 +0200
     1.3 @@ -42,10 +42,11 @@
     1.4  	cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
     1.5  	make oldconfig
     1.6  	ln .config slitaz/config
     1.7 -	make bzImage
     1.8 -	make modules
     1.9 -	make INSTALL_MOD_PATH=$PWD/_pkg modules_install
    1.10 -	make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install
    1.11 +	make bzImage &&
    1.12 +	make modules &&
    1.13 +	make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
    1.14 +	make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
    1.15 +	[ -s arch/x86/boot/bzImage ]
    1.16  }
    1.17  
    1.18  # Rules to gen a SliTaz package suitable for Tazpkg.
     2.1 --- a/linux/stuff/linux-unlzma-2.6.30.4.u	Tue Aug 18 18:45:48 2009 +0200
     2.2 +++ b/linux/stuff/linux-unlzma-2.6.30.4.u	Tue Aug 18 19:22:04 2009 +0200
     2.3 @@ -39,42 +39,72 @@
     2.4   	if (!wr->flush) {
     2.5   		int32_t pos;
     2.6   		while (offs > wr->header->dict_size)
     2.7 -@@ -311,6 +323,34 @@
     2.8 +@@ -309,8 +321,41 @@
     2.9   
    2.10 + }
    2.11 + 
    2.12 ++static inline void INIT write_byte_if_cpio(struct writer *wr, uint8_t byte)
    2.13 ++{
    2.14 ++	if (wr->buffer_pos % LZMA_IOBUF_SIZE == 0) {
    2.15 ++		// if the following large_malloc fails, the initramfs
    2.16 ++		// whould not be load with is_cpio_flush forced 0 too.
    2.17 ++		// Remember we do not allocate historic buffer.
    2.18 ++		// Let's assume it will never fail !
    2.19 ++		if (wr->next_index >= wr->max_index) {
    2.20 ++			// realloc wr->buffer_index
    2.21 ++			uint8_t **p = wr->buffer_index;
    2.22 ++			wr->buffer_index = (uint8_t **) 
    2.23 ++				large_malloc(LZMA_IOBUF_SIZE + 
    2.24 ++					    sizeof(*p) * wr->max_index);
    2.25 ++			if (wr->max_index) {
    2.26 ++				memcpy(wr->buffer_index, p,
    2.27 ++				       sizeof(*p) * wr->max_index);
    2.28 ++				free(p);
    2.29 ++			}
    2.30 ++			wr->max_index += LZMA_IOBUF_SIZE / sizeof(*p);
    2.31 ++		}
    2.32 ++		wr->buffer_index[wr->next_index++] =
    2.33 ++			(uint8_t *) large_malloc(LZMA_IOBUF_SIZE);
    2.34 ++	}
    2.35 ++	wr->buffer_index[wr->buffer_pos / LZMA_IOBUF_SIZE]
    2.36 ++			[wr->buffer_pos % LZMA_IOBUF_SIZE] =
    2.37 ++		wr->previous_byte = byte;
    2.38 ++	wr->buffer_pos++;
    2.39 ++}
    2.40 ++
    2.41   static inline void INIT write_byte(struct writer *wr, uint8_t byte)
    2.42   {
    2.43  +	if (wr->is_cpio_flush) {
    2.44 -+		if (wr->buffer_pos % LZMA_IOBUF_SIZE == 0) {
    2.45 -+			// if the following large_malloc fails, the initramfs
    2.46 -+			// whould not be load with is_cpio_flush forced 0 too.
    2.47 -+			// Remember we do not allocate historic buffer.
    2.48 -+			// Let's assume it will never fail !
    2.49 -+			if (wr->next_index >= wr->max_index) {
    2.50 -+				// realloc wr->buffer_index
    2.51 -+				uint8_t **p = wr->buffer_index;
    2.52 -+				wr->buffer_index = (uint8_t **) 
    2.53 -+					large_malloc(LZMA_IOBUF_SIZE + 
    2.54 -+						    sizeof(*p) * wr->max_index);
    2.55 -+				if (wr->max_index) {
    2.56 -+					memcpy(wr->buffer_index, p,
    2.57 -+					       sizeof(*p) * wr->max_index);
    2.58 -+					free(p);
    2.59 -+				}
    2.60 -+				wr->max_index += LZMA_IOBUF_SIZE / sizeof(*p);
    2.61 -+			}
    2.62 -+			wr->buffer_index[wr->next_index++] =
    2.63 -+				(uint8_t *) large_malloc(LZMA_IOBUF_SIZE);
    2.64 -+		}
    2.65 -+		wr->buffer_index[wr->buffer_pos / LZMA_IOBUF_SIZE]
    2.66 -+				[wr->buffer_pos % LZMA_IOBUF_SIZE] =
    2.67 -+			wr->previous_byte = byte;
    2.68 -+		wr->buffer_pos++;
    2.69 ++		write_byte_if_cpio(wr, byte);
    2.70  +		return;
    2.71  +	}
    2.72   	wr->buffer[wr->buffer_pos++] = wr->previous_byte = byte;
    2.73   	if (wr->flush && wr->buffer_pos == wr->header->dict_size) {
    2.74   		wr->buffer_pos = 0;
    2.75 -@@ -339,6 +379,9 @@
    2.76 +@@ -328,7 +373,21 @@
    2.77 + static inline void INIT copy_bytes(struct writer *wr,
    2.78 + 					 uint32_t rep0, int len)
    2.79 + {
    2.80 +-	do {
    2.81 ++	if (wr->is_cpio_flush) {
    2.82 ++		int32_t pos;
    2.83 ++		uint32_t offs = rep0;
    2.84 ++		while (offs > wr->header->dict_size)
    2.85 ++			offs -= wr->header->dict_size;
    2.86 ++		pos = wr->buffer_pos - offs;
    2.87 ++		do {
    2.88 ++			write_byte_if_cpio(wr, 
    2.89 ++				wr->buffer_index[pos / LZMA_IOBUF_SIZE]
    2.90 ++						[pos % LZMA_IOBUF_SIZE]);
    2.91 ++			pos++;
    2.92 ++			len--;
    2.93 ++		} while (len != 0 && wr->buffer_pos < wr->header->dst_size);
    2.94 ++	}
    2.95 ++	else do {
    2.96 + 		copy_byte(wr, rep0);
    2.97 + 		len--;
    2.98 + 	} while (len != 0 && wr->buffer_pos < wr->header->dst_size);
    2.99 +@@ -339,6 +398,9 @@
   2.100   				     int pos_state, uint16_t *prob,
   2.101   				     int lc, uint32_t literal_pos_mask) {
   2.102   	int mi = 1;
   2.103 @@ -84,7 +114,7 @@
   2.104   	rc_update_bit_0(rc, prob);
   2.105   	prob = (p + LZMA_LITERAL +
   2.106   		(LZMA_LIT_SIZE
   2.107 -@@ -369,18 +412,13 @@
   2.108 +@@ -369,18 +431,13 @@
   2.109   		rc_get_bit(rc, prob_lit, &mi);
   2.110   	}
   2.111   	write_byte(wr, mi);
   2.112 @@ -105,7 +135,7 @@
   2.113   	uint16_t *prob_len;
   2.114   	int num_bits;
   2.115   	int len;
   2.116 -@@ -396,7 +434,7 @@
   2.117 +@@ -396,7 +453,7 @@
   2.118   		prob = p + LZMA_LEN_CODER;
   2.119   	} else {
   2.120   		rc_update_bit_1(rc, prob);
   2.121 @@ -114,7 +144,7 @@
   2.122   		if (rc_is_bit_0(rc, prob)) {
   2.123   			rc_update_bit_0(rc, prob);
   2.124   			prob = (p + LZMA_IS_REP_0_LONG
   2.125 -@@ -417,13 +455,13 @@
   2.126 +@@ -417,13 +474,13 @@
   2.127   			uint32_t distance;
   2.128   
   2.129   			rc_update_bit_1(rc, prob);
   2.130 @@ -130,14 +160,15 @@
   2.131   				if (rc_is_bit_0(rc, prob)) {
   2.132   					rc_update_bit_0(rc, prob);
   2.133   					distance = cst->rep2;
   2.134 -@@ -444,24 +482,24 @@
   2.135 +@@ -444,24 +501,24 @@
   2.136   	prob_len = prob + LZMA_LEN_CHOICE;
   2.137   	if (rc_is_bit_0(rc, prob_len)) {
   2.138   		rc_update_bit_0(rc, prob_len);
   2.139  -		prob_len = (prob + LZMA_LEN_LOW
   2.140  +		prob_len += LZMA_LEN_LOW - LZMA_LEN_CHOICE
   2.141   			    + (pos_state <<
   2.142 - 			       LZMA_LEN_NUM_LOW_BITS));
   2.143 +-			       LZMA_LEN_NUM_LOW_BITS));
   2.144 ++			       LZMA_LEN_NUM_LOW_BITS);
   2.145   		offset = 0;
   2.146   		num_bits = LZMA_LEN_NUM_LOW_BITS;
   2.147   	} else {
   2.148 @@ -149,7 +180,8 @@
   2.149  -			prob_len = (prob + LZMA_LEN_MID
   2.150  +			prob_len += LZMA_LEN_MID - LZMA_LEN_CHOICE_2
   2.151   				    + (pos_state <<
   2.152 - 				       LZMA_LEN_NUM_MID_BITS));
   2.153 +-				       LZMA_LEN_NUM_MID_BITS));
   2.154 ++				       LZMA_LEN_NUM_MID_BITS);
   2.155   			offset = 1 << LZMA_LEN_NUM_LOW_BITS;
   2.156   			num_bits = LZMA_LEN_NUM_MID_BITS;
   2.157   		} else {
   2.158 @@ -159,7 +191,7 @@
   2.159   			offset = ((1 << LZMA_LEN_NUM_LOW_BITS)
   2.160   				  + (1 << LZMA_LEN_NUM_MID_BITS));
   2.161   			num_bits = LZMA_LEN_NUM_HIGH_BITS;
   2.162 -@@ -529,6 +567,7 @@
   2.163 +@@ -529,6 +586,7 @@
   2.164   			      void(*error_fn)(char *x)
   2.165   	)
   2.166   {
   2.167 @@ -167,7 +199,7 @@
   2.168   	struct lzma_header header;
   2.169   	int lc, pb, lp;
   2.170   	uint32_t pos_state_mask;
   2.171 -@@ -563,6 +602,10 @@
   2.172 +@@ -563,6 +621,10 @@
   2.173   	wr.global_pos = 0;
   2.174   	wr.previous_byte = 0;
   2.175   	wr.buffer_pos = 0;
   2.176 @@ -178,7 +210,7 @@
   2.177   
   2.178   	rc_init(&rc, fill, inbuf, in_len);
   2.179   
   2.180 -@@ -596,23 +639,23 @@
   2.181 +@@ -596,23 +658,23 @@
   2.182   	if (header.dict_size == 0)
   2.183   		header.dict_size = 1;
   2.184   
   2.185 @@ -206,7 +238,7 @@
   2.186   	rc_init_code(&rc);
   2.187   
   2.188   	while (get_pos(&wr) < header.dst_size) {
   2.189 -@@ -631,12 +674,25 @@
   2.190 +@@ -631,12 +693,25 @@
   2.191   
   2.192   	if (posp)
   2.193   		*posp = rc.ptr-rc.buffer;