Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

January 07 2016

11:18

2015-12-01 Meeting Minutes

Meeting held 2015-12-01 on FreeNode, channel #maemo-meeting (logs)

Attending: Peter Leinchen (peterleinchen), Halit Bal (HtheB), Gido Griese (Win7Mac), Jussi Ohenoja (juiceme)

Partial: Bernardo Reino (reinob)

Absent:

Summary of topics (ordered by discussion):

  • Discussing handling of ex-members accounts
  • Automatic calculation of election results
  • Finalizing the rules for the coding competition

(Topic Discussing handling of ex-members accounts):

  • Discussion about ex-users that still receive maermo mails; It seems that in some cases even when an user removes his account or requests removal from techstaff something might still remain active; for example mail bouncer might send something, or election machine might still dig up the mail account when automailing to members.
  • At least one case was solved by Techstaff; it was found out that the user still was listed as a project admin in a mailing list of one of his old projects.

(Topic Automatic calculation of election results):

  • The Council discussed the state of the Maemo voting system, what are the pros and cons of it.
  • The only problem currently is that the automatic calculation of the votes does not work, and it requires that the resulting list of votes is run manually through OpenSTV after the election closes and results are posted to the voting page.
  • Juiceme was not absolutely sure that it had ever worked correctly and had to check it from Woody; the answer is that it did work correctly sometime in the past.
  • Possibly a system update has at some point of time changed paths that the calculation script uses, hence breaking it.
  • HtheB raised again the point that we have 2 different user-base systems, "TMO users" != "Maemo users" which is a major disadvantage. Only people with Maemo account are allowed to vote on community matters, and there probably are many TMO users who do not even know that...
  • User base harmonization has been discussed before and it is very difficult to do and possibly disastrous. However there are reasons why it should be done. If the pressure to do it is strong enough we need to do something about it, so it should be studied further.
  • What should be done, is to try to get everybody on TMO to join MO. Maybe mass-posting or automatic notice message on TMO.

(Topic Finalizing the rules for the coding competition):

  • It has been decided that the competition categories are based on devices rather than types-of-apps.
  • Prize devices need to be collected by asking donations on TMO.
  • Categorizing the prizes; it needs to be ensured that "right devices match the right developers", so that the winners get what they need and deserve.
  • It needs to be decided how the competition entries are reviewed and tested as suitable. Who will be in the group that does it.
  • There was discussion on whether to allow closed-source entries; it is more difficult to review those and make sure there are no hiddem malicious features. However if the competition is restricted to FOSS only, it might alienate some developers. It was decided that we want to aim open/portable SW anyway, so competition entries need to be FOSS. Github can be used for source code inspection, and binaries could be uploaded to maemo.org repositories. Other than Maemo binaries (harmattan/SFOS) could be uploaded to openrepos (need to be checked if possible).
  • It could be a good idea to recruit people from other communities (like TJC) to test submissions and possibly to join TMO and attend the competition too :)

Action Items:
  • old items:
    • Looking into automatic calculation of election results ...
    • Discuss spam handling with techstaff.
  • new items:
    • Finalize the coding competition rules.
    • Post to TMO announcing the competition and requesting for donations.
    • Discuss competition entries storing with OpenRepos people.
0 Add to favourites0 Bury

December 29 2015

22:26

Learning Modern 3D Graphics Programming

one of the best resources to learn modern OpenGL and the one which helped me quite a lot is the Book at www.arcsynthesis.org/gltut/ – or lets better say was. Unfortunately the domain expired so the content is no longer reachable.

Luckily the Book was designed as an open source project and the code to generate the website is still available at Bitbucket. Unfortunately this repository does not seem to be actively maintained any more.

Therefore I set out to make the Book to be available again using Github Pages. You can find the results here:

https://paroj.github.io/gltut/

However I did not simply mirror the pages, but also improved it at several places. So what has changed so far?

  • converted mathematical expressions from SVG to inline MathML. This does not only improve readability in browsers, but also fixes broken math symbols when generating the PDF.
  • replace XSLTHL by highlight.js for better syntax highlighting
  • added fork me on github badge to website to visualize that one can easily contribute
  • enabled the Optimization Appendix. While it is not complete, it already provides some useful tips and maybe encourages contributions.
  • updated the Documentation build to work on Linux
  • added instructions how to Build the website/ PDF Docs

hopefully these changes will generate some momentum so this great Book gets extended again. As there were also non-cosmetical changes like the new Chapter I also tagged a 0.3.9 release.

I the process of the above work I found out that there is also a mirror of the original Book at http://alfonse.bitbucket.org/oldtut/. This one is however at the state of the 0.3.8 release, meaning it does not only misses the above changes but also some adjustment happened post 0.3.8 at bitbucket.

1 Add to favourites0 Bury

December 18 2015

20:55

Coding Competition 2016

As you may have already noticed in the recent Meeting Minutes, current Council is about to prepare a Coding Competition (CC) for 2016. In times like these, without Nokia or any other corporate entity sponsoring prizes/devices, there are of course limited resources for big giveaways. Nevertheless we believe the approach is worth it. :) We are relying on your donations.

Looking at last CC's, this time it will probably be more of the supportive kind than rival in the first place. Basically we want to support the ongoing AND future software development in a way that ideally, the winners will get the "right" devices to carry on their efforts or even to the next level (e.g. cross-platform).

Now since no current Councilor has ever arranged a CC, we would like to hear your thoughts on how to get it "right", satisfying community demands (SW) as well as individual developer demands (HW). Please share your ideas! And if you've been involved in organizing recent CC's and are willing to help, please holler. And we sure need help in having an uptodate wiki page.

Furthermore, we are calling all owners of now unused devices to consider donating* them for this CC, respectively to MC e.V., who will be responsible for collecting donations and funds. Especially we are looking at those that got rewarded in recent CC's or device programs (N950 anyone? ;)).

* or selling them for a reasonable price.

The voting webinterface will be the same as for the Maemo Council elections, so jury will be you. We also need you to scrutinize the submitted code (ideally installable/executable + binary). It is undecided yet wether or not to accept closed source apps. As the Council is organizing this CC, it will only intervene if a need occurs. Please help make sure conditions and rules are distinct.

