Combater


Tags:

Às vezes, é preciso combater. É preciso dizer que o outro está errado, que ele está falando besteira sobre um assunto que não conhece (e não quer conhecer). É preciso dizer o que é ético, o que é certo. É preciso discernir tudo o que é errado e anti-ético, imoral, e que faz mal. É preciso combater o ódio, muitas vezes com amor, outras tantas com força e integridade.

É preciso falar praquele ignorante que ele não sabe o que é Software Livre. É preciso dizer que o Software Livre é muito maior do que o GNU, muito maior do que uma pessoa ou do que suas declarações. É preciso dizer que o ignorante tornou-se troll. É preciso dizer que ele não sabe o que fala, e que deve calar-se. É preciso deixar que ele viva sua adolescência conturbada e por vezes medíocre, mas tomando cuidado para que isso não influencie outras pessoas ignorantes a tornarem-se trolls também. É preciso que esse troll saia do Twitter, saia do BR-[GNU/]Linux, saia dos fóruns movidos a coisas proprietárias; ou talvez seja preciso que ele fique lá, destilando seu ódio, veneno e ignorância para seus semelhantes.

É preciso combater o liberalismo de fachada, que é um veículo para o ódio. É preciso combater o ódio. É preciso combater a ignorância, novamente. É preciso combater o reacionarismo disfarçado de “livre mercado”, é preciso combater a falta de bom senso que ocorre quando se generaliza um partido político por um comportamento, é preciso combater o comportamento, é preciso fazer progresso social sempre, é preciso parar de se importar tanto com aqueles que não se importam.

É preciso combater o pastor ignorante. É preciso combater a ignorância, uma terceira vez. É preciso combater a “trollagem” do pastor, dos fiéis e dos simpatizantes a eles. É preciso combater a onda de “radicalismo conservador” que aflige a todos. É preciso combater a falta de amor ao próximo e o excesso de arrogância. É preciso combater as falsas palavras divinas, as falsas vontades de uma entidade, as falsas aglomerações públicas em torno de um erro.

É preciso combater o apresentador idiota, ignorante e presunçoso. É preciso combater o que se destila de ódio naquele país, porque nem todos têm um soro contra veneno de cobra criada. É preciso combater a ignorância, novamente, porque ela é o caminho mais fácil para o ódio, e o ódio retroalimenta a ignorância num ciclo difícil de ser quebrado. É preciso ensinar a aprender, e aprender a ensinar. É preciso combater a preguiça, essa desculpa tão usada e repetida que chega a dar preguiça de combatê-la. É preciso sair do sofá, mas não para ir para o Twitter ou Facebook; é preciso sair do sofá e ser crítico o suficiente para saber o que se deve fazer, porque não sou eu quem vou falar.


After spending the last weeks struggling with this, I decided to write a blog post. First, what is “this” that you are talking about? The answer is: Linux kernel's concept of memory mapping. I found it utterly confused, beyond my expectations, and so I believe that a blog post is the write way to (a) preserve and (b) share this knowledge. So, let's do it!

First things first

First, I cannot begin this post without a few acknowledgements and “thank you's”. The first goes to Oleg Nesterov (sorry, I could not find his website), a Linux kernel guru who really helped me a lot through the whole task. Another “thank you” goes to Jan Kratochvil, who also provided valuable feedback by commenting my GDB patch. Now, back to the point.

The task

The task was requested here: GDB needed to respect the /proc/<PID>/coredump_filter file when generating a coredump (i.e., when you use the gcore command).

Currently, GDB has his own coredump mechanism implemented which, despite its limitations and bugs, has been around for quite some time. However, and maybe you don't know that, but the Linux kernel has its own algorithm for generating the corefile of a process. And unfortunately, GDB and Linux were not really following the same standards here...

So, in the end, the task was about synchronizing GDB and Linux. To do that, I first had to decipher the contents of the /proc/<PID>/smaps file.

The /proc/<PID>/smaps file

This special file, generated by the Linux kernel when you read it, contains detailed information about each memory mapping of a certain process. Some of the fields on this file are documented in the proc(5) manpage, but others are missing there (asking for a patch!). Here is an explanation of everything I needed:

  • The first line of each memory mapping has the following format:

    The fields here are:

    a) address is the address range, in the process' address space, that the mapping occupies. This part was already treated by GDB, so I did not have to worry about it.

    b) perms is a set of permissions (r ead, w rite, e x ecute, s hared, p rivate [COW -- copy-on-write]) applied to the memory mapping. GDB was already dealing with rwx permissions, but I needed to include the p flag as well. I also made GDB ignore the mappings that did not have the r flag active, because it does not make sense to dump something that you cannot read.

    c) offset is the offset into the applied to the file, if the mapping is file-backed (see below). GDB already handled this correctly.

    d) dev is the device (major:minor) related to the file, if there is one. GDB already handled this correctly, though I was using this field for more things (continue reading).

    e) inode is the inode on the device above. The value of zero means that no inode is associated with the memory mapping. Nothing to do here.

    f) pathname is the file associate with this mapping, if there is one. This is one of the most important fields that I had to use, and one of the most complicated to understand completely. GDB now uses this to heuristically identify whether the mapping is anonymous or not.

  • GDB is now also interested in Anonymous: and AnonHugePages: fields from the smaps file. Those fields represent the content of anonymous data on the mapping; if GDB finds that this content is greater than zero, this means that the mapping is anonymous.

  • The last, but perhaps most important field, is the VmFlags: field. It contains a series of two-letter flags that provide very useful information about the mapping. A description of the fields is: a) sh: the mapping is shared (VM_SHARED) b) dd: this mapping should not be dumped in a corefile (VM_DONTDUMP) c) ht: this is HugeTLB mapping

With that in hands, the following task was to be able to determine whether a memory mapping is anonymous or file-backed, private or shared.

Types of memory mappings

There can be four types of memory mappings:

  1. Anonymous private mapping
  2. Anonymous shared mapping
  3. File-backed private mapping
  4. File-backed shared mapping

It should be possible to uniquely identify each mapping based on the information provided by the smaps file; however, you will see that this is not always the case. Below, I will explain how to determine each of the four characteristics that define a mapping.

Anonymous

