https://elinux.org/api.php?action=feedcontributions&user=Const&feedformat=atomeLinux.org - User contributions [en]2024-03-29T10:36:32ZUser contributionsMediaWiki 1.31.0https://elinux.org/index.php?title=Device_drivers&diff=535151Device drivers2020-10-20T12:21:01Z<p>Const: /* Sample drivers */</p>
<hr />
<div>== Manuals ==<br />
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction<br />
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition]<br />
<br />
== Sample drivers ==<br />
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.<br />
* [https://github.com/makelinux/ldt/blob/master/pci-ldt.c PCI Linux Driver Template]<br />
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0<br />
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton <br />
** [https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c sbull.c] - simple block device<br />
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device<br />
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works<br />
* [https://elixir.bootlin.com/linux/v3.18/source/drivers/media/platform/mem2mem_testdev.c mem2mem_testdev.c - virtual v4l2-mem2mem example device driver]<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix)<br />
* [https://elixir.bootlin.com/linux/v4.10/source/drivers/pci/hotplug/pcihp_skeleton.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled)<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver]<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo]<br />
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet)<br />
<br />
== Resources ==<br />
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers)</div>Consthttps://elinux.org/index.php?title=Device_drivers&diff=533376Device drivers2020-10-08T16:25:51Z<p>Const: /* Sample drivers */</p>
<hr />
<div>== Manuals ==<br />
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction<br />
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition]<br />
<br />
== Sample drivers ==<br />
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.<br />
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0<br />
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton <br />
** [https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c sbull.c] - simple block device<br />
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device<br />
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works<br />
* [https://elixir.bootlin.com/linux/v3.18/source/drivers/media/platform/mem2mem_testdev.c mem2mem_testdev.c - virtual v4l2-mem2mem example device driver]<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix)<br />
* [https://elixir.bootlin.com/linux/v4.10/source/drivers/pci/hotplug/pcihp_skeleton.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled)<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver]<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo]<br />
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet)<br />
<br />
== Resources ==<br />
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers)</div>Consthttps://elinux.org/index.php?title=Device_drivers&diff=533371Device drivers2020-10-08T16:23:10Z<p>Const: /* Sample drivers */</p>
<hr />
<div>== Manuals ==<br />
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction<br />
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition]<br />
<br />
== Sample drivers ==<br />
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.<br />
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0<br />
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton <br />
** [https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c sbull.c] - simple block device<br />
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device<br />
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works<br />
* [https://elixir.bootlin.com/linux/v3.18/source/drivers/media/platform/mem2mem_testdev.c mem2mem_testdev.c - virtual v4l2-mem2mem example device driver]<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix)<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/video/fbdev/skeletonfb.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled)<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver]<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo]<br />
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet)<br />
<br />
== Resources ==<br />
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers)</div>Consthttps://elinux.org/index.php?title=Device_drivers&diff=533366Device drivers2020-10-08T16:20:04Z<p>Const: elixir.bootlin.com</p>
<hr />
<div>== Manuals ==<br />
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction<br />
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition]<br />
<br />
== Sample drivers ==<br />
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.<br />
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0<br />
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton <br />
** [https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c sbull.c] - simple block device<br />
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device<br />
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/media/platform/mem2mem_testdev.c?v=3.18 mem2mem_testdev.c - virtual v4l2-mem2mem example device driver]<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix)<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/video/fbdev/skeletonfb.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled)<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver]<br />
* [https://elixir.bootlin.com/linux/latest/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo]<br />
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet)<br />
<br />
== Resources ==<br />
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers)</div>Consthttps://elinux.org/index.php?title=Device_drivers&diff=533361Device drivers2020-10-08T16:16:36Z<p>Const: </p>
<hr />
<div>== Manuals ==<br />
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction<br />
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition]<br />
<br />
== Sample drivers ==<br />
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.<br />
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0<br />
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton <br />
** [https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c sbull.c] - simple block device<br />
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device<br />
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device<br />
* [http://lxr.free-electrons.com/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works<br />
* [http://lxr.free-electrons.com/source/drivers/media/platform/mem2mem_testdev.c?v=3.18 mem2mem_testdev.c - virtual v4l2-mem2mem example device driver]<br />
* [http://lxr.free-electrons.com/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix)<br />
* [http://lxr.free-electrons.com/source/drivers/video/fbdev/skeletonfb.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled)<br />
* [http://lxr.free-electrons.com/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver]<br />
* [http://lxr.free-electrons.com/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo]<br />
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet)<br />
<br />
== Resources ==<br />
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers)</div>Consthttps://elinux.org/index.php?title=Android_Debugging&diff=509786Android Debugging2020-03-09T10:31:45Z<p>Const: remove obsolete, + cpu-profiler</p>
<hr />
<div>Debugging methods for Android<br />
== Framework debugging ==<br />
<br />
To enable define '''ALOGV''' use '#define LOG_NDEBUG 0' and to enable '''ALOGVV''' use '#define VERY_VERY_VERBOSE_LOGGING'<br />
<br />
== Debuggers ==<br />
=== Kernel and User co-debug with GDB on Android ===<br />
This presentation covers lots of Android debug resources provided by Linaro, presented<br />
by Zach Pfeffer in Spring 2012. Included is information about how to debug<br />
kernel and user simultaneously with gdb.<br />
<br />
See [[Media:Zach Pfeffer Next Gen Android 2012.pdf]]<br />
<br />
== loggers ==<br />
=== kernel message log ===<br />
The Linux kernel has a message log in an internal ring buffer. You can access the contents<br />
of this log using the [http://en.wikipedia.org/wiki/Dmesg 'dmesg'] command.<br />
<br />
You can add timing information to the printk messages, by adding "time" to the Linux<br />
kernel command line.<br />
<br />
==== init logging ====<br />
The Android init program outputs some messages to the kernel log, as it starts the system.<br />
You can increase the verbosity of init, using the "loglevel" command in the /init.rc file.<br />
<br />
The default loglevel is 3, but you can change it to 8 (the highest) by changing the following<br />
line in the /init.rc file. Change:<br />
loglevel 3<br />
to<br />
loglevel 8<br />
<br />
=== Android logging system ===<br />
The Android application framework has a built-in logging system, which goes through a special<br />
driver in the kernel. It is described at:http://developer.android.com/guide/developing/tools/adb.html#logcat<br />
<br />
Note that although the log dumper (logcat) is described on the Android developer site on the 'adb' page,<br />
there is a native logcat command included in the Android distribution (that is, available on the target<br />
file system, which can be run locally).<br />
<br />
Examples:<br />
* logcat -b all -d # dump all logs<br />
* logcat -b all -d '*:W' # dump at least warnings<br />
<br />
== tracers ==<br />
=== strace ===<br />
You can use [http://en.wikipedia.org/wiki/Strace strace] on Android. It is included in the<br />
Android open source project (at least as of Android 2.1), and appears to be automatically<br />
installed in engineering builds of the software.<br />
<br />
To use strace during early initialization, you can put it in the /init.rc file.<br />
For example, to trace zygote initialization, change the following line in <br />
/init.rc.<br />
<br />
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server<br />
<br />
should be changed to:<br />
<br />
service zygote /system/xbin/strace -tt -o/data/boot.strace /system/bin/app_process -Xzygote /system/bin --zygote --start system-server<br />
<br />
<br />
== Additional Resources ==<br />
* https://developer.android.com/studio/profile/cpu-profiler<br />
<br />
[[Category:Android]]</div>Consthttps://elinux.org/index.php?title=Android_Debugging&diff=509781Android Debugging2020-03-09T10:29:18Z<p>Const: /* Android logging system */ + examples</p>
<hr />
<div>Debugging methods for Android<br />
== Framework debugging ==<br />
<br />
To enable define '''ALOGV''' use '#define LOG_NDEBUG 0' and to enable '''ALOGVV''' use '#define VERY_VERY_VERBOSE_LOGGING'<br />
<br />
== Debuggers ==<br />
=== Kernel and User co-debug with GDB on Android ===<br />
This presentation covers lots of Android debug resources provided by Linaro, presented<br />
by Zach Pfeffer in Spring 2012. Included is information about how to debug<br />
kernel and user simultaneously with gdb.<br />
<br />
See [[Media:Zach Pfeffer Next Gen Android 2012.pdf]]<br />
<br />
== loggers ==<br />
=== kernel message log ===<br />
The Linux kernel has a message log in an internal ring buffer. You can access the contents<br />
of this log using the [http://en.wikipedia.org/wiki/Dmesg 'dmesg'] command.<br />
<br />
You can add timing information to the printk messages, by adding "time" to the Linux<br />
kernel command line.<br />
<br />
==== init logging ====<br />
The Android init program outputs some messages to the kernel log, as it starts the system.<br />
You can increase the verbosity of init, using the "loglevel" command in the /init.rc file.<br />
<br />
The default loglevel is 3, but you can change it to 8 (the highest) by changing the following<br />
line in the /init.rc file. Change:<br />
loglevel 3<br />
to<br />
loglevel 8<br />
<br />
=== Android logging system ===<br />
The Android application framework has a built-in logging system, which goes through a special<br />
driver in the kernel. It is described at:http://developer.android.com/guide/developing/tools/adb.html#logcat<br />
<br />
Note that although the log dumper (logcat) is described on the Android developer site on the 'adb' page,<br />
there is a native logcat command included in the Android distribution (that is, available on the target<br />
file system, which can be run locally).<br />
<br />
Examples:<br />
* logcat -b all -d # dump all logs<br />
* logcat -b all -d '*:W' # dump at least warnings<br />
<br />
== tracers ==<br />
=== strace ===<br />
You can use [http://en.wikipedia.org/wiki/Strace strace] on Android. It is included in the<br />
Android open source project (at least as of Android 2.1), and appears to be automatically<br />
installed in engineering builds of the software.<br />
<br />
To use strace during early initialization, you can put it in the /init.rc file.<br />
For example, to trace zygote initialization, change the following line in <br />
/init.rc.<br />
<br />
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server<br />
<br />
should be changed to:<br />
<br />
service zygote /system/xbin/strace -tt -o/data/boot.strace /system/bin/app_process -Xzygote /system/bin --zygote --start system-server<br />
<br />
=== Dalvik Method Tracer ===<br />
See http://developer.android.com/guide/developing/tools/traceview.html<br />
<br />
<br />
== Additional Resources ==<br />
* [http://www.youtube.com/watch?v=Dgnx0E7m1GQ&feature=related Google I/O 2009 - Debugging Arts of the Ninja Masters (video)] by Justin Mattson<br />
<br />
[[Category:Android]]</div>Consthttps://elinux.org/index.php?title=Android_Debugging&diff=509776Android Debugging2020-03-09T10:23:01Z<p>Const: </p>
<hr />
<div>Debugging methods for Android<br />
== Framework debugging ==<br />
<br />
To enable define '''ALOGV''' use '#define LOG_NDEBUG 0' and to enable '''ALOGVV''' use '#define VERY_VERY_VERBOSE_LOGGING'<br />
<br />
== Debuggers ==<br />
=== Kernel and User co-debug with GDB on Android ===<br />
This presentation covers lots of Android debug resources provided by Linaro, presented<br />
by Zach Pfeffer in Spring 2012. Included is information about how to debug<br />
kernel and user simultaneously with gdb.<br />
<br />
See [[Media:Zach Pfeffer Next Gen Android 2012.pdf]]<br />
<br />
== loggers ==<br />
=== kernel message log ===<br />
The Linux kernel has a message log in an internal ring buffer. You can access the contents<br />
of this log using the [http://en.wikipedia.org/wiki/Dmesg 'dmesg'] command.<br />
<br />
You can add timing information to the printk messages, by adding "time" to the Linux<br />
kernel command line.<br />
<br />
==== init logging ====<br />
The Android init program outputs some messages to the kernel log, as it starts the system.<br />
You can increase the verbosity of init, using the "loglevel" command in the /init.rc file.<br />
<br />
The default loglevel is 3, but you can change it to 8 (the highest) by changing the following<br />
line in the /init.rc file. Change:<br />
loglevel 3<br />
to<br />
loglevel 8<br />
<br />
=== Android logging system ===<br />
The Android application framework has a built-in logging system, which goes through a special<br />
driver in the kernel. It is described at:http://developer.android.com/guide/developing/tools/adb.html#logcat<br />
<br />
Note that although the log dumper (logcat) is described on the Android developer site on the 'adb' page,<br />
there is a native logcat command included in the Android distribution (that is, available on the target<br />
file system, which can be run locally).<br />
<br />
== tracers ==<br />
=== strace ===<br />
You can use [http://en.wikipedia.org/wiki/Strace strace] on Android. It is included in the<br />
Android open source project (at least as of Android 2.1), and appears to be automatically<br />
installed in engineering builds of the software.<br />
<br />
To use strace during early initialization, you can put it in the /init.rc file.<br />
For example, to trace zygote initialization, change the following line in <br />
/init.rc.<br />
<br />
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server<br />
<br />
should be changed to:<br />
<br />
service zygote /system/xbin/strace -tt -o/data/boot.strace /system/bin/app_process -Xzygote /system/bin --zygote --start system-server<br />
<br />
=== Dalvik Method Tracer ===<br />
See http://developer.android.com/guide/developing/tools/traceview.html<br />
<br />
<br />
== Additional Resources ==<br />
* [http://www.youtube.com/watch?v=Dgnx0E7m1GQ&feature=related Google I/O 2009 - Debugging Arts of the Ninja Masters (video)] by Justin Mattson<br />
<br />
[[Category:Android]]</div>Consthttps://elinux.org/index.php?title=Android_Build_System&diff=509771Android Build System2020-03-09T10:03:08Z<p>Const: /* What tools are used */ +ninja, soong</p>
<hr />
<div>The Android Build system are described at: https://source.android.com/setup/build<br />
<br />
You use build/envsetup.sh to set up a "convenience environment" for working on the<br />
Android source code. This file should be source'ed into your current shell environment.<br />
After doing so you can type '''hmm''' for a list of defined functions which are helpful<br />
for interacting with the source.<br />
<br />
== Overview ==<br />
The build system uses some pre-set environment variables and a series of 'make' files<br />
in order to build an Android system and prepare it for deployment to a platform.<br />
<br />
Subprojects' Android build files hamed Android.bp and Android.mk.<br />
<br />
There is only one official file named 'Makefile', at the top of the source tree for the whole repository. You set some environment variables, then type 'make' or just '''m''' to build stuff. You can add some options to the make command line (other targets) to turn on verbose output, or perform different actions.<br />
<br />
The build output is placed in 'out/host' and 'out/target' Stuff under 'out/host' are things<br />
compiled for your host platform (your desktop machine). Stuff under 'out/target/product/<platform-name>' eventually makes it's way to a target device (or emulator).<br />
<br />
The directory 'out/target/product/<platform-name>/obj' is used for staging "object" files, which<br />
are intermediate binary images used for building the final programs. Stuff that actually lands in<br />
the file system of the target is stored in the directories root, system, and data, under<br />
'out/target/product/<platform-name>'. Usually, these are bundled up into image files called<br />
system.img, ramdisk.img, and userdata.img.<br />
<br />
This matches the separate file system partitions used on most Android devices.<br />
<br />
== Some Details ==<br />
=== What tools are used ===<br />
During the build you will be using [https://android.googlesource.com/platform/build/soong/+/refs/heads/master/README.md soong], [https://ninja-build.org/ ninja] and 'make' to control the build steps themselves. A host<br />
toolchain (compiler, linker and other tools) and libraries will be used to build programs<br />
and tools that will run on the host. A different toolchain is used to compile the C and<br />
C++ code that will wind up on the target (which is an embedded board, device or the emulator).<br />
This is usually a "cross" toolchain that runs on an X86 platform, but produces code for some other<br />
platform (most commonly ARM). The kernel is compiled as a standalone binary (it does not use<br />
a program loader or link to any outside libraries). Other items, like native programs (e.g. init or toolbox), daemons or libraries will link against bionic or other system libraries.<br />
<br />
You will be using a Java compiler and a bunch of java-related tools to build<br />
most of the application framework, system services and Android applications themselves.<br />
Finally, tools are used to package the applications and resource files, and to <br />
create the filesystem images that can be installed on a device or used with the simulator.<br />
<br />
=== Telling the system where the Java toolchain is ===<br />
Before you build anything, you have to tell the Android build system where your Java SDK<br />
is. (Installing a Java SDK is a pre-requisite for building).<br />
<br />
Do this by setting a JAVA_HOME environment variable.<br />
<br />
=== Specifying what to build ===<br />
In order to decide what to build, and how to build it, the build system requires that some<br />
variables be set. Different products, with different packages and options can<br />
be built from the same source tree. The variables to control this can be set via a file<br />
with declarations of 'make' variables, or can be specified in the environment.<br />
<br />
A device vendor can create definition files that describe what is to be included on<br />
a particular board or for a particular product. The definition file is called:<br />
buildspec.mk, and it is located in the top-level source directory. You can edit this<br />
manually to hardcode your selections.<br />
<br />
If you have a buildspec.mk file, it sets all the make variables needed for a build, and<br />
you don't have to mess with options.<br />
<br />
Another method of specifying options is to set environment variables. The build system<br />
has a rather ornate method of managing these options for you.<br />
<br />
To set up your build environment, you need to load the variables and functions in build/envsetup.sh.<br />
Do this by 'source-ing' the file into your shell environment, like this:<br />
$ . build/envsetup.sh<br />
<br />
You can type 'help' (or 'hmm') at this point to see some utility functions that are available to make<br />
it easier to work with the source.<br />
<br />
To select the set of things you want to build, and what items to build for, you use either the<br />
'choosecombo' function or the 'lunch' function. 'choosecombo' will walk you through the different<br />
items you have to select, one-by-one, while 'lunch' allows you select some pre-set combinations.<br />
<br />
The items that have to be defined for a build are:<br />
* the product ('generic' or some specific board or platform name)<br />
* the build variant ('user', 'userdebug', or 'eng')<br />
* whether you're running on a simulator ('true' or 'false')<br />
* the build type ('release' or 'debug')<br />
<br />
Descriptions of these different build variants are at http://source.android.com/porting/build_system.html#androidBuildVariants<br />
<br />
The build process from a user perspective is described pretty well in this blog post: [http://blog.codepainters.com/2009/12/18/first-android-platform-build/ First Android platform build] by CodePainters, December 2009<br />
<br />
=== Actually building the system ===<br />
Once you have things set up, you actually build the system with the 'make' command.<br />
<br />
To build the whole thing, run 'make' in the top directory. The build will take a long time, if<br />
you are building everything (for example, the first time you do it).<br />
<br />
== Build tricks ==<br />
=== Seeing the actual commands used to build the software ===<br />
Use the "showcommands" target on your 'make' line:<br />
$ make -j4 showcommands<br />
<br />
This can be used in conjunction with another make target, to see the commands for that build.<br />
That is, 'showcommands' is not a target itself, but just a modifier for the specified build.<br />
<br />
In the example above, the -j4 is unrelated to the showcommands option, and is used to<br />
execute 4 make sessions that run in parallel.<br />
<br />
=== Make targets ===<br />
Here is a list of different make targets you can use to build different parts of the system:<br />
<br />
* <code>make sdk</code> - build the tools that are part of an SDK (adb, fastboot, etc.)<br />
* <code>make snod</code> - build the system image from the current software binaries<br />
* <code>make services</code><br />
* <code>make runtime</code><br />
* <code>make droid</code> - make droid is the normal build.<br />
* <code>make all</code> - make everything, whether it is included in the product definition or not<br />
* <code>make clean</code> - remove all built files (prepare for a new build). Same as rm -rf out/<configuration>/<br />
* <code>make modules</code> - shows a list of submodules that can be built (List of all LOCAL_MODULE definitions)<br />
* <code>make <local_module></code> - make a specific module (note that this is not the same as directory name. It is the LOCAL_MODULE definition in the Android.mk file)<br />
* <code>make clean-<local_module></code> - clean a specific module<br />
* <code>make bootimage TARGET_PREBUILT_KERNEL=/path/to/bzImage</code> - create a new boot image with custom bzImage<br />
<br />
=== Helper macros and functions ===<br />
There are some helper macros and functions that are installed when you source envsetup.sh. They are documented<br />
at the top of envesetup.sh, but here is information about a few of them:<br />
<br />
* <code>hmm</code> - ''List this help text''<br />
* <code>lunch <product_name>-<build_variant></code> - Load product & build variant config (driver files, device specific configs, etc).<br />
* <code>tapas [<App1> <App2> ...] [arm|x86|mips|armv5|arm64|x86_64|mips64] [eng|userdebug|user]</code> - command is for building unbundled apps. If you don't supply a build variant, it defaults to eng.<br />
* <code>provision</code> - Flash device with all required partitions. Options will be passed on to fastboot.<br />
<br />
==== Build Macros and functions ==== <br />
<br />
* <code>croot</code> - change directory to the top of the tree<br />
* <code>m</code> - execute 'make' from the top of the tree (even if your current directory is somewhere else)<br />
* <code>mm</code> - builds all of the modules in the current directory<br />
* <code>mmm <dir1> ...</code> - Builds all of the modules in the supplied directories, but not their dependencies. To limit the modules being built use the syntax: mmm dir/:target1,target2.<br />
* <code>mma</code> - Builds all of the modules in the current directory, and their dependencies.<br />
* <code>mmma <dir1> ... </code> - Builds all of the modules in the supplied directories, and their dependencies.<br />
<br />
==== Grep macros and functions ====<br />
<br />
* <code>cgrep <PATTERN></code> Greps on all local C/C++ files.<br />
* <code>ggrep <PATTERN></code> Greps on all local Gradle files.<br />
* <code>jgrep <PATTERN></code> Greps on all local Java files.<br />
* <code>resgrep <PATTERN></code> Greps on all local res/*.xml files.<br />
* <code>mangrep <PATTERN></code> Greps on all local AndroidManifest.xml files.<br />
* <code>mgrep <PATTERN></code> Greps on all local Makefiles files.<br />
* <code>sepgrep <PATTERN></code> Greps on all local sepolicy files.<br />
* <code>sgrep <PATTERN></code> Greps on all local source files.<br />
* <code>godir <filename></code> Go to the directory containing a file<br />
<br />
=== Speeding up the build ===<br />
You can use the '-j' option with make, to start multiple threads of make execution concurrently.<br />
<br />
In my experience, you should specify about 2 more threads than you have processors on your machine.<br />
If you have 2 processors, use 'make -j4', If they are hyperthreaded (meaning you have 4 virtual<br />
processors), try 'make -j6.<br />
<br />
You can also specify to use the 'ccache' compiler cache, which will speed up things once you have<br />
built things a first time. To do this, specify 'export USE_CCACHE=1' at your shell command line.<br />
(Note that ccache is included in the prebuilt section of the repository, and does not have to be<br />
installed on your host separately.)<br />
<br />
For recent Android versions, there's no prebuilt ccache and one needs to set the path to a local binary with CCACHE_EXEC, as per this [https://android.googlesource.com/platform/build/+/7556703f0dfab14c91c03dab1a3c25f6386268d4 commit].<br />
<br />
=== Building only an individual program or module ===<br />
If you use build/envsetup.sh, you can use some of the defined functions to build<br />
only a part of the tree. Use the 'mm' or 'mmm' commands to do this.<br />
<br />
The 'mm' command makes stuff in the current directory (and sub-directories, I believe).<br />
With the 'mmm' command, you specify a directory or list of directories, and it builds those.<br />
<br />
To install your changes, do 'make snod' from the top of tree.<br />
'make snod' builds a new system image from current binaries.<br />
<br />
=== Setting module-specific build parameters ===<br />
Some code in Android system can be customized in the way they are built (separate from the build<br />
variant and release vs. debug options). You can set variables that control individual<br />
build options, either by setting them in the environment or by passing them directly to<br />
'make' (or the 'm...' functions which call 'make'.)<br />
<br />
For example, the 'init' program can be built with support for bootchart logging<br />
by setting the INIT_BOOTCHART variable. (See [[Using Bootchart on Android]] for why<br />
you might want to do this.)<br />
<br />
You can accomplish either with:<br />
$ touch system/init/init.c<br />
$ export INIT_BOOTCHART=true<br />
$ make<br />
or<br />
$ touch system/init/init.c<br />
$ m INIT_BOOTCHART=true<br />
<br />
== Makefile tricks ==<br />
These are some tips for things you can use in your own Android.mk files.<br />
<br />
=== build helper functions ===<br />
A whole bunch of build helper functions are defined in the file <code>build/core/definitions.mk</code><br />
<br />
Try <code>grep define build/core/definitions.mk</code> for an exhaustive list.<br />
<br />
Call them via: <code>$(call <FUNCTION>, <PARAM-1>, <PARAM-2>)</code> or without parameters: <code>$(call <FUNCTION>)</code><br />
<br />
Here are some possibly interesting functions:<br />
* <code>print-vars</code> - print all Makefile variables, for debugging (not their values).<br />
* <code>emit-line</code> - output a line during building, to a file<br />
* <code>dump-words-to-file</code> - output a list of words to a file<br />
* <code>copy-one-file</code> - copy a file from one place to another (dest on target?)<br />
* <code>all-subdir-makefiles</code> - Recursively calls all <code>Android.mk</code> files, beginning in the current directory (Usage: <code>include $(call all-subdir-makefiles)</code>).<br />
<br />
=== build variables ===<br />
<br />
* <code>$(ANDROID_BUILD_TOP)</code> - AOSP file system root folder<br />
* <code>$(LOCAL_PATH)</code> - ''Usually'' the current directory. Gets set by the developer/user in every <code>Android.mk</code> file.<br />
: It get's overwritten in other <code>Android.mk</code> files down the file-tree (E.g. when you use <code>include $(call all-subdir-makefiles)</code>).<br />
: A workaround iss <ref>https://groups.google.com/forum/#!topic/android-ndk/7cUf3tkuBSM</ref>:<br />
<br />
SAVED_LOCAL_PATH := $(call my-dir)<br />
include $(call all-subdir-makefiles)<br />
LOCAL_PATH:= $(SAVED_LOCAL_PATH)<br />
<br />
=== Add a file directly to the output area ===<br />
You can copy a file directly to the output area, without building anything,<br />
using the add-prebuilt-files function.<br />
<br />
The following line, extracted from prebuilt/android-arm/gdbserver/Android.mk<br />
copies a list of files to the EXECUTABLES directory in the output area:<br />
<br />
$(call add-prebuilt-files, EXECUTABLES, $(prebuilt_files))<br />
<br />
== Adding a new program to build ==<br />
=== Steps for adding a new program to the Android source tree ===<br />
* make a directory under 'external'<br />
** e.g. ANDROID/external/myprogram<br />
* create your C/cpp files.<br />
* create Android.mk as clone of external/ping/Android.mk<br />
* Change the names ping.c and ping to match your C/cpp files and program name<br />
* add the directory name in ANDROID/build/core/main.mk after external/zlib as external/myprogram (Not needed anymore from ''at least'' Android 7.1 onwards)<br />
* make from the root of the source tree<br />
* your files will show up in the build output area, and in system images.<br />
** You can copy your file from the build output area, under out/target/product/..., if you want to copy it individually to the target (not do a whole install)<br />
<br />
See http://www.aton.com/android-native-development-using-the-android-open-source-project/ for a lot more detail.<br />
<br />
== Building the kernel ==<br />
The kernel is "outside" of the normal Android build system (indeed, the kernel is not included by default in the Android Open Source Project). However, there are tools in AOSP for building a kernel.<br />
If you are building the kernel, start on this page: http://source.android.com/source/building-kernels.html<br />
<br />
If you are building the kernel for the emulator, you may also want to look at:<br />
http://stackoverflow.com/questions/1809774/android-kernel-compile-and-test-with-android-emulator<br />
<br />
And, Ron M wrote (on the android-kernel mailing list, on May 21, 2012):<br />
<br />
This post is very old - but nothing has changes as far as AOSP is concerned, so <br />
in case anyone is interested and runs into this problem when building for QEMU:<br />
<br />
There is actually a nice and shorter way to build the kernel for your QEMU <br />
target provided by the AOSP:<br />
<br />
1. cd to your kernel source dir (Only goldfish 2.6.29 works out of the box for the emulator)<br />
<br />
2. ${ANDROID_BUILD_TOP}/external/qemu/distrib/build-kernel.sh -j=64 --arch=x86 --out=$YourOutDir<br />
<br />
3. emulator -kernel ${YourOutDir}/kernel-qemu # run emulator:<br />
<br />
<br />
Step #2 calls the toolbox.sh wrapper scripts which works around the SSE <br />
disabling gcc warning - which happens for GCC < 4.5 (as in the AOSP prebuilt X86 <br />
toolchain).<br />
<br />
This script adds the " -mfpmath=387 -fno-pic" in case it is an X86 and that in <br />
turn eliminates the compilation errors seen above.<br />
<br />
To have finer control over the build process, you can use the "toolbox.sh" <br />
wrapper and set some other stuff without modifying the script files.<br />
<br />
An example for building the same emulator is below:<br />
<br />
# Set arch<br />
export ARCH=x86<br />
# Have make refer to the QEMU wrapper script for building android over x86 <br />
(eliminates the errors listed above)<br />
export <br />
CROSS_COMPILE=${ANDROID_BUILD_TOP}/external/qemu/distrib/kernel-toolchain/android-kernel-toolchain-<br />
# Put your cross compiler here. I am using the AOSP prebuilt one in this example<br />
export <br />
REAL_CROSS_COMPILE=${ANDROID_BUILD_TOP}/prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/bin/i686-android-linux-<br />
# Configure your kernel - here I am taking the default goldfish_defconfig<br />
make goldfish_defconfig<br />
# build<br />
make -j64<br />
# Run emulator:<br />
emulator -kernel arch/x86/boot/bzImage -show-kernel<br />
<br />
<br />
This works for the 2.6.29 goldfish branch. If anyone is using the emulator with <br />
a 3+ kernel I would be like to hear about it.<br />
<br />
<br />
[[Category:Android]]</div>Consthttps://elinux.org/index.php?title=Android_Build_System&diff=509766Android Build System2020-03-09T09:54:04Z<p>Const: /* Overview */ +Android.bp, m</p>
<hr />
<div>The Android Build system are described at: https://source.android.com/setup/build<br />
<br />
You use build/envsetup.sh to set up a "convenience environment" for working on the<br />
Android source code. This file should be source'ed into your current shell environment.<br />
After doing so you can type '''hmm''' for a list of defined functions which are helpful<br />
for interacting with the source.<br />
<br />
== Overview ==<br />
The build system uses some pre-set environment variables and a series of 'make' files<br />
in order to build an Android system and prepare it for deployment to a platform.<br />
<br />
Subprojects' Android build files hamed Android.bp and Android.mk.<br />
<br />
There is only one official file named 'Makefile', at the top of the source tree for the whole repository. You set some environment variables, then type 'make' or just '''m''' to build stuff. You can add some options to the make command line (other targets) to turn on verbose output, or perform different actions.<br />
<br />
The build output is placed in 'out/host' and 'out/target' Stuff under 'out/host' are things<br />
compiled for your host platform (your desktop machine). Stuff under 'out/target/product/<platform-name>' eventually makes it's way to a target device (or emulator).<br />
<br />
The directory 'out/target/product/<platform-name>/obj' is used for staging "object" files, which<br />
are intermediate binary images used for building the final programs. Stuff that actually lands in<br />
the file system of the target is stored in the directories root, system, and data, under<br />
'out/target/product/<platform-name>'. Usually, these are bundled up into image files called<br />
system.img, ramdisk.img, and userdata.img.<br />
<br />
This matches the separate file system partitions used on most Android devices.<br />
<br />
== Some Details ==<br />
=== What tools are used ===<br />
During the build you will be using 'make' to control the build steps themselves. A host<br />
toolchain (compiler, linker and other tools) and libraries will be used to build programs<br />
and tools that will run on the host. A different toolchain is used to compile the C and<br />
C++ code that will wind up on the target (which is an embedded board, device or the emulator).<br />
This is usually a "cross" toolchain that runs on an X86 platform, but produces code for some other<br />
platform (most commonly ARM). The kernel is compiled as a standalone binary (it does not use<br />
a program loader or link to any outside libraries). Other items, like native programs (e.g. init or toolbox), daemons or libraries will link against bionic or other system libraries.<br />
<br />
You will be using a Java compiler and a bunch of java-related tools to build<br />
most of the application framework, system services and Android applications themselves.<br />
Finally, tools are used to package the applications and resource files, and to <br />
create the filesystem images that can be installed on a device or used with the simulator.<br />
<br />
=== Telling the system where the Java toolchain is ===<br />
Before you build anything, you have to tell the Android build system where your Java SDK<br />
is. (Installing a Java SDK is a pre-requisite for building).<br />
<br />
Do this by setting a JAVA_HOME environment variable.<br />
<br />
=== Specifying what to build ===<br />
In order to decide what to build, and how to build it, the build system requires that some<br />
variables be set. Different products, with different packages and options can<br />
be built from the same source tree. The variables to control this can be set via a file<br />
with declarations of 'make' variables, or can be specified in the environment.<br />
<br />
A device vendor can create definition files that describe what is to be included on<br />
a particular board or for a particular product. The definition file is called:<br />
buildspec.mk, and it is located in the top-level source directory. You can edit this<br />
manually to hardcode your selections.<br />
<br />
If you have a buildspec.mk file, it sets all the make variables needed for a build, and<br />
you don't have to mess with options.<br />
<br />
Another method of specifying options is to set environment variables. The build system<br />
has a rather ornate method of managing these options for you.<br />
<br />
To set up your build environment, you need to load the variables and functions in build/envsetup.sh.<br />
Do this by 'source-ing' the file into your shell environment, like this:<br />
$ . build/envsetup.sh<br />
<br />
You can type 'help' (or 'hmm') at this point to see some utility functions that are available to make<br />
it easier to work with the source.<br />
<br />
To select the set of things you want to build, and what items to build for, you use either the<br />
'choosecombo' function or the 'lunch' function. 'choosecombo' will walk you through the different<br />
items you have to select, one-by-one, while 'lunch' allows you select some pre-set combinations.<br />
<br />
The items that have to be defined for a build are:<br />
* the product ('generic' or some specific board or platform name)<br />
* the build variant ('user', 'userdebug', or 'eng')<br />
* whether you're running on a simulator ('true' or 'false')<br />
* the build type ('release' or 'debug')<br />
<br />
Descriptions of these different build variants are at http://source.android.com/porting/build_system.html#androidBuildVariants<br />
<br />
The build process from a user perspective is described pretty well in this blog post: [http://blog.codepainters.com/2009/12/18/first-android-platform-build/ First Android platform build] by CodePainters, December 2009<br />
<br />
=== Actually building the system ===<br />
Once you have things set up, you actually build the system with the 'make' command.<br />
<br />
To build the whole thing, run 'make' in the top directory. The build will take a long time, if<br />
you are building everything (for example, the first time you do it).<br />
<br />
== Build tricks ==<br />
=== Seeing the actual commands used to build the software ===<br />
Use the "showcommands" target on your 'make' line:<br />
$ make -j4 showcommands<br />
<br />
This can be used in conjunction with another make target, to see the commands for that build.<br />
That is, 'showcommands' is not a target itself, but just a modifier for the specified build.<br />
<br />
In the example above, the -j4 is unrelated to the showcommands option, and is used to<br />
execute 4 make sessions that run in parallel.<br />
<br />
=== Make targets ===<br />
Here is a list of different make targets you can use to build different parts of the system:<br />
<br />
* <code>make sdk</code> - build the tools that are part of an SDK (adb, fastboot, etc.)<br />
* <code>make snod</code> - build the system image from the current software binaries<br />
* <code>make services</code><br />
* <code>make runtime</code><br />
* <code>make droid</code> - make droid is the normal build.<br />
* <code>make all</code> - make everything, whether it is included in the product definition or not<br />
* <code>make clean</code> - remove all built files (prepare for a new build). Same as rm -rf out/<configuration>/<br />
* <code>make modules</code> - shows a list of submodules that can be built (List of all LOCAL_MODULE definitions)<br />
* <code>make <local_module></code> - make a specific module (note that this is not the same as directory name. It is the LOCAL_MODULE definition in the Android.mk file)<br />
* <code>make clean-<local_module></code> - clean a specific module<br />
* <code>make bootimage TARGET_PREBUILT_KERNEL=/path/to/bzImage</code> - create a new boot image with custom bzImage<br />
<br />
=== Helper macros and functions ===<br />
There are some helper macros and functions that are installed when you source envsetup.sh. They are documented<br />
at the top of envesetup.sh, but here is information about a few of them:<br />
<br />
* <code>hmm</code> - ''List this help text''<br />
* <code>lunch <product_name>-<build_variant></code> - Load product & build variant config (driver files, device specific configs, etc).<br />
* <code>tapas [<App1> <App2> ...] [arm|x86|mips|armv5|arm64|x86_64|mips64] [eng|userdebug|user]</code> - command is for building unbundled apps. If you don't supply a build variant, it defaults to eng.<br />
* <code>provision</code> - Flash device with all required partitions. Options will be passed on to fastboot.<br />
<br />
==== Build Macros and functions ==== <br />
<br />
* <code>croot</code> - change directory to the top of the tree<br />
* <code>m</code> - execute 'make' from the top of the tree (even if your current directory is somewhere else)<br />
* <code>mm</code> - builds all of the modules in the current directory<br />
* <code>mmm <dir1> ...</code> - Builds all of the modules in the supplied directories, but not their dependencies. To limit the modules being built use the syntax: mmm dir/:target1,target2.<br />
* <code>mma</code> - Builds all of the modules in the current directory, and their dependencies.<br />
* <code>mmma <dir1> ... </code> - Builds all of the modules in the supplied directories, and their dependencies.<br />
<br />
==== Grep macros and functions ====<br />
<br />
* <code>cgrep <PATTERN></code> Greps on all local C/C++ files.<br />
* <code>ggrep <PATTERN></code> Greps on all local Gradle files.<br />
* <code>jgrep <PATTERN></code> Greps on all local Java files.<br />
* <code>resgrep <PATTERN></code> Greps on all local res/*.xml files.<br />
* <code>mangrep <PATTERN></code> Greps on all local AndroidManifest.xml files.<br />
* <code>mgrep <PATTERN></code> Greps on all local Makefiles files.<br />
* <code>sepgrep <PATTERN></code> Greps on all local sepolicy files.<br />
* <code>sgrep <PATTERN></code> Greps on all local source files.<br />
* <code>godir <filename></code> Go to the directory containing a file<br />
<br />
=== Speeding up the build ===<br />
You can use the '-j' option with make, to start multiple threads of make execution concurrently.<br />
<br />
In my experience, you should specify about 2 more threads than you have processors on your machine.<br />
If you have 2 processors, use 'make -j4', If they are hyperthreaded (meaning you have 4 virtual<br />
processors), try 'make -j6.<br />
<br />
You can also specify to use the 'ccache' compiler cache, which will speed up things once you have<br />
built things a first time. To do this, specify 'export USE_CCACHE=1' at your shell command line.<br />
(Note that ccache is included in the prebuilt section of the repository, and does not have to be<br />
installed on your host separately.)<br />
<br />
For recent Android versions, there's no prebuilt ccache and one needs to set the path to a local binary with CCACHE_EXEC, as per this [https://android.googlesource.com/platform/build/+/7556703f0dfab14c91c03dab1a3c25f6386268d4 commit].<br />
<br />
=== Building only an individual program or module ===<br />
If you use build/envsetup.sh, you can use some of the defined functions to build<br />
only a part of the tree. Use the 'mm' or 'mmm' commands to do this.<br />
<br />
The 'mm' command makes stuff in the current directory (and sub-directories, I believe).<br />
With the 'mmm' command, you specify a directory or list of directories, and it builds those.<br />
<br />
To install your changes, do 'make snod' from the top of tree.<br />
'make snod' builds a new system image from current binaries.<br />
<br />
=== Setting module-specific build parameters ===<br />
Some code in Android system can be customized in the way they are built (separate from the build<br />
variant and release vs. debug options). You can set variables that control individual<br />
build options, either by setting them in the environment or by passing them directly to<br />
'make' (or the 'm...' functions which call 'make'.)<br />
<br />
For example, the 'init' program can be built with support for bootchart logging<br />
by setting the INIT_BOOTCHART variable. (See [[Using Bootchart on Android]] for why<br />
you might want to do this.)<br />
<br />
You can accomplish either with:<br />
$ touch system/init/init.c<br />
$ export INIT_BOOTCHART=true<br />
$ make<br />
or<br />
$ touch system/init/init.c<br />
$ m INIT_BOOTCHART=true<br />
<br />
== Makefile tricks ==<br />
These are some tips for things you can use in your own Android.mk files.<br />
<br />
=== build helper functions ===<br />
A whole bunch of build helper functions are defined in the file <code>build/core/definitions.mk</code><br />
<br />
Try <code>grep define build/core/definitions.mk</code> for an exhaustive list.<br />
<br />
Call them via: <code>$(call <FUNCTION>, <PARAM-1>, <PARAM-2>)</code> or without parameters: <code>$(call <FUNCTION>)</code><br />
<br />
Here are some possibly interesting functions:<br />
* <code>print-vars</code> - print all Makefile variables, for debugging (not their values).<br />
* <code>emit-line</code> - output a line during building, to a file<br />
* <code>dump-words-to-file</code> - output a list of words to a file<br />
* <code>copy-one-file</code> - copy a file from one place to another (dest on target?)<br />
* <code>all-subdir-makefiles</code> - Recursively calls all <code>Android.mk</code> files, beginning in the current directory (Usage: <code>include $(call all-subdir-makefiles)</code>).<br />
<br />
=== build variables ===<br />
<br />
* <code>$(ANDROID_BUILD_TOP)</code> - AOSP file system root folder<br />
* <code>$(LOCAL_PATH)</code> - ''Usually'' the current directory. Gets set by the developer/user in every <code>Android.mk</code> file.<br />
: It get's overwritten in other <code>Android.mk</code> files down the file-tree (E.g. when you use <code>include $(call all-subdir-makefiles)</code>).<br />
: A workaround iss <ref>https://groups.google.com/forum/#!topic/android-ndk/7cUf3tkuBSM</ref>:<br />
<br />
SAVED_LOCAL_PATH := $(call my-dir)<br />
include $(call all-subdir-makefiles)<br />
LOCAL_PATH:= $(SAVED_LOCAL_PATH)<br />
<br />
=== Add a file directly to the output area ===<br />
You can copy a file directly to the output area, without building anything,<br />
using the add-prebuilt-files function.<br />
<br />
The following line, extracted from prebuilt/android-arm/gdbserver/Android.mk<br />
copies a list of files to the EXECUTABLES directory in the output area:<br />
<br />
$(call add-prebuilt-files, EXECUTABLES, $(prebuilt_files))<br />
<br />
== Adding a new program to build ==<br />
=== Steps for adding a new program to the Android source tree ===<br />
* make a directory under 'external'<br />
** e.g. ANDROID/external/myprogram<br />
* create your C/cpp files.<br />
* create Android.mk as clone of external/ping/Android.mk<br />
* Change the names ping.c and ping to match your C/cpp files and program name<br />
* add the directory name in ANDROID/build/core/main.mk after external/zlib as external/myprogram (Not needed anymore from ''at least'' Android 7.1 onwards)<br />
* make from the root of the source tree<br />
* your files will show up in the build output area, and in system images.<br />
** You can copy your file from the build output area, under out/target/product/..., if you want to copy it individually to the target (not do a whole install)<br />
<br />
See http://www.aton.com/android-native-development-using-the-android-open-source-project/ for a lot more detail.<br />
<br />
== Building the kernel ==<br />
The kernel is "outside" of the normal Android build system (indeed, the kernel is not included by default in the Android Open Source Project). However, there are tools in AOSP for building a kernel.<br />
If you are building the kernel, start on this page: http://source.android.com/source/building-kernels.html<br />
<br />
If you are building the kernel for the emulator, you may also want to look at:<br />
http://stackoverflow.com/questions/1809774/android-kernel-compile-and-test-with-android-emulator<br />
<br />
And, Ron M wrote (on the android-kernel mailing list, on May 21, 2012):<br />
<br />
This post is very old - but nothing has changes as far as AOSP is concerned, so <br />
in case anyone is interested and runs into this problem when building for QEMU:<br />
<br />
There is actually a nice and shorter way to build the kernel for your QEMU <br />
target provided by the AOSP:<br />
<br />
1. cd to your kernel source dir (Only goldfish 2.6.29 works out of the box for the emulator)<br />
<br />
2. ${ANDROID_BUILD_TOP}/external/qemu/distrib/build-kernel.sh -j=64 --arch=x86 --out=$YourOutDir<br />
<br />
3. emulator -kernel ${YourOutDir}/kernel-qemu # run emulator:<br />
<br />
<br />
Step #2 calls the toolbox.sh wrapper scripts which works around the SSE <br />
disabling gcc warning - which happens for GCC < 4.5 (as in the AOSP prebuilt X86 <br />
toolchain).<br />
<br />
This script adds the " -mfpmath=387 -fno-pic" in case it is an X86 and that in <br />
turn eliminates the compilation errors seen above.<br />
<br />
To have finer control over the build process, you can use the "toolbox.sh" <br />
wrapper and set some other stuff without modifying the script files.<br />
<br />
An example for building the same emulator is below:<br />
<br />
# Set arch<br />
export ARCH=x86<br />
# Have make refer to the QEMU wrapper script for building android over x86 <br />
(eliminates the errors listed above)<br />
export <br />
CROSS_COMPILE=${ANDROID_BUILD_TOP}/external/qemu/distrib/kernel-toolchain/android-kernel-toolchain-<br />
# Put your cross compiler here. I am using the AOSP prebuilt one in this example<br />
export <br />
REAL_CROSS_COMPILE=${ANDROID_BUILD_TOP}/prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/bin/i686-android-linux-<br />
# Configure your kernel - here I am taking the default goldfish_defconfig<br />
make goldfish_defconfig<br />
# build<br />
make -j64<br />
# Run emulator:<br />
emulator -kernel arch/x86/boot/bzImage -show-kernel<br />
<br />
<br />
This works for the 2.6.29 goldfish branch. If anyone is using the emulator with <br />
a 3+ kernel I would be like to hear about it.<br />
<br />
<br />
[[Category:Android]]</div>Consthttps://elinux.org/index.php?title=Android_Build_System&diff=509761Android Build System2020-03-09T09:38:59Z<p>Const: +https://source.android.com/setup/build</p>
<hr />
<div>The Android Build system are described at: https://source.android.com/setup/build<br />
<br />
You use build/envsetup.sh to set up a "convenience environment" for working on the<br />
Android source code. This file should be source'ed into your current shell environment.<br />
After doing so you can type '''hmm''' for a list of defined functions which are helpful<br />
for interacting with the source.<br />
<br />
== Overview ==<br />
The build system uses some pre-set environment variables and a series of 'make' files<br />
in order to build an Android system and prepare it for deployment to a platform.<br />
<br />
Android make files end in the extension '.mk' by convention, with the ''main'' make file<br />
in any particular source directory being named 'Android.mk'.<br />
<br />
There is only one official file named 'Makefile', at the top of the source tree for the whole repository. You set some environment variables, then type 'make' to build stuff. You can add some options to the make command line (other targets) to turn on verbose output, or perform different actions.<br />
<br />
The build output is placed in 'out/host' and 'out/target' Stuff under 'out/host' are things<br />
compiled for your host platform (your desktop machine). Stuff under 'out/target/product/<platform-name>' eventually makes it's way to a target device (or emulator).<br />
<br />
The directory 'out/target/product/<platform-name>/obj' is used for staging "object" files, which<br />
are intermediate binary images used for building the final programs. Stuff that actually lands in<br />
the file system of the target is stored in the directories root, system, and data, under<br />
'out/target/product/<platform-name>'. Usually, these are bundled up into image files called<br />
system.img, ramdisk.img, and userdata.img.<br />
<br />
This matches the separate file system partitions used on most Android devices.<br />
<br />
== Some Details ==<br />
=== What tools are used ===<br />
During the build you will be using 'make' to control the build steps themselves. A host<br />
toolchain (compiler, linker and other tools) and libraries will be used to build programs<br />
and tools that will run on the host. A different toolchain is used to compile the C and<br />
C++ code that will wind up on the target (which is an embedded board, device or the emulator).<br />
This is usually a "cross" toolchain that runs on an X86 platform, but produces code for some other<br />
platform (most commonly ARM). The kernel is compiled as a standalone binary (it does not use<br />
a program loader or link to any outside libraries). Other items, like native programs (e.g. init or toolbox), daemons or libraries will link against bionic or other system libraries.<br />
<br />
You will be using a Java compiler and a bunch of java-related tools to build<br />
most of the application framework, system services and Android applications themselves.<br />
Finally, tools are used to package the applications and resource files, and to <br />
create the filesystem images that can be installed on a device or used with the simulator.<br />
<br />
=== Telling the system where the Java toolchain is ===<br />
Before you build anything, you have to tell the Android build system where your Java SDK<br />
is. (Installing a Java SDK is a pre-requisite for building).<br />
<br />
Do this by setting a JAVA_HOME environment variable.<br />
<br />
=== Specifying what to build ===<br />
In order to decide what to build, and how to build it, the build system requires that some<br />
variables be set. Different products, with different packages and options can<br />
be built from the same source tree. The variables to control this can be set via a file<br />
with declarations of 'make' variables, or can be specified in the environment.<br />
<br />
A device vendor can create definition files that describe what is to be included on<br />
a particular board or for a particular product. The definition file is called:<br />
buildspec.mk, and it is located in the top-level source directory. You can edit this<br />
manually to hardcode your selections.<br />
<br />
If you have a buildspec.mk file, it sets all the make variables needed for a build, and<br />
you don't have to mess with options.<br />
<br />
Another method of specifying options is to set environment variables. The build system<br />
has a rather ornate method of managing these options for you.<br />
<br />
To set up your build environment, you need to load the variables and functions in build/envsetup.sh.<br />
Do this by 'source-ing' the file into your shell environment, like this:<br />
$ . build/envsetup.sh<br />
<br />
You can type 'help' (or 'hmm') at this point to see some utility functions that are available to make<br />
it easier to work with the source.<br />
<br />
To select the set of things you want to build, and what items to build for, you use either the<br />
'choosecombo' function or the 'lunch' function. 'choosecombo' will walk you through the different<br />
items you have to select, one-by-one, while 'lunch' allows you select some pre-set combinations.<br />
<br />
The items that have to be defined for a build are:<br />
* the product ('generic' or some specific board or platform name)<br />
* the build variant ('user', 'userdebug', or 'eng')<br />
* whether you're running on a simulator ('true' or 'false')<br />
* the build type ('release' or 'debug')<br />
<br />
Descriptions of these different build variants are at http://source.android.com/porting/build_system.html#androidBuildVariants<br />
<br />
The build process from a user perspective is described pretty well in this blog post: [http://blog.codepainters.com/2009/12/18/first-android-platform-build/ First Android platform build] by CodePainters, December 2009<br />
<br />
=== Actually building the system ===<br />
Once you have things set up, you actually build the system with the 'make' command.<br />
<br />
To build the whole thing, run 'make' in the top directory. The build will take a long time, if<br />
you are building everything (for example, the first time you do it).<br />
<br />
== Build tricks ==<br />
=== Seeing the actual commands used to build the software ===<br />
Use the "showcommands" target on your 'make' line:<br />
$ make -j4 showcommands<br />
<br />
This can be used in conjunction with another make target, to see the commands for that build.<br />
That is, 'showcommands' is not a target itself, but just a modifier for the specified build.<br />
<br />
In the example above, the -j4 is unrelated to the showcommands option, and is used to<br />
execute 4 make sessions that run in parallel.<br />
<br />
=== Make targets ===<br />
Here is a list of different make targets you can use to build different parts of the system:<br />
<br />
* <code>make sdk</code> - build the tools that are part of an SDK (adb, fastboot, etc.)<br />
* <code>make snod</code> - build the system image from the current software binaries<br />
* <code>make services</code><br />
* <code>make runtime</code><br />
* <code>make droid</code> - make droid is the normal build.<br />
* <code>make all</code> - make everything, whether it is included in the product definition or not<br />
* <code>make clean</code> - remove all built files (prepare for a new build). Same as rm -rf out/<configuration>/<br />
* <code>make modules</code> - shows a list of submodules that can be built (List of all LOCAL_MODULE definitions)<br />
* <code>make <local_module></code> - make a specific module (note that this is not the same as directory name. It is the LOCAL_MODULE definition in the Android.mk file)<br />
* <code>make clean-<local_module></code> - clean a specific module<br />
* <code>make bootimage TARGET_PREBUILT_KERNEL=/path/to/bzImage</code> - create a new boot image with custom bzImage<br />
<br />
=== Helper macros and functions ===<br />
There are some helper macros and functions that are installed when you source envsetup.sh. They are documented<br />
at the top of envesetup.sh, but here is information about a few of them:<br />
<br />
* <code>hmm</code> - ''List this help text''<br />
* <code>lunch <product_name>-<build_variant></code> - Load product & build variant config (driver files, device specific configs, etc).<br />
* <code>tapas [<App1> <App2> ...] [arm|x86|mips|armv5|arm64|x86_64|mips64] [eng|userdebug|user]</code> - command is for building unbundled apps. If you don't supply a build variant, it defaults to eng.<br />
* <code>provision</code> - Flash device with all required partitions. Options will be passed on to fastboot.<br />
<br />
==== Build Macros and functions ==== <br />
<br />
* <code>croot</code> - change directory to the top of the tree<br />
* <code>m</code> - execute 'make' from the top of the tree (even if your current directory is somewhere else)<br />
* <code>mm</code> - builds all of the modules in the current directory<br />
* <code>mmm <dir1> ...</code> - Builds all of the modules in the supplied directories, but not their dependencies. To limit the modules being built use the syntax: mmm dir/:target1,target2.<br />
* <code>mma</code> - Builds all of the modules in the current directory, and their dependencies.<br />
* <code>mmma <dir1> ... </code> - Builds all of the modules in the supplied directories, and their dependencies.<br />
<br />
==== Grep macros and functions ====<br />
<br />
* <code>cgrep <PATTERN></code> Greps on all local C/C++ files.<br />
* <code>ggrep <PATTERN></code> Greps on all local Gradle files.<br />
* <code>jgrep <PATTERN></code> Greps on all local Java files.<br />
* <code>resgrep <PATTERN></code> Greps on all local res/*.xml files.<br />
* <code>mangrep <PATTERN></code> Greps on all local AndroidManifest.xml files.<br />
* <code>mgrep <PATTERN></code> Greps on all local Makefiles files.<br />
* <code>sepgrep <PATTERN></code> Greps on all local sepolicy files.<br />
* <code>sgrep <PATTERN></code> Greps on all local source files.<br />
* <code>godir <filename></code> Go to the directory containing a file<br />
<br />
=== Speeding up the build ===<br />
You can use the '-j' option with make, to start multiple threads of make execution concurrently.<br />
<br />
In my experience, you should specify about 2 more threads than you have processors on your machine.<br />
If you have 2 processors, use 'make -j4', If they are hyperthreaded (meaning you have 4 virtual<br />
processors), try 'make -j6.<br />
<br />
You can also specify to use the 'ccache' compiler cache, which will speed up things once you have<br />
built things a first time. To do this, specify 'export USE_CCACHE=1' at your shell command line.<br />
(Note that ccache is included in the prebuilt section of the repository, and does not have to be<br />
installed on your host separately.)<br />
<br />
For recent Android versions, there's no prebuilt ccache and one needs to set the path to a local binary with CCACHE_EXEC, as per this [https://android.googlesource.com/platform/build/+/7556703f0dfab14c91c03dab1a3c25f6386268d4 commit].<br />
<br />
=== Building only an individual program or module ===<br />
If you use build/envsetup.sh, you can use some of the defined functions to build<br />
only a part of the tree. Use the 'mm' or 'mmm' commands to do this.<br />
<br />
The 'mm' command makes stuff in the current directory (and sub-directories, I believe).<br />
With the 'mmm' command, you specify a directory or list of directories, and it builds those.<br />
<br />
To install your changes, do 'make snod' from the top of tree.<br />
'make snod' builds a new system image from current binaries.<br />
<br />
=== Setting module-specific build parameters ===<br />
Some code in Android system can be customized in the way they are built (separate from the build<br />
variant and release vs. debug options). You can set variables that control individual<br />
build options, either by setting them in the environment or by passing them directly to<br />
'make' (or the 'm...' functions which call 'make'.)<br />
<br />
For example, the 'init' program can be built with support for bootchart logging<br />
by setting the INIT_BOOTCHART variable. (See [[Using Bootchart on Android]] for why<br />
you might want to do this.)<br />
<br />
You can accomplish either with:<br />
$ touch system/init/init.c<br />
$ export INIT_BOOTCHART=true<br />
$ make<br />
or<br />
$ touch system/init/init.c<br />
$ m INIT_BOOTCHART=true<br />
<br />
== Makefile tricks ==<br />
These are some tips for things you can use in your own Android.mk files.<br />
<br />
=== build helper functions ===<br />
A whole bunch of build helper functions are defined in the file <code>build/core/definitions.mk</code><br />
<br />
Try <code>grep define build/core/definitions.mk</code> for an exhaustive list.<br />
<br />
Call them via: <code>$(call <FUNCTION>, <PARAM-1>, <PARAM-2>)</code> or without parameters: <code>$(call <FUNCTION>)</code><br />
<br />
Here are some possibly interesting functions:<br />
* <code>print-vars</code> - print all Makefile variables, for debugging (not their values).<br />
* <code>emit-line</code> - output a line during building, to a file<br />
* <code>dump-words-to-file</code> - output a list of words to a file<br />
* <code>copy-one-file</code> - copy a file from one place to another (dest on target?)<br />
* <code>all-subdir-makefiles</code> - Recursively calls all <code>Android.mk</code> files, beginning in the current directory (Usage: <code>include $(call all-subdir-makefiles)</code>).<br />
<br />
=== build variables ===<br />
<br />
* <code>$(ANDROID_BUILD_TOP)</code> - AOSP file system root folder<br />
* <code>$(LOCAL_PATH)</code> - ''Usually'' the current directory. Gets set by the developer/user in every <code>Android.mk</code> file.<br />
: It get's overwritten in other <code>Android.mk</code> files down the file-tree (E.g. when you use <code>include $(call all-subdir-makefiles)</code>).<br />
: A workaround iss <ref>https://groups.google.com/forum/#!topic/android-ndk/7cUf3tkuBSM</ref>:<br />
<br />
SAVED_LOCAL_PATH := $(call my-dir)<br />
include $(call all-subdir-makefiles)<br />
LOCAL_PATH:= $(SAVED_LOCAL_PATH)<br />
<br />
=== Add a file directly to the output area ===<br />
You can copy a file directly to the output area, without building anything,<br />
using the add-prebuilt-files function.<br />
<br />
The following line, extracted from prebuilt/android-arm/gdbserver/Android.mk<br />
copies a list of files to the EXECUTABLES directory in the output area:<br />
<br />
$(call add-prebuilt-files, EXECUTABLES, $(prebuilt_files))<br />
<br />
== Adding a new program to build ==<br />
=== Steps for adding a new program to the Android source tree ===<br />
* make a directory under 'external'<br />
** e.g. ANDROID/external/myprogram<br />
* create your C/cpp files.<br />
* create Android.mk as clone of external/ping/Android.mk<br />
* Change the names ping.c and ping to match your C/cpp files and program name<br />
* add the directory name in ANDROID/build/core/main.mk after external/zlib as external/myprogram (Not needed anymore from ''at least'' Android 7.1 onwards)<br />
* make from the root of the source tree<br />
* your files will show up in the build output area, and in system images.<br />
** You can copy your file from the build output area, under out/target/product/..., if you want to copy it individually to the target (not do a whole install)<br />
<br />
See http://www.aton.com/android-native-development-using-the-android-open-source-project/ for a lot more detail.<br />
<br />
== Building the kernel ==<br />
The kernel is "outside" of the normal Android build system (indeed, the kernel is not included by default in the Android Open Source Project). However, there are tools in AOSP for building a kernel.<br />
If you are building the kernel, start on this page: http://source.android.com/source/building-kernels.html<br />
<br />
If you are building the kernel for the emulator, you may also want to look at:<br />
http://stackoverflow.com/questions/1809774/android-kernel-compile-and-test-with-android-emulator<br />
<br />
And, Ron M wrote (on the android-kernel mailing list, on May 21, 2012):<br />
<br />
This post is very old - but nothing has changes as far as AOSP is concerned, so <br />
in case anyone is interested and runs into this problem when building for QEMU:<br />
<br />
There is actually a nice and shorter way to build the kernel for your QEMU <br />
target provided by the AOSP:<br />
<br />
1. cd to your kernel source dir (Only goldfish 2.6.29 works out of the box for the emulator)<br />
<br />
2. ${ANDROID_BUILD_TOP}/external/qemu/distrib/build-kernel.sh -j=64 --arch=x86 --out=$YourOutDir<br />
<br />
3. emulator -kernel ${YourOutDir}/kernel-qemu # run emulator:<br />
<br />
<br />
Step #2 calls the toolbox.sh wrapper scripts which works around the SSE <br />
disabling gcc warning - which happens for GCC < 4.5 (as in the AOSP prebuilt X86 <br />
toolchain).<br />
<br />
This script adds the " -mfpmath=387 -fno-pic" in case it is an X86 and that in <br />
turn eliminates the compilation errors seen above.<br />
<br />
To have finer control over the build process, you can use the "toolbox.sh" <br />
wrapper and set some other stuff without modifying the script files.<br />
<br />
An example for building the same emulator is below:<br />
<br />
# Set arch<br />
export ARCH=x86<br />
# Have make refer to the QEMU wrapper script for building android over x86 <br />
(eliminates the errors listed above)<br />
export <br />
CROSS_COMPILE=${ANDROID_BUILD_TOP}/external/qemu/distrib/kernel-toolchain/android-kernel-toolchain-<br />
# Put your cross compiler here. I am using the AOSP prebuilt one in this example<br />
export <br />
REAL_CROSS_COMPILE=${ANDROID_BUILD_TOP}/prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/bin/i686-android-linux-<br />
# Configure your kernel - here I am taking the default goldfish_defconfig<br />
make goldfish_defconfig<br />
# build<br />
make -j64<br />
# Run emulator:<br />
emulator -kernel arch/x86/boot/bzImage -show-kernel<br />
<br />
<br />
This works for the 2.6.29 goldfish branch. If anyone is using the emulator with <br />
a 3+ kernel I would be like to hear about it.<br />
<br />
<br />
[[Category:Android]]</div>Consthttps://elinux.org/index.php?title=Android_Build_System&diff=509756Android Build System2020-03-09T09:32:16Z<p>Const: hmm</p>
<hr />
<div>The Android Build system are described at:<br />
https://android.googlesource.com/platform/build/+/master/core/build-system.html<br />
<br />
You use build/envsetup.sh to set up a "convenience environment" for working on the<br />
Android source code. This file should be source'ed into your current shell environment.<br />
After doing so you can type '''hmm''' for a list of defined functions which are helpful<br />
for interacting with the source.<br />
<br />
== Overview ==<br />
The build system uses some pre-set environment variables and a series of 'make' files<br />
in order to build an Android system and prepare it for deployment to a platform.<br />
<br />
Android make files end in the extension '.mk' by convention, with the ''main'' make file<br />
in any particular source directory being named 'Android.mk'.<br />
<br />
There is only one official file named 'Makefile', at the top of the source tree for the whole repository. You set some environment variables, then type 'make' to build stuff. You can add some options to the make command line (other targets) to turn on verbose output, or perform different actions.<br />
<br />
The build output is placed in 'out/host' and 'out/target' Stuff under 'out/host' are things<br />
compiled for your host platform (your desktop machine). Stuff under 'out/target/product/<platform-name>' eventually makes it's way to a target device (or emulator).<br />
<br />
The directory 'out/target/product/<platform-name>/obj' is used for staging "object" files, which<br />
are intermediate binary images used for building the final programs. Stuff that actually lands in<br />
the file system of the target is stored in the directories root, system, and data, under<br />
'out/target/product/<platform-name>'. Usually, these are bundled up into image files called<br />
system.img, ramdisk.img, and userdata.img.<br />
<br />
This matches the separate file system partitions used on most Android devices.<br />
<br />
== Some Details ==<br />
=== What tools are used ===<br />
During the build you will be using 'make' to control the build steps themselves. A host<br />
toolchain (compiler, linker and other tools) and libraries will be used to build programs<br />
and tools that will run on the host. A different toolchain is used to compile the C and<br />
C++ code that will wind up on the target (which is an embedded board, device or the emulator).<br />
This is usually a "cross" toolchain that runs on an X86 platform, but produces code for some other<br />
platform (most commonly ARM). The kernel is compiled as a standalone binary (it does not use<br />
a program loader or link to any outside libraries). Other items, like native programs (e.g. init or toolbox), daemons or libraries will link against bionic or other system libraries.<br />
<br />
You will be using a Java compiler and a bunch of java-related tools to build<br />
most of the application framework, system services and Android applications themselves.<br />
Finally, tools are used to package the applications and resource files, and to <br />
create the filesystem images that can be installed on a device or used with the simulator.<br />
<br />
=== Telling the system where the Java toolchain is ===<br />
Before you build anything, you have to tell the Android build system where your Java SDK<br />
is. (Installing a Java SDK is a pre-requisite for building).<br />
<br />
Do this by setting a JAVA_HOME environment variable.<br />
<br />
=== Specifying what to build ===<br />
In order to decide what to build, and how to build it, the build system requires that some<br />
variables be set. Different products, with different packages and options can<br />
be built from the same source tree. The variables to control this can be set via a file<br />
with declarations of 'make' variables, or can be specified in the environment.<br />
<br />
A device vendor can create definition files that describe what is to be included on<br />
a particular board or for a particular product. The definition file is called:<br />
buildspec.mk, and it is located in the top-level source directory. You can edit this<br />
manually to hardcode your selections.<br />
<br />
If you have a buildspec.mk file, it sets all the make variables needed for a build, and<br />
you don't have to mess with options.<br />
<br />
Another method of specifying options is to set environment variables. The build system<br />
has a rather ornate method of managing these options for you.<br />
<br />
To set up your build environment, you need to load the variables and functions in build/envsetup.sh.<br />
Do this by 'source-ing' the file into your shell environment, like this:<br />
$ . build/envsetup.sh<br />
<br />
You can type 'help' (or 'hmm') at this point to see some utility functions that are available to make<br />
it easier to work with the source.<br />
<br />
To select the set of things you want to build, and what items to build for, you use either the<br />
'choosecombo' function or the 'lunch' function. 'choosecombo' will walk you through the different<br />
items you have to select, one-by-one, while 'lunch' allows you select some pre-set combinations.<br />
<br />
The items that have to be defined for a build are:<br />
* the product ('generic' or some specific board or platform name)<br />
* the build variant ('user', 'userdebug', or 'eng')<br />
* whether you're running on a simulator ('true' or 'false')<br />
* the build type ('release' or 'debug')<br />
<br />
Descriptions of these different build variants are at http://source.android.com/porting/build_system.html#androidBuildVariants<br />
<br />
The build process from a user perspective is described pretty well in this blog post: [http://blog.codepainters.com/2009/12/18/first-android-platform-build/ First Android platform build] by CodePainters, December 2009<br />
<br />
=== Actually building the system ===<br />
Once you have things set up, you actually build the system with the 'make' command.<br />
<br />
To build the whole thing, run 'make' in the top directory. The build will take a long time, if<br />
you are building everything (for example, the first time you do it).<br />
<br />
== Build tricks ==<br />
=== Seeing the actual commands used to build the software ===<br />
Use the "showcommands" target on your 'make' line:<br />
$ make -j4 showcommands<br />
<br />
This can be used in conjunction with another make target, to see the commands for that build.<br />
That is, 'showcommands' is not a target itself, but just a modifier for the specified build.<br />
<br />
In the example above, the -j4 is unrelated to the showcommands option, and is used to<br />
execute 4 make sessions that run in parallel.<br />
<br />
=== Make targets ===<br />
Here is a list of different make targets you can use to build different parts of the system:<br />
<br />
* <code>make sdk</code> - build the tools that are part of an SDK (adb, fastboot, etc.)<br />
* <code>make snod</code> - build the system image from the current software binaries<br />
* <code>make services</code><br />
* <code>make runtime</code><br />
* <code>make droid</code> - make droid is the normal build.<br />
* <code>make all</code> - make everything, whether it is included in the product definition or not<br />
* <code>make clean</code> - remove all built files (prepare for a new build). Same as rm -rf out/<configuration>/<br />
* <code>make modules</code> - shows a list of submodules that can be built (List of all LOCAL_MODULE definitions)<br />
* <code>make <local_module></code> - make a specific module (note that this is not the same as directory name. It is the LOCAL_MODULE definition in the Android.mk file)<br />
* <code>make clean-<local_module></code> - clean a specific module<br />
* <code>make bootimage TARGET_PREBUILT_KERNEL=/path/to/bzImage</code> - create a new boot image with custom bzImage<br />
<br />
=== Helper macros and functions ===<br />
There are some helper macros and functions that are installed when you source envsetup.sh. They are documented<br />
at the top of envesetup.sh, but here is information about a few of them:<br />
<br />
* <code>hmm</code> - ''List this help text''<br />
* <code>lunch <product_name>-<build_variant></code> - Load product & build variant config (driver files, device specific configs, etc).<br />
* <code>tapas [<App1> <App2> ...] [arm|x86|mips|armv5|arm64|x86_64|mips64] [eng|userdebug|user]</code> - command is for building unbundled apps. If you don't supply a build variant, it defaults to eng.<br />
* <code>provision</code> - Flash device with all required partitions. Options will be passed on to fastboot.<br />
<br />
==== Build Macros and functions ==== <br />
<br />
* <code>croot</code> - change directory to the top of the tree<br />
* <code>m</code> - execute 'make' from the top of the tree (even if your current directory is somewhere else)<br />
* <code>mm</code> - builds all of the modules in the current directory<br />
* <code>mmm <dir1> ...</code> - Builds all of the modules in the supplied directories, but not their dependencies. To limit the modules being built use the syntax: mmm dir/:target1,target2.<br />
* <code>mma</code> - Builds all of the modules in the current directory, and their dependencies.<br />
* <code>mmma <dir1> ... </code> - Builds all of the modules in the supplied directories, and their dependencies.<br />
<br />
==== Grep macros and functions ====<br />
<br />
* <code>cgrep <PATTERN></code> Greps on all local C/C++ files.<br />
* <code>ggrep <PATTERN></code> Greps on all local Gradle files.<br />
* <code>jgrep <PATTERN></code> Greps on all local Java files.<br />
* <code>resgrep <PATTERN></code> Greps on all local res/*.xml files.<br />
* <code>mangrep <PATTERN></code> Greps on all local AndroidManifest.xml files.<br />
* <code>mgrep <PATTERN></code> Greps on all local Makefiles files.<br />
* <code>sepgrep <PATTERN></code> Greps on all local sepolicy files.<br />
* <code>sgrep <PATTERN></code> Greps on all local source files.<br />
* <code>godir <filename></code> Go to the directory containing a file<br />
<br />
=== Speeding up the build ===<br />
You can use the '-j' option with make, to start multiple threads of make execution concurrently.<br />
<br />
In my experience, you should specify about 2 more threads than you have processors on your machine.<br />
If you have 2 processors, use 'make -j4', If they are hyperthreaded (meaning you have 4 virtual<br />
processors), try 'make -j6.<br />
<br />
You can also specify to use the 'ccache' compiler cache, which will speed up things once you have<br />
built things a first time. To do this, specify 'export USE_CCACHE=1' at your shell command line.<br />
(Note that ccache is included in the prebuilt section of the repository, and does not have to be<br />
installed on your host separately.)<br />
<br />
For recent Android versions, there's no prebuilt ccache and one needs to set the path to a local binary with CCACHE_EXEC, as per this [https://android.googlesource.com/platform/build/+/7556703f0dfab14c91c03dab1a3c25f6386268d4 commit].<br />
<br />
=== Building only an individual program or module ===<br />
If you use build/envsetup.sh, you can use some of the defined functions to build<br />
only a part of the tree. Use the 'mm' or 'mmm' commands to do this.<br />
<br />
The 'mm' command makes stuff in the current directory (and sub-directories, I believe).<br />
With the 'mmm' command, you specify a directory or list of directories, and it builds those.<br />
<br />
To install your changes, do 'make snod' from the top of tree.<br />
'make snod' builds a new system image from current binaries.<br />
<br />
=== Setting module-specific build parameters ===<br />
Some code in Android system can be customized in the way they are built (separate from the build<br />
variant and release vs. debug options). You can set variables that control individual<br />
build options, either by setting them in the environment or by passing them directly to<br />
'make' (or the 'm...' functions which call 'make'.)<br />
<br />
For example, the 'init' program can be built with support for bootchart logging<br />
by setting the INIT_BOOTCHART variable. (See [[Using Bootchart on Android]] for why<br />
you might want to do this.)<br />
<br />
You can accomplish either with:<br />
$ touch system/init/init.c<br />
$ export INIT_BOOTCHART=true<br />
$ make<br />
or<br />
$ touch system/init/init.c<br />
$ m INIT_BOOTCHART=true<br />
<br />
== Makefile tricks ==<br />
These are some tips for things you can use in your own Android.mk files.<br />
<br />
=== build helper functions ===<br />
A whole bunch of build helper functions are defined in the file <code>build/core/definitions.mk</code><br />
<br />
Try <code>grep define build/core/definitions.mk</code> for an exhaustive list.<br />
<br />
Call them via: <code>$(call <FUNCTION>, <PARAM-1>, <PARAM-2>)</code> or without parameters: <code>$(call <FUNCTION>)</code><br />
<br />
Here are some possibly interesting functions:<br />
* <code>print-vars</code> - print all Makefile variables, for debugging (not their values).<br />
* <code>emit-line</code> - output a line during building, to a file<br />
* <code>dump-words-to-file</code> - output a list of words to a file<br />
* <code>copy-one-file</code> - copy a file from one place to another (dest on target?)<br />
* <code>all-subdir-makefiles</code> - Recursively calls all <code>Android.mk</code> files, beginning in the current directory (Usage: <code>include $(call all-subdir-makefiles)</code>).<br />
<br />
=== build variables ===<br />
<br />
* <code>$(ANDROID_BUILD_TOP)</code> - AOSP file system root folder<br />
* <code>$(LOCAL_PATH)</code> - ''Usually'' the current directory. Gets set by the developer/user in every <code>Android.mk</code> file.<br />
: It get's overwritten in other <code>Android.mk</code> files down the file-tree (E.g. when you use <code>include $(call all-subdir-makefiles)</code>).<br />
: A workaround iss <ref>https://groups.google.com/forum/#!topic/android-ndk/7cUf3tkuBSM</ref>:<br />
<br />
SAVED_LOCAL_PATH := $(call my-dir)<br />
include $(call all-subdir-makefiles)<br />
LOCAL_PATH:= $(SAVED_LOCAL_PATH)<br />
<br />
=== Add a file directly to the output area ===<br />
You can copy a file directly to the output area, without building anything,<br />
using the add-prebuilt-files function.<br />
<br />
The following line, extracted from prebuilt/android-arm/gdbserver/Android.mk<br />
copies a list of files to the EXECUTABLES directory in the output area:<br />
<br />
$(call add-prebuilt-files, EXECUTABLES, $(prebuilt_files))<br />
<br />
== Adding a new program to build ==<br />
=== Steps for adding a new program to the Android source tree ===<br />
* make a directory under 'external'<br />
** e.g. ANDROID/external/myprogram<br />
* create your C/cpp files.<br />
* create Android.mk as clone of external/ping/Android.mk<br />
* Change the names ping.c and ping to match your C/cpp files and program name<br />
* add the directory name in ANDROID/build/core/main.mk after external/zlib as external/myprogram (Not needed anymore from ''at least'' Android 7.1 onwards)<br />
* make from the root of the source tree<br />
* your files will show up in the build output area, and in system images.<br />
** You can copy your file from the build output area, under out/target/product/..., if you want to copy it individually to the target (not do a whole install)<br />
<br />
See http://www.aton.com/android-native-development-using-the-android-open-source-project/ for a lot more detail.<br />
<br />
== Building the kernel ==<br />
The kernel is "outside" of the normal Android build system (indeed, the kernel is not included by default in the Android Open Source Project). However, there are tools in AOSP for building a kernel.<br />
If you are building the kernel, start on this page: http://source.android.com/source/building-kernels.html<br />
<br />
If you are building the kernel for the emulator, you may also want to look at:<br />
http://stackoverflow.com/questions/1809774/android-kernel-compile-and-test-with-android-emulator<br />
<br />
And, Ron M wrote (on the android-kernel mailing list, on May 21, 2012):<br />
<br />
This post is very old - but nothing has changes as far as AOSP is concerned, so <br />
in case anyone is interested and runs into this problem when building for QEMU:<br />
<br />
There is actually a nice and shorter way to build the kernel for your QEMU <br />
target provided by the AOSP:<br />
<br />
1. cd to your kernel source dir (Only goldfish 2.6.29 works out of the box for the emulator)<br />
<br />
2. ${ANDROID_BUILD_TOP}/external/qemu/distrib/build-kernel.sh -j=64 --arch=x86 --out=$YourOutDir<br />
<br />
3. emulator -kernel ${YourOutDir}/kernel-qemu # run emulator:<br />
<br />
<br />
Step #2 calls the toolbox.sh wrapper scripts which works around the SSE <br />
disabling gcc warning - which happens for GCC < 4.5 (as in the AOSP prebuilt X86 <br />
toolchain).<br />
<br />
This script adds the " -mfpmath=387 -fno-pic" in case it is an X86 and that in <br />
turn eliminates the compilation errors seen above.<br />
<br />
To have finer control over the build process, you can use the "toolbox.sh" <br />
wrapper and set some other stuff without modifying the script files.<br />
<br />
An example for building the same emulator is below:<br />
<br />
# Set arch<br />
export ARCH=x86<br />
# Have make refer to the QEMU wrapper script for building android over x86 <br />
(eliminates the errors listed above)<br />
export <br />
CROSS_COMPILE=${ANDROID_BUILD_TOP}/external/qemu/distrib/kernel-toolchain/android-kernel-toolchain-<br />
# Put your cross compiler here. I am using the AOSP prebuilt one in this example<br />
export <br />
REAL_CROSS_COMPILE=${ANDROID_BUILD_TOP}/prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/bin/i686-android-linux-<br />
# Configure your kernel - here I am taking the default goldfish_defconfig<br />
make goldfish_defconfig<br />
# build<br />
make -j64<br />
# Run emulator:<br />
emulator -kernel arch/x86/boot/bzImage -show-kernel<br />
<br />
<br />
This works for the 2.6.29 goldfish branch. If anyone is using the emulator with <br />
a 3+ kernel I would be like to hear about it.<br />
<br />
<br />
[[Category:Android]]</div>Consthttps://elinux.org/index.php?title=User:Const&diff=509751User:Const2020-03-09T09:29:23Z<p>Const: </p>
<hr />
<div>* http://www.MakeLinux.net</div>Consthttps://elinux.org/index.php?title=Scripting&diff=494121Scripting2019-06-25T07:47:00Z<p>Const: wicked_cool_shell_scripts_2e</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
* http://www.techbar.me/linux-shell-tips/<br />
* https://natelandau.com/bash-scripting-utilities/<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** [http://www.makelinux.net/man/1/S/shtool man shtool]<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [https://github.com/brandonprry/wicked_cool_shell_scripts_2e Wicked Cool Shell Scripts 2e] <small>[http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]</small><br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
** Most useful functions: make-debug, trap_err, readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/SkypLabs/bsfl bsfl - Bash Shell Function Library]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** exported to [https://github.com/kennelbound/shesfw GitHhub]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
** Regular operations implelented in shell. Usedfull on out of memory (OOM) when there is no memory to run external programms.<br />
** easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Experts&diff=469131Experts2018-05-18T05:35:56Z<p>Const: </p>
<hr />
<div>== '''Embedded Linux Expert List''' ==<br />
<br />
* [[Rusty_Russell_Quotes]] This page is here in honor of Rusty Russell, one of the funniest Linux kernel developers EVER<br />
<br />
=== Instructions for Experts ===<br />
This page is intended to provide a place for Embedded Linux Experts to advertise their availability, and describe their expertise, to companies interested in paying them for services. This could include contract work or fulltime employment.<br />
<br />
Linux experts are encouraged to provide their information in the table below so that companies may contact them for their areas of interest. Please put an expiration date for the information, so we can remove information when it<br />
gets stale. Or even better, when you have obtained work, please remove your entry from this table.<br />
<br />
See the [[Jobs]] page for jobs already posted to this site.<br />
<br />
=== Instructions for Employers ===<br />
Please contact the person below, if you have a position or contract work you would like to hire<br />
someone to do. This list is not intended to be used to ask for free support.<br />
<br />
You can also list your job on the [[Jobs]] page.<br />
<br />
== '''The List''' ==<br />
{| border="1" cellspacing="0" cellpadding="5"<br />
|- style="background:#CCCCCC"<br />
! style="width:200px" | Name (Link)<br />
! style="width:400px" | Expertise areas<br />
! style="width:200px" | Contact Info<br />
! style="width:100px" | Expires date<br />
|- align="center"<br />
| Ayoub Zaki<br>Embexus<br>Germany<br />
| Yocto development, Board bring-up, Board Support Package, Drivers Development, Software Update, Factory End-Of-Line Testing, User Interface Development, Security and IoT<br />
| https://embexus.com <br> [mailto:info@embexus.com info@embexus.com]<br />
| 2018<br />
|- align="center"<br />
| Sebastien Ronsse<br>Witekio<br>US<br />
| Embedded development on ARM and x86 platforms (bootloader, drivers/kernel, middleware), System Consulting, Training<br />
| [mailto:sronsse@witekio.us sronsse@witekio.us]<br />
| 2018<br />
|- align="center"<br />
| Eric Wheeler<br>Linux Global<br>USA<br />
| Embedded Redundant Bootloader Snapshot Support with Easy Manufacturer Reset Features, Linux Security, Support, Maintenance, Monitoring, and Consulting with 20 Years of Experience<br />
| [https://www.linuxglobal.com/ www.LinuxGlobal.com]<br> [mailto:elinux@o.ewheeler.net elinux@o.ewheeler.net]<br />
| 2021<br />
|- align="center"<br />
| Constantine Shulyupin<br>Israel, Worldwide<br />
| TI DaVinci, drivers, boot loaders, fast boot<br />
| http://www.makelinux.com <br> mailto://const@makelinux.com<br />
| 2020<br />
|- align="center"<br />
| Leon Woestenberg, MSc. EE, Sidebranch<br>Eindhoven, The Netherlands, EU/USA/CA<br />
| Embedded Linux, SoC/FPGA, Yocto, PCI Express, Real-time, OpenEmbedded, System and Hardware Design, Device Drivers, Training, Video Broadcast<br />
| [http://www.sidebranch.com/ www.sidebranch.com]<br>[mailto:leon@sidebranch.com leon@sidebranch.com]<br />
| 2020<br />
|- align="center"<br />
| Robert Berger - Reliable Embedded Systems - Robert Berger e.U. , Embedded Software Specialist, Athens (Greece)/St. Barbara (Austria), EU<br />
| Training for: Yocto Project, Embedded Linux (Systems Architecture, Device Drivers), Real-time, Debugging, Boot, ... <br />
| elinux@reliableembeddedsystems.com [http://www.reliableembeddedsystems.com/ http://www.reliableembeddedsystems.com]<br />
| 2043<br />
|- align="center"<br />
| Marco Cavallini, Bergamo (Italy), EU<br />
| Consulting and Training for: Embedded Linux (Systems Architecture, Device Drivers, Yocto Project), ARM, Real-time, Debugging, U-boot, Yocto Project development, OpenEmbedded, Board bring-up, Board Support Package, Drivers Development, Software Update, User Interface Development, Security and IoT<br />
| [http://www.koansoftware.com KOAN sas]<br />
| 2020<br />
|- align="center"<br />
| Young-Ho Song, Seoul (Korea)<br />
| Embedded Linux, Device drivers, Multimedia Communication & System, IPTV, Network Security<br />
| [http://elinux.org/User:Young-Ho_Song Young-Ho Song]<br />
| 2022<br />
|- align="center"<br />
| Frank Duason, Massachusetts (USA)<br />
| Embedded Linux, board bring-up, u-boot, BSP, device drivers, PowerPC, ARM, power management, applications and libraries<br />
| fduason@yahoo.com<br />
| 2013<br />
|- align="center"<br />
| Thomas Soehus, Aalborg (Denmark)<br />
| TI OMAP, Sitara, Davinci and Freescale iMX SOC's, Embedded Linux, U-boot, BSP, device drivers, Yocto and Android.<br />
| [mailto:info@ceepro.dk info@ceepro.dk]<br />
| 2018<br />
|- align="center"<br />
| Juan Solano, Munich (Germany)<br />
| Embedded Linux, ARM, Device Drivers, Real-time.<br />
| [mailto:elinux@jsolano.com elinux@jsolano.com]<br />
| 2022<br />
|- align="center"<br />
| Steve Poulsen - Signetik, Nebraska (USA)<br />
| Embedded Linux, ARM/DSP, System Bring-up including HW troubleshooting, DDR, eMMC, NAND, Yocto and minimal Linux, ALSA, V4L2, DSPLink, DSPBios, Device Drivers, PRU, Real-time, IoT, and more.<br />
| e-mail: [mailto:spoulsen@signetik.com spoulsen@signetik.com]<br>web: [http://www.signetik.com Signetik]<br />
| 2018<br />
|- align="center"<br />
| Aaron Clarke (USA)<br>Embedded Consultant<br>[[User:AaronClarke|e-Linux User Page]]<br />
| Prototyping; BeagleBone, Raspberry Pi<br>board bring-up; Linux kernels, bootloaders and device drivers<br>peripherals and communications protocols<br> troubleshooting and integration<br />
| web: [http://AaronClarke.com AaronClarke.com]<br>e-mail: [mailto:ac@aaronclarke.com ac@aaronclarke.com]<br />
| 2016<br />
|- align="center"<br />
| Gautam Bhat - Bangalore, (India)<br />
| Embedded Linux, ARM, uboot, custom bootloaders, Baremetal OS on ARM microprocessors and microcontrollers, Embedded Test Software Development, Prototyping, Controller and Peripheral device driver development, board bring up, AOSP bring up, Android framework customization.<br />
| [mailto:gautam.nbhat@gmail.com gautam.nbhat@gmail.com]<br />
|2020<br />
|- align="center"<br />
| Michael Schloh von Bennewitz (Germany/U.S.A.)<br>Computer Scientist, Europalab Networks<br>[[User:Michael|ELinux User Page]]<br />
| Embedded engineering on ARM MCU and IA32 platforms (bootloader, middleware, messaging, Q.A., deployment), H2M and M2M communications consulting, penetration testing, and applied systems workshop training.<br />
| Email: [mailto:elinux@encambio.com elinux@encambio.com]<br>Web: [http://michael.schloh.com/ http://michael.schloh.com/]<br />
| 2018<br />
|- align="center"<br />
| Scott Ellis (USA)<br>Jumpnow Technologies, LLC<br />
| Embedded Linux consulting<br>BSPs using Yocto or Buildroot, Mender integration<br>RPi (RPi3, RPi0-W, CM3), TI (OMAP, AM335x), NXP i.MX6<br>Device drivers, bootloader customization, Qt5, custom software development<br />
| scott@jumpnowtek.com<br>http://jumpnowtek.com<br />
| 2020<br />
|}<br />
<br />
[[Category:Categories]]</div>Consthttps://elinux.org/index.php?title=Device_drivers&diff=420711Device drivers2016-09-27T12:05:53Z<p>Const: /* Sample drivers */</p>
<hr />
<div>== Manuals ==<br />
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction<br />
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition]<br />
* [http://www.makelinux.net/reference.d/drivers_linux Tutorial for writing parallel port driver]<br />
<br />
== Sample drivers ==<br />
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.<br />
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0<br />
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton <br />
** [https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c sbull.c] - simple block device<br />
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device<br />
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device<br />
* [http://lxr.free-electrons.com/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works<br />
* [http://lxr.free-electrons.com/source/drivers/media/platform/mem2mem_testdev.c?v=3.18 mem2mem_testdev.c - virtual v4l2-mem2mem example device driver]<br />
* [http://lxr.free-electrons.com/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix)<br />
* [http://lxr.free-electrons.com/source/drivers/video/fbdev/skeletonfb.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled)<br />
* [http://lxr.free-electrons.com/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver]<br />
* [http://lxr.free-electrons.com/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo]<br />
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet)<br />
<br />
== Resources ==<br />
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers)</div>Consthttps://elinux.org/index.php?title=Device_drivers&diff=420706Device drivers2016-09-27T12:04:43Z<p>Const: /* Sample drivers */</p>
<hr />
<div>== Manuals ==<br />
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction<br />
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition]<br />
* [http://www.makelinux.net/reference.d/drivers_linux Tutorial for writing parallel port driver]<br />
<br />
== Sample drivers ==<br />
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.<br />
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0<br />
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton <br />
** [https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c sbull.c] - simple block device<br />
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device<br />
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device<br />
* [http://lxr.free-electrons.com/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works<br />
* [http://lxr.free-electrons.com/source/drivers/media/platform/mem2mem_testdev.c?v=3.18 mem2mem_testdev.c - virtual v4l2-mem2mem example device driver]<br />
* [http://lxr.free-electrons.com/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix)<br />
* [http://lxr.free-electrons.com/source/drivers/video/skeletonfb.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled)<br />
* [http://lxr.free-electrons.com/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver]<br />
* [http://lxr.free-electrons.com/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo]<br />
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet)<br />
<br />
== Resources ==<br />
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers)</div>Consthttps://elinux.org/index.php?title=Device_drivers&diff=420701Device drivers2016-09-27T12:02:55Z<p>Const: /* Sample drivers */</p>
<hr />
<div>== Manuals ==<br />
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction<br />
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition]<br />
* [http://www.makelinux.net/reference.d/drivers_linux Tutorial for writing parallel port driver]<br />
<br />
== Sample drivers ==<br />
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.<br />
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0<br />
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton <br />
** [https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c sbull.c] - simple block device<br />
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device<br />
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device<br />
* [http://lxr.free-electrons.com/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works<br />
* [http://lxr.free-electrons.com/source/drivers/media/video/mem2mem_testdev.c mem2mem_testdev.c - virtual v4l2-mem2mem example device driver]<br />
* [http://lxr.free-electrons.com/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix)<br />
* [http://lxr.free-electrons.com/source/drivers/video/skeletonfb.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled)<br />
* [http://lxr.free-electrons.com/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver]<br />
* [http://lxr.free-electrons.com/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo]<br />
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet)<br />
<br />
== Resources ==<br />
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers)</div>Consthttps://elinux.org/index.php?title=Scripting&diff=415961Scripting2016-08-03T19:26:11Z<p>Const: /* Shell scripting */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
* http://www.techbar.me/linux-shell-tips/<br />
* https://natelandau.com/bash-scripting-utilities/<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** [http://www.makelinux.net/man/1/S/shtool man shtool]<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
** Most useful functions: make-debug, trap_err, readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/SkypLabs/bsfl bsfl - Bash Shell Function Library]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** exported to [https://github.com/kennelbound/shesfw GitHhub]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
** Regular operations implelented in shell. Usedfull on out of memory (OOM) when there is no memory to run external programms.<br />
** easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Cross-compilation&diff=387101Cross-compilation2015-08-11T13:06:49Z<p>Const: Created page with "* [https://autotools.io/pkgconfig/cross-compiling.html pkg-config cross-compilation] * [https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html Autom..."</p>
<hr />
<div>* [https://autotools.io/pkgconfig/cross-compiling.html pkg-config cross-compilation]<br />
* [https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html Automake cross-compilation]</div>Consthttps://elinux.org/index.php?title=Patch_Submission_HOWTO&diff=386731Patch Submission HOWTO2015-08-07T20:36:53Z<p>Const: </p>
<hr />
<div>The Most updated official manuals: <br />
* [https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches SubmittingPatches] <br />
* [https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/submitting-patches.txt Submitting devicetree (DT) binding patches ]<br />
<br />
The rest of the document is obsolete and should be reworked. <br />
<br />
== Obsolete == <br />
<br />
This document describes current practices for submitting a patch to the eLinux.org mailing list.<br />
<br />
== Quick Overview ==<br />
<br />
Patches should follow standard open source practices. Here is a quick overview of the steps involved:<br />
<br />
*make sure to diff between your modified tree and a saved-off original tree<br />
*make sure to avoid including any intermediate build results in your patch (usually done by using a "dontdiff" file)<br />
*use the following diff flags:<br />
**unified format (i.e. <code>"-u"</code>)<br />
**recursive (if appropriate)(i.e <code>"-r"</code>)<br />
**include new files (if appropriate)(i.e. <code>"-N"</code>)<br />
**include procedure name for patch hunks (i.e. <code>"-p"</code>)<br />
**make sure the original tree dir is listed first (thus, the standard diff line to use is something like:<br />
<br />
<code>"diff -pruN -X dontdiff linux-2.6.8.1.orig linux-withmymods"</code><br />
*make sure the patch applies with <code>-p1</code><br />
*use the kernel patch e-mail message preferences<br />
**subject should start with [PATCH ...]<br />
**subject should contain a short description string<br />
**body of message should have long description<br />
**body of message should have <code>diffstat</code> information<br />
**body of message should have "Signed-off-by" line<br />
**body of message should have actual patch in plaintext format:<br />
***uncompressed, unencoded<br />
***inline (not as an attachment)<br />
***non-wrapped lines, no whitespace conversions<br />
***no trailing whitespace<br />
*send the patch via e-mail to the <code>celinux-dev</code> mailing list<br />
*[[Image:Alert.gif]] our strong preference is that all forum-bound patches go to the <code>celinux-dev</code> mailing list, rather than only to a technical working group mailing list<br />
*if sending the patch to an external open source project list, please copy <code>celinux-dev</code><br />
*upload patch to the appropriate technology wiki page or the PatchArchive page<br />
**attach the patch to the page<br />
**modify the page to refer to the attached patch<br />
<br />
== Some Details ==<br />
=== Pre-requisites ===<br />
==== Use an Open Source license ====<br />
All code submitted to the forum must be licensed under an appropriate open source license (See the membership agreement for exact details.) For code submitted to the forum related to the Linux kernel, the submission MUST be licensed under the GNU General Public License.<br />
<br />
==== Make sure you have permission and authority to make the contribution ====<br />
Code submitted to the forum must be free of intellectual property limitations (which would violate the open source licensing policy anyway). Please make sure that any code you submit is either:<br />
#written exclusively by you or your company<br />
#was provided to you under an open source license<br />
<br />
Also, make sure that you are allowed by your company to submit the code to the forum. For things you obtained from open source, which you modified and contributed as part of forum activity, this should not be a problem. But you may want to double-check your company policy.<br />
<br />
==== Check the intellectual property status of your code ====<br />
If you are aware of any intellectual property issues (including patent infringement) related to your submission, you MUST notify the forum about the issue within 10 days of your submission<br />
<br />
=== Prepare patch (diff) against original source ===<br />
Before starting your modification, you should save off a pristine copy of the source code so you can make patches against it. It is common to rename this item with an extension of <code>.orig</code>. This is helpful to identify the original versus the new files in the patch file (in case you get the diff command ordering mixed up).<br />
<br />
=== Use the latest Linux kernel version ===<br />
Please make your patch from the latest Linux kernel version - preferrably from that latest<br />
stable kernel from Linus.<br />
<br />
=== Avoid including intermediate build results ===<br />
When you build the kernel, all kinds of extra files are created (including but not limited to dependency files, object files, utility binaries, etc.) There are three ways to avoid including them in your patch:<br />
*use "-X dontdiff" to eliminate certain files from your diff. <code>dontdiff</code> is a file containing a list of filename and patterns that should be omitted from a kernel diff. You can obtain the latest one using the command: [http://www.moses.uklinux.net/patches/dontdiff dontdiff]"<br />
<br />
OR<br />
<br />
*always do your builds so that intermediate files are in a separate directory To do this, use "make O==dir" to specify an output directory. Use "make help" to get more information on kernel build options.<br />
<br />
OR<br />
<br />
*do "make distclean" on your modified tree before creating your patch. This will clean up all intermediate files in the kernel source tree. However, be careful, as this will remove your .config as well.<br />
<br />
=== Use unified diff format ===<br />
Use the unified diff format. Normally, when diff'ing anything but a single file, the arguments "-r", "-u", and "-N" should be used. This tells diff to operate recursively, in unified format, and to include new files as part of the output.<br />
<br />
Also, some kernel developers prefer if you use the -p option so that you diff tries to identify the C procedure for each patch hunk.<br />
<br />
=== Send the patch via e-mail ===<br />
Code submissions to the forum should be in patch format, attached to an e-mail which is sent to a forum mailing list (rather than to an individual or list of e-mail recipients). This ensures that the patch will be archived by forum mailing list software, which provides an official record of the submission.<br />
<br />
The e-mail should have the exact phrase "[PATCH]" (without the quotes) at the beginning of the subject line. The patch message should describe the patch. The patch itself should be attached or inlined in the message. The patch should be uncompressed (except for extremely large patches) and use plain text encoding.<br />
<br />
==== Send it to the appropriate mailing list ====<br />
There are two main audiences for your patch: Patches for Working Group activity and patches submitted generally to the whole forum.<br />
<br />
If you are a member, it may be most convenient to send the first kind of patch directly to the Working Group mailing list. However, for patches from non-members, or for patches intended for the entire forum, please send them to the celinux-dev@tree.celinuxforum.org mailing list.<br />
<br />
See http://tree.celinuxforum.org/ for a link to the mailing list page, to subscribe to this list or view the current archives.<br />
<br />
*What do do about mail list size limits?<br />
<br />
It is possible you will run into trouble with the size of your patch. If your patch is greater than 40K, then the celinux-dev mailing list will hold it temporarily, pending administrator approval. If you do not wish to wait for this approval, instead please post the patch to a publicly accessible location and refer to the URL for that location in your message.<br />
<br />
*Update: the mail list size limit was removed from celinux-dev.<br />
<br />
This wiki provides an [[Special:Upload|File Upload]] where you may do this. You may use this page, but please don't abuse it.<br />
<br />
==== Include diffstat information with the patch ====<br />
It is very helpful in evaluating a patch to see the results of running the <code>diffstat</code> command. These results should be included in your e-mail.<br />
<br />
Many current distributions of Linux include the diffstat utility. If it was not installed by default, check your CDs and install it if necessary. If your distribution does not include it, you can obtain the source for diffstat at [http://dickey.his.com/diffstat/diffstat.html diffstat].<br />
<br />
==== Include patch instructions ====<br />
You should include instructions in your e-mail message about how and where to apply your patch.<br />
Specifically, please mention the tree directory where the patch should be applied, and the appropriate patch level (if any).<br />
<br />
E.g. <code>Apply this patch at the root of the tree, with "patch -p1 <foo.patch"</code><br />
<br />
=== Upload patch to Patch Archive ===<br />
To upload your patch to the patch archive, follow these steps:<br />
*go to the PatchArchive page<br />
*click on Edit Text at the bottom of the page<br />
*find the wiki source for the table which matches the kernel version for your patch (e.g. 2.6.10)<br />
*add a new line for your patch to the table. See the wiki online help for the format codes for tables.<br />
(Usually, you can just copy an existing table line.)<br />
**add the name, base kernel version and status, on a single wiki line<br />
**[[Image:Alert.gif]] it is helpful, in editing large wiki tables, to make the text size very small so you see the source for the table lines without wrapping in the HTML edit form.<br />
*save your changes to the page by clicking on "Save Changes"<br />
*attach the patch file to the page by clicking on Attach File, at the bottom of the page<br />
**when attaching the patch, do NOT use embedded spaces in the filename of the patch. There is an option to rename the file when uploading it. If your patch filename has spaces, please rename it.<br />
**select the checkbox: "Add link to page" <br />
**click on "Upload"<br />
*click on "Show Text" to see the page text again<br />
*edit the page again, and move the "attachment:<filename>" line from the end of the wiki page into the entry for your patch that you created earlier<br />
*save the page again.<br />
*if there is not already a wiki discussion page for this patch (or feature), please create one, and add a reference to it to your table entry line. When creating the page, use the TechnologyProjectTemplate.<br />
<br />
== Miscellaneous tidbits ==<br />
Here is an important statement of CELF policy:<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
! style="background:#ff8080;"|'''IT IS OUR STRONG DESIRE TO HAVE OUR CODE ACCEPTED BY "MAINSTREAM" KERNEL DEVELOPERS AT KERNEL.ORG, AT SOME POINT IN THE FUTURE'''<br />
|}<br />
<br />
In order to accomplish this, we need to conform to accepted coding standards and submission<br />
practices.<br />
<br />
=== Kernel submission guidelines ===<br />
The kernel source tree contains some guidelines (many of which are listed here) for patch submissions to kernel.org. See the files: [http://lxr.linux.no/source/Documentation/SubmittingDrivers Documentation/SubmittingDrivers]<br />
and [http://lxr.linux.no/source/Documentation/SubmittingPatches Documentation/SubmittingPatches] for details.<br />
<br />
=== Coding style ===<br />
For kernel code, please follow the kernel coding guidelines which are found in the file [http://lxr.linux.no/source/Documentation/CodingStyle Documentation/CodingStyle]<br />
<br />
=== Andrew's "perfect patch" instructions ===<br />
Andrew Morton, an important kernel developer who manages thousands of patches for the kernel development process, wrote a set of guidelines for submittingpatches. It is at:<br />
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt<br />
<br />
=== Jeff Garzik's patch instructions ===<br />
http://linux.yyz.us/patch-format.html<br />
<br />
=== Useful Linux Kernel Scripts ===<br />
* scripts/checkpatch.pl -strict -- checks your patch for obvious style errors<br />
* scripts/get_maintainer.pl -- get the email adresses of the maintainers and the people who might be interested in your patch<br />
<br />
=== Git ===<br />
Creating and sending emails is very easy and far less error prone with [[git]] - see [[git#Additional_Resources]] for more information.<br />
<br />
== Example ==<br />
The following example shows a patch which was submitted to the Bootup Times Working Group. This example is not optimal, since it was made relative to a 2.4.20 kernel, rather than the CELF tree, but it demonstrates most of the conventions described above.<br />
<br />
<pre><br />
Subject: [PATCH] Patch for pre-calculated loops_per_jiffy<br />
<br />
Attached is a patch which allows for setting a pre-calculated<br />
loops_per_jiffy. This patch was derived from the CONFIG_INSTANT_ON<br />
feature in the CELF source tree, which was developed by MontaVista.<br />
This feature is already available in the CELF source tree, for the<br />
OMAP board.<br />
<br />
loops_per_jiffy (LPJ) is the value used internally<br />
by the kernel for the delay() function. Normally, LPJ is<br />
determined at boot time by the routine calibrate_delay(), in<br />
init/main.c. This routine takes approximately 250 ms to complete<br />
on my test machine. Note that the routine uses a sequence of programmed<br />
waits to determine the correct LPJ value, with each wait taking about 1 HZ<br />
(usually 10 ms) period. With a pre-calculated value, this calibration<br />
is eliminated.<br />
<br />
This patch is currently against a linux 2.4.20 kernel, for the x86<br />
architecture.<br />
<br />
When the patch is applied, a new option appears in the General setup<br />
menu of menuconfig: "Fast booting". When this option is enabled, you<br />
are asked to set the value of another new option: 'Loops per jiffy'.<br />
These set the config variables CONFIG_FASTBOOT and CONFIG_FASTBOOT_LPJ.<br />
<br />
diffstat for this patch is:<br />
Documentation/Configure.help | 23 +++++++++++++++++++++++<br />
arch/i386/config.in | 6 ++++++<br />
init/main.c | 13 +++++++++++++<br />
3 files changed, 42 insertions(+)<br />
<br />
To apply the patch, in the root of a kernel tree use:<br />
patch -p1 <fastboot_lpj.patch<br />
<br />
To use the patch, apply it and boot your machine with Fast booting<br />
off. You can determine the correct value for Loops per jiffy by examining<br />
the printk output from the kernel boot. Now configure the kernel with<br />
Fast booting on, and with the correct LPJ value.<br />
<br />
Alternatively, you can set the LPJ value to 5000 times the value of<br />
BogoMips, if you know that for your target.<br />
<br />
With this patch applied (and configured) you should notice an<br />
approximately 1/4 second speedup in booting.<br />
<br />
You may want to use the time_bootup patch I sent previously to measure<br />
this improvement.<br />
<br />
The technology in this patch is architecture-independent.<br />
<br />
Please let me know any feedback you have on this patch or the approach used.<br />
<br />
Thanks,<br />
<br />
=====================<br />
Tim Bird<br />
Senior Staff Engineer<br />
Linux Architecture and Standards<br />
Platform Technology Center of America<br />
Sony Electronics<br />
=====================<br />
<br />
Signed-off-by: Tim Bird <tim.bird@am.sony.com><br />
<br />
--------------------------------------------------------------------------------<br />
diff -u -ruN linux-2.4.20.orig/Documentation/Configure.help linux-2.4.20/Documentation/Configure.help<br />
--- linux-2.4.20.orig/Documentation/Configure.help Thu Nov 28 15:53:08 2002<br />
+++ linux-2.4.20/Documentation/Configure.help Tue Sep 30 15:32:35 2003<br />
@@ -5274,6 +5274,29 @@<br />
replacement for kerneld.) Say Y here and read about configuring it<br />
in <file:Documentation/kmod.txt>.<br />
<br />
+Fast booting support<br />
+CONFIG_FASTBOOT<br />
+ Say Y here to enable faster booting of the Linux kernel. If you say<br />
+ Y here, you will be asked to provide hardcoded values for some<br />
+ parameters that the kernel usually probes for or determines at boot<br />
+ time. This is primarily of interest in embedded devices where<br />
+ quick boot time is a requirement.<br />
+<br />
+ If unsure, say N.<br />
+<br />
+Fast boot loops-per-jiffy<br />
+CONFIG_FASTBOOT_LPJ<br />
+ This is the number of loops passed to delay() to achieve a single<br />
+ HZ of delay inside the kernel. It is roughly BogoMips * 5000.<br />
+ To determine the correct value for your kernel, first turn off<br />
+ the fast booting option, compile and boot the kernel on your target<br />
+ hardware, then see what value is printed during the kernel boot.<br />
+ Use that value here.<br />
+<br />
+ If unsure, don't use the fast booting option. An incorrect value<br />
+ will cause delays in the kernel to be incorrect. Although unlikely,<br />
+ in the extreme case this might damage your hardware.<br />
+<br />
ARP daemon support<br />
CONFIG_ARPD<br />
Normally, the kernel maintains an internal cache which maps IP<br />
diff -u -ruN linux-2.4.20.orig/arch/i386/config.in linux-2.4.20/arch/i386/config.in<br />
--- linux-2.4.20.orig/arch/i386/config.in Thu Nov 28 15:53:09 2002<br />
+++ linux-2.4.20/arch/i386/config.in Tue Sep 30 15:33:04 2003<br />
@@ -316,6 +316,12 @@<br />
bool ' Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF<br />
fi<br />
<br />
+bool "Fast booting" CONFIG_FASTBOOT<br />
+if [ "$CONFIG_FASTBOOT" == "y" ]; then<br />
+ define_int CONFIG_DEFAULT_LPJ 414720<br />
+ int ' Loops per jiffy' CONFIG_FASTBOOT_LPJ $CONFIG_DEFAULT_LPJ<br />
+fi<br />
+<br />
endmenu<br />
<br />
source drivers/mtd/Config.in<br />
diff -u -ruN linux-2.4.20.orig/init/main.c linux-2.4.20/init/main.c<br />
--- linux-2.4.20.orig/init/main.c Fri Aug 2 17:39:46 2002<br />
+++ linux-2.4.20/init/main.c Tue Sep 30 15:32:04 2003<br />
@@ -164,6 +164,12 @@<br />
<br />
loops_per_jiffy == (1<<12);<br />
<br />
+#ifdef CONFIG_FASTBOOT_LPJ<br />
+ loops_per_jiffy == CONFIG_FASTBOOT_LPJ;<br />
+ printk("Calibrating delay loop (skipped)... ");<br />
+<br />
+#else /* CONFIG_FASTBOOT */<br />
+<br />
printk("Calibrating delay loop... ");<br />
while (loops_per_jiffy <<== 1) {<br />
/* wait for "start of" clock tick */<br />
@@ -192,10 +198,17 @@<br />
loops_per_jiffy &== ~loopbit;<br />
}<br />
<br />
+#endif /* CONFIG_FASTBOOT_LPJ */<br />
+<br />
/* Round the value and print it */<br />
printk("%lu.%02lu BogoMIPS\n",<br />
loops_per_jiffy/(500000/HZ),<br />
(loops_per_jiffy/(5000/HZ)) % 100);<br />
+<br />
+#ifndef CONFIG_FASTBOOT_LPJ<br />
+ printk("Use 'Loops per jiffy'==%lu for fast boot.\n",<br />
+ loops_per_jiffy);<br />
+#endif /* CONFIG_FASTBOOT_LPJ */<br />
}<br />
<br />
static int __init debug_kernel(char *str)<br />
</pre><br />
<br />
[[Category:HOWTOs]]</div>Consthttps://elinux.org/index.php?title=Patch_Submission_HOWTO&diff=386726Patch Submission HOWTO2015-08-07T20:32:03Z<p>Const: </p>
<hr />
<div><br />
The Most updated [https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches SubmittingPatches] manual <br />
<br />
The rest of the document is obsolete and should be reworked. <br />
<br />
== Obsolete == <br />
<br />
This document describes current practices for submitting a patch to the eLinux.org mailing list.<br />
<br />
== Quick Overview ==<br />
<br />
Patches should follow standard open source practices. Here is a quick overview of the steps involved:<br />
<br />
*make sure to diff between your modified tree and a saved-off original tree<br />
*make sure to avoid including any intermediate build results in your patch (usually done by using a "dontdiff" file)<br />
*use the following diff flags:<br />
**unified format (i.e. <code>"-u"</code>)<br />
**recursive (if appropriate)(i.e <code>"-r"</code>)<br />
**include new files (if appropriate)(i.e. <code>"-N"</code>)<br />
**include procedure name for patch hunks (i.e. <code>"-p"</code>)<br />
**make sure the original tree dir is listed first (thus, the standard diff line to use is something like:<br />
<br />
<code>"diff -pruN -X dontdiff linux-2.6.8.1.orig linux-withmymods"</code><br />
*make sure the patch applies with <code>-p1</code><br />
*use the kernel patch e-mail message preferences<br />
**subject should start with [PATCH ...]<br />
**subject should contain a short description string<br />
**body of message should have long description<br />
**body of message should have <code>diffstat</code> information<br />
**body of message should have "Signed-off-by" line<br />
**body of message should have actual patch in plaintext format:<br />
***uncompressed, unencoded<br />
***inline (not as an attachment)<br />
***non-wrapped lines, no whitespace conversions<br />
***no trailing whitespace<br />
*send the patch via e-mail to the <code>celinux-dev</code> mailing list<br />
*[[Image:Alert.gif]] our strong preference is that all forum-bound patches go to the <code>celinux-dev</code> mailing list, rather than only to a technical working group mailing list<br />
*if sending the patch to an external open source project list, please copy <code>celinux-dev</code><br />
*upload patch to the appropriate technology wiki page or the PatchArchive page<br />
**attach the patch to the page<br />
**modify the page to refer to the attached patch<br />
<br />
== Some Details ==<br />
=== Pre-requisites ===<br />
==== Use an Open Source license ====<br />
All code submitted to the forum must be licensed under an appropriate open source license (See the membership agreement for exact details.) For code submitted to the forum related to the Linux kernel, the submission MUST be licensed under the GNU General Public License.<br />
<br />
==== Make sure you have permission and authority to make the contribution ====<br />
Code submitted to the forum must be free of intellectual property limitations (which would violate the open source licensing policy anyway). Please make sure that any code you submit is either:<br />
#written exclusively by you or your company<br />
#was provided to you under an open source license<br />
<br />
Also, make sure that you are allowed by your company to submit the code to the forum. For things you obtained from open source, which you modified and contributed as part of forum activity, this should not be a problem. But you may want to double-check your company policy.<br />
<br />
==== Check the intellectual property status of your code ====<br />
If you are aware of any intellectual property issues (including patent infringement) related to your submission, you MUST notify the forum about the issue within 10 days of your submission<br />
<br />
=== Prepare patch (diff) against original source ===<br />
Before starting your modification, you should save off a pristine copy of the source code so you can make patches against it. It is common to rename this item with an extension of <code>.orig</code>. This is helpful to identify the original versus the new files in the patch file (in case you get the diff command ordering mixed up).<br />
<br />
=== Use the latest Linux kernel version ===<br />
Please make your patch from the latest Linux kernel version - preferrably from that latest<br />
stable kernel from Linus.<br />
<br />
=== Avoid including intermediate build results ===<br />
When you build the kernel, all kinds of extra files are created (including but not limited to dependency files, object files, utility binaries, etc.) There are three ways to avoid including them in your patch:<br />
*use "-X dontdiff" to eliminate certain files from your diff. <code>dontdiff</code> is a file containing a list of filename and patterns that should be omitted from a kernel diff. You can obtain the latest one using the command: [http://www.moses.uklinux.net/patches/dontdiff dontdiff]"<br />
<br />
OR<br />
<br />
*always do your builds so that intermediate files are in a separate directory To do this, use "make O==dir" to specify an output directory. Use "make help" to get more information on kernel build options.<br />
<br />
OR<br />
<br />
*do "make distclean" on your modified tree before creating your patch. This will clean up all intermediate files in the kernel source tree. However, be careful, as this will remove your .config as well.<br />
<br />
=== Use unified diff format ===<br />
Use the unified diff format. Normally, when diff'ing anything but a single file, the arguments "-r", "-u", and "-N" should be used. This tells diff to operate recursively, in unified format, and to include new files as part of the output.<br />
<br />
Also, some kernel developers prefer if you use the -p option so that you diff tries to identify the C procedure for each patch hunk.<br />
<br />
=== Send the patch via e-mail ===<br />
Code submissions to the forum should be in patch format, attached to an e-mail which is sent to a forum mailing list (rather than to an individual or list of e-mail recipients). This ensures that the patch will be archived by forum mailing list software, which provides an official record of the submission.<br />
<br />
The e-mail should have the exact phrase "[PATCH]" (without the quotes) at the beginning of the subject line. The patch message should describe the patch. The patch itself should be attached or inlined in the message. The patch should be uncompressed (except for extremely large patches) and use plain text encoding.<br />
<br />
==== Send it to the appropriate mailing list ====<br />
There are two main audiences for your patch: Patches for Working Group activity and patches submitted generally to the whole forum.<br />
<br />
If you are a member, it may be most convenient to send the first kind of patch directly to the Working Group mailing list. However, for patches from non-members, or for patches intended for the entire forum, please send them to the celinux-dev@tree.celinuxforum.org mailing list.<br />
<br />
See http://tree.celinuxforum.org/ for a link to the mailing list page, to subscribe to this list or view the current archives.<br />
<br />
*What do do about mail list size limits?<br />
<br />
It is possible you will run into trouble with the size of your patch. If your patch is greater than 40K, then the celinux-dev mailing list will hold it temporarily, pending administrator approval. If you do not wish to wait for this approval, instead please post the patch to a publicly accessible location and refer to the URL for that location in your message.<br />
<br />
*Update: the mail list size limit was removed from celinux-dev.<br />
<br />
This wiki provides an [[Special:Upload|File Upload]] where you may do this. You may use this page, but please don't abuse it.<br />
<br />
==== Include diffstat information with the patch ====<br />
It is very helpful in evaluating a patch to see the results of running the <code>diffstat</code> command. These results should be included in your e-mail.<br />
<br />
Many current distributions of Linux include the diffstat utility. If it was not installed by default, check your CDs and install it if necessary. If your distribution does not include it, you can obtain the source for diffstat at [http://dickey.his.com/diffstat/diffstat.html diffstat].<br />
<br />
==== Include patch instructions ====<br />
You should include instructions in your e-mail message about how and where to apply your patch.<br />
Specifically, please mention the tree directory where the patch should be applied, and the appropriate patch level (if any).<br />
<br />
E.g. <code>Apply this patch at the root of the tree, with "patch -p1 <foo.patch"</code><br />
<br />
=== Upload patch to Patch Archive ===<br />
To upload your patch to the patch archive, follow these steps:<br />
*go to the PatchArchive page<br />
*click on Edit Text at the bottom of the page<br />
*find the wiki source for the table which matches the kernel version for your patch (e.g. 2.6.10)<br />
*add a new line for your patch to the table. See the wiki online help for the format codes for tables.<br />
(Usually, you can just copy an existing table line.)<br />
**add the name, base kernel version and status, on a single wiki line<br />
**[[Image:Alert.gif]] it is helpful, in editing large wiki tables, to make the text size very small so you see the source for the table lines without wrapping in the HTML edit form.<br />
*save your changes to the page by clicking on "Save Changes"<br />
*attach the patch file to the page by clicking on Attach File, at the bottom of the page<br />
**when attaching the patch, do NOT use embedded spaces in the filename of the patch. There is an option to rename the file when uploading it. If your patch filename has spaces, please rename it.<br />
**select the checkbox: "Add link to page" <br />
**click on "Upload"<br />
*click on "Show Text" to see the page text again<br />
*edit the page again, and move the "attachment:<filename>" line from the end of the wiki page into the entry for your patch that you created earlier<br />
*save the page again.<br />
*if there is not already a wiki discussion page for this patch (or feature), please create one, and add a reference to it to your table entry line. When creating the page, use the TechnologyProjectTemplate.<br />
<br />
== Miscellaneous tidbits ==<br />
Here is an important statement of CELF policy:<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
! style="background:#ff8080;"|'''IT IS OUR STRONG DESIRE TO HAVE OUR CODE ACCEPTED BY "MAINSTREAM" KERNEL DEVELOPERS AT KERNEL.ORG, AT SOME POINT IN THE FUTURE'''<br />
|}<br />
<br />
In order to accomplish this, we need to conform to accepted coding standards and submission<br />
practices.<br />
<br />
=== Kernel submission guidelines ===<br />
The kernel source tree contains some guidelines (many of which are listed here) for patch submissions to kernel.org. See the files: [http://lxr.linux.no/source/Documentation/SubmittingDrivers Documentation/SubmittingDrivers]<br />
and [http://lxr.linux.no/source/Documentation/SubmittingPatches Documentation/SubmittingPatches] for details.<br />
<br />
=== Coding style ===<br />
For kernel code, please follow the kernel coding guidelines which are found in the file [http://lxr.linux.no/source/Documentation/CodingStyle Documentation/CodingStyle]<br />
<br />
=== Andrew's "perfect patch" instructions ===<br />
Andrew Morton, an important kernel developer who manages thousands of patches for the kernel development process, wrote a set of guidelines for submittingpatches. It is at:<br />
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt<br />
<br />
=== Jeff Garzik's patch instructions ===<br />
http://linux.yyz.us/patch-format.html<br />
<br />
=== Useful Linux Kernel Scripts ===<br />
* scripts/checkpatch.pl -strict -- checks your patch for obvious style errors<br />
* scripts/get_maintainer.pl -- get the email adresses of the maintainers and the people who might be interested in your patch<br />
<br />
=== Git ===<br />
Creating and sending emails is very easy and far less error prone with [[git]] - see [[git#Additional_Resources]] for more information.<br />
<br />
== Example ==<br />
The following example shows a patch which was submitted to the Bootup Times Working Group. This example is not optimal, since it was made relative to a 2.4.20 kernel, rather than the CELF tree, but it demonstrates most of the conventions described above.<br />
<br />
<pre><br />
Subject: [PATCH] Patch for pre-calculated loops_per_jiffy<br />
<br />
Attached is a patch which allows for setting a pre-calculated<br />
loops_per_jiffy. This patch was derived from the CONFIG_INSTANT_ON<br />
feature in the CELF source tree, which was developed by MontaVista.<br />
This feature is already available in the CELF source tree, for the<br />
OMAP board.<br />
<br />
loops_per_jiffy (LPJ) is the value used internally<br />
by the kernel for the delay() function. Normally, LPJ is<br />
determined at boot time by the routine calibrate_delay(), in<br />
init/main.c. This routine takes approximately 250 ms to complete<br />
on my test machine. Note that the routine uses a sequence of programmed<br />
waits to determine the correct LPJ value, with each wait taking about 1 HZ<br />
(usually 10 ms) period. With a pre-calculated value, this calibration<br />
is eliminated.<br />
<br />
This patch is currently against a linux 2.4.20 kernel, for the x86<br />
architecture.<br />
<br />
When the patch is applied, a new option appears in the General setup<br />
menu of menuconfig: "Fast booting". When this option is enabled, you<br />
are asked to set the value of another new option: 'Loops per jiffy'.<br />
These set the config variables CONFIG_FASTBOOT and CONFIG_FASTBOOT_LPJ.<br />
<br />
diffstat for this patch is:<br />
Documentation/Configure.help | 23 +++++++++++++++++++++++<br />
arch/i386/config.in | 6 ++++++<br />
init/main.c | 13 +++++++++++++<br />
3 files changed, 42 insertions(+)<br />
<br />
To apply the patch, in the root of a kernel tree use:<br />
patch -p1 <fastboot_lpj.patch<br />
<br />
To use the patch, apply it and boot your machine with Fast booting<br />
off. You can determine the correct value for Loops per jiffy by examining<br />
the printk output from the kernel boot. Now configure the kernel with<br />
Fast booting on, and with the correct LPJ value.<br />
<br />
Alternatively, you can set the LPJ value to 5000 times the value of<br />
BogoMips, if you know that for your target.<br />
<br />
With this patch applied (and configured) you should notice an<br />
approximately 1/4 second speedup in booting.<br />
<br />
You may want to use the time_bootup patch I sent previously to measure<br />
this improvement.<br />
<br />
The technology in this patch is architecture-independent.<br />
<br />
Please let me know any feedback you have on this patch or the approach used.<br />
<br />
Thanks,<br />
<br />
=====================<br />
Tim Bird<br />
Senior Staff Engineer<br />
Linux Architecture and Standards<br />
Platform Technology Center of America<br />
Sony Electronics<br />
=====================<br />
<br />
Signed-off-by: Tim Bird <tim.bird@am.sony.com><br />
<br />
--------------------------------------------------------------------------------<br />
diff -u -ruN linux-2.4.20.orig/Documentation/Configure.help linux-2.4.20/Documentation/Configure.help<br />
--- linux-2.4.20.orig/Documentation/Configure.help Thu Nov 28 15:53:08 2002<br />
+++ linux-2.4.20/Documentation/Configure.help Tue Sep 30 15:32:35 2003<br />
@@ -5274,6 +5274,29 @@<br />
replacement for kerneld.) Say Y here and read about configuring it<br />
in <file:Documentation/kmod.txt>.<br />
<br />
+Fast booting support<br />
+CONFIG_FASTBOOT<br />
+ Say Y here to enable faster booting of the Linux kernel. If you say<br />
+ Y here, you will be asked to provide hardcoded values for some<br />
+ parameters that the kernel usually probes for or determines at boot<br />
+ time. This is primarily of interest in embedded devices where<br />
+ quick boot time is a requirement.<br />
+<br />
+ If unsure, say N.<br />
+<br />
+Fast boot loops-per-jiffy<br />
+CONFIG_FASTBOOT_LPJ<br />
+ This is the number of loops passed to delay() to achieve a single<br />
+ HZ of delay inside the kernel. It is roughly BogoMips * 5000.<br />
+ To determine the correct value for your kernel, first turn off<br />
+ the fast booting option, compile and boot the kernel on your target<br />
+ hardware, then see what value is printed during the kernel boot.<br />
+ Use that value here.<br />
+<br />
+ If unsure, don't use the fast booting option. An incorrect value<br />
+ will cause delays in the kernel to be incorrect. Although unlikely,<br />
+ in the extreme case this might damage your hardware.<br />
+<br />
ARP daemon support<br />
CONFIG_ARPD<br />
Normally, the kernel maintains an internal cache which maps IP<br />
diff -u -ruN linux-2.4.20.orig/arch/i386/config.in linux-2.4.20/arch/i386/config.in<br />
--- linux-2.4.20.orig/arch/i386/config.in Thu Nov 28 15:53:09 2002<br />
+++ linux-2.4.20/arch/i386/config.in Tue Sep 30 15:33:04 2003<br />
@@ -316,6 +316,12 @@<br />
bool ' Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF<br />
fi<br />
<br />
+bool "Fast booting" CONFIG_FASTBOOT<br />
+if [ "$CONFIG_FASTBOOT" == "y" ]; then<br />
+ define_int CONFIG_DEFAULT_LPJ 414720<br />
+ int ' Loops per jiffy' CONFIG_FASTBOOT_LPJ $CONFIG_DEFAULT_LPJ<br />
+fi<br />
+<br />
endmenu<br />
<br />
source drivers/mtd/Config.in<br />
diff -u -ruN linux-2.4.20.orig/init/main.c linux-2.4.20/init/main.c<br />
--- linux-2.4.20.orig/init/main.c Fri Aug 2 17:39:46 2002<br />
+++ linux-2.4.20/init/main.c Tue Sep 30 15:32:04 2003<br />
@@ -164,6 +164,12 @@<br />
<br />
loops_per_jiffy == (1<<12);<br />
<br />
+#ifdef CONFIG_FASTBOOT_LPJ<br />
+ loops_per_jiffy == CONFIG_FASTBOOT_LPJ;<br />
+ printk("Calibrating delay loop (skipped)... ");<br />
+<br />
+#else /* CONFIG_FASTBOOT */<br />
+<br />
printk("Calibrating delay loop... ");<br />
while (loops_per_jiffy <<== 1) {<br />
/* wait for "start of" clock tick */<br />
@@ -192,10 +198,17 @@<br />
loops_per_jiffy &== ~loopbit;<br />
}<br />
<br />
+#endif /* CONFIG_FASTBOOT_LPJ */<br />
+<br />
/* Round the value and print it */<br />
printk("%lu.%02lu BogoMIPS\n",<br />
loops_per_jiffy/(500000/HZ),<br />
(loops_per_jiffy/(5000/HZ)) % 100);<br />
+<br />
+#ifndef CONFIG_FASTBOOT_LPJ<br />
+ printk("Use 'Loops per jiffy'==%lu for fast boot.\n",<br />
+ loops_per_jiffy);<br />
+#endif /* CONFIG_FASTBOOT_LPJ */<br />
}<br />
<br />
static int __init debug_kernel(char *str)<br />
</pre><br />
<br />
[[Category:HOWTOs]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=324518Scripting2014-04-26T22:43:15Z<p>Const: /* Historical */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
* http://www.techbar.me/linux-shell-tips/<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** [http://www.makelinux.net/man/1/S/shtool man shtool]<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
** Most useful functions: make-debug, trap_err, readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
** Regular operations implelented in shell. Usedfull on out of memory (OOM) when there is no memory to run external programms.<br />
** easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=324512Scripting2014-04-26T22:32:19Z<p>Const: /* Shell scripting */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
* http://www.techbar.me/linux-shell-tips/<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** [http://www.makelinux.net/man/1/S/shtool man shtool]<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
** Most useful functions: make-debug, trap_err, readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
** Usually operations implelented in sheel. Usedfull on out of memory (OOM) when there is no memory to run external programms.<br />
** easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=324506Scripting2014-04-26T21:55:13Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** [http://www.makelinux.net/man/1/S/shtool man shtool]<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
** Most useful functions: make-debug, trap_err, readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
** Usually operations implelented in sheel. Usedfull on out of memory (OOM) when there is no memory to run external programms.<br />
** easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=324500Scripting2014-04-26T21:10:13Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** [http://www.makelinux.net/man/1/S/shtool man shtool]<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
** Most useful functions: readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
** Usually operations implelented in sheel. Usedfull on out of memory (OOM) when there is no memory to run external programms.<br />
** easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=313100Scripting2014-01-19T11:19:30Z<p>Const: /* Historical */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
** Most useful functions: readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
** Usually operations implelented in sheel. Usedfull on out of memory (OOM) when there is no memory to run external programms.<br />
** easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=311678Scripting2014-01-11T12:57:58Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
** Most useful functions: readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=311672Scripting2014-01-11T12:57:20Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** Single script, 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
*** Most useful functions: readline-bindings, duplicates, fs_usage, system_status_short, git_fixup, tcpdump-text, git_ign_add, for_each, mem_avail_kb<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=311648Scripting2014-01-10T20:42:38Z<p>Const: /* Specialized frameworks and libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks] - something messy <br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=311642Scripting2014-01-10T20:33:45Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Specialized frameworks and libraries====<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=311636Scripting2014-01-10T20:27:47Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** Portable wrappers to standard operations<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** Most in interesting functions: 015-newrm.sh, 016-unrm.sh, 021-findman.sh, 029-loancalc.sh, 037-zcat.sh, 038-bestcompress.sh, 040-diskhogs.sh, 084-webaccess.sh, 100-hangman.sh<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=311504Scripting2014-01-08T22:23:40Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** Weird <br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=311498Scripting2014-01-08T22:18:47Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool] The GNU Portable Shell Tool<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=310838Scripting2014-01-04T19:05:55Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool]<br />
** Official GNU project<br />
** 3000 SLOC, 19 functions, bloated<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Complicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Complicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=310832Scripting2014-01-04T19:01:07Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool]<br />
** Official GNU project<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=310826Scripting2014-01-04T19:00:35Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://www.gnu.org/software/shtool/ shtool]<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=310202Scripting2013-12-29T22:09:30Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** Indeed cool shell scripts, worth to read<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
* [https://github.com/makelinux/lib lib.sh]<br />
** 300 SLOC, 40 functions and aliases <br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309962Scripting2013-12-26T00:02:43Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309956Scripting2013-12-26T00:02:08Z<p>Const: /* Historical */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts, 2004, samples]<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309950Scripting2013-12-26T00:01:08Z<p>Const: /* Historical */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
** 4000 SLOC, 100 files-functions<br />
** Easy to use<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309944Scripting2013-12-26T00:00:42Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files-functions<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
** 4000 SLOC, 100 files-functions<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309920Scripting2013-12-24T23:34:08Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
** 1000 SLOC, 33 files (functions)<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309914Scripting2013-12-24T23:18:53Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
====References====<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309686Scripting2013-12-22T22:39:17Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples], 62 files<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007], 99 files <br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]. 82 files<br />
<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309680Scripting2013-12-22T22:23:42Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** 300 SLOC, 20 functions, simple wrapper functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples]<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007]<br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309674Scripting2013-12-22T22:12:38Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
** 700 SLOC, 30 functions<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** Some short functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples]<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007]<br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309656Scripting2013-12-22T19:40:48Z<p>Const: /* Shell scripting libraries */</p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
** loads and unloads functions from scripts with commands source and unset<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** Some short functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples]<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007]<br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309632Scripting2013-12-22T19:30:52Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging framework]<br />
** logging framework for shell scripts that works similar to http://logging.apache.org/<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** Some short functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples]<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007]<br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
See also<br />
* [[Android Scripting]]</div>Consthttps://elinux.org/index.php?title=Scripting&diff=309620Scripting2013-12-22T00:26:27Z<p>Const: </p>
<hr />
<div>Scripting is powerful technology especially valuable in embbedded Linux. It is used for building complex projects, building root file systems and distributions, system management, tests automation. <br />
<br />
Most commons shells are [http://www.gnu.org/software/bash/ bash] on PC and busybox's [http://en.wikipedia.org/wiki/Almquist_shell ash] on embedded Linux.<br />
==Shell scripting==<br />
* [http://www.gnu.org/software/bash/manual/bash.html Bash Reference Manual]<br />
* [http://www.makelinux.net/books/Bash-Beginners-Guide/ Bash Guide for Beginners]<br />
* [http://www.makelinux.net/books/abs-guide/ Advanced Bash-Scripting Guide] <br />
* [http://www.makelinux.net/books/GNU-Linux-Tools-Summary/GNU/Linux Command-Line Tools Summary]<br />
* http://wiki.bash-hackers.org/<br />
* http://bash.cyberciti.biz/<br />
* [http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html Top 10 Best Cheat Sheets and Tutorials for Linux / UNIX Commands]<br />
* http://wiki.bash-hackers.org/<br />
* https://wiki.archlinux.org/index.php/bash<br />
<br />
===Shell scripting libraries===<br />
<br />
* [http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/ List of Bash shell-scripting libraries]<br />
* [http://marcomaggi.github.io/docs/mbfl.html mbfl - Marco's Bash Functions Library]<br />
** 5000 SLOC, 500 functions, bloated<br />
** The philosophy of MBFL is to do the work as much as possible without external commands.<br />
** Сomplicated to use<br />
* [http://www.bashinator.org/ Bashinator]<br />
** Logging framework<br />
** 700 SLOC, 18 functions<br />
** Сomplicated to use<br />
* [http://code.google.com/p/bsfl/ bsfl - Bash Shell Function Library ]<br />
** 600 SLOC, 50 functions, logging functions, trivial wrappers<br />
** Easy to use<br />
* [http://code.google.com/p/shesfw/ shesfw - Shell Script Framework tool]<br />
** 200 SLOC, 20 functions<br />
** unified interface to kdialog, Xdialog, zenity<br />
* [http://code.google.com/p/shunit2/ shUnit2 - xUnit based unit testing for Unix shell scripts]<br />
* [https://sites.google.com/a/forestent.com/projects/log4sh log4sh - logging facility]<br />
* [http://sourceforge.net/projects/libbash/ libbash - tool for managing bash scripts]<br />
* [https://github.com/jpic/bashworks bashworks]<br />
* [https://github.com/rerun/rerun/blob/master/README.md rerun - a modular shell automation framework to organize your keeper scripts]<br />
* [https://github.com/lmartinking/monkey-tail @ aka monkey-tail]<br />
** Some short functions<br />
** Easy to use<br />
====Samples from books====<br />
* [http://examples.oreilly.com/9781565923478/ Learning the bash shell, 2005, samples]<br />
* [http://examples.oreilly.com/9780596526788/ Bash Cookbook, 2007]<br />
* [http://examples.oreilly.com/9780596005955/ Classic Shell Scripting, 2005]<br />
====Historical====<br />
* [http://examples.oreilly.com/9780596003302/ UNIX Power Tools, 1997, samples]<br />
* [http://www.cs.uleth.ca/~holzmann/C/shells/shell_book_blinn/ Portable Shell Programming, 1995, samples]<br />
* [http://intuitive.com/wicked/wicked-cool-shell-script-library.shtml Wicked Cool Shell Scripts]<br />
See also<br />
* [[Android Scripting]]</div>Const