Thursday 31 May 2018

Creation of a JFFS2 image

The creation of a JFFS2 image is fairly simple:
$ cd ${PRJROOT}
$ mkfs.jffs2 -r rootfs/ -o images/rootfs-jffs2.img
We use the -r option to specify the location of the directory containing the root filesystem, and the -o option to specify the name of the output file where the filesystem image should be stored. In addition to these options, we could use -l or -b to create little endian or big endian images, respectively. The JFFS2 compression ratio is much smaller than CRAMFS. For a root filesystem containing 7840 KB, for example, the resulting JFFS2 image is 6850 KB in size. The compression ratio is a little above 10%.
Once you create the JFFS2 image, you can write it to its designated MTD device. If this device is accessible on the host, you can carry out the appropriate commands directly on the host. Otherwise, follow the instructions in Section 8.2: boot your target with an NFS-mounted root filesystem, place the JFFS2 image on that filesystem, and issue the commands on the target to write the image to the designated MTD device. Regardless of your setup, you first need to erase the MTD device where the image will be placed:
# eraseall /dev/mtd5
Erased 8192 Kibyte @ 0 -- 100% complete.
Obviously, the space available on the MTD storage device must be equal to or larger than the JFFS2 image you are placing on it. With the MTD device erased, copy the JFFS2 image to the MTD partition:
# cat images/rootfs-jffs2.img > /dev/mtd5
Now, mount the copied filesystem to take a look at it:
# mount -t jffs2 /dev/mtdblock5 /mnt
# mount
...
/dev/mtdblock5 on /mnt type jffs2 (rw)
# ls mnt
bin      etc      linuxrc  sbin     usr
dev      lib      proc     tmp      var 
# umount mnt
Unlike disk filesystems, JFFS2 cannot be mounted on loopback using a mount -o loop ... command to view its content. Instead, it must be mounted from a real MTD device as done above. If you have no real MTD device on your host, such as CFI flash, you could use the virtual memory MTD device presented in Chapter 3. You could also use the jffs2reader command introduced in the previous chapter to view the image's content.
If your target had previously been using an NFS-mounted root filesystem, you are now ready to boot it using the JFFS2 filesystem as its root filesystem.

Wednesday 16 May 2018

Useful Books about Linux


1.1. General Linux

  • "Linux in a Nutshell" by Ellen Siever, Jessica P. Hackman, Stephen Spainhour, Stephen Figgins, O'Reilly UK, ISBN 0596000251
  • "Running Linux" by Matt Welsh, Matthias Kalle Dalheimer, Lar Kaufman, O'Reilly UK, ISBN 156592469X
  • "Linux Unleashed" by Tim Parker, Bill Ball, David Pitts, Sams, ISBN 0672316889
  • "When You Can't Find Your System Administrator" by Linda Mui, O'Reilly UK, ISBN 1565921046
  • When you actually buy a distribution, it will contain a very decent user manual.

1.2. Editors

  • "Learning the Vi Editor" by Linda Lamb and Arnold Robbins, O'Reilly UK, ISBN 1565924266
  • "GNU Emacs Manual" by Richard M.Stallman, iUniverse.Com Inc., ISBN 0595100333
  • "Learning GNU Emacs" by Debra Cameron, Bill Rosenblatt and Eric Raymond, O'Reilly UK, ISBN 1565921526
  • "Perl Cookbook" by Tom Christiansen and Nathan Torkington, O'Reilly UK, ISBN 1565922433

1.3. Shells

  • "Unix Shell Programming" by Stephen G.Kochan and Patrick H.Wood, Sams Publishing, ISBN 067248448X
  • "Learning the Bash Shell" by Cameron Newham and Bill Rosenblatt, O'Reilly UK, ISBN 1565923472
  • "The Complete Linux Shell Programming Training Course" by Ellie Quigley and Scott Hawkins, Prentice Hall PTR, ISBN 0130406767
  • "Linux and Unix Shell Programming" by David Tansley, Addison Wesley Publishing Company, ISBN 0201674726
  • "Unix C Shell Field Guide" by Gail and Paul Anderson, Prentice Hall, ISBN 013937468X