Ideas for categories:

- Old NIT‘s

- Fremantle

- Harmattan

- Sailfish OS

- "Port it/cross-platform"

- "Maintain it" (packages, CSSU)

- "Update/Fix it"

- "Bugfix it" (known, yet unresolved bugs)

- Core development or "Free it" (backport, clone, replace or supersede closed packages)

- Recent contributions (recent major releases)

- Wishlist (rewarded if/when completed)

- Beginner (first release)

A variant could be to have category "Update/Fix it" for each of the 4 device categories if it can be expected to have enough entries (and prizes).

Ideas and suggestions welcome. :)

0 Add to favourites0 Bury

December 01 2015

09:20

2015-11-24 Meeting Minutes

Meeting held 2015-11-24 on FreeNode, channel #maemo-meeting (logs)

Attending: Peter Leinchen (peterleinchen), Bernardo Reino (reinob), Halit Bal (HtheB), Gido Griese (Win7Mac), Jussi Ohenoja (juiceme)

Partial: Rudiger Schiller (chem|st)

Absent:

Summary of topics (ordered by discussion):

  • Council roles reorganization
  • Spam mail through Maemo accounts
  • How to handle user requests to remove projects
  • Code of Conduct
  • Maemo Coding Competition 2015
  • Elections handling and management

(Topic Council roles reorganization):

  • It was suggested that juiceme as the interim Council secretary should continue in the secretarial role, while other chair roles should be performed by HtheB.
  • Juiceme accepted the motion on the concession that minutes might be a bit late on publishing due to fair amount of other urgent work. This was okayed by the Council.

(Topic Spam mail through Maemo accounts):

  • There is spam email coming to the Council mail bouncer and the Maemo mailing lists. As an addition to the general annoyement caused by spam email there is also the issue of the "bad press" Maemo could be getting when allowing spamming though our infrastructure.
  • There was a lot of talk about the issue, as it is a bundle of different things; spam trough the council/board/techstaff bouncers is difficult to handle but it affects only few people, but spam to community/development lists has potential to go to thousands of users.
  • The mailing lists are protected, there is subscription and moderation to take care of the spam.
  • It seems that maemo.org mail server might be vulnerable to spoofed spam mail, however the recipients for that are single users, not multiple targets. That needs to be solved with techstaff help.
  • Otherwice spam is unfortunately fact of life due to the structure/specification of SMTP mail; it is largely responsibility of the email recipients to have sufficent filtering on their inboxes..

(Topic How to handle user requests to remove projects):

  • An user was unable to remove his garage project and user account. Shold that be possible, or is techstaff assistance always required?

(Topic Code of Conduct):

  • It was decided that the Code of Conduct should be published in both Wiki and legal/terms-of-use pages.
  • Reinob has published the CoC to the mailing list.

(Topic Maemo Coding Competition 2015):

  • Discussion on competition continues in the Council, when the rules are sorted out it will be published.

(Topic Elections handling and management):

  • Juiceme offered to have introduction to the voting engine for new Council members.

Action Items:
  • old items:
    • The selected Code of Conduct (KDE) still needs to be published on TMO.
    • Looking into automatic calculation of election results ...
    • Arrange Council status on TMO for new Council members
  • new items:
    • Discuss spam handling with techstaff.
    • Finalize the coding competition rules.
0 Add to favourites0 Bury

November 23 2015

18:33

IOCTL Android

IOCTL is a very useful system call: it is simple and multiplexes the different commands to the appropriate kernel space function. In this post, I want to describe how you can implement a module with IOCTL support for Android. There are a lot of good articles about it (links below), and I just describe the differences regarding to the Android platform.

So, let's create a very simple misc device and let's play with it, doing some reads and writes. Initially, let's define a very simple kernel module (most of the code was taken from here).

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <asm/uaccess.h>


#define MY_MACIG 'G'
#define READ_IOCTL _IOR(MY_MACIG, 0, int)
#define WRITE_IOCTL _IOW(MY_MACIG, 1, int)

static int used;
static char msg[200];

static ssize_t device_read(struct file *filp, char __user *buffer, size_t length, loff_t *offset)
{
return simple_read_from_buffer(buffer, length, offset, msg, 200);
}

static ssize_t device_write(struct file *filp, const char __user *buff, size_t len, loff_t *off)
{
if (len > 199)
return -EINVAL;
copy_from_user(msg, buff, len);
msg[len] = '\0';
return len;
}

static int device_open(struct inode *inode, struct file *file)
{
used++;
return 0;
}

static int device_release(struct inode *inode, struct file *file)
{
used--;
return 0;
}

char buf[200];
int device_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
{
int len = 200;
switch(cmd) {
case READ_IOCTL:
copy_to_user((char *)arg, buf, 200);
break;

case WRITE_IOCTL:
copy_from_user(buf, (char *)arg, len);
break;

default:
return -ENOTTY;
}
return len;
}

static struct file_operations fops = {
.owner = THIS_MODULE,
.read = device_read,
.write = device_write,
.open = device_open,
.release = device_release,
.unlocked_ioctl = device_ioctl
};

static struct miscdevice my_miscdev = {
.name = "my_device",
.mode = S_IRWXUGO,
.fops = &fops,
};

static int __init cdevexample_module_init(void)
{
int ret = misc_register(&my_miscdev);
if (ret < 0) {
printk ("Registering the character device failed\n");
return ret;
}
printk("create node with mknod /dev/my_device\n");
return 0;
}

static void __exit cdevexample_module_exit(void)
{
misc_deregister(&my_miscdev);
}

module_init(cdevexample_module_init);
module_exit(cdevexample_module_exit);
MODULE_LICENSE("GPL");

Compile it and insert into Android kernel.

shell@flounder:/ $ su
shell@flounder:/ $ insmod my_module.ko

Now, we can check the new device in /dev:

shell@flounder:/ $ su
shell@flounder:/ $ ls -l /dev
...
crw-rw---- root     mtp       10,  23 2015-11-23 18:04 mtp_usb
crw------- root     root      10,   0 2015-11-23 18:11 my_device
crw------- root     root      10,  36 2015-11-23 18:04 network_latency
crw------- root     root      10,  35 2015-11-23 18:04 network_throughput
crw-rw-rw- root     root       1,   3 2015-11-23 18:04 null

