| .. | .. |
|---|
| 1 | 1 | #!/bin/sh |
|---|
| 2 | +# SPDX-License-Identifier: GPL-2.0-only |
|---|
| 2 | 3 | |
|---|
| 3 | 4 | # XIP kernel .data segment compressor |
|---|
| 4 | 5 | # |
|---|
| 5 | 6 | # Created by: Nicolas Pitre, August 2017 |
|---|
| 6 | 7 | # Copyright: (C) 2017 Linaro Limited |
|---|
| 7 | 8 | # |
|---|
| 8 | | -# This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | -# it under the terms of the GNU General Public License version 2 as |
|---|
| 10 | | -# published by the Free Software Foundation. |
|---|
| 11 | 9 | |
|---|
| 12 | 10 | # This script locates the start of the .data section in xipImage and |
|---|
| 13 | 11 | # substitutes it with a compressed version. The needed offsets are obtained |
|---|
| .. | .. |
|---|
| 58 | 56 | # substitute the data section by a compressed version |
|---|
| 59 | 57 | $DD if="$XIPIMAGE" count=$data_start iflag=count_bytes of="$XIPIMAGE.tmp" |
|---|
| 60 | 58 | $DD if="$XIPIMAGE" skip=$data_start iflag=skip_bytes | |
|---|
| 61 | | -gzip -9 >> "$XIPIMAGE.tmp" |
|---|
| 59 | +$KGZIP -9 >> "$XIPIMAGE.tmp" |
|---|
| 62 | 60 | |
|---|
| 63 | 61 | # replace kernel binary |
|---|
| 64 | 62 | mv -f "$XIPIMAGE.tmp" "$XIPIMAGE" |
|---|