A mapping is anonymous if one of these conditions apply:

  1. The pathname associated with it is either /dev/zero (deleted), /SYSV%08x (deleted), or <filename> (deleted) (see below).
  2. There is content in the Anonymous: or in the AnonHugePages: fields of the mapping in the smaps file.

A special explanation is needed for the <filename> (deleted) case. It is not always guaranteed that it identifies an anonymous mapping; in fact, it is possible to have the (deleted) part for file-backed mappings as well (say, when you are running a program that uses shared libraries, and those shared libraries have been removed because of an update, for example). However, we are trying to mimic the behavior of the Linux kernel here, which checks to see if a file has no hard links associated with it (and therefore is truly deleted).

Although it may be possible for the userspace to do an extensive check (by stat ing the file, for example), the Linux kernel certainly could give more information about this.

File-backed

A mapping is file-backed (i.e., not anonymous) if:

  1. The pathname associated with it contains a <filename>, without the (deleted) part.

As has been explained above, a mapping whose pathname contains the (deleted) string could still be file-backed, but we decide to consider it anonymous.

It is also worth mentioning that a mapping can be simultaneously anonymous and file-backed: this happens when the mapping contains a valid pathname (without the (deleted) part), but also contains Anonymous: or AnonHugePages: contents.

Private

A mapping is considered to be private (i.e., not shared) if:

  1. In the absence of the VmFlags field (in the smaps file), its permission field has the flag p.
  2. If the VmFlags field is present, then the mapping is private if we do not find the sh flag there.

Shared

A mapping is shared (i.e., not private) if:

  1. In the absence of VmFlags in the smaps file, the permission field of the mapping does not have the p flag. Not having this flag actually means VM_MAYSHARE and not necessarily VM_SHARED (which is what we want), but it is the best approximation we have.
  2. If the VmFlags field is present, then the mapping is shared if we find the sh flag there.

The patch

With all that in mind, I hacked GDB to improve the coredump mechanism for GNU/Linux operating systems. The main function which decides the memory mappings that will or will not be dumped on GNU/Linux is linux_find_memory_regions_full; the Linux kernel obviously uses its own function, vma_dump_size, to do the same thing.

Linux has one advantage: it is a kernel, and therefore has much more knowledge about processes' internals than a userspace program. For example, inside Linux it is trivial to check if a file marked as "(deleted)" in the output of the smaps file has no hard links associated with it (and therefore is not really deleted); the same operation on userspace, however, would require root access to inspect the contents of the /proc/<PID>/map_files/ directory.

The case described above, if you remember, is something that impacts the ability to tell whether a mapping is anonymous or not. I am talking to the Linux kernel guys to see if it is possible to export this information directly via the smaps file, instead of having to do the current heuristic.

While doing this work, some strange behaviors were found in the Linux kernel. Oleg is working on them, along with other Linux hackers. From our side, there is still room for improvement on this code. The first thing I can think of is to improve the heuristics for finding anonymous mappings. Another relatively easy thing to do would be to let the user specify a value for coredump_filter on the command line, without editing the /proc file. And of course, keep this code always updated with its counterpart in the Linux kernel.

Upstream discussions and commit

If you are interested, you can see the discussions that happened upstream by going to this link. This is the fourth (and final) submission of the patch; you should be able to find the other submissions in the archive.

The final commit can be found in the official repository.


Fazendo a Diferença


Tags:

Deu saudade de escrever em português :-). E deu saudade, também, de fazer algum post mais “filosófico”.

Não sei dizer o porquê, mas às vezes tenho uma mania besta: gosto de ficar procurando “sarna pra me coçar”. Em outras palavras, eu fico procurando coisas que me deixam mal, mesmo sabendo que vou ficar mal depois de vê-las.

Não tenho explicação pra esse comportamento. É algo meio sabotador, meio sofredor, meio... Não sei. Às vezes, quando me vejo novamente nesse ciclo vicioso, consigo parar. No entanto, na maioria das vezes, eu entro num estado estranho: é como se eu estivesse me observando, estudando quais consequências aquele ato traz para mim. Fico me perguntando se sou a única pessoa desse mundo que faz isso...

Acho que um exemplo bom desse tipo de comportamento é o que tenho feito ultimamente. Às vezes, por algum motivo que me é estranho, leio coisas ruins escritas por pessoas extremamente insensatas. E, talvez pelo mesmo motivo misterioso, eu fico mal com o que leio, mesmo sabendo que, colocando na balança o que essas pessoas fazem e o que eu faço, a diferença é gigantesca. Então por que raios eu fico mal quando leio as besteiras que são praticamente vomitadas por essas pessoas?

Talvez algumas pessoas (eu incluso) tenham um radar pra sentimentos fortes. Por exemplo, um gesto de altruísmo é algo que consegue tocar o fundo da alma, e merece ser apreciado como um vinho raro. Mas, em contrapartida, uma expressão de raiva, desprezo ou incompreensão também capta a atenção de uma forma quase inevitável. O mistério que esse gesto, muitas vezes incoerente, esconde é algo que me deixa quase aficcionado, como se eu estivesse lendo um livro e não quisesse parar antes de chegar no final. Por que uma pessoa se coloca num papel por vezes ridículo, apenas por conta de uma opinião? Por que essa pessoa, na ânsia de criticar um comportamento, um pensamento, ou uma ideologia, muitas vezes exibe exatamente as mesmas características que repudia? O que faz um ser humano, cheio de falhas e limitações, subir num (muitas vezes falso) pedestal e esquecer que já esteve lá embaixo?

Felizmente, as questões acima, por mais intrigantes que sejam, não têm me prendido por muito tempo. Acho que, nesse processo de aprendizagem a que chamamos de “vida”, estou num ponto em que percebo claramente o caos que reina na cabeça dessas pessoas, e tento me afastar dele. Mas, mais importante que isso, acho que me dou conta de você pode escolher ser a mudança que quer ver no mundo (Gandhi), ou ficar ladrando enquanto a caravana passa... E eu definitivamente não quero perder meu tempo comparando códigos pra dizer quem é melhor.


The GNU Radical


Tags:

A friend of mine, Blaise, once told me not to introduce myself as “... what you would call a radical...”. He had listened to me talking to a person who were questioning what a Free Software activist does. My friend's rationale, to which I totally agree, is that you must let the other person decide whether she thinks you are a “radical” or not. In other words, if you say you are a “radical” from the beginning, it will probably induce the other person to a pre-judgement about you, which is not good for you and for her.

As I said, I agree with him. But I am going through a lot of situations in my life that are constantly reminding me that, maybe, I am that “radical” after all. I do not know whether this is good or bad, and I can say I have been questioning myself for a while now. This post, by the way, is going to be a lot about self-questioning.

Maybe the problem is that I am expecting too much from those that have the same beliefs that I do. Or maybe the cause is that I do not know what to expect from them in certain situations, and I am disappointed when I see that they do not follow what I think is best sometimes. On the other hand, when I look myself in the mirror, I do not know whether I am totally following what I think is best; and if I am not, then how can I even consider telling others to do that? And even if I am following my own advices, how can I be sure that they are good enough for others?

One good example of this is my opinion about FSF's use of Twitter. The opinion is public, and has been criticized by many people already, including Free Software supporters. Shortly after I wrote the post, I mentioned it to Richard Stallman, and he told me he was not going to read it because he considered it “too emotional”. I felt deeply sad because of his reaction, especially because it came from someone who often appeals to emotions in order to teach what he has to say. But I also started questioning myself about the topic.

Is it really bad to use Twitter? This is what I ask myself sometimes. I see so many people using it, including those who defend Free Software as I do (like Matt Lee), or those who stand against privacy abuses (like Jacob Appelbaum), or who are worried about social causes, or... Yeah, you got the point. I refuse to believe that they did not think about Twitter's issues, or about how they would be endorsing its use by using it themselves. Yet, they are there, and a lot of people is following their posts and discussing their opinions and ideas for a better world. As much as I try to understand their motivation for using Twitter (or even Facebook), I cannot convince myself that what they are doing is good for their goals. Am I being too narrow minded? Am I missing something?

Another example are my thoughts about Free Software programs that support (and sometimes even promote) unethical services. They (the thoughts) are also public. And it seems that this opinion, which is about something I called “Respectful Software”, is too strong (or “radical”?) for the majority of the developers, even considering Free Software developers. I saw very good arguments on why Free Software should support unethical services, and it is hard to disagree with them. I guess the best of those arguments is that when you support unethical services like Facebook, you are offering a Free Software option for those who want or need to use the service. In other words, you are helping them to slowly get rid of the digital handcuffs.

It seems like all those arguments (about Twitter, about implementing support for proprietary systems on Free Software, and others) are ultimately about reaching users that would otherwise remain ignorant of the Free Software philosophy. And how can someone have counter-arguments for this? It is impossible to argue that we do not need to take the Free Software message to everybody, because when someone does not use Free Software, she is doing harm to her community (thus, we want more people using Free Software, of course). When the Free Software Foundation makes use of Twitter to bring more people to the movement, and when I see that despite talking to people all around me I can hardly convince them to try GNU/Linux, who am I to criticize the FSF?

So, I have been thinking to myself whether it is time to change. What I am realizing more and more is that my fight for coherence perhaps is flawed. We are incoherent by nature. And the truth is that, no matter what we do, people change according to their own time, their own will, and their own beliefs (or to the lack of them). I remembered something that I once heard: changing is not binary, changing is a process. So, after all, maybe it is time to stop being a “GNU radical” (in the sense that I am radical even for the GNU project), and become a new type of activist.


Brasil em Conserva


Tags:

As eleições brasileiras já acabaram, e talvez eu devesse me sentir mais à vontade pra falar do assunto do que realmente me sinto. Não sei, mas tenho a impressão de que, dessa vez, as coisas aconteceram de um modo um pouco diferente do que o de costume. Aliás, não acho que tenha sido “coisa de momento”, e tampouco acho que seja uma exclusividade brasileira: as pessoas estão ficando mais conservadoras, mais “endireitadas”. E eu vou tentar explicar, talvez pretensiosamente, por que eu não acho que isso seja bom.

Nunca votei em candidato algum, em nenhuma eleição até hoje. Sempre me vi descrente das propostas apresentadas, ainda mais quando percebia que aqueles que davam rostos às propostas eram basicamente os mesmos. Por isso, nas primeiras eleições em que pude “exercer a cidadania em sua plenitude” (uma mentira deslavada contada pela imprensa, que talvez mereça outro post), lá no longínquo ano de 2002, decidi por anular meus votos. Depois disso, mudei-me de cidade, e não transferi meu título de eleitor porque, no final das contas, iria acabar votando nulo novamente. No entanto, e de uma maneira aparentemente contraditória, sempre interessei-me por política.

Pode mesmo parecer contradição, mas eu nunca entendi como existiam pessoas (e são muitas!) que não queriam saber de política, e do que estava acontecendo no próprio país. Obviamente, essas mesmas pessoas em geral são as primeiras que reclamam do governo, ou que criticam um político, mesmo sem saber exatamente o porquê de fazerem isso. E quando vamos falar sobre política com elas, aquela velha máxima “Política não se discute!” vem à tona, e você de repente perde qualquer motivação para continuar conversando. Mas mesmo com toda essa minha “descrença-crente” com a política, nessas últimas eleições eu tive uma enorme vontade de votar.

Meu voto não iria para o Aécio. E no primeiro turno, provavelmente eu não votasse em nenhum dos candidatos, como sempre fiz. Mas no segundo turno, senti que eu não podia deixar de ajudar a Dilma a ser reeleita, mesmo que isso não necessariamente signifique que eu a apóie e concorde com tudo o que seu governo tem feito. Mas, usando uma outra velha máxima, “dos males, o menor”.

Considero-me uma pessoa com fortes tendências para as questões sociais. Não à toa defendo o Software Livre com empenho, porque acredito que se olharmos para todos, avançamos mais. Daí deriva minha antipatia pela maioria das causas individualistas, por acreditar que, apesar de ser totalmente plausível admitir que o ser humano é egoísta, não acho que devamos nos acomodar com essa constatação. E isso vai de encontro com o que o governo da Dilma (e o antigo governo do Lula) tem feito para o Brasil: avançar nas causas sociais. O crescimento que o país experimentou nos últimos anos foi, sim, muito perceptível para mim. E, quando tive a oportunidade de visitar o Nordeste brasileiro há alguns anos, pude ver que a situação por lá, apesar de ainda não ser a ideal, também melhorou bastante. Ou seja, o bolo finalmente está sendo dividido mais igualmente para todos, ainda que falte muito para que a divisão possa ser considerada boa.