...

See that the permissions are limited. Don't forget to set it to:

shell@flounder:/ $ chmod 666 /dev/my_device
shell@flounder:/ $ ls -l /dev
...
crw-rw---- root     mtp       10,  23 2015-11-23 18:04 mtp_usb
crw-rw-rw- root     root      10,   0 2015-11-23 18:11 my_device
crw------- root     root      10,  36 2015-11-23 18:04 network_latency
crw------- root     root      10,  35 2015-11-23 18:04 network_throughput
crw-rw-rw- root     root       1,   3 2015-11-23 18:04 null

...

Now, let's try to do some operations with our device driver:

shell@flounder:/ $ echo "Hello world" > /dev/my_device
shell@flounder:/ $ cat /dev/my_device

You will see the following error on the logcat:

avc: denied { read write } for name="my_device" dev="tmpfs" scontext=u:r:system_app:s0 tcontext

This means that SELinux (yes, Android makes heavy usage of it) also controls the access to device drivers and you cannot read/write from/to your new drive. You have two options: i) disable SELinux in Android (you need to change some kernel options and rebuild it) or ii) add some new rules into SELinux. Let's do the last to learn a bit more :-)

So, we change the following files and give access (read, write, getattr, ioctl, open and create) to our new device /dev/my_device. If you need to restrict the access, you can adapt the policies according to your needs. For more information about SELinux and Android, take a look in this doc (specially the section "Implementation").

external/sepolicy/device.te
type fscklogs, dev_type;
type full_device, dev_type;
type my_device, dev_type;


external/sepolicy/file_contexts
/dev/rproc_user        u:object_r:rpmsg_device:s0
/dev/my_device         u:object_r:my_device:s0
/dev/snd(/.*)?         u:object_r:audio_device:s0


external/sepolicy/app.te
allow appdomain usb_device:chr_file { read write getattr ioctl };
allow appdomain usbaccessory_device:chr_file { read write getattr };
allow appdomain my_device:chr_file { read write getattr ioctl open create };


Now, let's build the Android framework again and flash the device. Everything should work fine.

shell@flounder:/ $ echo "Hello world" > /dev/my_device
shell@flounder:/ $ cat /dev/my_device
Hello world

That's it!! You can also check the following links


0 Add to favourites0 Bury

November 17 2015

18:05

2015-11-03 Meeting Minutes

Meeting held 2015-11-03 on FreeNode, channel #maemo-meeting (logs)

Attending: Bernardo Reino (reinob), Jussi Ohenoja (juiceme), Peter Leinchen (peterleinchen)

Partial: Rudiger Schiller (chem|st)

Absent: Halit Bal (HtheB), Gido Griese (Win7Mac)

Summary of topics (ordered by discussion):

  • TMO forum swearword filter
  • Maemo Coding Competition 2015

(Topic TMO forum swearword filter):

  • General feeling is that there should be no need for filters like that, unless for example mandated in some countries/locations.
  • There however seem to be some people who like to have it, so we should have an election to decide what to do about it.
  • This would also be a nice pretext to have a test election to train new Councillors to handle elections.

(Topic Maemo Coding Competition 2015):

  • Discussion on competition basic rules, whether to have categories based on device type or application type or something between..
  • The Council will continue to refine the idea further before presenting to the community.

Action Items:
  • old items:
    • The selected Code of Conduct (KDE) still needs to be published on TMO.
    • Looking into automatic calculation of election results ...
  • new items:
    • Arrange Council status on TMO for new Council members
0 Add to favourites0 Bury

November 11 2015

15:43

Latency/Bandwidth and Performance

I've been always interested in scrapping a bit more my application... no matter its level: frontend, framework or native. That's why I guess I have decided to study a bit more Software Systems. Some weeks ago, I was implementing some tests to evaluate my current project in terms of "time spent for certain operations". In addition, I had to force some cache/memory fault, work on some *non* cache-friendly program and, at the end, I was thinking about other aspects of my system. Usually, for software systems, we pretty much focus on latency and bandwidth. For example, when you are developing an application to have an efficient access to memory (cache-friendly!), you are thinking about latency, as you want to avoid (expensive) access to a lower-level memory. Of course, depending on the operation (network, memory access, etc.), latency and bandwidth have a bit different meaning. For example, for network, latency is measured by sending a packet that is returned to the sender. For memory access, latency can be explained as "the delay time between the moment a memory controller tells the memory module to access a particular memory column on a RAM module, and the moment the data from the given array location is available on the module's output pins". [Wiki]

I took a look on some amazing links that gave me a very precise and detailed view about such discussion and here they are:



0 Add to favourites0 Bury

October 20 2015

17:01

2015-09-15 Meeting Minutes

Meeting held 2015-09-15 on FreeNode, channel #maemo-meeting (logs)

Attending: Bernado Reino (reinob), Halit Bal (HtheB), Jussi Ohenoja (juiceme), Peter Leinchen (peterleinchen), Gido Griese (Win7Mac), Rudiger Schiller (chem|st), William McBee (gerbick), Paul Carlin (endsormeans)

Partial:

Absent:

Summary of topics (ordered by discussion):

  • Inaugural meeting of the new Maemo Council 2Q/2014
  • Other business

(Topic Inaugural meeting of the new Maemo Council 2Q/2014):

  • The Council election results were published, and new elected council is Htheb, juiceme, peterleinchen, reinob and Win7Mac.
  • The new Council discussed possible meeting day-of-week and time, and decided that continuing too have meetings on tuesdays is fine. Since all Councillors are from european timezones it was decided that the meetings would be held at 21:00 CET/CEST.
  • There was some discussion on official roles, and finally HtheB was elected as Chairman of the Council.
  • New Councillors need IRC cloaks, mailing list membership and TMO blog posting rights.

(Topic Other business):

  • The Council needs to ensure that next GA meeting accepts the result of the referendum, change of the council rules.
  • There was discussion on the result of the referendum, as 9 people voted against it for some reason.
  • Juiceme presented the statistics on the donation campaign, and what to do with the leftover funds. He had consulted the main donors wikiwide (1000eur) and reinob (600eur) for their wishes on how the contribution should be handled. Wikiwide wishes to use it towards future TM registrations/renewals and reinob wishes it to be used for any necessary Maemo-related tasks. HtheB asked for possibility to have ads on TMO website for raising money but that got a mixed reaction.

Action Items:
  • old items:
    • The selected Code of Conduct (KDE) still needs to be published on TMO.
    • Looking into automatic calculation of election results ...
    • Contacting freemangordon and merlin1991 about auto-builder: CSSU-thumb target, GCC versions?
    • Getting maemo trademark registration (everywhere?) renewed (and transferred to MCeV) by the end of February (or within six months since expiry date).
    • Archiving Ovi/Nokia store, especially for Harmattan.
    • Contacting Daphne Won on Facebook and LinkedIn to get administrator rights on Facebook for a Maemo member to migrate the plugin to v2.0 API and maintain it in the future.
  • new items:
    • Arrange user rights for new Council members
0 Add to favourites0 Bury

October 09 2015

15:38

Canon i-Sensys MF8280Cw on 64bit Debian

I’ve gotten my hands on a Canon i-Sensys MF8280Cw multifunction colour laser printer, in part because I noticed that Canon has published CUPS drivers for Debian (that is Ubuntu), so it should work. It also does work, but I had to jump a few hoops. The driver is available from here (Italian site). Running Debian […]0 Add to favourites0 Bury

September 13 2015

12:01

Meet the new Q2 2015 Maemo Community Council

Dear Maemo community, I have the great honor of introducing the new Community Council for the upcoming Q2/2015 period.

The members of the new council are (in alphabetical order):

  • Bernardo Reino (reinob)
  • Halit Bal (HtheB)
  • Gido Griese (win7mac)
  • Jussi Ohenoja (juiceme)
  • Peter Leinchen (peterleinchen)

The voting results can be seen on the voting page

I want to thank warmly all the members of the community who participated in this most important action of choosing a new council for us!

The new council shall meet on the #maemo-meeting IRC channel next tuesday at 20:00 UTC for the formal handover with the passing council.

Jussi Ohenoja, On behalf of the outgoing Maemo Community Council

0 Add to favourites0 Bury

September 07 2015

09:13

Assynchronous and synchronous I/O in Android NDK

This week, I had some issues on my tests in a Lollipop device with AOSP. I really wanted to have synchronous reads/writes so that I could evaluate my solution in a different way. If you check for assync and sync I/O operations for Linux, you'll a lot of references to the flags O_DIRECT, O_SYNC, O_DSYNC, ...

Actually, that's a good way to implement. However, with Android NDK apps, things are not so straightforward.

First, to have a good understanding about the O_*SYNC flags, check this link. Of course, the man page for the command open as well.

First, O_DIRECT does not work in Android since 4.4. See this link for more details about it.  That's sad. So, let's try to use the O_*SYNC data.

O_SYNC and O_DSYNC work fine in Android. But, as the description say, only for writes. Another detail: for Android, O_SYNC has the same semantics as O_DSYNC. That's good, but I still want something similar to reads as well.

Why don't we use O_RSYNC? Well, Android does not implement it :-( But it's not the only one... there are other Linux distributions that don't do it either.

What about dropping caches?? See this link for more details. Hum, that works, but after the first read, the data will be cached again.

So, I am still looking for a solution for Android Lollipop. Hope to post it soon!


0 Add to favourites0 Bury

August 17 2015

16:28

Android - Using Crypto extensions

I had some problems compiling ASM code as part of an Android kernel module.

As part of my system, I need to encrypt/decrypt data inside the kernel and I decided to use AES CBC with 128 bits keys. I am also using a Nexus 9 (arm64 v8), which means that I have access to crypto extensions, including instructions for AES operations :-)

Considering this scenario, I implemented 3 options (of course, I picked the most efficient one at the end):
  1. A "standard" AES CBC implementation in C (the worst performance);
  2. The Linux kernel Crypto lib with crypto extensions set to ON (good performance and very easy to use);
  3. The AES CBC asm implementation from the OpenSSL lib (good performance and it took me extra time to integrate it into my code);
At the end, I took the option #03. Both #02 and #03 have good performance, but #03 is slightly better.

Let's discuss #02 and #03 in this post.

As the very first step, check if your kernel has the proper options enabled for the crypto extension usage. The following ones should be set to "y":

CONFIG_CRYPTO_HW
CONFIG_ARM64_CRYPTO
CONFIG_CRYPTO_AES_ARM64_CE
CONFIG_CRYPTO_AES_ARM64_CE_CCM
CONFIG_CRYPTO_AES_ARM64_CE_BLK

The Crypto lib

