core/linux-aarch64-rc to 5.12.rc3-3

Changed logic for gathering dtb list to just use a wildcard for boards
that we're interested in.

Changed generate_chromebook_its.sh logic to just take in scattered dtb
files.

Compressed all input files that go into the .its
Here are some comparisons:
	none: 37M
	lz4: 17M < chosen in this commit
	lzma: ~10M but boots 1 second slower

Since it's compressed the .its now had to include external compatible
properties, used `fdtget .dtb / compatible`.
This commit is contained in:
Alexandru M Stan 2021-03-16 22:34:19 -07:00 committed by Kevin Mihelich
parent bbb3603ec4
commit 5784aa4823
2 changed files with 42 additions and 34 deletions

View file

@ -11,7 +11,7 @@ _srcname=linux-${_rcver}-rc${_rcrel}
_kernelname=${pkgbase#linux} _kernelname=${pkgbase#linux}
_desc="AArch64 multi-platform (release candidate)" _desc="AArch64 multi-platform (release candidate)"
pkgver=${_rcver}.rc${_rcrel} pkgver=${_rcver}.rc${_rcrel}
pkgrel=2 pkgrel=3
arch=('aarch64') arch=('aarch64')
url="http://www.kernel.org/" url="http://www.kernel.org/"
license=('GPL2') license=('GPL2')
@ -35,7 +35,7 @@ md5sums=('dc4fe4b1427b7223386205250988f55a'
'1553fe4abbe675ed8abd4644561d8e8c' '1553fe4abbe675ed8abd4644561d8e8c'
'9844db3484f4d4fa3e63c7e083f656f7' '9844db3484f4d4fa3e63c7e083f656f7'
'47c62c814000ad515ab71213c00734bf' '47c62c814000ad515ab71213c00734bf'
'beb35c282bbdadc0aab851d0ad4efd22' 'cb97c1ab32e0165cde8fb5eb68302225'
'61c5ff73c136ed07a7aadbf58db3d96a' '61c5ff73c136ed07a7aadbf58db3d96a'
'584777ae88bce2c5659960151b64c7d8' '584777ae88bce2c5659960151b64c7d8'
'41cb5fef62715ead2dd109dbea8413d6' '41cb5fef62715ead2dd109dbea8413d6'
@ -230,19 +230,23 @@ _package-chromebook() {
mkdir -p "${pkgdir}/boot" mkdir -p "${pkgdir}/boot"
../generate_chromebook_its.sh ${srcdir} > kernel.its << DT_END KARCH=arm64
rk3399-gru-bob image=arch/${KARCH}/boot/Image
rk3399-gru-kevin
rk3399-gru-scarlet-inx chromeos_boards=(
rk3399-gru-scarlet-kd 'elm'
sc7180-trogdor-lazor-r0 'gru'
sc7180-trogdor-lazor-r1 'kukui'
sc7180-trogdor-lazor-r1-kb 'trogdor'
sc7180-trogdor-lazor-r1-lte 'asurada'
sc7180-trogdor-lazor-r3 )
sc7180-trogdor-lazor-r3-kb chromebook_dtbs=($(for b in ${chromeos_boards[@]}; do find arch/${KARCH}/boot -name "*${b}*.dtb" | LC_COLLATE=C sort; done))
sc7180-trogdor-lazor-r3-lte
DT_END for to_compress in ${chromebook_dtbs[@]} ${image}; do
#lzma -9 -z -f -k ${to_compress} # This is 40% smaller but takes ~1 sec longer to boot
lz4 -20 -z -f ${to_compress}
done
echo ${chromebook_dtbs[@]/%/.lz4} | ../generate_chromebook_its.sh ${image}.lz4 ${KARCH} lz4 > kernel.its
mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg
dd if=/dev/zero of=bootloader.bin bs=512 count=1 dd if=/dev/zero of=bootloader.bin bs=512 count=1

View file

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
srcdir=$1 image=$1
read -r -d '' dt_list arch=$2
compression=$3
read -a dtb_list
cat <<-ITS_HEADER_END cat <<-ITS_HEADER_END
/dts-v1/; /dts-v1/;
@ -11,34 +13,30 @@ cat <<-ITS_HEADER_END
images { images {
kernel@1{ kernel@1{
description = "kernel"; description = "kernel";
data = /incbin/("arch/arm64/boot/Image"); data = /incbin/("${image}");
type = "kernel_noload"; type = "kernel_noload";
arch = "arm64"; arch = "${arch}";
os = "linux"; os = "linux";
compression = "none"; compression = "${compression}";
load = <0>; load = <0>;
entry = <0>; entry = <0>;
}; };
ITS_HEADER_END ITS_HEADER_END
its_entry_count=1 for i in ${!dtb_list[@]}; do
for dt in ${dt_list}; do dtb=${dtb_list[${i}]}
dts_path=${srcdir}/*/arch/arm64/boot/dts/*/${dt}.dts
! ls $dts_path >/dev/null && { echo "Error: dt not found $dt" >&2; exit 1; }
dt_dir=$(basename $(dirname ${dts_path}))
cat <<-FDT_END cat <<-FDT_END
fdt@${its_entry_count}{ fdt@$(expr ${i} + 1){
description = "${dt}.dtb"; description = "$(basename ${dtb})";
data = /incbin/("arch/arm64/boot/dts/${dt_dir}/${dt}.dtb"); data = /incbin/("${dtb}");
type = "flat_dt"; type = "flat_dt";
arch = "arm64"; arch = "${arch}";
compression = "none"; compression = "${compression}";
hash@1{ hash@1{
algo = "sha1"; algo = "sha1";
}; };
}; };
FDT_END FDT_END
let its_entry_count=${its_entry_count}+1
done done
cat <<-ITS_MIDDLE_END cat <<-ITS_MIDDLE_END
@ -47,11 +45,17 @@ cat <<-ITS_MIDDLE_END
default = "conf@1"; default = "conf@1";
ITS_MIDDLE_END ITS_MIDDLE_END
for((i=1;i<${its_entry_count};i++)); do for i in "${!dtb_list[@]}"; do
compat_line=""
dtb_uncompressed=$(echo ${dtb_list[${i}]} | sed "s/\(\.dtb\).*/\1/g")
for compat in $(fdtget "${dtb_uncompressed}" / compatible); do
compat_line+="\"${compat}\","
done
cat <<-ITS_CONF_END cat <<-ITS_CONF_END
conf@${i}{ conf@$(expr ${i} + 1){
kernel = "kernel@1"; kernel = "kernel@1";
fdt = "fdt@${i}"; fdt = "fdt@$(expr ${i} + 1)";
compatible = ${compat_line%,};
}; };
ITS_CONF_END ITS_CONF_END
done done