diff mbox

[1/2,v3] odroid-scripts: New Package.

Message ID 20160724055602.7159-1-daggs@gmx.com
State Superseded
Headers show

Commit Message

Dagg Stompler July 24, 2016, 5:56 a.m. UTC
v2 -> v3:
 - update repo rev to a252de04562dcf8d8a4918a544b45a9e3d46d2fb.
 - update hash

v1 -> v2:
 - fix hash type in hash file.

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 configs/odroidc2_defconfig                 |  1 +
 package/Config.in                          |  1 +
 package/odroid-scripts/Config.in           |  7 +++++++
 package/odroid-scripts/S50odroidc2_fb      | 20 +++++++++++++++++++
 package/odroid-scripts/odroid-scripts.hash |  2 ++
 package/odroid-scripts/odroid-scripts.mk   | 32 ++++++++++++++++++++++++++++++
 6 files changed, 63 insertions(+)
 create mode 100644 package/odroid-scripts/Config.in
 create mode 100644 package/odroid-scripts/S50odroidc2_fb
 create mode 100644 package/odroid-scripts/odroid-scripts.hash
 create mode 100644 package/odroid-scripts/odroid-scripts.mk

Comments

Thomas Petazzoni July 24, 2016, 12:40 p.m. UTC | #1
Hello,

On Sun, 24 Jul 2016 08:56:01 +0300, Dagg Stompler wrote:
> v2 -> v3:
>  - update repo rev to a252de04562dcf8d8a4918a544b45a9e3d46d2fb.
>  - update hash
> 
> v1 -> v2:
>  - fix hash type in hash file.

The changelog should not be part of the commit log.

> 
> Signed-off-by: Dagg Stompler <daggs@gmx.com>
> ---

It should be here.

>  configs/odroidc2_defconfig                 |  1 +
>  package/Config.in                          |  1 +
>  package/odroid-scripts/Config.in           |  7 +++++++
>  package/odroid-scripts/S50odroidc2_fb      | 20 +++++++++++++++++++
>  package/odroid-scripts/odroid-scripts.hash |  2 ++
>  package/odroid-scripts/odroid-scripts.mk   | 32 ++++++++++++++++++++++++++++++
>  6 files changed, 63 insertions(+)
>  create mode 100644 package/odroid-scripts/Config.in
>  create mode 100644 package/odroid-scripts/S50odroidc2_fb
>  create mode 100644 package/odroid-scripts/odroid-scripts.hash
>  create mode 100644 package/odroid-scripts/odroid-scripts.mk
> 
> diff --git a/configs/odroidc2_defconfig b/configs/odroidc2_defconfig
> index 43c2787..45ede62 100644
> --- a/configs/odroidc2_defconfig
> +++ b/configs/odroidc2_defconfig
> @@ -6,6 +6,7 @@ BR2_TARGET_GENERIC_HOSTNAME="odroidc2"
>  BR2_TARGET_ROOTFS_EXT2=y
>  BR2_TARGET_ROOTFS_EXT2_4=y
>  BR2_ROOTFS_POST_IMAGE_SCRIPT="board/hardkernel/odroidc2/post-image.sh"
> +BR2_PACKAGE_ODROID_SCRIPTS=y

This should be part of a separate commit.


> +ODROID_SCRIPTS_VERSION = a252de04562dcf8d8a4918a544b45a9e3d46d2fb
> +ODROID_SCRIPTS_SITE = $(call github,mdrjr,c2_bootini,$(ODROID_SCRIPTS_VERSION))

This repository contains the boot.ini for which you add a copy in
Buildroot (see our discussion from yesterday). Why don't we use this
one? It seems to be pretty much the same.

> +ODROID_SCRIPTS_LICENSE = unclear
> +
> +ifeq ($(BR2_PACKAGE_EUDEV),y)

BR2_PACKAGE_HAS_UDEV

so that it also works with systemd

> +	ODROID_SCRIPTS_INSTALL_UDEV_RULES = $(INSTALL) -D -m 0644 $(@D)/10-odroid.rules $(TARGET_DIR)/etc/udev/rules.d/10-odroid.rules

Please use:

define ODROID_SCRIPTS_INSTALL_UDEV_RULES
	$(INSTALL) -D -m 0644 $(@D)/10-odroid.rules $(TARGET_DIR)/etc/udev/rules.d/10-odroid.rules
endef

> +else
> +	ODROID_SCRIPTS_INSTALL_UDEV_RULES =

Not needed, by default variables are empty.

> +endif
> +
> +define ODROID_SCRIPTS_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/c2_init.sh $(TARGET_DIR)/usr/sbin/odroidc2_init_fb.sh
> +	$(ODROID_SCRIPTS_INSTALL_UDEV_RULES)
> +endef
> +
> +define ODROID_SCRIPTS_INSTALL_INIT_SYSTEMD
> +	$(INSTALL) -D -m 0644 $(@D)/amlogic.service $(TARGET_DIR)/usr/lib/systemd/system/odroidc2_fb.service
> +	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> +	ln -fs ../../../../usr/lib/systemd/system/odroidc2_fb.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/odroidc2_fb.service
> +endef
> +
> +define ODROID_SCRIPTS_INSTALL_INIT_SYSV
> +	$(INSTALL) -D -m 0755 package/odroid-scripts/S50odroidc2_fb $(TARGET_DIR)/etc/init.d/S50odroidc2_fb
> +endef

Other than that, looks good. Can you respin a new version?

Thanks!

Thomas
Dagg Stompler July 24, 2016, 1:26 p.m. UTC | #2
Greetings,

> Hello,
> 
> On Sun, 24 Jul 2016 08:56:01 +0300, Dagg Stompler wrote:
> > v2 -> v3:
> >  - update repo rev to a252de04562dcf8d8a4918a544b45a9e3d46d2fb.
> >  - update hash
> > 
> > v1 -> v2:
> >  - fix hash type in hash file.
> 
> The changelog should not be part of the commit log.
> 
> > 
> > Signed-off-by: Dagg Stompler <daggs@gmx.com>
> > ---
> 
> It should be here.

I always seems to forget were to place it.... :-/

> 
> >  configs/odroidc2_defconfig                 |  1 +
> >  package/Config.in                          |  1 +
> >  package/odroid-scripts/Config.in           |  7 +++++++
> >  package/odroid-scripts/S50odroidc2_fb      | 20 +++++++++++++++++++
> >  package/odroid-scripts/odroid-scripts.hash |  2 ++
> >  package/odroid-scripts/odroid-scripts.mk   | 32 ++++++++++++++++++++++++++++++
> >  6 files changed, 63 insertions(+)
> >  create mode 100644 package/odroid-scripts/Config.in
> >  create mode 100644 package/odroid-scripts/S50odroidc2_fb
> >  create mode 100644 package/odroid-scripts/odroid-scripts.hash
> >  create mode 100644 package/odroid-scripts/odroid-scripts.mk
> > 
> > diff --git a/configs/odroidc2_defconfig b/configs/odroidc2_defconfig
> > index 43c2787..45ede62 100644
> > --- a/configs/odroidc2_defconfig
> > +++ b/configs/odroidc2_defconfig
> > @@ -6,6 +6,7 @@ BR2_TARGET_GENERIC_HOSTNAME="odroidc2"
> >  BR2_TARGET_ROOTFS_EXT2=y
> >  BR2_TARGET_ROOTFS_EXT2_4=y
> >  BR2_ROOTFS_POST_IMAGE_SCRIPT="board/hardkernel/odroidc2/post-image.sh"
> > +BR2_PACKAGE_ODROID_SCRIPTS=y
> 
> This should be part of a separate commit.

will do.

> 
> 
> > +ODROID_SCRIPTS_VERSION = a252de04562dcf8d8a4918a544b45a9e3d46d2fb
> > +ODROID_SCRIPTS_SITE = $(call github,mdrjr,c2_bootini,$(ODROID_SCRIPTS_VERSION))
> 
> This repository contains the boot.ini for which you add a copy in
> Buildroot (see our discussion from yesterday). Why don't we use this
> one? It seems to be pretty much the same.

nope it isn't, as said in the other mail, there are two parts that will cause the image to fail booting or misbehave:
1. consider the following diff:
+# Booting

-# Load Images
 setenv loadaddr "0x11000000"
-setenv dtb_loadaddr "0x10000000"
+setenv dtb_loadaddr "0x1000000"
+setenv initrd_loadaddr "0x13000000"
+
+fatload mmc 0:1 ${initrd_loadaddr} uInitrd
 fatload mmc 0:1 ${loadaddr} Image
 fatload mmc 0:1 ${dtb_loadaddr} meson64_odroidc2.dtb
