How to make changes in Meilix Without rebuilding the ISO

We were building Meilix from build scripts from webapp which was taking 20 minutes approx. So to reduce that time we had an idea of using a pre built ISO as it requires fewer resources and less time as compared to the building the ISO from build script and makes modifications in it which would take less time after testing it took approx 8 minutes. The following steps were followed to edit Meilix ISO.

We require following packages for unpacking and repacking the ISO.

  • squashfs-tools
  • Genisoimage

Let’s start by unpacking the ISO. For that, we first mount the ISO.

sudo mount -o loop meilix-zesty-20170611-i386.iso mnt/


Now we extract the content of the ISO into a directory extract-cd and extract the squash file system and move it to edit folder to prepare chroot.

sudo rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
sudo unsquashfs mnt/casper/filesystem.squashfs
sudo mv squashfs-root edit


Now we can chroot and do the editing we require to do in the ISO.

sudo mount -o bind /run/ edit/run
sudo cp /etc/hosts edit/etc/
sudo mount --bind /dev/ edit/dev
sudo chroot edit


After doing the changes in chroot. For doing changes we can make a separate script to be executed inside the chroot.

sudo umount edit/dev


After completing all the changes we required in the ISO the important part comes that is repacking the ISO with the applied changes.

Regenerate the manifest.

sudo chmod +w extract-cd/casper/filesystem.manifest
sudo su <<HERE
chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest <<EOF
sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
sudo sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
sudo sed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop


Now we compress the file system we have just edited.
For higher compression we can increase the block size or use xz but that will increase the cost of compression time so we didn’t choose it for Meilix as we required a faster method.

sudo mksquashfs edit extract-cd/casper/filesystem.squashfs -noappend


Now we are going to calculate the MD5 sums again for the changes and replace them with the older MD5 sums.

cd extract-cd/ && find . -type f -not -name md5sum.txt -not -path '*/isolinux/*' -print0 | xargs -0 -- md5sum > md5sum.txt


Last step is to go in the edit directory and generate the ISO.

mkisofs \
    -V "Custom Meilix" \
    -r -cache-inodes -J -l \
    -b isolinux/isolinux.bin \
    -c isolinux/ \
    -no-emul-boot -boot-load-size 4 -boot-info-table \
    -o ../meilix-i386-custom.iso .


This covers all the steps need to make changes in Meilix without rebuilding ISO.


Sending e-mail from linux terminal

So while finalizing the apk-generator for my GSoC project, I faced a roadblock in sending the generated App to the organizer.

Normally the build takes around 10–12 minutes, so asking the user to wait for that long on the website and then providing him/her with a download link did not feel like a good option. (amirite?)

So I and Manan Wason thought of a different approach to this problem, which was to email the generated app to the organzier.

For doing this, we used 2 handy tools MSMTP and Mutt.
We can use MSMTP to send email but unfortunately we cannot include attachments, so we used Mutt to help us send email with attachments from the command line.
So hang tight and follow the rest of the guide to start sending emails from your terminal and get yourself some developer #swag

Step 1 : Installation

Use the following commands to install MSMTP and Mutt

sudo apt-get -y install msmtp
sudo apt-get -y install ca-certificates
sudo apt-get -y install mutt

We need to have a file that contains Certificate Authority (CA) certificates so that we can connect using SSL / TLS to the email server.

Step 2 : Configuring MSMTP

Now we’ll MSMTP configuration on /etc/msmtprc with the content below. NOTE : You will have to enter your username and password on this file so make sure to make this file private.

Lets first open this file

nano /etc/msmtprc

Next, add following text to the file,

account default
tls on
tls_starttls off
tls_certcheck off
auth on
host (change this to for gmail)
user username
password password
logfile /var/log/msmtp.log

NOTE : Refrain from using gmail as they might terminate your account for sending email via MSMTP.

For configuring mutt, we’ll use a similar command to edit the file located at /root/.muttrc

