Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's a Hardknott life for us. #65

Merged
merged 19 commits into from
Jul 22, 2021
Merged

Conversation

MagneFire
Copy link
Member

@MagneFire MagneFire commented Jun 13, 2021

Sorry about the title, this song has been stuck in my head ever since I realized Gatesgarth is EOL and Hardknott is the new stable...

This PR brings multiple changes (in commit order):

  • Compatibility with Yocto Hardknott as Gatesgarth is EOL.
  • Bump usb-moded to fix adb on sawfish
  • SDK fixes since the CMake changes to our core Asteroid apps. extra-cmake-modules is required for apps to compile.
  • Work towards a generic hybris solution.
    • As of Oreo bases we don't actually need to package system tarballs for specific watches, a generic approach can be used.

Other relevant PRs:

OpenEmbedded has two different GPL3 licenses the one used before still exists though under a different name.
adbd has been separated into a different package, use that one.
Using the default seccomp_filter causes sshd to exit with the following error:
fatal: privsep_preauth: preauth child terminated by signal 31

This is the second time this issue arose previously it was due to an incompatibility with older Linux kernels. A patch has been merged for that.

This time the cause is unknown, but the workaround that was suggested for the previous issue seems to work now too.

Reference: openssh/openssh-portable#149
OpenEmbedded has moved away from using autotools to build PulseAudio, it's using Meson now.
This patch adjusts the existing patch that adds pulsecore development headers needed for hybris plugins.
Adds patch to fix compilation issues with regards to undefined errno.
Create a file at /run/systemd/boot-status/init-done to indicate to usb-moded that the system has booted, without this usb-moded would ignore any usb-mode request change and stay in charge mode forever.
@jrtberlin jrtberlin added this to In progress in AsteroidOS 2.0 via automation Jun 14, 2021
And this fix was originally from upstream.
This package only provides dev files as such the actual package is empty.
When having this as a toolchain package it would result in extra-cmake-modules-dev depending on extra-cmake-modules which doesn't exist because it's empty.
This package only provides dev files as such the actual package is empty.
When having this as a toolchain package it would result in mcedevel-dev depending on mcedevel which doesn't exist because it's empty.

Adjust install stage to use the actuall make install command.
extra-cmake-modules is an added dependency since the AsteroidOS apps have transitioned to CMake.
mcedevel is needed to compile apps that use mce headers such as the settings app.
…n defined in machine.conf.

This is useful for when we transition to a more generic hybris solution where we use the exisiting partitions and having the hybris libraries located in /usr/libexec/.
No Asteroid component is using QtGraphicalEffects as it was buggy on tetra. However it is still useful to have this installed whenever someone wants to use it.
OpenEmbedded has separated adbd from android-tools include adbd as it is needed for debug-ramdisk mode.
…' issue.

For some reason when using the bootlogos with a transparent background it would result in some pixels not being rendered correctly, removing the transparency and replacing with full black solves this.
@MagneFire
Copy link
Member Author

Small note, I've also changed the backgrounds of the boot logos to full black this solves the issues where the boot logo would result in having a dead pixel.

The reference code I used to test this on my PC is as follows:

#include <stdint.h>
#include <stdbool.h>
typedef unsigned char uint8;
#include <gtk/gtk.h>
#include "psplash-poky-img.h"



#define IMAGE_WIDTH 256
#define IMAGE_HEIGHT    256

//guint8  myimage
static inline void
psplash_fb_plot_pixel (cairo_t *cr,
		       int          x,
		       int          y,
		       uint8        red,
		       uint8        green,
		       uint8        blue)
{
    
        cairo_set_source_rgb (cr, red/255.0, green/255.0, blue/255.0);
        cairo_rectangle (cr, x, y, 1, 1);
        cairo_fill (cr);
}


void
psplash_fb_draw_image (cairo_t    *fb,
		       int          x,
		       int          y,
		       int          img_width,
		       int          img_height,
		       int          img_bytes_per_pixel,
		       int          img_rowstride,
		       uint8       *rle_data)
{
  uint8       *p = rle_data;
  int          dx = 0, dy = 0,  total_len;
  unsigned int len;

  total_len = img_rowstride * img_height;

  /* FIXME: Optimise, check for over runs ... */
  while ((p - rle_data) < total_len)
    {
      len = *(p++);

      if (len & 128)
	{
	  len -= 128;

	  if (len == 0) break;

	  do
	    {
	      if ((img_bytes_per_pixel < 4 || *(p+3)) && dx < img_width)
	        psplash_fb_plot_pixel (fb, x+dx, y+dy, *(p), *(p+1), *(p+2));
	      if (++dx * img_bytes_per_pixel >= img_rowstride) { dx=0; dy++; }
	    }
	  while (--len);

	  p += img_bytes_per_pixel;
	}
      else
	{
	  if (len == 0) break;

	  do
	    {
	      if ((img_bytes_per_pixel < 4 || *(p+3)) && dx < img_width)
	        psplash_fb_plot_pixel (fb, x+dx, y+dy, *(p), *(p+1), *(p+2));
	      if (++dx * img_bytes_per_pixel >= img_rowstride) { dx=0; dy++; }
	      p += img_bytes_per_pixel;
	    }
	  while (--len && (p - rle_data) < total_len);
	}
    }
}