+fdt addr ${dtb_loadaddr}

-# Booting
-booti ${loadaddr} - ${dtb_loadaddr}
+ ...
+
+booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}

this will force buildroot to provide an initrd image, when asked, I was told to fetch the ubuntu's one.
if no initrd is provided, the system will fail boot.
also taking ubuntu's initrd means hijacking it.

2. consider the following diff:
 # Default Console Device Setting
-setenv condev "console=ttyS0,115200n8" # Serial Console
+setenv condev "console=ttyS0,115200n8 console=tty0"   # on both

this resulted im my serial usb stop working, e.g. I didn't know where I was in the boot nor couldn't log in into the system.

without both of the changes, the system boots ok.

> 
> > +ODROID_SCRIPTS_LICENSE = unclear
> > +
> > +ifeq ($(BR2_PACKAGE_EUDEV),y)
> 
> BR2_PACKAGE_HAS_UDEV
> 
> so that it also works with systemd

will do.

> 
> > +	ODROID_SCRIPTS_INSTALL_UDEV_RULES = $(INSTALL) -D -m 0644 $(@D)/10-odroid.rules $(TARGET_DIR)/etc/udev/rules.d/10-odroid.rules
> 
> Please use:
> 
> define ODROID_SCRIPTS_INSTALL_UDEV_RULES
> 	$(INSTALL) -D -m 0644 $(@D)/10-odroid.rules $(TARGET_DIR)/etc/udev/rules.d/10-odroid.rules
> endef
> 

same as above.

> > +else
> > +	ODROID_SCRIPTS_INSTALL_UDEV_RULES =
> 
> Not needed, by default variables are empty.

will remove.

> 
> > +endif
> > +
> > +define ODROID_SCRIPTS_INSTALL_TARGET_CMDS
> > +	$(INSTALL) -D -m 0755 $(@D)/c2_init.sh $(TARGET_DIR)/usr/sbin/odroidc2_init_fb.sh
> > +	$(ODROID_SCRIPTS_INSTALL_UDEV_RULES)
> > +endef
> > +
> > +define ODROID_SCRIPTS_INSTALL_INIT_SYSTEMD
> > +	$(INSTALL) -D -m 0644 $(@D)/amlogic.service $(TARGET_DIR)/usr/lib/systemd/system/odroidc2_fb.service
> > +	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> > +	ln -fs ../../../../usr/lib/systemd/system/odroidc2_fb.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/odroidc2_fb.service
> > +endef
> > +
> > +define ODROID_SCRIPTS_INSTALL_INIT_SYSV
> > +	$(INSTALL) -D -m 0755 package/odroid-scripts/S50odroidc2_fb $(TARGET_DIR)/etc/init.d/S50odroidc2_fb
> > +endef
> 
> Other than that, looks good. Can you respin a new version?

maybe later today.

thanks for the rejects.

> 
> Thanks!
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
Thomas Petazzoni July 24, 2016, 1:33 p.m. UTC | #3
Hello,

On Sun, 24 Jul 2016 15:26:24 +0200, daggs wrote:

> > The changelog should not be part of the commit log.
> >   
> > > 
> > > Signed-off-by: Dagg Stompler <daggs@gmx.com>
> > > ---  
> > 
> > It should be here.  
> 
> I always seems to forget were to place it.... :-/

It's pretty simple:

"""
foo: new package

Blabla what this new package is all about. Blabla.

Signed-off-by: John Doe
---
Changes since v2:
 ...
"""

Everything that is *above* the "---" sign gets kept in the Git history
as the commit log. Everything that is *below" the "---" sign is ignored
when the patch is applied.

Since the changelog is describing what was changed between iterations
of the patch, we don't want the changelog to be committed forever in
the Git history, so it should be below the "---" sign.

When doing a commit, you can simply introduce a "---" manually below
your Signed-off-by and write your changelog here.


> this resulted im my serial usb stop working, e.g. I didn't know where I was in the boot nor couldn't log in into the system.
> 
> without both of the changes, the system boots ok.

OK, makes sense. Thanks for explaining.

> > Other than that, looks good. Can you respin a new version?  
> 
> maybe later today.

Sure, or another day, there's no hurry.

Best regards,

Thomas
diff mbox

Patch