The Linux kernel provides the Crypto library, with several cryptography operations, such as AES, including different block/streams ciphers. The following code use AES 128-bits CBC, and a 0-ed IV (don't do that!)

static int pc_aes_encrypt_kernel(const void *key, int key_len,
void *dst, size_t *dst_len,
const void *src, size_t src_len)
{
struct crypto_blkcipher *blkcipher = NULL;
char *cipher = "__cbc-aes-ce";
char iv[AES_BLOCK_SIZE];
char *charkey = (unsigned char *) key;

unsigned int ivsize = 0;
char *scratchpad_in = NULL, *scratchpad_out = NULL;
struct scatterlist sg_in, sg_out;
struct blkcipher_desc desc;
int ret = -EFAULT;
int len = ((int)(src_len/16) + 1) * 16;

memset(iv, 0x00, AES_BLOCK_SIZE); // set the iv to a proper value!!

blkcipher = crypto_alloc_blkcipher(cipher, 0, 0);
if (IS_ERR(blkcipher)) {
PC_LOGV("could not allocate blkcipher handle for %s\n", cipher);
return -PTR_ERR(blkcipher);
}

if (crypto_blkcipher_setkey(blkcipher, charkey, key_len)) {
PC_LOGV("key could not be set\n");
ret = -EAGAIN;
goto out;
}

ivsize = crypto_blkcipher_ivsize(blkcipher);
if (ivsize) {
if (ivsize != AES_BLOCK_SIZE)
PC_LOGV("IV length differs from expected length. It should be : %d\n",ivsize);
crypto_blkcipher_set_iv(blkcipher, iv, ivsize);
}

scratchpad_in = kmalloc(src_len, GFP_KERNEL);
if (!scratchpad_in) {
PC_LOGV("could not allocate scratchpad_in for %s\n", cipher);
goto out;
}

scratchpad_out = kmalloc(len, GFP_KERNEL);
if (!scratchpad_out) {
PC_LOGV("could not allocate scratchpad_in for %s\n", cipher);
goto out;
}

memcpy(scratchpad_in,src,src_len);

desc.flags = 0;
desc.tfm = blkcipher;
sg_init_one(&sg_in, scratchpad_in, src_len);
sg_init_one(&sg_out, scratchpad_out, len);

crypto_blkcipher_encrypt(&desc, &sg_out, &sg_in, src_len);

// for decryption, use the following
// crypto_blkcipher_decrypt(&desc, &sg_out, &sg_in, src_len);

memcpy(dst,scratchpad_out,sg_out.length);

*dst_len = sg_out.length;

ret = 0;
goto out;

out:
if (blkcipher)
crypto_free_blkcipher(blkcipher);
if (scratchpad_out)
kzfree(scratchpad_out);
if (scratchpad_in)
kzfree(scratchpad_in);

return ret;

}

For decryption, you can use the same code, but use the function crypto_blkcipher_decrypt instead.

Integrating a *.S file as part if your module built process

As said, I used an existing implementation from OpenSSL, which uses the crypto extensions of arm64-v8. I only had to change the "includes" of the asm file. In addition, I included the object file into my Makefile, like this:

pc_module-objs := ...
src/pc_utility.o src/asm/aesv8-armx-64.o \
src/crypto/aes.o src/crypto/crypto.o


However, I had some problems with different asm files that I was testing. For example, for the OpenSSL library, some of them will not compile if you use GCC 4.8/4.9. The point is that they use a different architectural syntax (Apple) and you'll see several "Error: unknown mnemonic" error messages.

So, you can use LLVM to compile the asm files with the Apple architectural syntax. LLVM is available in the Android NDK. Then, you can copy the *.o files into your code and build your project. The symbols should match as a charm.

The following code shows the usage of the functions defined in the file aesv8-armx-64.S (available into the folder /external/openssl/ )

static int pc_aes_encrypt_hw(const void *key, int key_len,
void *dst, size_t *dst_len,
const void *src, size_t src_len)
{
AES_KEY enc_key;

unsigned char enc_out[src_len];
unsigned char iv[AES_BLOCK_SIZE];
unsigned char *aes_input = (unsigned char *) src;
unsigned char *aes_key = (unsigned char *) key;

memset(iv, 0x00, AES_BLOCK_SIZE);

HWAES_set_encrypt_key(aes_key, key_len*8, &enc_key);
HWAES_cbc_encrypt(aes_input, enc_out, src_len, &enc_key, iv, AES_ENCRYPT);

*dst_len = src_len;
memcpy(dst,&enc_out[0],src_len);

return 0;
}

static int pc_aes_decrypt_hw(const void *key, int key_len,
void *dst, size_t *dst_len,
const void *src, size_t src_len)
{
AES_KEY dec_key;

unsigned char iv[AES_BLOCK_SIZE];
unsigned char dec_out[src_len];
unsigned char *aes_input = (unsigned char *) src;
unsigned char *aes_key = (unsigned char *) key;

memset(iv, 0x00, AES_BLOCK_SIZE);

HWAES_set_decrypt_key(aes_key, key_len*8, &dec_key);
HWAES_cbc_encrypt(aes_input, dec_out, src_len, &dec_key, iv, AES_DECRYPT);

*dst_len = src_len;
memcpy(dst,&dec_out[0],src_len);

return 0;
}


The functions HWAES_set_encrypt_key, HWAES_set_decrypt_key, HWAES_cbc_encrypt and HWAES_cbc_decrypt are implemented in a asm file (aesv8-armx-64.S) and defined in a header file (aes_cbc.h). Again, I used AES 128-bits CBC, with 0-ed IV (don't do that!).


0 Add to favourites0 Bury

August 07 2015

17:06
Microsoft Education Delivery

August 05 2015

14:13

Converting a Ubuntu and Windows dual-boot installation to UEFI

UEFI is the successor to BIOS for communicating with the Firmware on your Mainboard.
While the first BIOS was released with the IBM-PC in 1981, the first UEFI version (EFI 2.0) was released 25 years later in 2006 building upon the lessons learned in that timespan. So UEFI is without any doubt the more modern solution.

The user-visible advantages of using UEFI instead of BIOS are

You could reinstall both Windows and Ubuntu to get UEFI. However it is also possible to convert existing installations of both on the fly – without the backup/ restore cycle. You should still do a backup in case something goes wrong though.

Prerequisites

Only the 64bit Versions of Windows support UEFI. Therefore this guide assumes that you run the 64bit versions of both Windows and Ubuntu.

Furthermore verify the following items before you continue – otherwise you will not be able to finish the conversion. Use GParted in case you have not enough space before the first or after the last partition.

  • 250MB space in front of first partition
    Typically Windows 8 creates a 350MB System Partition upon installation. This space can be reclaimed for a 100MB EFI partiton and a new 100MB Windows System partition.
  • 1-2MB behind last partiton (for the GPT backup)
  • UEFI bootable Ubuntu USB drive.
    You can use the startup disk creator on ubuntu with an Ubuntu 14.04+ ISO.
  • UEFI bootable Windows USB drive.
    You can use the Microsoft Media Creation tool for Windows 10 to get one.

to test that the sticks are indeed UEFI compatible, try booting them with CSM Mode disabled in your BIOS.

Convert the drive to GPT

UEFI requires a GUID Partition Table (GPT), so first we need to convert from MBR to GPT.

After this step you will not be able to boot your system any more. So make sure you have the Ubuntu USB drive ready.

We will use gdisk to perform the conversion as following:

sudo gdisk /dev/sdX
Command (? for help): w

where sdX is your system drive (e.g. sda)

Convert Windows to UEFI

Now boot your Windows USB drive and enter the command prompt as described in this Microsoft Technet article at step 6.

Continue with the following steps from the Article. Note that we have skipped steps 1-4 as we used Ubuntu to convert the disk to GPT.

We have now created a EFI partition, a new EFI compatible Windows System Partition and we have installed the Windows Bootloader to the EFI partition. Your Windows installation should now start again.
At this point you could also perform an upgrade to Windows 10, as the upgrade would erase grub from the EFI partition anyway.

Next we are going to install grub to the EFI partition and make it manage the boot.

Enter a Ubuntu chroot

As we can not directly boot our Ubuntu installation, we will instead boot from the Ubuntu USB drive and the switch to the installed Ubuntu.
To do the switch we have to setup and enter a chroot as following

sudo mount /dev/sdXY /mnt 
sudo mount /dev/sdX1 /mnt/boot/efi 
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /sys /mnt/sys
sudo mount -t proc /proc /mnt/proc
sudo cp /proc/mounts /mnt/etc/mtab
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
sudo chroot /mnt

where sdXY is the partition where your Ubuntu system is installed (e.g. sda5)

Convert Ubuntu to UEFI

Inside your Ubuntu Installation we have to replace grub for BIOS (aka grub-pc) with grub for UEFI (aka grub-efi) as:

sudo apt-get --reinstall install grub-common grub-efi-amd64 os-prober

this would be enough to get the system booting again, however we also aim for secure boot so we also need to install the following:

sudo apt-get install shim-signed grub-efi-amd64-signed linux-signed-generic

This installs signatures for grub and the kernel which are used to verify the integrity of these at boot. Furthermore we install shim, which is a passthrough bootloader that translates from the Microsoft signatures on you mainboard to the signatures by Canonical used to sign grub and the kernel (see this for details).

Next we finally install grub to the EFI partition by:

sudo grub-install --uefi-secure-boot /dev/sdX
sudo update-grub

where sdX is again your system drive (e.g. sda).

Now you can enable secure boot in your BIOS and benefit. Note that some BIOS implementations additionaly require you to select the trusted signatures. Look out for an option called “Install Default Secure Boot keys” or similar to select the Microsoft signatures.

0 Add to favourites0 Bury

August 02 2015

22:00

Re-Announcement of the Q2 2015 Community Council Election

Dear friends and Maemoans, as it happens we did not get enough confirmed candidates in the set nomination period, so according to the Council Election Rules we need to extend the nomination period by 4 weeks.

This will push all dates one month to future. The new schedule of the voting is as follows:

  • Nomination period continues until Saturday 29.08.2015
  • Contemplation period starts on Sunday 30.08.2015 and continues until Saturday 05.09.2015.
  • Election period starts on Sunday 06.09.2015 and continues until 12.09.2015.

Currently we have 5 confirmed candidates. (endsormeans, juiceme, reinob, Win7Mac, peterleinchen)

On behalf of the outgoing community council,

Jussi Ohenoja

0 Add to favourites0 Bury
20:23

2015-07-28 Council Meeting Minutes

Meeting held 2015-07-28 on FreeNode, channel #maemo-meeting (logs)

Attending: Jussi Ohenoja (juiceme), Peter Leinchen (peterleinchen), Gido Griese (Win7Mac), Paul Carlin (endsormeans)

Partial: Ruediger Schiller (chem|st)

Absent: Oksana Tkachenko (Oksana/Wikiwide), William McBee (gerbick), Alexander Kozhevnikov (MentalistTraceur)

Summary of topics (ordered by discussion):

  • Ongoing Council Elections
  • TM donation status

(Topic Ongoing Council Elections):

  • Elections announcement and nominations
  • Wiki page
  • Juiceme asked if endsormeans is willing to run for Council, and after some consideration he accepted candidacy.
  • There are now four confirmed candidates (reinob, endsormeans, peterleinchen, juiceme) but more are needed.

(Topic TM donation status):

  • Bitcoin account setup is going on.
  • Win7Mac is going to contact reinob for assistance/information on TM related matters.
  • Recap on the expiring TM's;
    • Europe - already expired, needs immediate refresh
    • USA - already expired, will not be refreshed
    • Taiwan - 2016
    • Brazil - 2018
    • Singapore - 2019
    • Japan, Korea, Russia, Switzerland, Norway - 2020
    • Canada - 2023

Action Items:
  • old items:
    • The selected Code of Conduct (KDE) still needs to be published on TMO.
    • Looking into automatic calculation of election results ...
    • Contacting freemangordon and merlin1991 about auto-builder: CSSU-thumb target, GCC versions?
    • Getting maemo trademark registration (everywhere?) renewed (and transferred to MCeV) by the end of February (or within six months since expiry date).
    • Archiving Ovi/Nokia store, especially for Harmattan.
    • Contacting Daphne Won on Facebook and LinkedIn to get administrator rights on Facebook for a Maemo member to migrate the plugin to v2.0 API and maintain it in the future.
  • new items:
0 Add to favourites0 Bury

August 01 2015

14:48

Gebruik maken van verbanden tussen metadata

Ik beweerde onlangs ergens dat een systeem dat verbanden (waar, wanneer, met wie, waarom) in plaats van louter metadata (titel, datum, auteur, enz.) over content verzamelt een oplossing zou kunnen bieden voor het probleem dat gebruikers van digitale media meer en meer zullen hebben; namelijk dat ze teveel materiaal gaan verzameld hebben om er ooit nog eens iets snel genoeg in terug te vinden.

Ik denk dat verbanden meer gewicht moeten krijgen dan louter de metadata omdat het door middel van verbanden is dat wij mensen in onze hersenen informatie onthouden. Niet door middel van feiten (titel, datum, auteur, enz.) maar wel door middel van verbanden (waar, wanneer, met wie, waarom) .

Ik gaf als hypothetisch voorbeeld dat ik een video wilde vinden die ik gekeken had met Erika toen ik op vakantie was met haar en die zij als super tof had gemarkeerd.

Wat zijn de verbanden die we moeten verzamelen? Dit is een eenvoudig oefeningetje in analyse: gewoon de zelfstandige naamwoorden onderlijnen en het probleem opnieuw uitschrijven:

  • Dat ik op vakantie was toen ik hem laatst zag. Dat is een point of interest (waar)
  • Dat het een film is (wat, is een feit over mijn te vinden onderwerp en dus geen verband. Maar we nemen dit mee)
  • Met wie ik de film gekeken heb en wanneer (met wie, wanneer)
  • Dat Erika, met wie ik de film gekeken heb, de film super tof vond (waarom)

Dus laat ik deze use-case eens in RDF gieten en oplossen met SPARQL. Dit moeten we verzamelen. Ik schrijf het in pseudo TTL. Bedenk er even bij dat deze ontology helemaal bestaat:

<erika> a Person ; name "Erika" .
<vakantiePlek> a PointOfInterest ; title "De vakantieplek" .
<filmA> a Movie ; lastSeenAt <vakantiePlek> ; sharedWith <erika>; title "The movie" .
<erika> likes <filmA> .

Dit is daarna de SPARQL query:

SELECT ?m { ?v a Movie ; title ?m . ?v lastSeenAt ?p . ?p title ?pt . ?v sharedWith <erika> . <erika> likes ?v . FILTER (?pt LIKE '%vakantieplek%') }

Ik laat het als een oefening aan de lezer om dit naar de ontology Nepomuk om te zetten (volgens mij kan het deze hele use-case aan). En dan kan je dat eens op je N9 of je standaard GNOME desktop testen met de tool tracker-sparql. Wedden dat het werkt. :-)

Het grote probleem is inderdaad de data aquisitie van de verbanden. De query maken is vrij eenvoudig. De ontology vastleggen en afspreken met alle partijen al wat minder. De informatie verzamelen is dé moeilijkheid.

Oh ja. En eens verzameld, de informatie veilig bijhouden zonder dat mijn privacy geschonden wordt. Dat lijkt tegenwoordig gewoonweg onmogelijk. Helaas.

Het is in ieder geval niet nodig dat een supercomputer of zo dit centraal moet oplossen (met AI en heel de gruwelijk complexe hype zooi van vandaag).

Ieder klein toestelletje kan dit soort use-cases zelfstandig oplossen. De bovenstaande inserts en query zijn eenvoudig op te lossen. SQLite doet dit in een paar milliseconden met een gedenormalizeerd schema. Uw fancy hipster NoSQL oplossing waarschijnlijk ook.

Dat is omdat het gewicht van data aquisitie op de verbanden ligt in plaats van op de feiten.

0 Add to favourites0 Bury

July 23 2015

19:16

2015-07-21 Council Meeting Minutes

Meeting held 2015-07-21 on FreeNode, channel #maemo-meeting (logs)

Attending: Jussi Ohenoja (juiceme), Peter Leinchen (peterleinchen)

Partial:

Absent: Oksana Tkachenko (Oksana/Wikiwide), William McBee (gerbick), Alexander Kozhevnikov (MentalistTraceur)

Summary of topics (ordered by discussion):

  • TM donation status
  • Referendum and Elections announcement

(Topic TM donation status):

  • Juiceme presented the current donation status; there are currently 1356 euros in donations, so about 1000 euros more is needed for EU trademark refreshing.

(Topic Referendum and Elections announcement):

  • Both the referendum and election have been announced and are progressing.

Action Items:
  • old items:
    • The selected Code of Conduct (KDE) still needs to be published on TMO.
    • Looking into automatic calculation of election results ...
    • Contacting freemangordon and merlin1991 about auto-builder: CSSU-thumb target, GCC versions?
    • Getting maemo trademark registration (everywhere?) renewed (and transferred to MCeV) by the end of February (or within six months since expiry date).
    • Archiving Ovi/Nokia store, especially for Harmattan.
    • Contacting Daphne Won on Facebook and LinkedIn to get administrator rights on Facebook for a Maemo member to migrate the plugin to v2.0 API and maintain it in the future.
  • new items:
0 Add to favourites0 Bury

July 19 2015

20:11

Referendum 2015

on the roles of Community Council and Maemo e.V.

Referendum 2015
(on the roles of Community Council and Maemo e.V.)

Dear Community,

in order to finalize our move from Hildon Foundation to the Maemo Community e.V. (MC eV), a referendum is called, which is supposed to fix deficiencies in the Council Election Rules as well as in the Articles of Association of MC eV. There will be two options:

- Yes, I accept MC eV Association Rules as our Community Council's Rules and I endorse the amendment of MC eV Articles of Association as described below.

- No, I do want Council rules to stay outside of MC eV and its ruleset and have them as originally described. I’m aware that Council then will have no say in any MC eV or maemo.org matters.

In other words...

…you vote option YES:

Rules around Maemo Community Council are adopted in order to fully incorporate Council as a body of MC eV.

…you vote NO on the referendum:

The original Council election rules will remain as is. Council then will be an interest grouping outside MC eV without a purpose, since there'll be nobody to (officially) adress anymore. Council then will be suspended from MC eV bylaws.

Either way, the referendum means a change of MC eV Articles of Association as well as Association Rules, which can only be done by GA. The referendum basically is an avowal for MC eV, an approval of its bylaws and a mandate for MC eV to change them accordingly.

For those who did not follow the process, here’s a short explanation in two parts (together with the affected rules, bylaws paragraphs):



Part 1 - History & Council election rules:

Back in Nokia times, the purpose of Council was to give the community a voice towards Nokia representatives (Community Manager, whatever…). Then Nokia abandoned Maemo, donated servers and sold the rights to maemo.org and Maemo(TM) to Hildon Foundation, a maemo community driven organisation. In the process of this we learned that an US based organisation has its drawbacks/challenges and it was decided to form an entity based in Europe which is a German Registered Association now known as Maemo Community e.V. - instead of having a board assigned to manage the organization, only the association is now accepting regular members which have the final say in any matter. The association's board does handle day to day tasks like minor community requests, funds, buy hardware for our infrastructure, basically pay the bills and do minor steering only. That said, the associations regular members having the final say in any matter, this also applies to rules and regulations and their changes, including but not limited to the Council Election Rules. During the MC eV founding meeting, the existing (unified Maemo Community/HiFo) Council was nominated for the Council of MC eV. The MC eV members voted unanimously "yes" for all existing councilors who accepted the vote. By doing so, Council effectively accepted MC eV Council election rules (and all other other regulations) which were publicized earlier. To have this sanctioned by all of you, we need this referendum.

MC eV Council election rules differ to original Council election rules in the following points:



Association Rules § 4.1 (Council Elections)

(6) Nominees with a professional interest in Maemo, such as working for Nokia - or any other a company involved in Maemo-related software development - must declare their interest when advertising their nomination. Failure to do so may result in the Nokia Community Manager Board of Directors, or the outgoing Council, declaring their nomination invalid and so bar them from standing in the current election."

(9) The election date must be publicised at least 1 month 4 weeks in advance of the election.

(11) If there are less than 4 candidates when the nominations close, the election can’t be held.

a) The nomination period will be extended by 1 month 4 weeks and the election postponed similarly.