Mas não foi só na área social que eu vi mudanças. Apesar de já estar nascido na época da inflação galopante da década de 1980, não tenho uma noção muito grande do que era viver naquela época. Eu era criança, e crianças não se preocupam com o preço das coisas. No entanto, lembro-me de que a vida, naquela época, não era fácil. O planejamento familiar era tarefa ingrata, porque como planejar se você não sabe o preço das coisas amanhã? E a desigualdade social era muito mais acentuada, porque (por exemplo) era impossível pensar em viajar de avião, mesmo para uma família de classe média (Europa, então, era outro mundo). Mas daí veio o plano Real, e as coisas melhoraram... E obviamente muito do crédito por essa melhora vai para o ex-presidente Fernando Henrique Cardoso e por sua política econômica que, pelo menos no começo do seu governo, conseguiu estabilizar as coisas de forma louvável. Mas, como pôde-se ver depois, Lula refinou a economia do antigo governo, e atrelou-a ao lado social, que por tanto tempo ficou esquecido.

Um outro argumento que ouço e vejo muito, principalmente por aqueles que são anti-petistas declarados, é o da corrupção. Confesso que não entendo o motivo desse ódio tão grande a apenas uma parcela do governo brasileiro (o PT não toma conta do Brasil, ao contrário do que muita gente insiste em dizer). Esquecem-se que denúncias de corrupção sempre existiram, em todos os nossos governos, e que é contra ela (a corrupção) que devemos lutar, ao invés de escolhermos um partido específico? Quando escolhemos um alvo, estamos, de certa forma, dando salvo-conduto para os outros que cometem o mesmo crime. Para mim, quando ouço um “argumento” desse tipo, a vontade de discutir cai exponencialmente.

Infelizmente, o argumento anti-petista passa por tantos outros absurdos (Venezuela, Cuba, bolivarianismo, comunismo), e é tão estúpido, que parece-me que a pré-condição para ser ouvinte dele é estar imerso na completa ignorância, principalmente a respeito desses termos. Se você souber o que é bolivarianismo ou comunismo, por exemplo, você já não pode ouvir o argumento, porque aí não vai acreditar nas conclusões. É algo tão impressionante e infantil que, novamente, fica difícil ter qualquer tipo de conversa com pessoas que repetem essas falácias como se fossem obviedades que estão aí, para qualquer um que queira vê-las.

Todo esse tipo de conversa, ao meu ver, leva a apenas uma conclusão: o conservadorismo está se alastrando no mundo. No Brasil, ele está tomando proporções perigosamente grandes. Às vezes penso qual seria a melhor maneira de combatê-lo: educar não me parece ser uma solução muito efetiva, ainda mais quando estamos falando de pessoas que possuem uma condição social mais favorável, e que julgam-se instruídas e informadas. Por enquanto, a solução tem sido ignorar o problema, o que também não vem surtindo efeitos práticos, haja visto a escalada dos conservadores nessas últimas eleições. Contraditoriamente, talvez a solução fosse parar de lutar e deixar a água correr. Parece-me às vezes que a humanidade precisa mesmo repetir seus erros de modo cíclico, para reaprender o motivo pelo qual eles já foram corrigidos outras vezes.


To what extent should Free Software respect its users?

The question, strange as it may sound, is not only valid but also becoming more and more important these days. If you think that the four freedoms are enough to guarantee that the Free Software will respect the user, you are probably being oversimplistic. The four freedoms are essential, but they are not sufficient. You need more. I need more. And this is why I think the Free Software movement should have been called the Respectful Software movement.

I know I will probably hear that I am too radical. And I know I will hear it even from those who defend Free Software the way I do. But I need to express this feeling I have, even though I may be wrong about it.

It all began as an innocent comment. I make lots of presentations and talks about Free Software, and, knowing that the word “Free” is ambiguous in English, I started joking that Richard Stallman should have named the movement “Respectful Software”, instead of “Free Software”. If you think about it just a little, you will see that “respect” is a word that brings different interpretations to different people, just as “free” does. It is a subjective word. However, at least it does not have the problem of referring to completely unrelated things such as “price” and “freedom”. Respect is respect, and everybody knows it. What can change (and often does) is what a person considers respectful or not.

(I am obviously not considering the possible ambiguity that may exist in another language with the word “respect”.)

So, back to the software world. I want you to imagine a Free Software. For example, let's consider one that is used to connect to so-called “social networks” like GNU Social or pump.io. I do not want to use a specific example here; I am more interested in the consequences of a certain decision. Which decision? Keep reading :-).

Now, let's imagine that this Free Software is just beginning its life, probably in some code repository under the control of its developer(s), but most likely using some proprietary service like GitHub (which is an issue by itself). And probably the developer is thinking: “Which social network should my software support first?”. This is an extremely valid and important question, but sometimes the developer comes up with an answer that may not be satisfactory to its users. This is where the “respect” comes into play.

In our case, this bad answer would be “Facebook”, “Twitter”, “Linkedin”, or any other unethical social network. However, those are exactly the easiest answers for many and many Free Software developers, either because those “vampiric” services are popular among users, or because the developer him/herself uses them!! By now, you should be able to see where I am getting at. My point, in a simple question, is: “How far should we, Free Software developers, allow users to go and harm themselves and the community?”. Yes, this is not just a matter of self-inflicted restrictions, as when the user chooses to use a non-free software to edit a text file, for example. It is, in most cases, a matter of harming the community too. (I have written a post related to this issue a while ago, called “Privacy as a Collective Good”.)

It should be easy to see that it does not matter if I am using Facebook through my shiny Free Software application on my computer or cellphone. What really matters is that, when doing so, you are basically supporting the use of those unethical social networks, to the point that perhaps some of your friends are also using them because of you. What does it matter if they are using Free Software to access them or not? Is the benefit offered by the Free Software big enough to eliminate (or even soften) the problems that exist when the user uses an unethical service like Linkedin?