diff --git a/configs/odroidc2_defconfig b/configs/odroidc2_defconfig
index 43c2787..45ede62 100644
--- a/configs/odroidc2_defconfig
+++ b/configs/odroidc2_defconfig
@@ -6,6 +6,7 @@  BR2_TARGET_GENERIC_HOSTNAME="odroidc2"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/hardkernel/odroidc2/post-image.sh"
+BR2_PACKAGE_ODROID_SCRIPTS=y
 
 # Kernel
 BR2_KERNEL_HEADERS_VERSION=y
diff --git a/package/Config.in b/package/Config.in
index 46ad276..a7858dc 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1688,6 +1688,7 @@  menu "System tools"
 	source "package/ncdu/Config.in"
 	source "package/numactl/Config.in"
 	source "package/nut/Config.in"
+	source "package/odroid-scripts/Config.in"
 	source "package/openvmtools/Config.in"
 	source "package/polkit/Config.in"
 	source "package/powerpc-utils/Config.in"
diff --git a/package/odroid-scripts/Config.in b/package/odroid-scripts/Config.in
new file mode 100644
index 0000000..48544b6
--- /dev/null
+++ b/package/odroid-scripts/Config.in
@@ -0,0 +1,7 @@ 
+config BR2_PACKAGE_ODROID_SCRIPTS
+	bool "odroid-scripts"
+	depends on BR2_aarch64 || BR2_arm
+	help
+	  Install the scripts for the odroidc2 based systems.
+
+	  https://github.com/mdrjr/c2_bootini
diff --git a/package/odroid-scripts/S50odroidc2_fb b/package/odroid-scripts/S50odroidc2_fb
new file mode 100644
index 0000000..2aae59d
--- /dev/null
+++ b/package/odroid-scripts/S50odroidc2_fb
@@ -0,0 +1,20 @@ 
+#!/bin/sh
+#
+# Set up frame buffer
+#
+
+case "$1" in
+    start)
+        echo "Setting up display..."
+        /usr/sbin/odroidc2_init_fb.sh
+        ;;
+    stop)
+        ;;
+    restart|reload)
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+esac
+
+exit $?
diff --git a/package/odroid-scripts/odroid-scripts.hash b/package/odroid-scripts/odroid-scripts.hash
new file mode 100644
index 0000000..8fd4b2c
--- /dev/null
+++ b/package/odroid-scripts/odroid-scripts.hash
@@ -0,0 +1,2 @@ 
+#  Locally computed hash
+sha256 779e8beccf8c66d51e495a4cc0e6eccf72c295499a1ecdc0740aa4459de786a0 odroid-scripts-a252de04562dcf8d8a4918a544b45a9e3d46d2fb.tar.gz
diff --git a/package/odroid-scripts/odroid-scripts.mk b/package/odroid-scripts/odroid-scripts.mk
new file mode 100644
index 0000000..445f2d8
--- /dev/null
+++ b/package/odroid-scripts/odroid-scripts.mk
@@ -0,0 +1,32 @@ 
+################################################################################
+#
+# odroid-scripts
+#
+################################################################################
+
+ODROID_SCRIPTS_VERSION = a252de04562dcf8d8a4918a544b45a9e3d46d2fb
+ODROID_SCRIPTS_SITE = $(call github,mdrjr,c2_bootini,$(ODROID_SCRIPTS_VERSION))
+ODROID_SCRIPTS_LICENSE = unclear
+
+ifeq ($(BR2_PACKAGE_EUDEV),y)
+	ODROID_SCRIPTS_INSTALL_UDEV_RULES = $(INSTALL) -D -m 0644 $(@D)/10-odroid.rules $(TARGET_DIR)/etc/udev/rules.d/10-odroid.rules
+else
+	ODROID_SCRIPTS_INSTALL_UDEV_RULES =
+endif
+
+define ODROID_SCRIPTS_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/c2_init.sh $(TARGET_DIR)/usr/sbin/odroidc2_init_fb.sh
+	$(ODROID_SCRIPTS_INSTALL_UDEV_RULES)
+endef
+
+define ODROID_SCRIPTS_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/amlogic.service $(TARGET_DIR)/usr/lib/systemd/system/odroidc2_fb.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../../../../usr/lib/systemd/system/odroidc2_fb.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/odroidc2_fb.service
+endef
+
+define ODROID_SCRIPTS_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/odroid-scripts/S50odroidc2_fb $(TARGET_DIR)/etc/init.d/S50odroidc2_fb
+endef
+
+$(eval $(generic-package))