b) If, after 1 month 4 weeks's delay, there are still fewer than 4 candidates; the outgoing council will decide - in conjunction with Hildon Foundation Board of Directors - about how to proceed. The preferred solution is to encourage more members of the maemo.org community to participate and re-run the election, but all options are open.

(12) Changes to any of the above rules must be approved by a resolution of the Passive Members' Meeting (community referendum) or General Assembly.*

a) Voting in such, will be open to anyone eligible to vote in the respective meeting.

b) The referendum options must be debated for a minimum of 1 month 4 weeks prior to the referendum.

c) Referendum voting will be open for the same length of time as the council elections.

* community referendum (aka resolution of the Passive Members' Meeting) is already granted by Articles of Association § 10 and Association Rules § 1.1

Now in order to grant sovereignty over Council election rules to community, the following changes to MC eV Association Rules shall be introduced:

Association Rules § 1.1 (Amendments)

(1) These association rules can be changed or dismissed by the General Assembly.

(2) § 4.1 (Council election rules) of these association rules can be changed or dismissed with a referendum by the Passive Members' Meeting. Changes to these election rules by the General Assembly must be confirmed by a resolution of the passive members meeting (referendum). Should the amendment be rejected by the passive members meeting, the proposed amendment can be revised and brought again to the vote.

(2) § 4.1 (Vorstandsratswahlen) dieser Vereinsordnung kann durch ein Referendum der passiven Mitgliederversammlung geändert oder aufgehoben werden. Änderungen dieser Wahlordnung durch die aktive Mitgliederversammlung müssen durch Beschluss der passiven Mitgliederversammlung bestätigt werden (Referendum). Sollte die Änderung von der passiven Mitgliederversammlung abgelehnt werden, kann der Änderungsvorschlag überarbeitet und erneut zur Abstimmung gebracht werden.

(please see MC eV Orga-chart for who can actually change what)



Part 2 - Council role & MC eV Bylaws:

MC eV Articles of Association have a drawback which lies within the fact that councils responsibility is not adequately described so far, Council may contradict GA resolutions or even try to “force” Board into anything. Therefore, the following changes to MC eV Articles of Association shall be introduced:

§ 7 (Board of directors)

(5) The Board of Directors executes carries out the resolutions of the General Assembly and of the Council insofar as this decision jurisdiction is delegated to Council according to the statutes.

(5) Der Vorstand führt die Beschlüsse der aktiven Mitgliederversammlung und der des Vorstandsrats aus, sofern ihm diese Entscheidungshoheit laut Satzung oder Vereinsordnung eingeräumt wird.

§ 8 (Council)

(4) The council has the duty to execute elections of all kinds. The council's duties, rules to announce council meetings, their proceedings and executions of votes are regulated by the Association Rules.

(4) Der Vorstandsrat ist insbesondere für die Durchführung aller Wahlen zuständig. Aufgaben des Vorstandsrats sowie Regelungen zur dessen Arbeit inklusive der Einberufung von Vorstandsratssitzungen, deren Ablauf und die Durchführung von Abstimmungen, wird durch die sind in der Vereinsordnung geregelt festgelegt.

This outsources the definition of Council responsibility from Articles of Association to Association Rules (which might be altered without the need to register those changes at court, avoiding hassle and fees). Accordingly, a new paragraph will be added to the Association Rules:

§ 3.2 Vorstandsrat (council)

(8) Tasks and competences of the Council are as follows:

(a) Representation of the associated members (garage account) and their interests.

(b) Counseling of the Board of directors in general matters

c) Council is responsible to execute all elections

