Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Odroid C2 NEXT and DEV branches, need testing
- Loading branch information
1 parent
29da133
commit b779446
Showing
100 changed files
with
34,623 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/scripts/package/builddeb | ||
+++ b/scripts/package/builddeb | ||
@@ -218,7 +218,7 @@ | ||
for script in postinst postrm preinst prerm ; do | ||
mkdir -p "$tmpdir$debhookdir/$script.d" | ||
cat <<EOF > "$tmpdir/DEBIAN/$script" | ||
-#!/bin/sh | ||
+#!/bin/bash | ||
|
||
set -e | ||
|
198 changes: 198 additions & 0 deletions
198
patch/kernel/odroidc2-dev/packaging-4.x-DEV-with-postinstall-scripts.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
diff --git a/scripts/package/builddeb b/scripts/package/builddeb | ||
index 807c9cd..9b9435f 100755 | ||
--- a/scripts/package/builddeb | ||
+++ b/scripts/package/builddeb | ||
@@ -29,6 +29,28 @@ create_package() { | ||
# in case we are in a restrictive umask environment like 0077 | ||
chmod -R a+rX "$pdir" | ||
|
||
+ # Create preinstall and post install script to remove dtb | ||
+ if [[ "$1" == *dtb* ]]; then | ||
+ echo "if [ -d /boot/dtb-$version ]; then mv /boot/dtb-$version /boot/dtb-$version.old; fi" >> $pdir/DEBIAN/preinst | ||
+ echo "if [ -d /boot/dtb.old ]; then rm -rf /boot/dtb.old; fi" >> $pdir/DEBIAN/preinst | ||
+ echo "if [ -d /dtb ]; then mv /dtb /dtb.old; fi" >> $pdir/DEBIAN/preinst | ||
+ echo "if [ -d /boot/dtb ]; then mv /boot/dtb /boot/dtb.old; fi" >> $pdir/DEBIAN/preinst | ||
+ echo "exit 0" >> $pdir/DEBIAN/preinst | ||
+ chmod 775 $pdir/DEBIAN/preinst | ||
+ # | ||
+ echo "if [ -d /boot/dtb-$version.old ]; then rm -rf /boot/dtb-$version.old; fi" >> $pdir/DEBIAN/postinst | ||
+ echo "ln -sf dtb-$version /boot/dtb > /dev/null 2>&1 || mv /boot/dtb-$version /boot/dtb" >> $pdir/DEBIAN/postinst | ||
+ echo "exit 0" >> $pdir/DEBIAN/postinst | ||
+ chmod 775 $pdir/DEBIAN/postinst | ||
+ fi | ||
+ | ||
+ # Create postinstall script for headers | ||
+ if [[ "$1" == *headers* ]]; then | ||
+ echo "cd /usr/src/linux-headers-$version; echo \"Compiling headers - please wait ...\"; make -s scripts >/dev/null 2>&1" >> $pdir/DEBIAN/postinst | ||
+ echo "exit 0" >> $pdir/DEBIAN/postinst | ||
+ chmod 775 $pdir/DEBIAN/postinst | ||
+ fi | ||
+ | ||
# Create the package | ||
dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch}" -p$pname -P"$pdir" | ||
dpkg --build "$pdir" .. | ||
@@ -95,11 +117,13 @@ tmpdir="$objtree/debian/tmp" | ||
fwdir="$objtree/debian/fwtmp" | ||
kernel_headers_dir="$objtree/debian/hdrtmp" | ||
libc_headers_dir="$objtree/debian/headertmp" | ||
+dtb_dir="$objtree/debian/dtbtmp" | ||
dbg_dir="$objtree/debian/dbgtmp" | ||
-packagename=linux-image-$version | ||
-fwpackagename=linux-firmware-image-$version | ||
-kernel_headers_packagename=linux-headers-$version | ||
-libc_headers_packagename=linux-libc-dev | ||
+packagename=linux-image-dev"$LOCALVERSION" | ||
+fwpackagename=linux-firmware-image-dev"$LOCALVERSION" | ||
+kernel_headers_packagename=linux-headers-dev"$LOCALVERSION" | ||
+dtb_packagename=linux-dtb-dev"$LOCALVERSION" | ||
+libc_headers_packagename=linux-libc-dev-dev"$LOCALVERSION" | ||
dbg_packagename=$packagename-dbg | ||
debarch= | ||
forcearch= | ||
@@ -126,7 +150,9 @@ esac | ||
BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)" | ||
|
||
# Setup the directory structure | ||
-rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files | ||
+rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" "$dtb_dir" $objtree/debian/files | ||
+mkdir -m 755 -p "$dtb_dir/DEBIAN" | ||
+mkdir -p "$dtb_dir/boot/dtb-$version" "$dtb_dir/usr/share/doc/$dtb_packagename" | ||
mkdir -m 755 -p "$tmpdir/DEBIAN" | ||
mkdir -p "$tmpdir/lib" "$tmpdir/boot" | ||
mkdir -p "$fwdir/lib/firmware/$version/" | ||
@@ -180,6 +206,11 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then | ||
fi | ||
fi | ||
|
||
+if grep -q '^CONFIG_OF=y' $KCONFIG_CONFIG ; then | ||
+ #mkdir -p "$tmpdir/boot/dtb" | ||
+ INSTALL_DTBS_PATH="$dtb_dir/boot/dtb-$version" $MAKE KBUILD_SRC= dtbs_install | ||
+fi | ||
+ | ||
if [ "$ARCH" != "um" ]; then | ||
$MAKE headers_check KBUILD_SRC= | ||
$MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" | ||
@@ -192,7 +223,7 @@ fi | ||
# so do we; recent versions of dracut and initramfs-tools will obey this. | ||
debhookdir=${KDEB_HOOKDIR:-/etc/kernel} | ||
if grep -q '^CONFIG_BLK_DEV_INITRD=y' $KCONFIG_CONFIG; then | ||
- want_initrd=Yes | ||
+ want_initrd=Yes | ||
else | ||
want_initrd=No | ||
fi | ||
@@ -204,9 +235,11 @@ for script in postinst postrm preinst prerm ; do | ||
set -e | ||
|
||
# Pass maintainer script parameters to hook scripts | ||
+ | ||
export DEB_MAINT_PARAMS="\$*" | ||
|
||
# Tell initramfs builder whether it's wanted | ||
+ | ||
export INITRD=$want_initrd | ||
|
||
test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d | ||
@@ -215,6 +248,55 @@ EOF | ||
chmod 755 "$tmpdir/DEBIAN/$script" | ||
done | ||
|
||
+## | ||
+## Create sym link to kernel image | ||
+## | ||
+sed -e "s/set -e//g" -i $tmpdir/DEBIAN/postinst | ||
+sed -e "s/exit 0//g" -i $tmpdir/DEBIAN/postinst | ||
+cat >> $tmpdir/DEBIAN/postinst <<EOT | ||
+if [ "\$(grep nand /proc/partitions)" != "" ] && [ "\$(grep mmc /proc/partitions)" = "" ]; then | ||
+mkimage -A arm -O linux -T kernel -C none -a "0x40008000" -e "0x40008000" -n "Linux kernel" -d /$installed_image_path /boot/uImage > /dev/null 2>&1 | ||
+cp /boot/uImage /tmp/uImage | ||
+sync | ||
+mountpoint -q /boot || mount /boot | ||
+cp /tmp/uImage /boot/uImage | ||
+rm -f /$installed_image_path | ||
+else | ||
+ln -sf $(basename $installed_image_path) /boot/zImage > /dev/null 2>&1 || mv /$installed_image_path /boot/zImage | ||
+fi | ||
+touch /boot/.next | ||
+exit 0 | ||
+EOT | ||
+## | ||
+## FAT install workaround | ||
+## | ||
+sed -e "s/set -e//g" -i $tmpdir/DEBIAN/preinst | ||
+sed -e "s/exit 0//g" -i $tmpdir/DEBIAN/preinst | ||
+cat >> $tmpdir/DEBIAN/preinst <<EOT | ||
+# exit if we are running chroot | ||
+if [ "\$(stat -c %d:%i /)" != "\$(stat -c %d:%i /proc/1/root/.)" ]; then exit 0; fi | ||
+ | ||
+check_and_unmount (){ | ||
+boot_device=\$(mountpoint -d /boot) | ||
+ | ||
+for file in /dev/* ; do | ||
+ CURRENT_DEVICE=\$(printf "%d:%d" \$(stat --printf="0x%t 0x%T" \$file)) | ||
+ if [[ "\$CURRENT_DEVICE" = "\$boot_device" ]]; then | ||
+ boot_partition=\$file | ||
+ break; | ||
+ fi | ||
+done | ||
+ | ||
+bootfstype=\$(blkid -s TYPE -o value \$boot_partition) | ||
+if [ "\$bootfstype" = "vfat" ]; then | ||
+umount /boot; | ||
+rm -f /boot/System.map* /boot/config* /boot/vmlinuz* /boot/zImage /boot/uImage | ||
+fi | ||
+} | ||
+mountpoint -q /boot && check_and_unmount | ||
+EOT | ||
+echo "exit 0" >> $tmpdir/DEBIAN/preinst | ||
+ | ||
# Try to determine maintainer and email values | ||
if [ -n "$DEBEMAIL" ]; then | ||
email=$DEBEMAIL | ||
@@ -329,12 +411,20 @@ if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then | ||
fi | ||
destdir=$kernel_headers_dir/usr/src/linux-headers-$version | ||
mkdir -p "$destdir" | ||
+######################## headers patch | ||
+ZACNI=$(pwd) | ||
+cd $destdir | ||
+patch -p1 < /tmp/headers-debian-byteshift.patch | ||
+cd $ZACNI | ||
+######################## headers patch | ||
(cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -) | ||
(cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -) | ||
(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be | ||
ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build" | ||
rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" | ||
|
||
+(cd "$destdir"; make M=scripts clean) | ||
+ | ||
cat <<EOF >> debian/control | ||
|
||
Package: $kernel_headers_packagename | ||
@@ -363,6 +453,16 @@ fi | ||
|
||
cat <<EOF >> debian/control | ||
|
||
+Package: $dtb_packagename | ||
+Architecture: any | ||
+Description: Linux DTB, version $version | ||
+ This package contains device blobs from the Linux kernel, version $version. | ||
+EOF | ||
+ | ||
+create_package "$dtb_packagename" "$dtb_dir" | ||
+ | ||
+cat <<EOF >> debian/control | ||
+ | ||
Package: $libc_headers_packagename | ||
Section: devel | ||
Provides: linux-kernel-headers | ||
@@ -374,7 +474,7 @@ EOF | ||
|
||
if [ "$ARCH" != "um" ]; then | ||
create_package "$kernel_headers_packagename" "$kernel_headers_dir" | ||
- create_package "$libc_headers_packagename" "$libc_headers_dir" | ||
+# create_package "$libc_headers_packagename" "$libc_headers_dir" | ||
fi | ||
|
||
create_package "$packagename" "$tmpdir" |
32 changes: 32 additions & 0 deletions
32
patch/kernel/odroidc2-next/0001-ARM64-dts-meson-gxbb-Add-gpio-ranges.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 86f0b91719a9d97095187af6ddaade3b34dc1257 Mon Sep 17 00:00:00 2001 | ||
From: Neil Armstrong <narmstrong@baylibre.com> | ||
Date: Thu, 16 Mar 2017 09:38:10 +0100 | ||
Subject: [PATCH 01/93] ARM64: dts: meson-gxbb: Add gpio-ranges | ||
|
||
--- | ||
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | ||
index b353073..2be29a3 100644 | ||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | ||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | ||
@@ -186,6 +186,7 @@ | ||
reg-names = "mux", "pull", "gpio"; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
+ gpio-ranges = <&pinctrl_aobus 0 0 14>; | ||
}; | ||
|
||
uart_ao_a_pins: uart_ao_a { | ||
@@ -279,6 +280,7 @@ | ||
reg-names = "mux", "pull", "pull-enable", "gpio"; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
+ gpio-ranges = <&pinctrl_periphs 0 14 120>; | ||
}; | ||
|
||
emmc_pins: emmc { | ||
-- | ||
1.9.1 | ||
|
40 changes: 40 additions & 0 deletions
40
patch/kernel/odroidc2-next/0002-pinctrl-meson-use-gpio-ranges-from-DT.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From be24356f2a4214a9efbb28441f58cfd91aefb4b4 Mon Sep 17 00:00:00 2001 | ||
From: Neil Armstrong <narmstrong@baylibre.com> | ||
Date: Thu, 16 Mar 2017 09:40:16 +0100 | ||
Subject: [PATCH 02/93] pinctrl: meson: use gpio-ranges from DT | ||
|
||
--- | ||
drivers/pinctrl/meson/pinctrl-meson.c | 14 +------------- | ||
1 file changed, 1 insertion(+), 13 deletions(-) | ||
|
||
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c | ||
index 620c231a..3372ce9 100644 | ||
--- a/drivers/pinctrl/meson/pinctrl-meson.c | ||
+++ b/drivers/pinctrl/meson/pinctrl-meson.c | ||
@@ -557,22 +557,10 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc) | ||
if (ret) { | ||
dev_err(pc->dev, "can't add gpio chip %s\n", | ||
pc->data->name); | ||
- goto fail; | ||
- } | ||
- | ||
- ret = gpiochip_add_pin_range(&pc->chip, dev_name(pc->dev), | ||
- 0, pc->data->pin_base, | ||
- pc->chip.ngpio); | ||
- if (ret) { | ||
- dev_err(pc->dev, "can't add pin range\n"); | ||
- goto fail; | ||
+ return ret; | ||
} | ||
|
||
return 0; | ||
-fail: | ||
- gpiochip_remove(&pc->chip); | ||
- | ||
- return ret; | ||
} | ||
|
||
static struct regmap_config meson_regmap_config = { | ||
-- | ||
1.9.1 | ||
|
32 changes: 32 additions & 0 deletions
32
patch/kernel/odroidc2-next/0003-ARM64-dts-meson-gxbb-Add-USB-Hub-GPIO-hog.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 58d7c939ec531f768b03b0be2a714805a6aac3cf Mon Sep 17 00:00:00 2001 | ||
From: Neil Armstrong <narmstrong@baylibre.com> | ||
Date: Thu, 16 Mar 2017 09:40:48 +0100 | ||
Subject: [PATCH 03/93] ARM64: dts: meson-gxbb: Add USB Hub GPIO hog | ||
|
||
--- | ||
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 9 +++++++++ | ||
1 file changed, 9 insertions(+) | ||
|
||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | ||
index c59403a..492ac35 100644 | ||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | ||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | ||
@@ -177,6 +177,15 @@ | ||
pinctrl-names = "default"; | ||
}; | ||
|
||
+&gpio_ao { | ||
+ usb-hub { | ||
+ gpio-hog; | ||
+ gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>; | ||
+ output-high; | ||
+ line-name = "usb-hub-reset"; | ||
+ }; | ||
+}; | ||
+ | ||
&usb0_phy { | ||
status = "okay"; | ||
phy-supply = <&usb_otg_pwr>; | ||
-- | ||
1.9.1 | ||
|
Oops, something went wrong.
It should be either
tag:v4.10.17
orbranch:linux-4.10.y