I wonder, though, what is the limit that we should obey. Where should we draw the line and say “I will not pass beyond this point”? Should we just “abandon” the users of those unethical services and social networks, while we lock ourselves in our not-very-safe world? After all, we need to communicate with them in order to bring them to our cause, but it is hard doing so without getting our hands dirty. But that is a discussion to another post, I believe.

Meanwhile, I could give plenty of examples of existing Free Softwares that are doing a disservice to the community by allowing (and even promoting) unethical services or solutions for their users. They are disrespecting their users, sometimes exploiting the fact that many users are not fully aware of privacy issues that come as a “gift” when you use those services, without spending any kind of effort to teach the users. However, I do not want this post to become a flamewar, so I will not mention any software explicitly. I think it should be quite easy for the reader to find examples out there.

Perhaps this post does not have a conclusion. I myself have not made my mind completely about the subject, though I am obviously leaning towards what most people would call the “radical” solution. But it is definitely not an easy topic to discuss, or to argument about. Nonetheless, we are closing our eyes to it, and we should not do so. The future of Free Software depends also on what kinds of services we promote, and what kinds of services we actually warn the users against. This is my definition of respect, and this is why I think we should develop Free and Respectful Software.


Yes, you are reading correctly: I decided to buy a freacking Chromebook. I really needed a lightweight notebook with me for my daily hackings while waiting for my subway station, and this one seemed to be the best option available when comparing models and prices. To be fair, and before you throw me rocks, I visited the LibreBoot X60's website for some time, because I was strongly considering buying one (even considering its weight); however, they did not have it in stock, and I did not want to wait anymore, so...

Anyway, as one might expect, configuring GNU/Linux on notebooks is becoming harder as time goes by, either because the infamous Secure Boot (anti-)feature, or because they come with more and more devices that demand proprietary crap to be loaded. But fortunately, it is still possible to overcome most of those problems and still get a GNU/Linux distro running.

References

For main reference, I used the following websites:

I also used other references for small problems that I had during the configuration, and I will list them when needed.

Backing up ChromeOS

The first thing you will probably want to do is to make a recovery image of the ChromeOS that comes pre-installed in the machine, in case things go wrong. Unfortunately, to do that you need to have a Google account, otherwise the system will fail to record the image. So, if you want to let Google know that you bought a Chromebook, login into the system, open Chrome, and go to the special URL chrome://imageburner. You will need a 4 GiB pendrive/sdcard. It should be pretty straightforward to do the recording from there.

Screw the screw

Now comes the hard part. This notebook comes with a write-protect screw. You might be thinking: what is the purpose of this screw?

Well, the thing is: Chromebooks come with their own boot scheme, which unfortunately doesn't work to boot Linux. However, newer models also offer a “legacy boot” option (SeaBIOS), and this can boot Linux. So far, so good, but...

When you switch to SeaBIOS (details below), the system will complain that it cannot find ChromeOS, and will ask if you want to reinstall the system. This will happen every time you boot the machine, because the system is still entering the default BIOS. In order to activate SeaBIOS, you have to press CTRL-L (Control + L) every time you boot! And this is where the screw comes into play.

If you remove the write-protect screw, you will be able to make the system use SeaBIOS by default, and therefore will not need to worry about pressing CTRL-L every time. Sounds good? Maybe not so much...

The first thing to consider is that you will lose your warranty the moment you open the notebook case. As I was not very concerned about it, I decided to try to remove the screw, and guess what happened? I stripped the screw! I am still not sure why that happened, because I was using the correct screw driver for the job, but when I tried to remove the screw, it seemed like butter and started to “decompose”!

Anyway, after spending many hours trying to figure out a way to remove the screw, I gave up. My intention is to always suspend the system, so I rarely need to press CTRL-L anyway...

Well, that's all I have to say about this screwed screw. If you decide to try removing it, keep in mind that I cannot help you in any way, and that you are entirely responsible for what happens.

Now, let's install the system :-).

Enable Developer Mode

You need to enable the Developer Mode in order to be able to enable SeaBIOS. To do that, follow these steps from the Arch[GNU/]Linux wiki page.

I don't remember if this step works if you don't have activated the ChromeOS (i.e., if you don't have a Google account associated with the device). For my use, I just created a fake account to be able to proceed.

Accessing the superuser shell inside ChromeOS

Now, you will need to access the superuser (root) shell inside ChromeOS, to enable SeaBIOS. Follow the steps described in the Arch[GNU/]Linux wiki page. For this specific step, you don't need to login, which is good.

Enabling SeaBIOS

We're almost there! The last step before you boot your Fedora LiveUSB is to actually enable SeaBIOS. Just go inside your superuser shell (from the previous step) and type:

1
> crossystem dev_boot_usb=1 dev_boot_legacy=1

And that's it!

If you managed to successfuly remove the write-protect screw, you may also want to enable booting SeaBIOS by default. To do that, there is a guide, again on Arch[GNU/]Linux wiki. DO NOT DO THAT IF YOU DID NOT REMOVE THE WRITE-PROTECT SCREW!!!!

Booting Fedora

Now, we should finally be able to boot Fedora! Remember, you will have to press CTRL-L after you reboot (if you have not removed the write-protect screw), otherwise the system will just complain and not boot into SeaBIOS. So, press CTRL-L, choose the boot order (you will probably want to boot from USB first, if your Fedora is on a USB stick), choose to boot the live Fedora image, and... bum!! You will probably see a message complaining that there was not enough memory to boot (the message is “Not enough memory to load specified image”).

You can solve that by passing the mem parameter to Linux. So, when GRUB complains that it was unable to load the specified image, it will give you a command prompt (boot:), and you just need to type:

#!bash boot: linux mem=1980M

And that's it, things should work.

Installing the system

I won't guide you through the installation process; I just want to remember you that you have a 32 GiB SSD drive, so think carefully before you decide how you want to set up the partitions. What I did was to reserve 1 GB for my swap, and take all the rest to the root partition (i.e., I did not create a separate /home partition).

You will also notice that the touchpad does not work (neither does the touchscreen). So you will have to do the installation using a USB mouse for now.

Getting the touchpad to work

I strongly recommend you to read this Fedora bug, which is mostly about the touchpad/touchscreen support, but also covers other interesting topics as well.

Anyway, the bug is still being constantly updated, because the proposed patches to make the touchpad/touchscreen work were not fully integrated into Linux yet. So, depending on the version of Linux that you are running, you will probably need to run a different version of the scripts that are being kindly provided in the bug.

As of this writing, I am running Linux 3.16.2-201.fc20, and the script that does the job for me is this one. If you are like me, you will never run a script without looking at what it does, so go there and do it, I will wait :-).

OK, now that you are confident, run the script (as root, of course), and confirm that it actually installs the necessary drivers to make the devices work. In my case, I only got the touchpad working, even though the touchscreen is also covered by this script. However, since I don't want the touchscreen, I did not investigate this further.

After the installation, reboot your system and at least your touchpad should be working :-). Or kind of...

What happened to me was that I was getting strange behaviors with the touchpad. Sometimes (randomly), its sensitivity became weird, and it was very hard to move the pointer or to click on things. Fortunately, I found the solution in the same bug, in this comment by Yannick Defais. After creating this X11 configuration file, everything worked fine.

Getting suspend to work

Now comes the hard part. My next challenge was to get suspend to work, because (as I said above) I don't want to poweroff/poweron every time.

My first obvious attempt was to try to suspend using the current configuration that came with Fedora. The notebook actually suspended, but then it resumed 1 second later, and the system froze (i.e., I had to force the shutdown by holding the power button for a few seconds). Hmm, it smelled like this would take some effort, and my nose was right.

After a lot of search (and asking in the bug), I found out about a few Linux flags that I could provide in boot time. To save you time, this is what I have now in my /etc/default/grub file:

1
GRUB_CMDLINE_LINUX="tpm_tis.force=1 tpm_tis.interrupts=0 ..."

The final ... means that you should keep whatever was there before you included those parameters, of course. Also, after you edit this file, you need to regenerate the GRUB configuration file on /boot. Run the following command as root:

1
> grub2-mkconfig -o /boot/grub2/grub.cfg

Then, after I rebooted the system, I found that only adding those flags was still not enough. I saw a bunch of errors on dmesg, which showed me that there was some problem with EHCI and xHCI. After a few more research, I found the this comment on an Arch[GNU/]Linux forum. Just follow the steps there (i.e., create the necessary files, especially the /usr/lib/systemd/system-sleep/cros-sound-suspend.sh), and things should start to get better. But not yet...

Now, you will see that suspend/resume work OK, but when you suspend, the system will still resume after 1 second or so. Basically, this happens because the system is using the touchpad and the touchscreen to determine whether it should resume from suspend or not. So basically what you have to do is to disable those sources of events:

1
2
echo TPAD > /proc/acpi/wakeup
echo TSCR > /proc/acpi/wakeup

And voilà! Now everything should work as expected :-). You might want to issue those commands every time you boot the system, in order to get suspend to work every time, of course. To do that, you can create a /etc/rc.d/rc.local, which gets executed when the system starts:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
> cat /etc/rc.d/rc.local
#!/bin/bash

suspend_tricks()
{
  echo TPAD > /proc/acpi/wakeup
  echo TSCR > /proc/acpi/wakeup
}

suspend_tricks

exit 0

Don't forget to make this file executable:

1
> chmod +x /etc/rc.d/rc.local

Conclusion

Overall, I am happy with the machine. I still haven't tried installing Linux-libre on it, so I am not sure if it can work without binary blobs and proprietary craps.

I found the keyboard comfortable, and the touchpad OK. The only extra issue I had was using the Canadian/French/whatever keyboard that comes with it, because it lacks some useful keys for me, like Page Up/Down, Insert, and a few others. So far, I am working around this issue by using xbindkeys and xvkdb.

I do not recommend this machine if you are not tech-savvy enough to follow the steps listed in this post. If that is the case, then consider buying a machine that can easily run GNU/Linux, because you feel much more comfortable configuring it!


It has been a while since I dream of being able to send encrypted e-mail to everyone in my contact list. It is still a distant future, but fortunately it is getting closer with campaigns like the Reset the Net. And while I already send encrypted messages to a couple of friends, it is always good to discover (and share!) some configuration tips to make your life easy :-).

I use Gnus as my e-mail (and news!) reader for quite a while, and I can say it is a very nice piece of software (kudos to Lars and all the devs!). For those who are not aware, Gnus runs inside Emacs, which is a very nice operating system (and text editor also).

Emacs provides EasyPG for those who want to make use of cryptographic operations inside it, and Gnus also uses it to encrypt/decrypt the messages it handles. I am using it for my own messages, and it works like a charm. However, there was something that I had not had configured properly: the ability to read the encrypted messages that I was sending to my friends.

In a brief explanation, when you send an encrypted message GnuPG looks at the recipients of the message (i.e., the people that will receive it, listed in the “From:”, “Cc:” and “Bcc:” fields) and encrypts it according to each recipient's public key, which must be present in your local keyring. But when you send a message to someone, you are not (usually) present in the original recipients list, so GnuPG does not encrypt the message using your public key, and therefore you are unable to read the message later. In fact, this example can be used to illustrate how secure this system really is, when not even the sender can read his/her message again!

Anyway, this behavior was mostly unnoticed by me because I rarely look at my “Sent/” IMAP folder. Until today. And it kind of pissed me off, because I wanted to read what I wrote, damn it! So, after looking for a solution, I found a neat GnuPG setting called hidden-encrypt-to. It basically tells GnuPG to add a hidden recipient in every message it encrypts. So, all I had to do was to provide my key's ID and ask GnuPG to always encrypt the message to myself too.

You basically have to edit your $HOME/.gnupg/gpg.conf file and put this setting there:

1
hidden-encrypt-to ID

That's it. Now, whenever I send an encrypted message, GnuPG encrypts it for me as well, so I just need to go to my “Sent/” folder, and decrypt it to read.

I hope this tip helps you the same way it helped me!


Após quase 1 mês, cá estou pra compartilhar minhas impressões a respeito do FISL 15, que aconteceu em Porto Alegre, RS, entre os dias 7 e 10 de Maio de 2014.