(8) Aufgaben und Zuständigkeiten des Vorstandsrats sind wie folgt:

(a) Vertretung der assoziierten Mitglieder und ihrer Interessen

(b) Beratung des Vorstands in allgemeinen Belangen

c) Der Vorstandsrat ist für die Durchführung aller Wahlen zuständig

Please note that according to Articles of Association, General Assembly can decide on literally anything, as of

§ 9 (General Assembly)

  1. The General Assembly as the superior decision-making body of the association is by default responsible for all tasks unless certain tasks are delegated to other bodies of the association in accordance with these articles of incorporation.





Coincidence or not, the last paragraph somewhat closes a circle… everybody can have his share of power by simply becoming a member. Get involved yourself instead of just electing representatives (Council).

So in one month the voting booth will open and you can decide on above mentioned changes and if Council will be recognized as a group within the Maemo Community e.V. or not.

0 Add to favourites0 Bury

July 18 2015

16:57

Q2 2015 Community Council Election Announcement

Dear friends and Maemoans, six months and even a bit more has passed and again it is time to elect a new Community Council for us.

The last election finished on Saturday 3rd of January 2015 so we are running little late with the next one.

The schedule of the voting is as follows:

  • Nomination period starts now on Sunday 19th of July 2015 and continues until 1st of August 2015.
  • Contemplation period starts on Sunday 2nd of August 2015 and continues until Saturday 8th of August 2015.
  • Election period starts on Sunday 9th of August 2015 and continues until 15th of August 2015.

To get our community to continue strong, we need fresh people with fresh viewpoints to carry on the torch, so please think about volunteering for Maemo Council.

At the same time during the Council election we will also be running a referendum on Council rules. The referendum will be announced shortly.

On behalf of the outgoing community council,

Jussi Ohenoja

0 Add to favourites0 Bury
Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl