Free open source software lab manual

open source lab manual and free open source software lab manual jntu
KomalMittal Profile Pic
KomalMittal,India,Teacher
Published Date:13-07-2017
Your Website URL(Optional)
Comment
LAB MANUAL: 2013-2014(ODD SEMESTER) CS2406-OPEN SOURCE LAB PREPARED BY, S.OYYATHEVAN / Asso.Prof Computer Science and Engineering Odaiyappa College of Engineering and Technology-Theni. S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 1 CS 2406 OPEN SOURCE LAB L T P C 0 0 3 2 OBJECTIVE: To expose students to FOSS environment and introduce them to use open source packages. 1. Kernel configuration, compilation and installation : Download / access The latest kernel source code from kernel.org,compile the kernel and install it in the local system.Try to view the source code of the kernel 2. Virtualisation environment (e.g., xen, kqemu or lguest) to test an applications,new kernels and isolate applications. It could also be used to expose students to other alternate OSs like BSD 3. Compiling from source : learn about the various build systems used like the auto family, cmake, ant etc. instead of just running the commands. This could involve the full process like fetching from a cvs and also include autoconf,automake etc., 4. Introduction to packet management system : Given a set of RPM or DEB, how to build and maintain, serve packages over http or ftp. and also how do you configure client systems to access the package repository. 5. Installing various software packages Either the package is yet to be installed or an older version is existing. The student can practice installing the latest version. Of course, this might need internet access 5.1Install samba and share files to windows 5.2 Install Common Unix Printing System(CUPS) 6. Write userspace drivers using fuse — easier to debug and less dangerous to the system (Writing full-fledged drivers is difficult at student level) 7. GUI programming : a sample programme – using Gambas since the students have VB knowledge. However, one should try using GTK or QT 8. Version Control System setup and usage using RCS, CVS, SVN 9. Text processing with Perl: simple programs, connecting with database e.g., MYSQL 10. Running PHP : simple applications like login forms after setting up a LAMP stack 11. Running Python : some simple exercise – e.g. Connecting with MySql database 12. Set up the complete network interface using ifconfig command liek setting gateway, DNS, IP tables, etc., TOTAL: 45 PERIODS S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 2 LIST OF EQUIPMENTS: Hardware: Minimum Requirements: – 700 Mhz X86 Processor – 384 MB of system memory (RAM) – 40 GB of disk space – Graphics card capable of 1024768 resolution – Sound Card – Network or Internet Connection Software: Latest distribution of Linux(FEDERO 14) S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 3 LIST OF EXPERIMENTS 1) Kernel configuration, compilation and installation 2) Virtualisation environment 3) Compiling from source 4) Introduction to packet management system 5) Installing various software packages 6) Write userspace drivers using fuse 7) GUI programming 8) Version Control System 9) Text processing with Perl 10) Running PHP 11) Running Python 12) Set up the complete network interface S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 4 EX. No : 1 KERNEL CONFIGURATION, COMPILATION AND INSTALLATION DATE: Aim : To download / access The latest kernel source code from kernel.org,compile the kernel and install it in the local system and to Try viewing the source code of the kernel. Algorithm: Follow the following Steps: Step 1: OPEN THE BROWSER AND TYPE THE FOLLOWING COMMAND: HTTP://192.168.105.254/CS2406/Software requirements for Lab exercises/ - select the kernel source code (ex no 1)-display the linux-2.6.35.7.tar.gz-select linux-2.6.35.7.tar.gz link-save the folder in Downloads directory-go to Download directory from places in menubar-extract linux-2.6.35.7.tar.gz folder on that same directory. Step 2:Display the user name fosslabfosslab uname -r 2.6.35.6-45.fc14.i686 Step 3: Enter the Download Directory and Display password of the Directory and display the list fosslabfosslab cd Downloads/ fosslabfosslab Downloads pwd /home/fosslab/Downloads fosslabfosslab Downloads ls -l total 93332 -rw-rw-r 1 fosslab fosslab 344011 Jun 28 01:50 04524284.pdf -rw-rw-r 1 fosslab fosslab 251225 Jun 28 01:36 91-US-31-1_Cloud_Computing.pdf -rw-rw-r 1 fosslab fosslab 556032 Jun 28 01:41 ABSTRACT and pro_vidhya.doc -rw-rw-r 1 fosslab fosslab 429466 Jun 28 01:37 computing-whitepaper.pdf -rw-rw-r 1 fosslab fosslab 99019 Aug 1 01:03 Criterion-8.docx -rw-rw-r 1 fosslab fosslab 110194 Aug 1 01:03 Criterion 9(2).docx -rw-rw-r 1 fosslab fosslab 110194 Aug 1 01:03 Criterion 9.docx -rw-rw-r 1 fosslab fosslab 512000 Aug 1 01:03 criter XP12-chandran.doc -rw-rw-r 1 fosslab fosslab 422400 Aug 1 01:03 criter XP12_Mech.doc -rwxrwxr-x 1 fosslab fosslab 493564 Jun 7 2011 Downloads.exe S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 5 -rw-rw-r 1 fosslab fosslab 634100 Jun 28 00:13 EJSR_64_2_05.pdf -rw-rw-r 1 fosslab fosslab 237418 Jun 28 00:13 EJSR_64_2_14.pdf -rw-rw-r 1 fosslab fosslab 54227 Jun 28 01:39 EJSR_74_3_04.pdf -rw-rw-r 1 fosslab fosslab 527523 Jun 28 01:44 EJSR_77_1_06.pdf -rw-rw-r 1 fosslab fosslab 147175 Jul 9 01:55 foss-lab-manual-p1-1.0-rc1.pdf -rw-rw-r 1 fosslab fosslab 20228 Jun 28 01:50 Gartner Data Mining Addtl.pdf -rw-rw-r 1 fosslab fosslab 12253 Aug 11 14:02 HP-LaserJet-laserjet.ppd -rw-rw-r 1 fosslab fosslab 219237 Jun 28 00:10 kdd98_elder_abbott_nopics_bw.pdf -rw-rw-r 1 fosslab fosslab 88323744 Aug 16 14:27 linux-2.6.35.7.tar.gz -rw-rw-r 1 fosslab fosslab 60416 Jul 14 04:56 newFOC LP.doc -rw-rw-r 1 fosslab fosslab 43520 Jun 28 01:40 ProjectTitles.doc -rw-rw-r 1 fosslab fosslab 180964 Jun 28 01:57 sensor-route-security.pdf -rw-rw-r 1 fosslab fosslab 56320 Jul 18 01:55 ssLABabet outcome.doc -rw-rw-r 1 fosslab fosslab 142336 Jul 18 01:53 ss Lesson-plan.doc -rw-rw-r 1 fosslab fosslab 14540 Jul 30 04:55 st_newmark3(2).jsp -rw-rw-r 1 fosslab fosslab 14702 Jul 30 04:45 st_newmark3.jsp -rw-rw-r 1 fosslab fosslab 1517376 Jul 28 02:36 wrar420.exe Step 4: Enter the linux-2.6.35.7 Directory and Display the password of the linux-2.6.35.7 and Display the list of that linux-2.6.35.7 directory fosslabfosslab Downloads cd linux-2.6.35.7/ fosslabfosslab linux-2.6.35.7 pwd /home/fosslab/Downloads/linux-2.6.35.7 fosslabfosslab linux-2.6.35.7 ls -l total 456 drwxrwxr-x 25 fosslab fosslab 4096 Sep 28 2010 arch drwxrwxr-x 2 fosslab fosslab 4096 Sep 28 2010 block -rw-rw-r 1 fosslab fosslab 18693 Sep 28 2010 COPYING -rw-rw-r 1 fosslab fosslab 94031 Sep 28 2010 CREDITS drwxrwxr-x 3 fosslab fosslab 4096 Sep 28 2010 crypto drwxrwxr-x 85 fosslab fosslab 12288 Sep 28 2010 Documentation drwxrwxr-x 89 fosslab fosslab 4096 Sep 28 2010 drivers drwxrwxr-x 36 fosslab fosslab 4096 Sep 28 2010 firmware S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 6 drwxrwxr-x 72 fosslab fosslab 4096 Sep 28 2010 fs drwxrwxr-x 20 fosslab fosslab 4096 Sep 28 2010 include drwxrwxr-x 2 fosslab fosslab 4096 Sep 28 2010 init drwxrwxr-x 2 fosslab fosslab 4096 Sep 28 2010 ipc -rw-rw-r 1 fosslab fosslab 2440 Sep 28 2010 Kbuild drwxrwxr-x 8 fosslab fosslab 4096 Sep 28 2010 kernel drwxrwxr-x 6 fosslab fosslab 4096 Sep 28 2010 lib -rw-rw-r 1 fosslab fosslab 174535 Sep 28 2010 MAINTAINERS -rw-rw-r 1 fosslab fosslab 51251 Sep 28 2010 Makefile drwxrwxr-x 2 fosslab fosslab 4096 Sep 28 2010 mm drwxrwxr-x 50 fosslab fosslab 4096 Sep 28 2010 net -rw-rw-r 1 fosslab fosslab 17459 Sep 28 2010 README -rw-rw-r 1 fosslab fosslab 3371 Sep 28 2010 REPORTING-BUGS drwxrwxr-x 7 fosslab fosslab 4096 Sep 28 2010 samples drwxrwxr-x 12 fosslab fosslab 4096 Sep 28 2010 scripts drwxrwxr-x 7 fosslab fosslab 4096 Sep 28 2010 security drwxrwxr-x 21 fosslab fosslab 4096 Sep 28 2010 sound drwxrwxr-x 4 fosslab fosslab 4096 Sep 28 2010 tools drwxrwxr-x 2 fosslab fosslab 4096 Sep 28 2010 usr drwxrwxr-x 3 fosslab fosslab 4096 Sep 28 2010 virt Step 5:Open the Makefile in vi editor and type the extraversion directory fosslabfosslab linux-2.6.35.7 vi Makefile VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 35 EXTRAVERSION = .7-veni NAME = Yokohama Step 6:To make the menuconfiguratiom fosslabfosslab linux-2.6.35.7 make menuconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/docproc HOSTCC scripts/basic/hash S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 7 HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/kxgettext.o HOSTCC scripts/kconfig/lxdialog/checklist.o HOSTCC scripts/kconfig/lxdialog/inputbox.o HOSTCC scripts/kconfig/lxdialog/menubox.o HOSTCC scripts/kconfig/lxdialog/textbox.o HOSTCC scripts/kconfig/lxdialog/util.o HOSTCC scripts/kconfig/lxdialog/yesno.o HOSTCC scripts/kconfig/mconf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/lex.zconf.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/mconf scripts/kconfig/mconf arch/x86/Kconfig using defaults found in /boot/config-2.6.35.6-45.fc14.i686 configuration written to .config End of Linux kernel configuration. Execute 'make' to build the kernel or try 'make help'. Step 7:Display the General setup screen and do the following steps file systems-DOS/FAT/NT FILE SYSTEM-NTFS FILE SYSTEMS press space bar-NTFS FILE SUPPORT press the space bar-exit Step 8: To make the bootlImage from the x86 boot directory fosslabfosslab linux-2.6.35.7make bzImage Step 9: Login in to the super user(root) fosslabfosslab linux-2.6.35.7 su Password: (admin123) S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 8 Step 10: To copy the bootlinuzImage from the x86 boot directory in to the vmlinuz-2.6.35.7 directory rootfosslab linux-2.6.35.7 cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.35.7-veni Step 11: Exit from the super user rootfosslab linux-2.6.35.7 exit exit Step 12: To make the modules in linux-2.6.35.7 and Display list of modules are available in modules fosslabfosslab linux-2.6.35.7 make modules fosslabfosslab linux-2.6.35.7 ls -l /lib/modules total 8 drwxr-xr-x. 6 root root 4096 May 29 02:54 2.6.35.6-45.fc14.i686 drwxr-xr-x. 6 root root 4096 May 29 02:48 2.6.35.6-45.fc14.i686.PAE Step 13: Login in to the super user(root) fosslabfosslab linux-2.6.35.7 su Password:(admin123) Step 14: Modules are install into the linux-2.6.35.7 on the super user and Display the available directories on the linux-2.6.35.7 rootfosslab linux-2.6.35.7 make modules_install rootfosslab linux-2.6.35.7 ls -l /lib/modules total 12 drwxr-xr-x. 6 root root 4096 May 29 02:54 2.6.35.6-45.fc14.i686 drwxr-xr-x. 6 root root 4096 May 29 02:48 2.6.35.6-45.fc14.i686.PAE drwxr-xr-x 3 root root 4096 Aug 17 11:49 2.6.35.7-veni Step 15: stored all the hardwares and directories in to th e initram directory //////////////rootfosslab linux-2.6.35.7 mkinitrd /boot/initramfs-2.6.35.7-veni.img 2.6.35.7-veni Step 16: Enter in to the boot directory and Display the list of files are avilable on the boot directoy rootfosslab linux-2.6.35.7 cd /boot rootfosslab boot ls -l S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 9 total 61848 -rw-rr. 1 root root 114968 Oct 18 2010 config-2.6.35.6-45.fc14.i686 -rw-rr. 1 root root 115205 Oct 18 2010 config-2.6.35.6-45.fc14.i686.PAE drwxr-xr-x. 3 root root 4096 May 29 01:06 efi drwxr-xr-x. 2 root root 4096 May 29 00:53 extlinux drwxr-xr-x. 2 root root 4096 May 29 02:56 grub -rw-rr. 1 root root 13507699 May 29 02:46 initramfs-2.6.35.6-45.fc14.i686.img -rw-rr. 1 root root 13502690 May 29 02:47 initramfs-2.6.35.6-45.fc14.i686.PAE.img -rw-rr 1 root root 11005350 Aug 17 11:51 initramfs-2.6.35.7-veni.img -rw-rr. 1 root root 1106328 May 29 01:52 initrd-plymouth.img -rw-rr. 1 root root 1681526 Oct 18 2010 System.map-2.6.35.6-45.fc14.i686 -rw-rr. 1 root root 1709576 Oct 18 2010 System.map-2.6.35.6-45.fc14.i686.PAE -rwxr-xr-x. 1 root root 3696448 Oct 18 2010 vmlinuz-2.6.35.6-45.fc14.i686 -rwxr-xr-x. 1 root root 3761568 Oct 18 2010 vmlinuz-2.6.35.6-45.fc14.i686.PAE -rw-rr 1 root root 3677056 Aug 17 10:58 vmlinuz-2.6.35.7-veni -rw-rr. 1 root root 571311 Oct 12 2010 xen-4.0.1.gz lrwxrwxrwx. 1 root root 12 May 29 00:40 xen.gz - xen-4.0.1.gz -rw-rr. 1 root root 8840980 Oct 12 2010 xen-syms-4.0.1 Step 17: Enter in to the grub file on the boot directory rootfosslab boot cd /boot/grub Step 18: open the grub.conf file from grub directory rootfosslab grub vi grub.conf add end of the file line title Fedora (2.6.35.7-veni) root (hd0,0) kernel /boot/vmlinuz-2.6.35.7-mykernel ro root=UUID=6c37c0aa-4b4c-4bbe-a235-d9149be80d24 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb- sun16 KEYTABLE=us rhgb quiet S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 10 initrd /boot/initramfs-2.6.35.7-veni.img copy this statement form title fedora ro root=UUID=6c37c0aa-4b4c-4bbe-a235-d9149be80d24 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet Step 19: Reboot the system rootfosslab grub reboot Result: Thus to download / access the latest kernel source code from kernel.org, compiling the kernel and install it in the local system and trying to view the source code of the kernel is done successfully. S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 11 EX.NO.2: VIRTUALISATION ENVIRONMENT DATE: Aim: To test an applications, new kernels and isolate applications. Algorithm: Follow the following steps : Step1: In Application MenuSystem ToolsTerminals. Step2: Display the qemu packages are available on the resource package manager fosslabfosslab rpm -qa grep qemu qemu-user-0.13.0-0.7.rc1.fc14.i686 qemu-system-sh4-0.13.0-0.7.rc1.fc14.i686 qemu-system-ppc-0.13.0-0.7.rc1.fc14.i686 qemu-system-sparc-0.13.0-0.7.rc1.fc14.i686 qemu-img-0.13.0-0.7.rc1.fc14.i686 qemu-kvm-0.13.0-0.7.rc1.fc14.i686 qemu-common-0.13.0-0.7.rc1.fc14.i686 gpxe-roms-qemu-1.0.1-1.fc14.noarch kmod-kqemu-2.6.35.6-45.fc14.i686-1.4.0-0.2.pre1.fc14.17.i686 qemu-0.13.0-0.7.rc1.fc14.i686 qemu-system-cris-0.13.0-0.7.rc1.fc14.i686 qemu-system-m68k-0.13.0-0.7.rc1.fc14.i686 kmod-kqemu-2.6.35.6-45.fc14.i686.PAE-1.4.0-0.2.pre1.fc14.17.i686 akmod-kqemu-1.4.0-0.2.pre1.fc14.17.i686 qemu-system-mips-0.13.0-0.7.rc1.fc14.i686 kqemu-1.4.0-0.5.pre1.fc14.noarch qemu-system-x86-0.13.0-0.7.rc1.fc14.i686 S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 12 qemu-system-arm-0.13.0-0.7.rc1.fc14.i686 Step3: Display the details about qemu fosslabfosslab rpm -qi qemu Name : qemu Relocations: (not relocatable) Version : 0.13.0 Vendor: Fedora Project Release : 0.7.rc1.fc14 Build Date: Tue 21 Sep 2010 06:14:54 PM EDT Install Date: Tue 29 May 2012 01:38:39 AM EDT Build Host: x86-09.phx2.fedoraproject.org Group : Development/Tools Source RPM: qemu-0.13.0-0.7.rc1.fc14.src.rpm Size : 0 License: GPLv2+ and LGPLv2+ and BSD Signature : RSA/SHA256, Wed 22 Sep 2010 01:42:58 PM EDT, Key ID 421caddb97a1071f Packager : Fedora Project URL : http://www.qemu.org/ Summary : QEMU is a FAST processor emulator Description : QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation. QEMU has two operating modes: Full system emulation. In this mode, QEMU emulates a full system (for example a PC), including a processor and various peripherials. It can be used to launch different Operating Systems without rebooting the PC or to debug system code. User mode emulation. In this mode, QEMU can launch Linux processes compiled for one CPU on another CPU. As QEMU requires no host kernel patches to run, it is safe and easy to use. Step4: Open Firefox and type the following address: S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 13 http://192.168.105.254/tools/freedos/ output: Index of /tools/freedos Name Last modified Size Description Parent Directory - fdbasecd.iso 28-Mar-2011 09:17 7.9M freedos.qcow2 28-Mar-2011 09:18 9.2M Step 5: Select fdbasecd.iso and save the file Now Goto Places - Downloads and check whether the .iso file have been downloaded Step6: Goto to terminal and diaplay the password of fosslab fosslabfosslab pwd /home/fosslab Step7: To make the directory name virtual fosslabfosslab mkdir virtual Step8:Get the directory virtual fosslabfosslab cd virtual/ fosslabfosslab virtual Step 9:To display the password of virtual directory fosslabfosslab virtual pwd /home/fosslab/virtual Step10: Move the fdbasecd.iso. folder from download directory into virtual directory fosslabfosslab virtual mv /home/fosslab/Downloads/fdbasecd.iso . Step11: fosslabfosslab virtual ls -l total 8140 S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 14 -rw-rw-r 1 fosslab fosslab 8333312 Aug 22 08:38 fdbasecd.iso Step 12: Create virtual disk image size is 100M fosslabfosslab virtual qemu-img create virtualdisk.img 100M Formatting 'virtualdisk.img', fmt=raw size=104857600 Step13:fosslabfosslab virtual ls -l total 8140 -rw-rw-r 1 fosslab fosslab 8333312 Aug 22 08:38 fdbasecd.iso -rw-rr 1 fosslab fosslab 104857600 Aug 22 08:46 virtualdisk.img step14:Boot the virtual disk fosslabfosslab virtual qemu -hda virtualdisk.img -cdrom fdbasecd.iso -boot d Now Press Enter key Step15: S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 15 Now Press Enter Step16: Press Enter Step17: S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 16 Press Enter Step18: press Enter Step19: Type fdisk S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 17 Step20: Press 1 S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 18 Step21 : Now Press 1 option Step22: Step23: S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 19 Now press Esc to Continue Step24: Press ESC S.OYYATHEVAN M.E.,(Ph.D). OPEN SOURCE LAB MANUAL 20