Antes de mais nada, gostaria de fazer um pequeno “jabá”. Acho que mereço, por conta do trabalho que tive pra fazer isso (já explico) dar certo! Estou falando da palestra do Diego Aranha, que foi um dos destaques dessa edição do evento. A palestra, entitulada Software Livre e Segurança Eleitoral (veja o vídeo dela aqui) é, na minha opinião, algo que todo cidadão brasileiro deveria assistir e refletir a respeito. Comecei a me envolver mais no assunto da urna eletrônica brasileira depois que assisti essa mesma palestra (proferida pelo próprio Diego), há mais de 1 ano atrás, na UNICAMP. Considero impossível não se sentir minimamente indignado com a falta de escrúpulos (e de competência!) daqueles que, teoricamente, estão zelando pela democracia no país.

Enfim, depois de assistir essa palestra pelo menos umas 3 vezes (sendo uma delas na edição do Software Freedom Day Campinas, que eu organizei em nome do LibrePlanet São Paulo), achei que devesse tentar “mexer os pauzinhos” e colocá-la na grade oficial do FISL. Só pra garantir, eu e o Diego também submetemos a mesma palestra pelo sistema normal de submissão. Mas no fim, depois de conversar com algumas pessoas “de dentro” (agradecimento especial ao Paulo Meirelles da UnB nesse ponto), consegui encaixar o Diego na grade de destaques do evento! Foi uma grande conquista, e tenho certeza de que quem viu a palestra saiu de lá com a pulga atrás da orelha...

Mas enfim, vamos aos fatos. Minha participação no FISL desse ano foi mais tímida do que no ano passado, mas após alguma reflexão, cheguei à conclusão de que ela também foi mais proveitosa. Apesar de ter submetido praticamente 8 propostas de palestras, cobrindo os mais diferentes níveis e assuntos, não tive nenhuma proposta aceita! Obviamente fiquei bastante chateado com isso, ainda mais depois de ver o nível de algumas palestras que foram aprovadas... Confesso que considerei não ir ao evento, já que, além de não ter tido nenhuma palestra aprovada (o que significava que eu não receberia nenhum patrocínio pra ir), também não ia poder rever muitos amigos que não puderam comparecer nessa edição (podem botar isso na conta da Copa).

Passada a fase de chorar as pitangas, decidi ir de qualquer maneira. O Alexandre Oliva havia me convidado para fazer parte de uma “mesa redonda” cujo objetivo era debater a suposta morte do movimento Software Livre no Brasil. Senti-me honrado com o convite, e como participo da causa há bastante tempo, tinha bastante coisa a dizer. Foi uma honra ter feito parte da mesa com o próprio Oliva, o Anahuac, o Fred, e o Panaggio. Tivemos 2 horas para falar nossas opiniões a respeito do tema, e abrir a discussão para o público presente no auditório. Infelizmente, acabou sendo muito pouco tempo para tanta coisa que tínhamos pra falar! Eu mesmo acabei dizendo muito pouco, e resolvi parar antes para deixar a platéia se manifestar, na esperança de que o microfone iria voltar às minhas mãos para que eu pudesse fazer as considerações finais. Ledo engano! Todos queriam um pedacinho do tempo, e acabou que ficou faltando muita coisa a ser dita, de ambos os lados (palestrantes e platéia). Aliás, se quiser ver o vídeo do debate, faça o download dele aqui.

Não é exagero dizer que esse debate explicitou um sentimento recorrente nos ativistas do movimento Software Livre. Há algum tempo vínhamos tendo essa “consciência coletiva” de que as coisas não estavam muito bem pro lado do Software Livre (ao contrário do Open Source, que vai de vento em popa). Eu mesmo já havia feito alguns posts a respeito do assunto, e do meu incômodo quando pedi para que o nome Software Livre não fosse utilizado indevidamente (post em inglês), e o Anahuac levantou esse ponto durante o debate também. Achei bastante sintomático isso. E depois que voltei do FISL comecei a pensar bastante a respeito desses (e outros) assuntos novamente, o que já gerou alguns posts por aqui.

Gostei, também, da maior parte das colocações que ouvi da platéia. Apesar de eu ter tido a impressão de que algumas pessoas não entenderam muito bem o que estava sendo discutido, considero que os contrapontos levantados por parte da platéia são dignos de serem pensados, mesmo que a pessoa que trouxe esses contrapontos não seja necessariamente uma ativista. Talvez eu prepare mais um post a respeito do que ouvi por lá...

Por último, já no final da palestra, não pude deixar de pedir o microfone pro Oliva e levantar um ponto que eu queria que tivesse tido mais atenção: precisamos hackear mais! O Software Livre, enquanto movimento social e político, precisa de pessoas que discutam e tragam à tona os problemas que nós, como sociedade, devemos resolver. No entanto, o Software Livre também é um movimento técnico, e como tal precisa de ferramentas que façam frente ao domínio proprietário. Hackers, precisamos de vocês :-).

Mas... mudando um pouco de assunto, eu também fui ao evento para divulgar, mais uma vez, o nosso grupo de Software Livre, chamado LibrePlanet São Paulo. Nesse ano, levamos duas propostas interessantes ao evento: contas grátis na nossa instância do GNU Social, e no nosso servidor Jabber.

O GNU Social, que antes era conhecido como StatusNet (e que era utilizado pelo site Identica, que depois migrou para um outro tipo de serviço), é como se fosse um “Twitter distribuído”, implementado com Software Livre. O ponto é que você consegue utilizar seu próprio servidor (se quiser), e consegue conversar com pessoas que estão usando GNU Social em outros servidores. Se quiser registrar sua conta na nossa instância do GNU Social, pode acessar a página de cadastro.

O Jabber (XMPP) é um “conhecido anônimo” de quase todos. É a tecnologia que o Google Talk, o Facebook Chat, o WhatsApp, e vários outros serviços proprietários utilizam. Nós, do LibrePlanet São Paulo, estamos oferecendo contas de graça no nosso servidor Jabber. Ainda não possuímos uma página de cadastro de usuários, então se você quiser uma conta, entre em contato comigo através do e-mail (ou deixe um comentário aqui). É importante dizer que o Jabber/XMPP também é um protocolo totalmente distribuído, e que você vai conseguir conversar com outras pessoas que estão utilizando Jabber em outros servidores! Infelizmente, você não vai poder falar com quem usa o Facebook Chat e o WhatsApp, porque essas empresas proíbem essa funcionalidade. O Google permitia isso para quem utilizava o Google Chat “normal”; se a pessoa já tiver migrado para o Hangout, ela também não vai conseguir falar com outros servidores Jabber. Mais um motivo pra largar esses “serviços” vampíricos, não acha? :-).

O saldo final foi de 5 contas Jabber criadas, e nenhuma conta GNU Social. Infelizmente, isso é absolutamente normal em qualquer tipo de evento; o FISL, apesar de ter “SL” no nome, é, em sua esmagadora maioria, composto por pessoas que às vezes não se importam tanto com a parte social.

Por último, gostaria de deixar registrado o excelente trabalho que o pessoal do LibrePlanet São Paulo e Espírito Santo fizeram durante o Encontro Comunitário dos grupos. Veja o vídeo do encontro aqui.

No final, fiquei feliz com o resultado do evento. O ponto alto, pra mim, certamente foi o debate. Acho que uma “mexida” no status quo é sempre bem vinda, e foi isso que tentamos fazer. Esse movimento acabou gerando atividade dos dois lados (Software Livre e Open Source), e também ajudou-nos a diferenciar melhor quem é quem nessa história toda. Agora, é esperar o próximo FISL pra ver o que saiu e o que ficou no lugar. Até lá!

Abraços!


This post is massively inspired by a post in the gnu-prog-discuss mailing list. This is a closed list of the GNU Project, and only GNU maintainers and contributors can join, so I cannot put a link to the original message (by Mike Gerwitz), but this topic is being discussed over and over again at many places, so you will not have trouble finding similar opinions. I am also “responding” to a recent discussion that I had with Luiz Izidoro, which is a “friend” (as he himself likes to say) of the LibrePlanet São Paulo group.

Mike's point is simple: we, Free Software activists, are the geeks (or nerds) at school, surrounded by the “popular guys” all over again. In case it is not clear, the “popular guys” are the people who do not care about the Free Software ideology; the programmers who license their softwares using permissive licenses using the excuse of “more freedom”, but give away their work to increase the proprietary world.

It is undeniable that the Free Software, as a technical movement, has won. Anywhere you look, you see Free Software being developed and used. It is important to say that by “Free Software” I mean not only copyleft programs, but also permissive ones. However, it is also undeniable that several proprietary programs and solutions are being developed with the help of those permissive Free Softwares, without giving anything back to the community, as usual.

Numbers speak for themselves, so I am posting here the example that Mike used in his message, about Trello, a “web-based project management application”, according to Wikipedia. It is quite popular among project managers, and I know about two or three companies that use it, though I have never used it myself (luckily). Being web-based, it is full of Javascript code, and I appreciated the work Mike had to determine which pieces of Free Software Trello uses. The result is:

jQuery, Sizzle, jQuery UI, jQuery Widget, jQuery UI Mouse, jQuery UI Position, jQuery UI Draggable, jQuery UI Droppable, jQuery UI Sortable, jQuery UI Datepicker, Hogan, Backbone, JSON2 (Crockford), Markdown.js, Socket.io, Underscore.js, Bootstrap, Backbone, and Mustache

You can see the license headers of all those projects here:

This is only on the client-side, i.e., the Javascript portion. I will not post the link to the full Javascript code (condensed in one single file) because I do not have permission to do so, but it should not be hard to take a look yourself if you are curious.

On the server side, Mike came up with this list of Free Softwares being used by Trello:

MongoDB, Redis, Node.js, HAProxy, Express, Connect, Cluster, node_redis, Mongoose, node-mogodb-native, async, CofeeScript, and probably more

Quite a lot of Free Software, right? And Trello advertises itself as being “free”, which might confuse the inexperient reader because they are talking about price, not about freedom.

The lesson we learn is obvious but no less painful. He who contributes to Free Software using permissive licenses is directly contributing to the dissemination of proprietary software. And the corolary should be obvious as well: you are being exploited. Another nice addition made by Mike is a quote by Larry Ellison, CEO and founder of Oracle Corporation, about Free Software (and Open Source):

“If an open source product gets good enough, we'll simply take it.... So the great thing about open source is nobody owns it – a company like Oracle is free to take it for nothing, include it in our products and charge for support, and that's what we'll do. So it is not disruptive at all – you have to find places to add value. Once open source gets good enough, competing with it would be insane. ... We don't have to fight open source, we have to exploit open source.”

So, do you really think you have more freedom because you can choose BSD/MIT over GPL? Do you really think you it doesn't matter what other people do to your code, which you released as a Free Software? What are your goal with this movement, contribute to a better Free Software ecosystem (which will lead to a society which is more fair), or just getting your name in the hall of (f|sh)ame?

Back to the initial point, about not being “popular” among your friends (or be the “radical”, “extremist”, and other adjectives), I believe Mike hit the nail when he said that, because that is exactly how I am feeling currently, and I know other Free Softwares activists feel exactly the same. To defend a copyleft license is to defend something that is wrong, because, in the “popular kids' view”, copyleft is about anything but freedom! The cool thing now is to be indifferent, or even to think that it is nice that proprietary software can coexist with Free Software, so let's give it a help and release everything we can under permissive licenses. I could mention lots of very nice Free Softwares that chose to be permissive because their maintainers thought (and still think) GPL is evil.

I contributed and still contribute to some Free Softwares that are permissive licensed. And despite trying to use only copyleft software, sometimes I replace some of them by permissive ones, and do not feel guilty about it. I do that because I believe in Free Software, and I believe we should support it in every way we can. But doing so is also nocive to our cause. We are supporting softwares that are contributing to the proprietary world, even if that is not what their developers want. We are making it very easy for people like Larry Ellison to win and think they can exploit what other people are doing for free(dom). We are feeding our own enemy in their mouths. And we should be very careful about that.

This post is a request. I am asking you a favor. Please, consider (re)licensing your project using a copyleft license. If you do value what Free Software is about (or even what Open Source is about!), then help spread it by not helping the proprietary side. I am not asking you to join our ideological cause (or maybe I am?); feel free to stay out of this if you want. But please, at least consider helping the Free Software community by avoiding making your code permissive, which will give too much power to the unethical side.

Thank you!