nano /root/.muttrc

Add following text to it which specifies the MSMTP account to use for sending email

set sendmail=”/usr/bin/msmtp”
set use_from=yes
set realname=”MY Real Name”
set envelope_from=yes

That’s it!
Now lets get ready for the fun part, SENDING THOSE EMAILS 😀

Step 3 : Sending

Now, there are 2 cases that might arise while sending the email,

1 : Sending without attachment

This is pretty straightforward and can be done with either MSMTP or Mutt.


printf “To: recipient@domain.comnFrom: username@domain.comnSubject: Testing MSMTPnnHello there. This is email test from MSMTP.” | msmtp

Entering the following code will send the email to the recipient and also display the sent email in the terminal.

Using Mutt

mutt -s “Testing Mutt” — < /path/to/body.txt

NOTE : ‘body.txt’ is the file whose contents will be used in the body of the email that will be sent to ‘’.

2 : Sending WITH an attachment

Unlike the previous case, this can be done ONLY using Mutt and the code used is

mutt -a /path/to/attachment.txt -s “Testing Mutt — < /path/to/body.txt

The syntax is similar to the above case where we sent the email without attachments.

So well, that it then!
If you followed the instructions carefully, you will have a working email client built into your terminal!
Pretty cool right?

So that’s it for this week, hope to catch you next week with some more interesting tips and tutorials.

Linux Foundation Certification at FOSSASIA 2015 in Singapore

We’re happy to bring you good news from the Linux Foundation in cooperation with OlinData: You can take a Linux Foundation exam at FOSSASIA Singapore for a special one-time 33% discount. It is possible to get yourself certified for both the Linux Foundation Certified Engineer (LFCE) and the Linux Foundation Certified System Administrator (LFCS). We’ll have a dedicated room on Saturday March 14, 2015 at Blk71 where you can sit down in all quietness and take the examination so you can walk away with one of the highest quality Linux Certification in the industry.

A Linux Foundation Certified System Administrator (LFCS) has the skills to do basic to intermediate system administration from the command-line for systems running Linux. Linux Foundation Certified System Administrators are knowledgeable in the operational support of Linux systems and services. They are responsible for first line troubleshooting and analysis, and decide when to escalate issues to engineering teams. More information here:

If you want to make sure you are prepared for the LFCS exam we have a great deal for you: By taking a special edition of the online self-paced course for the LFCS certification, you’ll be well prepared for the LFCS certification and at the same time supporting FOSSASIA: The Linux Foundation has promised to sponsor 100 USD for each online course sold. Please go here for more information and Sign Up Now.

A Linux Foundation Certified Engineer (LFCE) possesses a wider range and greater depth of skills than the Linux Foundation Certified System Administrator (LFCS). Linux Foundation Certified Engineers are responsible for the design and implementation of system architecture. They provide an escalation path and serve as Subject Matter Experts (SMEs) for the next generation of system administration professionals. More information here:

Meetup of Beijing Linux User Group with Dang Hong Phuc from FOSSASIA

Hong Phuc Dang FOSSASIA, Women in IT Asia

Please join our FOSSASIA Bejinglug meetup with Dang Hong Phuc in Bejing, China on December 6, 2015. Hong Phuc will give insights about the FOSSASIA network, the programs of FOSSASIA and the FOSSASIA summit 2015 in Singapore.

FOSSASIA runs contributors, Open Source developers and hardware maker programs in cooperations with companies and communities such as Google Summer of Code and Google Code-In (current Code-In program until January 19).

For our programs in 2015 we are looking for mentors and students of Open Technology projects who would like to join us and register their groups on the FOSSASIA community network.

The FOSSASIA summit will take place from March 13-15 in Singapore. The call for papers is open until December 20. If you are interested to present at the event, please register here:

