Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
How to Compile Linux Kernel with Current Configuration
7:03 PM Dedy Yasriady
This article is abount recompiling Ubuntu 14.04 kernel using current configuration. Customizing of the kernel is possible after you made copy of current config from /boot/config-`uname -r` to .config as well.
For linux distribution version other than Ubuntu 14.04 TrustyTahr might also applied with several adjustment.
Prepare workspace
$ mkdir -pv /opt/Ubuntu_x64/TrustyTahr/KERNEL
$ cd /opt/Ubuntu_x64/TrustyTahr/KERNEL
$ git clone git://kernel.ubuntu.com/ubuntu/ubuntu-trusty.git
Get Current Kernel
$ export MYKERNEL=linux-image-$(uname -r)
$ apt-get source $MYKERNEL
$ cd cd linux-lts-utopic-3.16.0
$ cp /boot/config-`uname -r` .config
Do customize whatever you want to modify on this kernel source ...
Then,
$ make
$ make modules_install
$ make install
slimbian - Slim and Minimalist Raspbian
12:19 AM Dedy Yasriady
Minimal installation of raspbian.Jessie is out, targetted for full running lite server or embedded application.
- 100% Official Raspbian compatible.
- Less than 500MB installed.
- Small memory footprint ~56MB.
- ~09 seconds boot up on Raspberry Pi 2.
- Linux 4.1.7-v7+ armv7l.
- SSH server enable.
Cross Compile WxWidgets/C++ Application for Raspberry Pi
1:52 AM Dedy Yasriady
How to Build wxWidgets / C++ for Raspberry Pi Model 2 (ARMv7 Architecture).
UPDATED:
For ease to install and configure Eclipse-IDE/Toolchain, use following link of ready used installer:
wxWidgets is an awesome C++/GUI library to work with. It can produce very nice desktop interface and has complete class library either for GUI on non GUI. Binary program yields by this library is also small and portable. Statically linking is possible to make the program running independently to any linux distribution.
Raspberry Pi is credit card sized computer, it has small form factor with capability similar to PC of PIII/900MHz with 1GB RAM. Thus, sufficient to running desktop application, as in his case, Raspbian Wheezy.
Here, you will find brief tutorial how to build wxWidgets for Raspbian to run on Raspberry Pi model 2 (ARMv7 processor).
Setup environment to used are:
- Build system on Ubuntu 14.04 LTS x64
- buildroot
- wxWidgets-3.0.2
- Target: RaspberryPi2 and Raspbian Wheezy
Build Toolchain for ARMv7
To build cross architecture Toolchain we can use awesome build system called buildroot (http://buildroot.uclibc.org/)$ cd ~
$ mkdir wxWidgets
$ cd ~/wxWidgets
$ git clone git://git.buildroot.net/buildroot
$ cd buildroot
$ make raspberrypi2_defconfig
$ make menuconfig
Adjust some requirement as follow:
Toolchain
C library (uClibc) --->
(X) glibc
Target packages > Graphic libraries and applications
[*] X.org X WIndow System --->
Target packages > Libraries > Graphics
[X] libgtk2
[Save]
$ make
Build wxWidgets for ARMv7
Once above toolchain baked and cooked well, then we can start to build and compile wxWidgets and it’s sample application.$ export PATH=~/wxWidgets/buildroot/output/host/usr/bin:$PATH
$ cd ~/wxWidgets
$ wget http://nchc.dl.sourceforge.net/project/wxwindows/3.0.2/wxWidgets-3.0.2.tar.bz2
$ tar -xzpvf wxWidgets-3.0.2.tar.bz2
$ cd wxWidgets-3.0.2
$ mkdir -p build_rpi2/wx3.0.2u_static
$ cd build_rpi2/wx3.0.2u_static
$ ../../configure --host=arm-linux --with-gtk --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-regex=builtin --with-zlib=builtin --with-expat=builtin LDFLAGS="-static-libgcc -static-libstdc++"
$ make
Sit back and relax......
Build Sample Application
$ cd samples/minimal$ make
Copy sample/minimal/minimal to Pi's sdcard and from there try to run:
$ ./minimal
See the result ................
After adjusting some path as describe on buildroot manual, you can download ready used Raspberrypi-Toolchain on sourceforge.net. The toolchain already tested on Ubuntu 14.04 with wxWidgets-3.0.2 as target built. This toolchain can be used for compiling Plain C/C++ for Pi application.
Linux / Raspberry Pi / Raspbian / Ubuntu / wxWidgets
How to Configure Ubuntu Linux Look Like Windows 7/8
7:53 PM Dedy Yasriady
Ones who migrating from Windows to Ubuntu Linux will not lose previous look and feel, you can have similar environment in your new home. With look and feel like previous operating system style, you can customize your Ubuntu Linux like the ways I'm tried here.
- Ready used Ubuntu Linux
- Cinnamon Desktop
- Windows 7/8 Theme
- Windows Icon
Terminal Commands:
$ sudo add-apt-repository ppa:lestcape/cinnamon
$ sudo apt-get update
$ sudo apt-get install cinnamon
$ sudo add-apt-repository ppa:noobslab/themes
$ sudo apt-get update
$ sudo apt-get install win-themes
Terminal Commands:
$ sudo add-apt-repository ppa:noobslab/icons
$ sudo apt-get update
$ sudo apt-get install win-icons



What You Need?
Here I will explain in brief tutorial how to make such configuration. What you need among some ingridients are:- Ready used Ubuntu Linux
- Cinnamon Desktop
- Windows 7/8 Theme
- Windows Icon
Get Installed Cinnamon Desktop
First, you need to install Cinnamon Desktop in your Linux Box with following command line:Terminal Commands:
$ sudo add-apt-repository ppa:lestcape/cinnamon
$ sudo apt-get update
$ sudo apt-get install cinnamon
Install Windows Theme
Terminal Commands:$ sudo add-apt-repository ppa:noobslab/themes
$ sudo apt-get update
$ sudo apt-get install win-themes
Install Windows Icons
Terminal Commands:
$ sudo add-apt-repository ppa:noobslab/icons
$ sudo apt-get update
$ sudo apt-get install win-icons
Apply The Installation



How To Change Grub Default Boot
4:07 PM Dedy Yasriady
This article will show you how to change Grub default boot for any
installed operation system inside your computer, be it various Linux or
Windows. The steps here known to working very well in my Ubuntu 14.04,
while other version or distribution may have similar method.

$ sudo cp /etc/default/grub /etc/default/grub.bak
$ sudo nano /etc/default/grub

Change to

After saving above file, then issue this command:
$ sudo update-grub

$ sudo reboot
You can search MenuEntry Label on this file: /boot/grub/grub.cfg
$ sudo cp /etc/default/grub /etc/default/grub.bak
$ sudo nano /etc/default/grub
Change to
After saving above file, then issue this command:
$ sudo update-grub
$ sudo reboot
You can search MenuEntry Label on this file: /boot/grub/grub.cfg
Build wxWidgets Application to Run on Any Linux
4:22 PM Dedy Yasriady
Link wxWidgets application statically and run on any linux distribution without missing any dependency files.
This tutorial inspired by article written by Tierra here, mentioned about linking with gtk and run on any linux. Also to show you how to make static linking to libstdc++ since various linux distribution will have different version of this library that could lead to error program to running.
Note: Remember that GTK is licensed under LGPL, which essentially means that in order to link it to your application _statically_, your application will have to be (L)GPL-licensed.
$ sudo mkdir -p /opt/wxWidgets
$ cd /opt/wxWidgets
$ wget http://ftp.wxwidgets.org/pub/3.0.2/wxWidgets-3.0.2.tar.bz2
$ tar -xapvf wxWidgets-3.0.2.tar.bz2
$ cd wxWidgets-3.0.2
$ mkdir -p build2/wx3.0.2u_static
$ cd build2/wx3.0.2u_static
$ ../../configure --disable-shared --with-gtk --with-libtiff=builtin --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-zlib=builtin --with-expat=builtin LDFLAGS="-static-libgcc -static-libstdc++"
$ make
Note: using similar switch as shown at autoconf above , you may also build/compile any Plain C/C++ application to link statically.
This tutorial inspired by article written by Tierra here, mentioned about linking with gtk and run on any linux. Also to show you how to make static linking to libstdc++ since various linux distribution will have different version of this library that could lead to error program to running.
Note: Remember that GTK is licensed under LGPL, which essentially means that in order to link it to your application _statically_, your application will have to be (L)GPL-licensed.
$ sudo mkdir -p /opt/wxWidgets
$ cd /opt/wxWidgets
$ wget http://ftp.wxwidgets.org/pub/3.0.2/wxWidgets-3.0.2.tar.bz2
$ tar -xapvf wxWidgets-3.0.2.tar.bz2
$ cd wxWidgets-3.0.2
$ mkdir -p build2/wx3.0.2u_static
$ cd build2/wx3.0.2u_static
$ ../../configure --disable-shared --with-gtk --with-libtiff=builtin --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-zlib=builtin --with-expat=builtin LDFLAGS="-static-libgcc -static-libstdc++"
$ make
Note: using similar switch as shown at autoconf above , you may also build/compile any Plain C/C++ application to link statically.
GitHub - HowTo Work With
12:07 AM Dedy Yasriady
It would be easy for us to have program source code stored in centralized version control system in the server. GitHub provide such service free for open source projects. The simple steps herewith will guide you to setup and initialize your very first project into GitHub.
Install Git on Ubuntu
$ sudo apt-get install gitConfiguring GitHub
$ git config --global user.name “user_name”$ git config --global user.email “email_id@domain”
Create Local Repository
$ git init MyRepo$ cd MyRepo
Create README.md
README.md is initial file you may put on the repo.$ nano README.md
Adding Repository Files to an Index
For the next, you can populate MyRepo directory with program source codes. copy over all the files into the directory, or create one if you wish to.$ git add *
$ git commit -m “some_message”
Create Repo on GitHub with Same Name
Once the repo is made on the GitHub server, you may then push local content. To connect to GitHub, use following command:
$ git remote add origin https://github.com/yasriady/MyRepo.git
Pushing Files into GitHub
Final step is to push your files into server with following command line:$ git push origin master
Check the result on your GitHub.com
Congratulation,.... you are now on GitHub, Happy Coding....!!
How To Make Linux Fonts Look Like Windows Fonts
12:41 AM Dedy Yasriady
For this purpose, I set font configuration with following simple steps:
$ sudo apt-get install msttcorefonts
$ wget http://file-id.sf.net/downloads/39-clearfonts.conf
$ sudo cp 39-clearfonts.conf /etc/fonts/conf.avail/
$ sudo ln -s /etc/fonts/conf.avail/39-clearfonts.conf /etc/fonts/conf.d
$ sudo cp 39-clearfonts.conf /etc/fonts/conf.avail/
$ sudo ln -s /etc/fonts/conf.avail/39-clearfonts.conf /etc/fonts/conf.d
Download 39-clearfonts.conf here.
To make this change applied, please relogin your current session.
Then you may use unity-tweak-tool to customize appearance of the desktop. If not installed, then do this command line:
$ sudo apt-get install unity-tweak-tool
$ unity-tweak-tool
$ sudo apt-get install unity-tweak-tool
$ unity-tweak-tool
Make a selection to [Appearance] - [Fonts], then adjust your font to match Windows Look a Like …….
See the result:
Diskless Computer via NFS with ArchLinux
3:48 PM Dedy Yasriady
# pacman -S tftp-hpa dhcp nfs-utils btrfs-progs mkinitcpio mkinitcpio-nfs-utils
# pacman -S dhcp
# nano /etc/dhcpd.conf
allow booting;
allow bootp;
authoritative;
option domain-name-servers 192.168.0.10;
option architecture code 93 = unsigned integer 16;
group {
next-server 192.168.0.10;
if option architecture = 00:07 {
filename "/grub/x86_64-efi/core.efi";
} else {
filename "/grub/i386-pc/core.0";
}
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
range 192.168.0.128 192.168.0.254;
}
}
|
# pacman –S tftp-hpa
# cp /usr/lib/systemd/system/tftpd.service /etc/systemd/system
# nano /etc/systemd/system/tftpd.service
[Unit]
Description=hpa's original TFTP daemon
[Service]
ExecStart=/usr/sbin/in.tftpd -s /srv/arch/boot
StandardInput=socket
StandardOutput=inherit
StandardError=journal
|
Run tftpd
# systemctl start tftpd.socket
Enable to run at boot time:
# systemctl enable tftpd.socket
Created symlink from /etc/systemd/system/sockets.target.wants/tftpd.socket to /usr/lib/systemd/system/tftpd.socket.
# pacman –S nfs-utils
# nano /etc/exports
/srv *(rw,fsid=0,no_root_squash,no_subtree_check)
/srv/arch *(rw,no_root_squash,no_subtree_check)
|
# mkdir /srv/arch
# sudo systemctl start nfs-idmapd.service
# sudo systemctl start nfs-mountd.service
Client installation
# pacman –S btrfs.progs
# truncate -s 1G /srv/arch.img
# mkfs.btrfs /srv/arch.img
# export root=/srv/arch
# mkdir -p "$root"
# mount -o loop,discard,compress=lzo /srv/arch.img "$root"
# pacman –S devtools arch-install-scripts
# pacstrap -d "$root" base mkinitcpio-nfs-utils nfs-utils
# sed s/nfsmount/mount.nfs4/ "$root/usr/lib/initcpio/hooks/net" > "$root/usr/lib/initcpio/hooks/net_nfs4"
# cp $root/usr/lib/initcpio/install/net{,_nfs4}
Edit $root/etc/mkinitcpio.conf and add nfsv4 to MODULES, net_nfs4 to HOOKS, and /usr/bin/mount.nfs4 to BINARIES.
# nano /srv/arch/etc/mkinitcpio.conf
# arch-chroot "$root" mkinitcpio -p linux
Client configuration
# pacman --root "$root" --dbpath "$root/var/lib/pacman" -S grub
Create a grub prefix on the target installation for both architectures using grub-mknetdir.
# arch-chroot "$root" grub-mknetdir --net-directory=/boot --subdir=grub
# nano "$root/boot/grub/grub.cfg"
menuentry "Arch Linux" {
linux /vmlinuz-linux quiet add_efi_memmap ip=:::::eth0:dhcp nfsroot=192.168.0.10:/arch
initrd /initramfs-linux.img
}
|
Subscribe to:
Posts (Atom)





