I’m so interested in contributing for the linux kernel, so I’m going to follow the instructions to submit a first patch.
Actually I’m running in my laptop Fedora 27, the tutorial was made for ubuntu but with a little changes we can do it for fedora.
1 – Install some packages
The first thing we are going to do is to run this command
sudo dnf install vim libncurses5-devel gcc make git ctags openssl-devel
let it download the packages.
2 – Setup your Linux kernel code repository
Create a directory and a subdirectory in our user’s home
enter to this subdirectory and we are going to clone there the tree Greg Kroah-Hartman’s staging tree repository
then we enter to the directory staging.
3 – Setting up your kernel configuration
When we download the source tree, it doesn’t have a .config file. We have to generate a .config file which determines which drivers are built. In order to do that duplicate your current config.
That config file is stored somewhere in /boot/. And we need to copy that file in our current directory just running this command
And as we can see, the file was copied, now we have to change it name
4 – Building the kernel
I couln’t run the command make at first, because before that I had to install the packages bison and flex, also installed libelf-dev, libelf-devel or elfutils-libelf-devel, on my laptop worked with elfutils-libelf-devel
Now, I can run make, takes a long time, but finally it works without errors
finally we can see that make add to our current directory 6 files (built-in.o, modules.order, modules.builtin, Moule.symvers, System.map, vmlinux.o) and 2 directories (net, vmlinux)
5- Installing the kernel
Once we have the .ko files, we have to install the kernel running this command
And that’s all, when you boot your computer in the grub will appear the kernel that you have installed.
We wanted to create a program that can do something like take an entry and select an option to choose a faculty where you study and finally return the name and the faculty where belongs instead of message
we enter the name of the student(alumno) “fiorella effio saldivar” and then select the faculty(facultad) “Facultad Ciencias Matematicas”, finally press send(enviar) and we will have “name of the student” + of(de la) + “faculty”
Now we are going to see the taxonomy of this program
The first part of the code
Here we set the title for the window in line 8 (UNMSM), in line 11 create a Gtk.Box called box_outer to contain all the items(select_message, listbox, button, final_label), in line 12 we add this box_outer to our main window, in line 13 we create a Gtk.Label called select_message and then in line 14 add it to our box_outer.
Now in line 16 we create a Gtk.ListBoxRow called listbox to contain the row1 and row2, in line we set the selection mode to NONE, in line 19 we create row1 to contain hbox11, in line 20 create hbox11 to contain label1 and entry1.
In line 28 we create row2 to contain hbox21, in line 29 create hbox21 to contain label2 and combo.
The second partin line 32 we create a Gtk.ComboBoxText called combo, then in line 33, 34, 35, 36 we define the options for combo, in line 41 we create a Gtk.Button called button and in line 42 create a Gtk.Label called final_label to show the result for our program.
In line 44 we are going to called for button when it is clicked the function on_clicked_me, we add the button and final_label to box_outer.
Finally we define the function on_clicked_me that ask us for 5 parameters (self, button, entry, label,combo), first we get the text written in a variable text, then in text2 we get the string for our combo option selected, in text3 we combine text and text2, and finally we set the text for final_label 🙂
You can check the code here.
Today is the final session for #PeruRoadtoGSoC2018 and we are going to test integration with CircleCI in order to contribute with the documentation of Fedora (automatize the proccess of deploying), first you have to create an account in CircleCI (link), to create it please sign up with your github account, once you do that you can see in the Projects tab that you don’t have any project building on CircleCI
Now we have to create our repository so create a directory called integration_Fedora containing another directory called src there create the file index.html with this code
and creating it in our github we can initiliaze our repo now ir order to push all the commits, now in the CircleCI page check the tab Projects and you can see our project integration_Fedora now click on Setup project
We have to read this guide and the first step is create a folder name .circleci and add a file config.yml there, the second step is to copy on the file the sample .yml below, now push this change up to your Github and press Start building once you did that
Just actualize the page and you have this
Now, we are going to do our second commit
And we see that we put an octocat when you enter the name of the commit
Now we are going to edit our config.yml file changing for fedora:latest
Now we are going to create a ssh-keygen, please what I did in my terminal
Then in the github page we can check in settings the ssh keys and we add our ssh key with the part in white selected, once you’ve done that it will be there our ssh-key
Now in the CircleCI page we have to authorize in permissions checkout SSH keys
Then just authorize
After creating the key we start to commit with a icon (fire)
Icon (rat and raise_hand)
Finally we are going to edit our config.yml file in this way
And edit our index.html file like this
Now we are going to upload it to our repository
Here you can get the link to your page
And finally we see here how it works! 🙂
You can check my repo here.
Today we are going to use Gtk with Python and for that we can check our version of Python just type python
Then I’m going to install pygobject3-devel
this code just create an empty window that close the program when you close the window
and then we run it with python
Now, if you want to set the title, you have to add the line win.set_title(“The Text”) like this
And finally you can run it
Now we are going to create another file that have to allow us lo go to the web page of 4 languages, there we are going to add a label and gtk.listbox that contains 4 gtklistboxrow in order to create some like this
We create a Gtk.Box that will contain all (our first label and gtklistbox and so on)
Here is how it works
- box_outer contain label and gtklistbox
- gtklistbox contain gtklistboxrow and hbox
- hbox contain button
All that we did was to create the same 4 rows and just change the link for each one using gtklinbutton also to create the link and open it in Chrome.
You can check the code here.
Finally we were seeing how to search bugs in gnome here.
In the next picture we are able to see the nautilus bugs clicking in Issues
There we can grep bugs for people who are Newcomers like me
Also we saw the projects for Fedora in this link
we saw one project called system_config_language that wants to create something like a button for example that change the language configuration for all the system including apps browser keyword etc
First we have to install gtk dependencies to compile the file and also run the file. So you have to install with this comand
sudo dnf install gtk3-devel gstreamer-devel clutter-devel libgda-devel gobject-introspection-devel
then we are going to install webkit dependencies to compile our file
At the moment of compile we had an error
That’s because the name of the package is not the same as the package that we download before, so we have to find it in /usr/lib64
And here at the end we have the webkit2gtk-4.0
So we have to do a modification to compile it replace webkit3.0 for wetkit2gtk-4.0
But there is another error because we have to do a modification in the file that contains our code, so open the file to modificate it
just add 2 at the final of webkit, like this
now we can compile it without errors 😀
finally we can run the code 🙂
You can check the code here.
After shared a lunch sponsored by GNOME and took many photos
We start with a simple example that let us to display a window
to compile and run we are going to use gjs
and we have this
And for the end of the day we have to create some like this
So, we had to use grid.attach for the position in the grid that have 5 arguments, the first one to tell which element we are going to put in that position, 2: top, 3:left 4:width 5:lenght.
You can see all this examples in my repository here.
Today we are going to know more about the newcomers guide to contribute to fedora or gnome applications, for that we had the help of one trainer in Nautilus, his name is Carlos Soriano and we were with his online support.
If you want to contribute and you’ve never been involved in this kind of things you have to start wih the newcomers guide here. As the newcomers guide said to contribute we need four steps:
Carlos Soriano told us that we don’t need to be the best programming but if you know a bit of object oriented programming and git you can start contributing.
Now, you can press the button Let’s do it! in the page. There you get the link to the IRC chat where you can get help exclusive for newcomers.
Then press Gotcha, let’s go! There we have the first step to contribute: Choose a project. The project that I’ve choosen was Nautilus
Now, after you choose your project press the button Build the project. We need to get flatpak, it is first necessary to set up a development environment with the latest version, for that reason we need to get flatpak, all this will allow us to make changes, test them, and create patches. Actually I have Fedora 27 so I’ve had already installed flatpak, only I had to check my version.
Then you have to download Builder to clone a GNOME project using it. I installed it with this command:
Builder uses Flatpak to compile and run your project in a “sandbox”. It takes a long time to download but finally you have this when it finished.
Press the button Clone..
And the repository url for nautilus is https://github.com/GNOME/nautilus.git , just press Clone to continue, there we have to wait for the installation of Sdk.
When it finished you will able to see the files for the project
Now you can start seeing how to fix a bug and then solve it to contribute in that way for the project, good luck for everyone.
The homework for the session 2 was to create a shopping cart application that allow us to manage products, purchase products, add products, display products and generate a bill if you purchase some items in our application.
I’m going to explain my code, first you have to call the libraries you are going to use, in this case we are using three libraries First we are going to declare our functions before our funtion mainand also create our structs like Product and BillThen in our function main we are going to see how it works, we give to you at first 4 options: manage product, purchase a product, generate a bill or exit and with a while we evaluate the input the principal functions in our function main are 3: manageProduct, purchaseProduct, generateBillbefore seeing this functions we have to define our structs who is calling a function called updateProductThen continuing with our first menu in the manageproduct function we are going to display 3 options add a product, display all products or be back at the first menu
then we have purchase a product, here we are going to ask if you want to purchase some items one by one
and finally we have the generateBill function that generates a bill with the items that we purchase in the second optionAnd that’s all the structure of the code, if you want to get the code, you can check it in my repository here.