Time: 18:00
Date: Saturday, December 6, 2014
Location: Jazz Island Coffee (爵士岛咖啡二楼)
Address (Chinese): 东城区东直门内大街东扬威街11号楼(来福士大厦对面北侧)
Map: mapbar (via dianping)
Subway: Dongzhimen Exit A
Phone: 010-8406-1040


Beijinglug Announcement:…

FOSSASIA Community Network:

FOSSASIA Summit Speaker Registration:


Meilix System Lock released

We released the first version 0.1 of Meilix System Lock. It is an application that can lock or “freeze” your system.

The application is based on Ofris, but it offers more features like a simple graphic interface to lock or unlock the system. Main developer is Hon Nguyen (Vanhonit) from Vietnam, who started the tool as part of his Google Summer of Code project for FOSSASIA.

The sourcecode is here on github:

A couple of Meilix System Lock Screenshots.

Meilix System Lock

How to create a Fedora spin – Developer Meet Up in Hong Kong

Hon Nguyen (Vietnam), Dicky (Hong Kong), Hong Phuc (Vietnam) (from right to left)

Dicky (Hong Kong) and Mathieu Bridon (France)

At our meet ups at GNOME.Asia in Hong Kong it was great to meet developers from different continents. One thing we were particularly interested in is, how to create a custom Linux based on Fedora Linux.

Well, we were lucky to meet Mathieu Bridon (Blog). There are some pictures below. Even though some pictures might look just like socializing in a pub, we actually took quite late until the eve to learn about using Kickstart files to create our own custom Linux. Thank you! So the how to of Mathieu below first.

== Building your downstream distro ==

From a Fedora system:
    # yum install spin-kickstarts pungi

See the kickstarts used to create the various Fedora spins in:

Use that as examples, the actual kickstart doc is at:

Then once you have your kickstart file:
    # pungi -c [your kickstart file]

(see pungi -h for all the options)

== Avoiding trademark issues ==

Replace fedora-logos by generic-logos to avoid the Fedora trademarks.

Clone the git repository for the package spec file:
$ fedpkg clone -a generic-logos
$ cd generic-logos

Fetch the source tarball:
$ fedpkg sources

Make your own tarball following the layout and file names.

Rename the spec file (and change the Name: tag):
Name:       xmario-logos
Version:    17.0.0
[… snip …]

See how the tarball is named like the spec file?

$ fedpkg mockbuild

== Caching packages ==

1. Synchronize the whole repository:
$ yum install yum-utils
$ reposync -r fedora -r updates -p /path/to/repository_cache

2. Keep in cache the packages you install:
  1. set keepcache=1 in /etc/yum.conf
  2. install, update,…
  3. $ find /var/cache/yum -name ‘*.rpm’

3. Download packages:
$ yum install yum-utils
$ yumdowloader foo
$ yumdownloader –resolve foo

Some different approaches to repo caching:


If you need to make an install media (not live), you’ll have to maintain
a trivial patch to anaconda.

$ fedpkg clone -a anaconda
$ cd anaconda
$ fedpkg prep
$ cd anaconda-$version
$ git init
$ git add .
$ git commit -m prepped
$ cp pyanaconda/installclasses/{,}

Replace all occurences of “fedora” by “xmario” in the file you copied,
and give it a **higher** priority (bigger number) than all other install
classes so that yours is used.

Create a patch that adds your modifications. I like to use git for that,
but you can just use the diff command if you prefer:
$ git commit -a -m “Create our install class for X-Mario”
$ git format-patch HEAD~1
$ mv 0001-*.patch ..
$ cd ..

Add the patch to the spec file header:
    [… snip …]
    Patch1000000: 0001-blabla.patch
    [… snip …]

Apply at the end of %setup:
    %patch1000000 -p1

Bump the “Release:” tag and add a changelog message in %changelog.

Commit to git:
$ git add 0000*.patch anaconda.spec
$ git commit -m “Bla bla bla commit message”

$ fedpkg mockbuild

More about fedpkg:

Mathieu Bridon and Sammy Fung (HK)