Nomodeset in Meilix

Meilix contains configuration file which is required to config the ways of Meilix booting. There are several parameter out of which is nomodeset is one of them.

Problem:

Meilix result in blank screen in a machine which boots splash screen with a driver.

Solution:

When the OS boots, nomodeset takes care that the video like splash screen happen in kernel rather than on driver. Sometimes the driver is unable to run the video which results in blank screen issue. nomodeset confirms that no video get loaded and OS boots in BIOS mode until the driver get loaded.

Way 1:

menuentry "Try Live Meilix" {
	linux	/casper/vmlinuz  file=/cdrom/preseed/lubuntu.seed boot=casper iso-scan/filename=${iso_path} nomodeset quiet splash --
	initrd	/casper/initrd.lz
}
menuentry "Install Meilix" {
	linux	/casper/vmlinuz  file=/cdrom/preseed/lubuntu.seed boot=casper only-ubiquity iso-scan/filename=${iso_path} quiet splash --
	initrd	/casper/initrd.lz
}
menuentry "Check disc for defects" {
	linux	/casper/vmlinuz  boot=casper integrity-check iso-scan/filename=${iso_path} quiet splash --
	initrd	/casper/initrd.lz
}
menuentry "Test memory" {
	linux16	/install/mt86plus
}

We put nomodeset in Try Live Meilix option for testing purpose. This file can be found https://github.com/fossasia/meilix/edit/master/image/boot/grub/loopback.cfg.

Parameter quiet splash — is responsible for showing the splash screen and at the same time, it takes care to not to display other messages while the splash screen is loaded.

We can tweak parameter with the present options during the boot screen.

This is the one way through which we can use nomodeset while editing the configuration file.

Way 2:

During running of the OS, we can use this feature by editing this file /etc/default/grub and including nomodeset in it.

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debi`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
GRUB_CMDLINE_LINUX=""

And then save and exiting the file. Then we need to update grub using

sudo update-grub

Reference:

Configuring nomodeset

nomodeset, quiet and splash

 

Continue ReadingNomodeset in Meilix

Resolving Internal Error on Badgeyay

Badgeyay is in development stage and is frequently seen to encounter bugs. One such bug is the Internal Server Error in Badgeyay.

What was the bug?

The bug was with the badge generator’s backend code. The generator was trying to server the zip file that was not present. After going through the log I noticed that it was because a folder was missing from Badgeyay’s directory.

 

I immediately filed an issue #58 which stated the bug and how could it be resolved. After being assigned to the issue I did my work and created a Pull Request that was merged soon.

The Pull Request can be found here.

Resolving the bug

With the help of extensive error management and proper code and log analysis I was able to figure out a fix for this bug. It was in-fact due to a missing folder that was deleted by a subsequent code during zipfile/pdf generation. It was supposed to be recreated every time it was deleted. I quickly designed a function that solved this error for future usage of Badgeyay.

 

How was it resolved?

First I started by checking if the “BADGES_FOLDER” was not present. And if it was not present then the folder was created using the commands below

 

if not os.path.exists(BADGES_FOLDER):

    os.mkdir(BADGES_FOLDER)

 

Then, I added docstring to the remaining part of the code. It was used to empty all the files and folder inside the “BADGES_FOLDER”. We could have to delete two things, a folder or a file.

So proper instructions are added to handle file deletion and folder deletion.

 

for file in os.listdir(BADGES_FOLDER):

    file_path = os.path.join(BADGES_FOLDER, file)

    try:

        if os.path.isfile(file_path):

            os.unlink(file_path)

        elif os.path.isdir(file_path):

            shutil.rmtree(file_path)

    except Exception:

        traceback.print_exc()

 

Here “os.unlink” is a function that is used to delete a file. And “shutil.rmtree” is a function that deletes the whole folder at once. It is similar to “sudo rm -rf /directory”. Proper error handling is done as well to ensure stability of program as well.

Challenges

There were many problems that I had to face during this bug.

  • It was my first time solving a bug, so I was nervous.
  • I had no knowledge about “shutil” library.
  • I was a new-comer.

But I took these problems as challenges and was able to fix this bug that caused the INTERNAL SERVER ERROR : 500 .

Resources

 

 

Continue ReadingResolving Internal Error on Badgeyay