diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-26 16:52:18 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-29 09:02:44 +0100 |
commit | 5e4a8202438504b1b034e2d29bdca6865a17d23f (patch) | |
tree | 9a7401c32336561deeae9682474db12eee8bf2e8 /patches/lzop-1.04 | |
parent | da169984e95eb41cdd579ace5af06b9d164acc20 (diff) | |
download | ptxdist-5e4a8202438504b1b034e2d29bdca6865a17d23f.tar.gz ptxdist-5e4a8202438504b1b034e2d29bdca6865a17d23f.tar.xz |
host-lzop: add some patches
One got lost in the update and another one add SOURCE_DATE_EPOCH support
for reproducible output.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/lzop-1.04')
-rw-r--r-- | patches/lzop-1.04/0001-make-block-size-configureable.patch | 63 | ||||
-rw-r--r-- | patches/lzop-1.04/0002-allow-overriding-modification-time.patch | 35 | ||||
-rw-r--r-- | patches/lzop-1.04/series | 5 |
3 files changed, 103 insertions, 0 deletions
diff --git a/patches/lzop-1.04/0001-make-block-size-configureable.patch b/patches/lzop-1.04/0001-make-block-size-configureable.patch new file mode 100644 index 000000000..1916f90dd --- /dev/null +++ b/patches/lzop-1.04/0001-make-block-size-configureable.patch @@ -0,0 +1,63 @@ +From: Sascha Hauer <s.hauer@pengutronix.de> +Date: Tue, 5 Oct 2010 15:36:03 +0200 +Subject: [PATCH] make block size configureable + +Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> +Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> +--- + src/lzop.c | 5 +++++ + src/p_lzo.c | 4 ++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/lzop.c b/src/lzop.c +index e34be8396c98..a540ad9c4d33 100644 +--- a/src/lzop.c ++++ b/src/lzop.c +@@ -2470,6 +2470,7 @@ char* prepare_shortopts(char *buf, const char *n, + return buf; + } + ++extern lzo_uint32 block_size; + + static int do_option(acc_getopt_p g, int optc) + { +@@ -2479,6 +2480,9 @@ static int do_option(acc_getopt_p g, int optc) + + switch (optc) + { ++ case 'b': ++ block_size = strtoul(mfx_optarg,NULL,0); ++ break; + case 'c': + opt_stdout = 1; + break; +@@ -2753,6 +2757,7 @@ static int get_options(int argc, char **argv) + + static const struct acc_getopt_longopt_t longopts[] = + { ++ {"blocksize", 1, 0, 'b'}, + {"best", 0, 0, '9'}, /* compress better */ + {"decompress", 0, 0, 'd'}, /* decompress */ + {"fast", 0, 0, '1'}, /* compress faster */ +diff --git a/src/p_lzo.c b/src/p_lzo.c +index 36716a2d163d..07e0766e23cd 100644 +--- a/src/p_lzo.c ++++ b/src/p_lzo.c +@@ -192,7 +192,7 @@ static lzo_bool alloc_mem(lzo_uint32 s1, lzo_uint32 s2, lzo_uint32 w) + **************************************************************************/ + + /* maybe make this an option ? */ +-static const lzo_uint32 block_size = BLOCK_SIZE; ++lzo_uint32 block_size = BLOCK_SIZE; + + lzo_bool lzo_enter(const header_t *h) + { +@@ -219,7 +219,7 @@ lzo_bool lzo_enter(const header_t *h) + #endif + assert(block_size <= BLOCK_SIZE); + assert(block_size <= MAX_BLOCK_SIZE); +- assert(block_size >= 16*1024); ++ assert(block_size >= 1024); + + if (opt_method == M_LZO1X_1) + wrk_len = LZO1X_1_MEM_COMPRESS; diff --git a/patches/lzop-1.04/0002-allow-overriding-modification-time.patch b/patches/lzop-1.04/0002-allow-overriding-modification-time.patch new file mode 100644 index 000000000..192d73c2b --- /dev/null +++ b/patches/lzop-1.04/0002-allow-overriding-modification-time.patch @@ -0,0 +1,35 @@ +From: =?UTF-8?q?Florian=20B=C3=A4uerle?= <florian.baeuerle@allegion.com> +Date: Thu, 25 Oct 2018 17:26:30 +0200 +Subject: [PATCH] allow overriding modification time + +--- + src/lzop.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/lzop.c b/src/lzop.c +index a540ad9c4d33..c2f877d16f92 100644 +--- a/src/lzop.c ++++ b/src/lzop.c +@@ -712,6 +712,7 @@ void init_compress_header(header_t *h, const file_t *fip, const file_t *fop) + assert(opt_method > 0); + assert(opt_level > 0); + assert(fip->st.st_mode == 0 || S_ISREG(fip->st.st_mode)); ++ const char *source_date_epoch = getenv("SOURCE_DATE_EPOCH"); + + memset(h,0,sizeof(header_t)); + +@@ -748,7 +749,13 @@ void init_compress_header(header_t *h, const file_t *fip, const file_t *fop) + + h->mode = fix_mode_for_header(fip->st.st_mode); + +- if (fip->st.st_mtime > 0) ++ if (source_date_epoch) ++ { ++ time_t mtime = strtoul(source_date_epoch, NULL, 0); ++ h->mtime_low = (lzo_uint32) (mtime); ++ h->mtime_high = (lzo_uint32) ((mtime >> 16) >> 16); ++ } ++ else if (fip->st.st_mtime > 0) + { + h->mtime_low = (lzo_uint32) (fip->st.st_mtime); + h->mtime_high = (lzo_uint32) ((fip->st.st_mtime >> 16) >> 16); diff --git a/patches/lzop-1.04/series b/patches/lzop-1.04/series new file mode 100644 index 000000000..b39beae13 --- /dev/null +++ b/patches/lzop-1.04/series @@ -0,0 +1,5 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-make-block-size-configureable.patch +0002-allow-overriding-modification-time.patch +# 60f89c991618def8b0cb0c6c07143d2f - git-ptx-patches magic |