1.4. X Window

  • "Gnome User's Guide" by the Gnome Community, iUniverse.Com Inc., ISBN 0595132251
  • "KDE Bible" by Dave Nash, Hungry Minds Inc., ISBN 0764546929
  • "The Concise Guide to XFree86 for Linux" by Aron HSiao, Que, ISBN 0789721821
  • "The New XFree86" by Bill Ball, Prima Publishing, ISBN 0761531521
  • "Beginning GTK+ and Gnome" by Peter Wright, Wrox Press, ISBN 1861003811
  • "KDE 2.0 Development" by David Sweet and Matthias Ettrich, Sams Publishing, ISBN 0672318911
  • "GTK+/Gnome Application Development" by Havoc Pennington, New Riders Publishing, ISBN 0735700788

1.5. Networking

  • "TCP/IP Illustrated, Volume I: The Protocols" by W. Richard Stevens, Addison-Wesley Professional Computing Series, ISBN 0-201-63346-9
  • "DNS and BIND" by Paul Albitz, Cricket Liu, Mike Loukides and Deborah Russell, O'Reilly & Associates, ISBN 0596001584
  • "The Concise Guide to DNS and BIND" by Nicolai Langfeldt, Que, ISBN 0789722739
  • "Implementing LDAP" by Mark Wilcox, Wrox Press, ISBN 1861002211
  • "Understanding and deploying LDAP directory services" by Tim Howes and co., Sams, ISBN 0672323168
  • "Sendmail" by Brian Costales and Eric Allman, O'Reilly UK, ISBN 1565922220
  • "Removing the Spam : Email Processing and Filtering" by Geoff Mulligan, Addison Wesley Publishing Company, ISBN 0201379570
  • "Managing IMAP" by Dianna & Kevin Mullet, O'Reilly UK, ISBN 059600012X

Tuesday 15 May 2018

Linux Board Porting Training Series By TI:

Hi All,

Please find the below link which guides you all to learn porting Linux on any TI custom boards.


The "Linux Board Porting" on-line series is comprised of nine, 10-minute modules (3 Lecture and 6 Lab) that provide an introduction to porting U-boot and the Linux Kernel to custom hardware platforms.
This series includes:
  • Module 1 - Introduction: This 3-minute presentation provides an overview of "Linux Board Porting" online series.
  • Module 2 - Linux Board Port Overview: Overview of the process of porting Linux and U-boot from a standard TI development platform to the developer's custom hardware.
  • Module 3 - Linux Boot Process: Overview of the process of booting Linux on an embedded Arm Cortex device.
  • Module 4 - Linux/U-boot Source Code Structure: Overview of the layered organization of the source code files for both Linux and U-boot, focusing on those files which are most pertinent to a typical board porting effort.
  • Module 5 - Installing Code Composer Studio: This first lab exercise of the series is a recording of the presenter installing Code Composer Studio. In particular, installation of the proper JTAG drivers and a valid CCS license are required to debug U-boot. This is the first of three lab exercises centered around debugging U-boot using JTAG.
  • Module 6 - Building U-boot in CCS: This lab exercise shows the user how to set up a makefile-based project in Code Composer Studio in order to rebuild u-boot from source code.
  • Module 7 - Debugging U-boot with JTAG in CCS: This module is a recording of the presenter using Code Composer Studio and an xds560 emulator to debug U-boot on the Beaglebone Black platform.
  • Module 8 - Installing SDK and Building Kernel with Debug Symbols: This module is a recording of the presenter installing the Sitara Software Development Kit (SDK) and rebuilding the Linux Kernel with Debugging Symbols. It is the first of three modules demonstrating the debugging of the Linux Kernel in Code Composer Studio using JTAG.
  • Module 9 - Booting Linux from MMC/SD Card and TFTP: This module is a recording of the presenter using the SDK utility to build a bootable MMC/SD card for the AM335x starter kit and modifying the card to load the Linux Kernel from a TFTP server.
  • Module 10 - Debugging Linux Kernel with JTAG in CCS: This module is a recording of the presenter configuring JTAG debugging of the Linux Kernel using Code Composer Studio. It is the final in a ten-part series.