guchar rgbbuf[IMAGE_WIDTH * IMAGE_HEIGHT * 3];
gboolean on_darea_expose (GtkWidget *widget,
          GdkEventExpose *event,
          gpointer user_data);
int
main (int argc, char *argv[])
{


        GdkPixbuf *pixbuf;
        gint width;
        gint height;
        cairo_format_t format;
        cairo_surface_t *surface;
        cairo_t *cr;

        g_type_init ();
        //pixbuf = gdk_pixbuf_new_from_data(POKY_IMG_RLE_PIXEL_DATA, GDK_COLORSPACE_RGB, false, 8, POKY_IMG_WIDTH, POKY_IMG_HEIGHT, POKY_IMG_ROWSTRIDE, NULL, NULL);
        //pixbuf = gdk_pixbuf_new_from_file ("psplash-img-320.png", NULL);.
        pixbuf = gdk_pixbuf_new_from_inline (-1, myimage_inline, FALSE, NULL);
        
        g_assert (pixbuf != NULL);
        format = (gdk_pixbuf_get_has_alpha (pixbuf)) ? CAIRO_FORMAT_ARGB32 : CAIRO_FORMAT_RGB24;
        width = gdk_pixbuf_get_width (pixbuf);
        height = gdk_pixbuf_get_height (pixbuf);
        surface = cairo_image_surface_create (format, width, height);
        g_assert (surface != NULL);
        cr = cairo_create (surface);
        /* Draw the pixbuf */
        gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
        cairo_paint (cr);
        /* Draw a red rectangle */
        cairo_set_source_rgb (cr, 0, 0, 0);
        //cairo_rectangle (cr, width * .25, height * .25, width *.5, height *.5);
        cairo_rectangle (cr, 0, 0, width, height);
        cairo_fill (cr);
        //psplash_fb_plot_pixel(cr, 10, 10, 1, 0, 0);



  psplash_fb_draw_image (cr, 
			 (width  - POKY_IMG_WIDTH)/2, 
			 (height - POKY_IMG_HEIGHT)/2,
			 POKY_IMG_WIDTH,
			 POKY_IMG_HEIGHT,
			 POKY_IMG_BYTES_PER_PIXEL,
			 POKY_IMG_ROWSTRIDE,
			 POKY_IMG_RLE_PIXEL_DATA);

        /* Save to a PNG file */
        cairo_surface_write_to_png (surface, "output.png");
        cairo_surface_destroy (surface);
        cairo_destroy (cr);


  /*GtkWidget *window, *darea;
  gint x, y;
  guchar *pos;
  gtk_init (&argc, &argv);
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  darea = gtk_drawing_area_new ();
  gtk_widget_set_size_request (darea, IMAGE_WIDTH, IMAGE_HEIGHT);
  gtk_container_add (GTK_CONTAINER (window), darea);
  gtk_signal_connect (GTK_OBJECT (darea), "expose-event",
                  GTK_SIGNAL_FUNC (on_darea_expose), NULL);
  gtk_widget_show_all (window);
  pos = rgbbuf;
  for (y = 0; y < IMAGE_HEIGHT; y++)
    {
      for (x = 0; x < IMAGE_WIDTH; x++)
    {
      *pos++ = x - x % 32;
      *pos++ = (x / 32) * 4 + y - y % 32;
      *pos++ = y - y % 32;
    }
    }
  gtk_main ();
  return 0;*/
}
/*
gboolean
on_darea_expose (GtkWidget *widget,
     GdkEventExpose *event,
     gpointer user_data)
{
  gdk_draw_rgb_image (widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
          0, 0, IMAGE_WIDTH, IMAGE_HEIGHT,
          GDK_RGB_DITHER_MAX, rgbbuf, IMAGE_WIDTH * 3);
    GdkPixbuf * icon_title = gdk_pixbuf_new_from_data(POKY_IMG_RLE_PIXEL_DATA, GDK_COLORSPACE_RGB, false, POKY_IMG_BYTES_PER_PIXEL, POKY_IMG_WIDTH, POKY_IMG_HEIGHT, POKY_IMG_ROWSTRIDE, NULL, NULL);
    gtk_window_set_icon(window, icon_title);
  return TRUE;
}*/

To generate the header file I used the command:

./make-image-header.sh psplash-img-280.png POKY ; and mv psplash-img-280-img.h psplash-poky-img.h

This script is available in the psplash repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants