├── patches ├── kernel-img.conf ├── apt │ ├── 99progressbar │ ├── 90-xapt-periodic │ ├── 01proxy │ ├── udoo.preferences │ ├── udoo.list │ ├── nodejs.list │ ├── wyliodrin.list │ └── sources.list ├── autologin.accountservice ├── autologin.lightdm ├── fstab ├── hosts ├── 90-st1232touchscreen.conf ├── 91-3m_touchscreen.conf ├── g_multi.conf ├── ttymxc0.conf ├── ttymxc1.conf ├── network-interfaces ├── neo-audio │ ├── asound.conf │ └── asound.state ├── ttyGS0.conf ├── x11vnc.conf ├── rc.local ├── 10-help-text ├── firstrun └── g_multi.sh ├── boards ├── a62 │ ├── uEnv.txt │ ├── uboot.imx │ ├── uboot_dl.imx │ ├── uboot_s.imx │ └── board.conf ├── udoo-qdl │ ├── uEnv.txt │ ├── uboot.imx │ └── board.conf └── udoo-neo │ ├── uboot.imx │ ├── uEnv.txt │ └── board.conf ├── .gitignore ├── tools ├── make-qdl-sataimg.sh ├── make-uboot-neo.sh └── make-uboot-qdl.sh ├── README.md ├── include ├── imager.sh ├── debootstrap.sh └── configure.sh ├── mkudoobuntu.sh └── LICENSE /patches/kernel-img.conf: -------------------------------------------------------------------------------- 1 | do_symlinks = no -------------------------------------------------------------------------------- /patches/apt/99progressbar: -------------------------------------------------------------------------------- 1 | Dpkg::Progress-Fancy "1"; 2 | -------------------------------------------------------------------------------- /patches/apt/90-xapt-periodic: -------------------------------------------------------------------------------- 1 | APT::Periodic::Enable "0"; 2 | -------------------------------------------------------------------------------- /boards/a62/uEnv.txt: -------------------------------------------------------------------------------- 1 | #save this file with unix-like newlines! (\n, 0x0A) 2 | -------------------------------------------------------------------------------- /boards/udoo-qdl/uEnv.txt: -------------------------------------------------------------------------------- 1 | #save this file with unix-like newlines! (\n, 0x0A) 2 | -------------------------------------------------------------------------------- /patches/autologin.accountservice: -------------------------------------------------------------------------------- 1 | [User] 2 | XSession=Lubuntu 3 | SystemAccount=false 4 | -------------------------------------------------------------------------------- /boards/a62/uboot.imx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UDOOboard/mkudoobuntu/HEAD/boards/a62/uboot.imx -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | rootfs 2 | sdcard 3 | udoo-* 4 | debootstrap_*.tar.gz 5 | *.img 6 | *.zip 7 | *~ 8 | a62 9 | -------------------------------------------------------------------------------- /boards/a62/uboot_dl.imx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UDOOboard/mkudoobuntu/HEAD/boards/a62/uboot_dl.imx -------------------------------------------------------------------------------- /boards/a62/uboot_s.imx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UDOOboard/mkudoobuntu/HEAD/boards/a62/uboot_s.imx -------------------------------------------------------------------------------- /patches/apt/01proxy: -------------------------------------------------------------------------------- 1 | Acquire::http::Proxy "http://127.0.0.1:3142"; 2 | Acquire::https::Proxy "DIRECT"; -------------------------------------------------------------------------------- /patches/apt/udoo.preferences: -------------------------------------------------------------------------------- 1 | Package: * 2 | Pin: origin repository.udoo.org 3 | Pin-Priority: 1001 4 | -------------------------------------------------------------------------------- /boards/udoo-neo/uboot.imx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UDOOboard/mkudoobuntu/HEAD/boards/udoo-neo/uboot.imx -------------------------------------------------------------------------------- /boards/udoo-qdl/uboot.imx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UDOOboard/mkudoobuntu/HEAD/boards/udoo-qdl/uboot.imx -------------------------------------------------------------------------------- /patches/autologin.lightdm: -------------------------------------------------------------------------------- 1 | [SeatDefaults] 2 | autologin-user=USERNAMEPWD 3 | autologin-user-timeout=0 4 | -------------------------------------------------------------------------------- /patches/apt/udoo.list: -------------------------------------------------------------------------------- 1 | deb http://repository.udoo.org udoobuntu main 2 | #deb-src http://repository.udoo.org udoobuntu main 3 | -------------------------------------------------------------------------------- /patches/apt/nodejs.list: -------------------------------------------------------------------------------- 1 | deb https://deb.nodesource.com/node_5.x UBUNTURELEASE main 2 | deb-src https://deb.nodesource.com/node_5.x UBUNTURELEASE main 3 | -------------------------------------------------------------------------------- /patches/fstab: -------------------------------------------------------------------------------- 1 | /dev/mmcblk0p2 / ext4 defaults,noatime 0 0 2 | /dev/mmcblk0p1 /boot vfat defaults,noatime 0 0 3 | -------------------------------------------------------------------------------- /patches/apt/wyliodrin.list: -------------------------------------------------------------------------------- 1 | deb http://repository.udoo.org/extras/wyliodrin trusty main 2 | #deb-src http://repository.udoo.org/extras/wyliodrin trusty main 3 | -------------------------------------------------------------------------------- /boards/udoo-neo/uEnv.txt: -------------------------------------------------------------------------------- 1 | #save this file with unix-like newlines! (\n, 0x0A) 2 | 3 | video_output=hdmi 4 | m4_enabled=true 5 | #m4last=/path/to/arduino/sketch.fw 6 | #fdt_file=/path/to/custom/devicetree.dtb 7 | -------------------------------------------------------------------------------- /patches/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost THISHOST 2 | ::1 localhost THISHOST ip6-localhost ip6-loopback 3 | fe00::0 ip6-localnet 4 | ff00::0 ip6-mcastprefix 5 | ff02::1 ip6-allnodes 6 | ff02::2 ip6-allrouters 7 | -------------------------------------------------------------------------------- /patches/90-st1232touchscreen.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "Touchscreen" 3 | MatchProduct "st1232-touchscreen" 4 | Driver "evdev" 5 | Option "Calibration" "3 794 476 0" 6 | EndSection 7 | -------------------------------------------------------------------------------- /patches/91-3m_touchscreen.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "calibration" 3 | MatchProduct "3M 3M USB Touchscreen - EX II" 4 | Option "Calibration" "1853 14628 2589 14106" 5 | Option "SwapAxes" "1" 6 | EndSection 7 | -------------------------------------------------------------------------------- /patches/g_multi.conf: -------------------------------------------------------------------------------- 1 | # 2 | # g_multi - g_multi start script 3 | # 4 | 5 | author "Ettore Chimenti" 6 | description "USB Gadget Script" 7 | 8 | start on local-filesystems 9 | stop on deconfiguring-networking 10 | 11 | exec /usr/sbin/g_multi.sh 12 | 13 | -------------------------------------------------------------------------------- /patches/ttymxc0.conf: -------------------------------------------------------------------------------- 1 | start on stopped rc RUNLEVEL=[2345] 2 | stop on runlevel [!2345] 3 | 4 | respawn 5 | 6 | pre-start script 7 | 8 | test -c /dev/ttymxc0 || { stop; exit 0; } 9 | 10 | end script 11 | 12 | exec /sbin/getty --noclear 115200 ttymxc0 13 | -------------------------------------------------------------------------------- /patches/ttymxc1.conf: -------------------------------------------------------------------------------- 1 | start on stopped rc RUNLEVEL=[2345] 2 | stop on runlevel [!2345] 3 | 4 | respawn 5 | 6 | pre-start script 7 | 8 | test -c /dev/ttymxc1 || { stop; exit 0; } 9 | 10 | end script 11 | 12 | exec /sbin/getty --noclear 115200 ttymxc1 13 | -------------------------------------------------------------------------------- /patches/network-interfaces: -------------------------------------------------------------------------------- 1 | # Loopback network interface 2 | auto lo 3 | iface lo inet loopback 4 | 5 | # Primary network interface 6 | #auto eth0 7 | #iface eth0 inet dhcp 8 | 9 | # USB OTG connection 10 | allow-hotplug usb0 11 | iface usb0 inet static 12 | address 192.168.7.2 13 | netmask 255.255.255.252 14 | -------------------------------------------------------------------------------- /patches/neo-audio/asound.conf: -------------------------------------------------------------------------------- 1 | pcm.softvol { 2 | type softvol 3 | slave { 4 | pcm "cards.pcm.default" 5 | } 6 | control { 7 | name "Master" 8 | card 0 9 | } 10 | } 11 | 12 | pcm.!default { 13 | type plug 14 | slave.pcm "softvol" 15 | } 16 | -------------------------------------------------------------------------------- /patches/neo-audio/asound.state: -------------------------------------------------------------------------------- 1 | state.imxaudiotda1998 { 2 | control.1 { 3 | iface MIXER 4 | name Master 5 | value.0 255 6 | value.1 255 7 | comment { 8 | access 'read write user' 9 | type INTEGER 10 | count 2 11 | range '0 - 255' 12 | tlv '00000001000000080000000000000014' 13 | dbmin 0 14 | dbmax 5100 15 | dbvalue.0 5100 16 | dbvalue.1 5100 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /patches/ttyGS0.conf: -------------------------------------------------------------------------------- 1 | # 2 | # g_multi - g_multi serial 3 | # 4 | 5 | author "Ettore Chimenti" 6 | description "USB Gadget Serial" 7 | 8 | start on tty-device-added DEVNAME=*ttyGS0 9 | stop on stopping g_multi 10 | 11 | respawn 12 | 13 | pre-start script 14 | 15 | test -c /dev/ttyGS0 || { stop; exit 0; } 16 | if [ -f /etc/disable_getty_GS0 ]; then 17 | stop; exit 0; 18 | fi 19 | 20 | end script 21 | 22 | exec /sbin/getty --noclear 115200 ttyGS0 23 | -------------------------------------------------------------------------------- /patches/x11vnc.conf: -------------------------------------------------------------------------------- 1 | 2 | author "Ettore Chimenti" 3 | description "UDOO x11VNC Server" 4 | 5 | start on login-session-start 6 | stop on deconfiguring-networking 7 | 8 | pre-start script 9 | test -x /usr/bin/x11vnc || { stop; exit 0; } 10 | end script 11 | 12 | script 13 | /usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 \ 14 | -rfbauth /etc/x11vnc.pass -forever -bg \ 15 | -rfbport 5900 -o /var/log/x11vnc.log 16 | end script 17 | -------------------------------------------------------------------------------- /patches/rc.local: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # rc.local 4 | # 5 | # This script is executed at the end of each multiuser runlevel. 6 | # Make sure that the script will "exit 0" on success or any other 7 | # value on error. 8 | # 9 | # In order to enable or disable this script just change the execution 10 | # bits. 11 | # 12 | # By default this script does nothing. 13 | 14 | if [ `date +"%Y"` -eq "1970" ]; then 15 | date --set="2017-01-01" 16 | fi 17 | 18 | if [ -x "/udoo-autostart.sh" ]; then 19 | /udoo-autostart.sh & 20 | fi 21 | 22 | exit 0 23 | -------------------------------------------------------------------------------- /patches/apt/sources.list: -------------------------------------------------------------------------------- 1 | deb http://ports.ubuntu.com/ubuntu-ports/ UBUNTURELEASE main universe multiverse 2 | deb http://ports.ubuntu.com/ubuntu-ports/ UBUNTURELEASE-updates main universe multiverse 3 | deb http://ports.ubuntu.com/ubuntu-ports/ UBUNTURELEASE-security main universe multiverse 4 | 5 | #deb-src http://ports.ubuntu.com/ubuntu-ports/ UBUNTURELEASE main universe multiverse 6 | #deb-src http://ports.ubuntu.com/ubuntu-ports/ UBUNTURELEASE-updates main universe multiverse 7 | #deb-src http://ports.ubuntu.com/ubuntu-ports/ UBUNTURELEASE-security main universe multiverse 8 | -------------------------------------------------------------------------------- /tools/make-qdl-sataimg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Francesco Montefoschi 3 | # License: GNU GPL version 2 4 | 5 | if [ "$#" -ne 1 ]; then 6 | echo "Please call this script with u-boot-imx repo path as first argument." 7 | exit 1 8 | fi 9 | 10 | args=("$@") 11 | ubootdir=${args[0]} 12 | OUTPUT=/tmp/qdl-sata.img 13 | 14 | cd $ubootdir 15 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make clean 16 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make udoo_qd_sata_config 17 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j8 18 | cd - 19 | 20 | if [ ! -e $ubootdir/SPL ]; then 21 | echo "SPL file missing! Check build messages for errors." 22 | exit 1 23 | fi 24 | 25 | if [ ! -e $ubootdir/u-boot.img ]; then 26 | echo "u-boot.img file missing! Check build messages for errors." 27 | exit 1 28 | fi 29 | 30 | truncate $OUTPUT --size 1M 31 | dd if=$ubootdir/SPL of=$OUTPUT bs=1K seek=1 conv=notrunc 32 | dd if=$ubootdir/u-boot.img of=$OUTPUT bs=1K seek=69 conv=notrunc 33 | 34 | echo "Your SD image for SATA boot is in $OUTPUT" 35 | 36 | -------------------------------------------------------------------------------- /tools/make-uboot-neo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Francesco Montefoschi 3 | # License: GNU GPL version 2 4 | 5 | if [ "$#" -ne 1 ]; then 6 | echo "Please call this script with u-boot-imx repo path as first argument." 7 | exit 1 8 | fi 9 | 10 | args=("$@") 11 | ubootdir=${args[0]} 12 | binarydir="$(dirname "$(pwd)")/boards/udoo-neo" 13 | targetfile="uboot.imx" 14 | 15 | cd $ubootdir 16 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make clean 17 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make udoo_neo_config 18 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j8 19 | cd - 20 | 21 | if [ ! -e $ubootdir/SPL ]; then 22 | echo "SPL file missing! Check build messages for errors." 23 | exit 1 24 | fi 25 | 26 | if [ ! -e $ubootdir/u-boot.img ]; then 27 | echo "u-boot.img file missing! Check build messages for errors." 28 | exit 1 29 | fi 30 | 31 | truncate $binarydir/$targetfile --size 500k 32 | dd if=$ubootdir/SPL of=$binarydir/$targetfile bs=1K seek=0 conv=notrunc 33 | dd if=$ubootdir/u-boot.img of=$binarydir/$targetfile bs=1K seek=68 34 | 35 | echo "Your u-boot is in $binarydir/$targetfile" 36 | 37 | -------------------------------------------------------------------------------- /tools/make-uboot-qdl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Francesco Montefoschi 3 | # License: GNU GPL version 2 4 | 5 | if [ "$#" -ne 1 ]; then 6 | echo "Please call this script with u-boot-imx repo path as first argument." 7 | exit 1 8 | fi 9 | 10 | args=("$@") 11 | ubootdir=${args[0]} 12 | binarydir="$(dirname "$(pwd)")/boards/udoo-qdl" 13 | targetfile="uboot.imx" 14 | 15 | cd $ubootdir 16 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make clean 17 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make udoo_qd_config 18 | ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j8 19 | cd - 20 | 21 | if [ ! -e $ubootdir/SPL ]; then 22 | echo "SPL file missing! Check build messages for errors." 23 | exit 1 24 | fi 25 | 26 | if [ ! -e $ubootdir/u-boot.img ]; then 27 | echo "u-boot.img file missing! Check build messages for errors." 28 | exit 1 29 | fi 30 | 31 | truncate $binarydir/$targetfile --size 500k 32 | dd if=$ubootdir/SPL of=$binarydir/$targetfile bs=1K seek=0 conv=notrunc 33 | dd if=$ubootdir/u-boot.img of=$binarydir/$targetfile bs=1K seek=68 34 | 35 | echo "Your u-boot is in $binarydir/$targetfile" 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## mkudoobuntu 2 | This script creates SD-card images for UDOO boards. It supports both desktop and 3 | headless images. The created images are as small as possible and expanded to the 4 | whole card size during the first boot. 5 | 6 | ### Usage 7 | To debootstrap a new unnamed image, use: 8 | 9 | sudo ./mkudoobuntu.sh 10 | 11 | Branded-release images can be generated with: 12 | 13 | sudo RELEASE="2.0 Beta6" ./mkudoobuntu.sh 14 | 15 | To edit a previously debootstrapped rootfs, use: 16 | 17 | sudo ./mkudoobuntu.sh 18 | 19 | `` can be: `udoo-qdl`, `udoo-neo`. 20 | 21 | `` can be: 22 | * `install`: Install a deb in rootfs from repos 23 | * `remove`: Remove a deb from rootfs 24 | * `list`: List installed pkg in rootfs 25 | * `reimage`: Make a new image from a modified rootfs 26 | * `shell`: Open an interactive shell in a rootfs 27 | 28 | ### Prerequisites 29 | This script has been tested on Ubuntu 16.10, 16.04, 15.10, 15.04 and 14.04. 30 | It may work on other Debian-like system. 31 | 32 | ### Supported boards 33 | 1. UDOO Quad 34 | 2. UDOO Dual 35 | 3. UDOO Neo (Basic, Extended, Full) 36 | 37 | ### Misc sources 38 | Original work: 39 | https://github.com/igorpecovnik/lib 40 | 41 | U-Boot: 42 | https://github.com/UDOOboard/uboot-imx 43 | 44 | Kernel: 45 | https://github.com/UDOOboard/linux_kernel/ 46 | -------------------------------------------------------------------------------- /patches/10-help-text: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 10-help-text - print the help text associated with the distro 4 | # Copyright (C) 2009-2010 Canonical Ltd. 5 | # 6 | # Authors: Dustin Kirkland , 7 | # Brian Murray 8 | # 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License along 20 | # with this program; if not, write to the Free Software Foundation, Inc., 21 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 22 | 23 | [ -r /etc/lsb-release ] && . /etc/lsb-release 24 | 25 | if [ -z "$DISTRIB_RELEASE" ] && [ -x /usr/bin/lsb_release ]; then 26 | # Fall back to using the very slow lsb_release utility 27 | DISTRIB_RELEASE=$(lsb_release -sr) 28 | fi 29 | 30 | URL="http://www.udoo.org/docs/" 31 | if grep -qs "Neo" /proc/device-tree/model; then 32 | URL="http://www.udoo.org/docs-neo/" 33 | fi 34 | 35 | printf "\n * Documentation: %s\n" "$URL" 36 | -------------------------------------------------------------------------------- /boards/udoo-qdl/board.conf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # UU 4 | # U UU UU 5 | # UU UU UU 6 | # UU UU UU UU 7 | # UU UU UU UU 8 | # UU UUU UU UU Filesystem Builder 9 | # 10 | # UUUUUUUUUUUUUU DDDDDDDDDD OOOOOOOO OOOOOOOOO 11 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOO OOOOOOOOOOOOO 12 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 13 | # UUUUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 14 | # UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 15 | # UUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOOOO OOOOOOOOOOOOOO 16 | # UUUUUUUUUU DDDDDDDDDDD OOOOOOOOOO OOOOOOOOOO 17 | # 18 | # Author: Francesco Montefoschi 19 | # Author: Ettore Chimenti 20 | # Based on: Igor Pečovnik's work - https://github.com/igorpecovnik/lib 21 | # License: GNU GPL version 2 22 | # 23 | ################################################################################ 24 | 25 | ROOTPWD="ubuntu" 26 | USERNAMEPWD="udooer" 27 | CPUMIN="392000" 28 | CPUMAX="996000" 29 | HOSTNAME="udoo" 30 | FLAVOURS=( minimal desktop ) 31 | 32 | 33 | BASE_PACKAGES+=( linux-udooqdl firmware-ralink udev-udooqdl-rules ) 34 | 35 | PACKAGES_minimal=( imx-gpu-viv-9t6-acc-fb imx-gpu-viv-9t6-test ) 36 | PACKAGES_desktop=( $UDOOLXDE gstreamer1.0-pulseaudio arduino-core-udooqdl udoo-web-conf ) 37 | -------------------------------------------------------------------------------- /boards/a62/board.conf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # UU 4 | # U UU UU 5 | # UU UU UU 6 | # UU UU UU UU 7 | # UU UU UU UU 8 | # UU UUU UU UU Filesystem Builder 9 | # 10 | # UUUUUUUUUUUUUU DDDDDDDDDD OOOOOOOO OOOOOOOOO 11 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOO OOOOOOOOOOOOO 12 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 13 | # UUUUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 14 | # UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 15 | # UUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOOOO OOOOOOOOOOOOOO 16 | # UUUUUUUUUU DDDDDDDDDDD OOOOOOOOOO OOOOOOOOOO 17 | # 18 | # Author: Francesco Montefoschi 19 | # Author: Ettore Chimenti 20 | # Based on: Igor Pečovnik's work - https://github.com/igorpecovnik/lib 21 | # License: GNU GPL version 2 22 | # 23 | ################################################################################ 24 | 25 | ROOTPWD="ubuntu" 26 | USERNAMEPWD="udooer" 27 | CPUMIN="392000" 28 | CPUMAX="996000" 29 | HOSTNAME="SBC-A62" 30 | FLAVOURS=( minimal desktop ) 31 | 32 | 33 | BASE_PACKAGES+=( linux-3.14.28-a62 firmware-ralink udev-udooqdl-rules ) 34 | 35 | UNWANTED_PACKAGES+=( bluefish scratch udoo-gpio-export dtweb transmission-gtk ) 36 | 37 | PACKAGES_minimal=( imx-gpu-viv-9t6-acc-fb imx-gpu-viv-9t6-test ) 38 | PACKAGES_desktop=( $UDOOLXDE gstreamer1.0-pulseaudio ) 39 | -------------------------------------------------------------------------------- /boards/udoo-neo/board.conf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # UU 4 | # U UU UU 5 | # UU UU UU 6 | # UU UU UU UU 7 | # UU UU UU UU 8 | # UU UUU UU UU Filesystem Builder 9 | # 10 | # UUUUUUUUUUUUUU DDDDDDDDDD OOOOOOOO OOOOOOOOO 11 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOO OOOOOOOOOOOOO 12 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 13 | # UUUUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 14 | # UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 15 | # UUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOOOO OOOOOOOOOOOOOO 16 | # UUUUUUUUUU DDDDDDDDDDD OOOOOOOOOO OOOOOOOOOO 17 | # 18 | # Author: Francesco Montefoschi 19 | # Author: Ettore Chimenti 20 | # Based on: Igor Pečovnik's work - https://github.com/igorpecovnik/lib 21 | # License: GNU GPL version 2 22 | # 23 | ################################################################################ 24 | 25 | ROOTPWD="ubuntu" 26 | USERNAMEPWD="udooer" 27 | CPUMIN="392000" 28 | CPUMAX="996000" 29 | HOSTNAME="udooneo" 30 | FLAVOURS=( minimal desktop wyliodrin ) 31 | 32 | 33 | BASE_PACKAGES+=( linux-udooneo udoo-dhcpd 34 | firmware-udooneo-wl1831 udooneo-bluetooth udev-udooneo-rules 35 | udooneo-m4uploader udoofota-server udoofota-serial ) 36 | 37 | UNWANTED_PACKAGES+=( pavucontrol pulseaudio ) 38 | 39 | PACKAGES_desktop=( $UDOOLXDE gnome-alsamixer arduino-core-udooneo 40 | udoo-web-conf ) 41 | 42 | PACKAGES_wyliodrin=( ${PACKAGES_desktop[*]} wyliodrin ) 43 | -------------------------------------------------------------------------------- /patches/firstrun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: firstrun 5 | # Required-Start: $all 6 | # Required-Stop: 7 | # Should-Start: 8 | # Default-Start: 2 3 4 5 9 | # Default-Stop: 0 1 6 10 | # Short-Description: Script to run when first starting 11 | # Description: Something needs to be done when is 12 | # starting at first time. 13 | # regenerate ssh host key 14 | ### END INIT INFO 15 | 16 | N=/etc/init.d/firstrun 17 | 18 | set -e 19 | 20 | do_expand_rootfs(){ 21 | if grep -qs "sda2\s*/\s*" /etc/fstab; then 22 | device="/dev/sda" 23 | rootpart="/dev/sda2" 24 | elif grep -qs "mmcblk0p2\s*/\s*" /etc/fstab; then 25 | device="/dev/mmcblk0" 26 | rootpart="/dev/mmcblk0p2" 27 | else 28 | device="/dev/"$(lsblk -idn -o NAME | grep mmc) 29 | rootpart=$(mount | sed -n -e 's/ on \/ .*//p') 30 | fi 31 | 32 | PARTITIONS=$(($(fdisk -l $device | grep $device | wc -l)-1)) 33 | 34 | echo Editing the partition table... 35 | ( (echo d; echo $PARTITIONS; echo n; echo p; echo ; echo ; echo ; echo w; ) | 36 | fdisk $device )>/dev/null 37 | sync 38 | 39 | echo Probing the partition table... 40 | partx -u ${device} || return $? 41 | 42 | echo Resizing the partition... 43 | resize2fs ${rootpart} || return $? 44 | sync 45 | } 46 | 47 | regenerate_ssh_keys(){ 48 | echo "SSH keys recreation. One moment please" 49 | rm -f /etc/ssh/ssh_host* 50 | dpkg-reconfigure openssh-server 51 | rm /etc/init/ssh.override 52 | service ssh start 53 | } 54 | 55 | on_background(){ 56 | sleep 10 57 | regenerate_ssh_keys 58 | echo "Removing firstrun script" 59 | update-rc.d -f firstrun remove >/dev/null 2>&1 60 | sync 61 | } 62 | 63 | case "$1" in 64 | start) 65 | set +e 66 | echo "Expanding rootfs..." 67 | 68 | if do_expand_rootfs ; 69 | then 70 | echo "Expanding partition success" 71 | else 72 | echo "Expanding rootfs has failed, see log files. Error code: $?" 73 | fi 74 | 75 | on_background & 76 | 77 | if `rm /etc/init/lightdm.override 2>/dev/null` 78 | then 79 | service lightdm start 80 | fi 81 | ;; 82 | 83 | *) 84 | echo "Usage: $N {start}" >&2 85 | exit 1 86 | ;; 87 | esac 88 | 89 | exit 0 90 | -------------------------------------------------------------------------------- /patches/g_multi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ### 3 | # Simple g_multi start script 4 | ### 5 | # 6 | # Author: Robert C. Nelson 7 | # Modified by: Ettore Chimenti 8 | # 9 | # Original at: https://gist.github.com/5103e2035f26418c6bf9.git 10 | # 11 | #needs: sudo apt-get install udhcpd 12 | #sudo sed -i -e 's:no:yes:g' /etc/default/udhcpd 13 | 14 | H=`cat /sys/fsl_otp/HW_OCOTP_CFG0 |sed -e 's/0x//'` 15 | L=`cat /sys/fsl_otp/HW_OCOTP_CFG1 |sed -e 's/0x//'` 16 | SerialNumber=$H$L 17 | SerialNumber=${SerialNumber^^} 18 | Manufacturer="SECO-AIDILAB" 19 | Product="UDOONEO" 20 | 21 | #host_addr/dev_addr 22 | #Should be "constant" for a particular unit, if not specified g_multi/g_ether will 23 | #randomly generate these, this causes interesting problems in windows/systemd/etc.. 24 | # 25 | #systemd: ifconfig -a: (mac = device name) 26 | #enx4e719db78204 Link encap:Ethernet HWaddr 4e:71:9d:b7:82:04 27 | 28 | host_vend="4e:71:9d" 29 | dev_vend="4e:71:9e" 30 | 31 | if [ -f /sys/class/net/eth0/address ]; then 32 | #concatenate a fantasy vendor with last 3 digit of onboard eth mac 33 | address=$(cut -d: -f 4- /sys/class/net/eth0/address) 34 | elif [ -f /sys/class/net/wlan0/address ]; then 35 | address=$(cut -d: -f 4- /sys/class/net/wlan0/address) 36 | else 37 | address="aa:bb:cc" 38 | fi 39 | 40 | host_addr=${host_vend}:${address} 41 | dev_addr=${dev_vend}:${address} 42 | 43 | usb0_address="192.168.7.2" 44 | usb0_gateway="192.168.7.1" 45 | usb0_netmask="255.255.255.252" 46 | 47 | unset root_drive 48 | root_drive="$(cat /proc/cmdline | sed 's/ /\n/g' | grep root=UUID= | awk -F 'root=' '{print $2}' || true)" 49 | if [ ! "x${root_drive}" = "x" ] ; then 50 | root_drive="$(/sbin/findfs UUID=${root_drive} || true)" 51 | else 52 | root_drive="$(cat /proc/cmdline | sed 's/ /\n/g' | grep root= | awk -F 'root=' '{print $2}' || true)" 53 | fi 54 | 55 | g_network="iSerialNumber=${SerialNumber} iManufacturer=${Manufacturer}" 56 | g_network+="iProduct=${Product} host_addr=${host_addr} dev_addr=${dev_addr}" 57 | 58 | g_drive="cdrom=0 ro=0 stall=0 removable=1 nofua=1" 59 | 60 | #In a single partition setup, dont load g_multi, as we could trash the linux file system... 61 | if [ "x${root_drive}" = "x/dev/mmcblk0p1" ] || 62 | [ "x${root_drive}" = "x/dev/mmcblk1p1" ] ; then 63 | if [ -f /usr/sbin/dhcpd ] ; then 64 | #Make sure (# CONFIG_USB_ETH_EEM is not set), 65 | #otherwise this shows up as "usb0" instead of ethX on host pc.. 66 | modprobe g_ether ${g_network} || true 67 | else 68 | #serial: 69 | modprobe g_serial || true 70 | fi 71 | else 72 | boot_drive="${root_drive%?}1" 73 | modprobe g_multi file=${boot_drive} ${g_drive} ${g_network} || true 74 | fi 75 | 76 | trap "echo" 1 77 | 78 | while [ 1 ] 79 | do 80 | sleep 1000 81 | done 82 | 83 | -------------------------------------------------------------------------------- /include/imager.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # UU 4 | # U UU UU 5 | # UU UU UU 6 | # UU UU UU UU 7 | # UU UU UU UU 8 | # UU UUU UU UU Filesystem Builder 9 | # 10 | # UUUUUUUUUUUUUU DDDDDDDDDD OOOOOOOO OOOOOOOOO 11 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOO OOOOOOOOOOOOO 12 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 13 | # UUUUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 14 | # UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 15 | # UUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOOOO OOOOOOOOOOOOOO 16 | # UUUUUUUUUU DDDDDDDDDDD OOOOOOOOOO OOOOOOOOOO 17 | # 18 | # Author: Francesco Montefoschi 19 | # Author: Ettore Chimenti 20 | # Based on: Igor Pečovnik's work - https://github.com/igorpecovnik/lib 21 | # License: GNU GPL version 2 22 | # 23 | ################################################################################ 24 | 25 | checkroot 26 | 27 | echo -e "Unmount..." 28 | umountroot 29 | umount -lf sdcard/boot 30 | umount -lf sdcard 31 | 32 | #guessing sd image size.. 33 | ROOTSIZE="$(du -s "$ROOTFS" | cut -f 1)" 34 | SDSIZE="$(( $ROOTSIZE * 115 / 100000 ))" 35 | 36 | OUTPUT="udoobuntu-$BOARD-$FLAVOUR" 37 | 38 | if [ -n "$RELEASE" ]; then 39 | OUTPUT+=$(echo $RELEASE | sed -e "s/ //g" | tr '[:upper:]' '[:lower:]' | awk '{print "_"$1".img"}') 40 | else 41 | OUTPUT+="_$(date +%Y%m%d-%H%M).img" 42 | fi 43 | 44 | echo -e "${GREENBOLD}Creating a $SDSIZE MB image in $OUTPUT...${RST}" >&1 >&2 45 | dd if=/dev/zero of=$OUTPUT bs=1M count=$SDSIZE status=noxfer >/dev/null 2>&1 46 | 47 | LOOP=$(losetup -f) 48 | losetup $LOOP $OUTPUT || error "Cannot set $LOOP" 49 | 50 | OFFSET="1" 51 | BOOTSIZE="32" 52 | BOOTSTART=$(($OFFSET*2048)) 53 | ROOTSTART=$(($BOOTSTART+($BOOTSIZE*2048))) 54 | BOOTEND=$(($ROOTSTART-1)) 55 | 56 | LABELBOOT=${LABELBOOT:-boot} 57 | LABELFS=${LABELFS:-udoobuntu} 58 | 59 | echo -e "${GREENBOLD}Creating image partitions...${RST}" >&1 >&2 60 | # Create partitions and file-system 61 | parted -s $LOOP -- mklabel msdos 62 | parted -s $LOOP -- mkpart primary fat16 $BOOTSTART"s" $BOOTEND"s" 63 | parted -s $LOOP -- mkpart primary ext4 $ROOTSTART"s" -1s 64 | partprobe $LOOP 65 | mkfs.vfat -n "$LABELBOOT" $LOOP"p1" >/dev/null 2>&1 66 | mkfs.ext4 -q $LOOP"p2" -L "$LABELFS" 67 | 68 | mkdir sdcard 2> /dev/null 69 | mount $LOOP"p2" sdcard 70 | 71 | for i in boot dev proc run mnt tmp 72 | do mkdir -p "sdcard/$i" 73 | done 74 | 75 | chmod o+t,ugo+rw sdcard/tmp 76 | mount "${LOOP}p1" sdcard/boot 77 | 78 | rm -rf "$ROOTFS/home/ubuntu" #temp fix, we need to move the files later 79 | 80 | echo -e "${GREENBOLD}Copying filesystem on SD image...${RST}" >&1 >&2 81 | rsync -a --exclude run --exclude tmp --exclude qemu-arm-static "$ROOTFS/" sdcard/ 82 | ln -s /run sdcard/var/run 83 | ln -s /run/network sdcard/etc/network/run 84 | mkdir sdcard/var/tmp 85 | chmod o+t,ugo+rw sdcard/var/tmp 86 | 87 | echo -e "${GREENBOLD}Writing U-BOOT...${RST}" >&1 >&2 88 | dd if=boards/$BOARD/uboot.imx of="$LOOP" bs=1k seek=1 89 | sync 90 | 91 | umount -lf sdcard/boot 92 | umount -lf sdcard 93 | 94 | losetup -d "$LOOP" 95 | sync 96 | 97 | echo -e "${GREENBOLD}Build complete!${RST}" 98 | -------------------------------------------------------------------------------- /include/debootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # UU 4 | # U UU UU 5 | # UU UU UU 6 | # UU UU UU UU 7 | # UU UU UU UU 8 | # UU UUU UU UU Filesystem Builder 9 | # 10 | # UUUUUUUUUUUUUU DDDDDDDDDD OOOOOOOO OOOOOOOOO 11 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOO OOOOOOOOOOOOO 12 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 13 | # UUUUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 14 | # UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 15 | # UUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOOOO OOOOOOOOOOOOOO 16 | # UUUUUUUUUU DDDDDDDDDDD OOOOOOOOOO OOOOOOOOOO 17 | # 18 | # Author: Francesco Montefoschi 19 | # Author: Ettore Chimenti 20 | # Based on: Igor Pečovnik's work - https://github.com/igorpecovnik/lib 21 | # License: GNU GPL version 2 22 | # 23 | ################################################################################ 24 | 25 | set -e 26 | 27 | checkroot 28 | umountroot 29 | 30 | export LC_ALL=C LANGUAGE=C LANG=C 31 | UBUNTURELEASE="trusty" 32 | 33 | OLDCORE=( debootstrap_${UBUNTURELEASE}_*.tar.gz ) 34 | OLDCORE_LEN=${#OLDCORE[*]} 35 | OLDCORE_LAST=${OLDCORE[$OLDCORE_LEN-1]} 36 | 37 | if [ -f "$OLDCORE_LAST" ]; then 38 | echo -e -n "${GREENBOLD}Found a ${UBUNTURELEASE} core in ${OLDCORE_LAST}, unpacking it...${RST} " >&1 >&2 39 | mkdir "$ROOTFS" 40 | tar -xzpf "$OLDCORE_LAST" -C "$ROOTFS" || error 41 | echo -e "${GREENBOLD}done!${RST}" 42 | 43 | mountroot 44 | echo -e "${GREENBOLD}Installing updates from APT...${RST}" >&1 >&2 45 | chroot "$ROOTFS/" /bin/bash -c "apt update" 46 | chroot "$ROOTFS/" /bin/bash -c 'PATH=/fake:$PATH apt -y full-upgrade' 47 | 48 | else 49 | echo -e "${GREENBOLD}Starting debootstrap...${RST}" >&1 >&2 50 | 51 | debootstrap --foreign \ 52 | --arch=armhf \ 53 | --include=ubuntu-keyring,apt-transport-https,ca-certificates,openssl \ 54 | $UBUNTURELEASE "$ROOTFS" http://127.0.0.1:3142/ports.ubuntu.com 55 | 56 | (( $? )) && error "Debootstrap exited with error $?" 57 | 58 | echo -e "${GREENBOLD}Configuring keyring...${RST}" >&1 >&2 59 | cp /usr/bin/qemu-arm-static "$ROOTFS/usr/bin" 60 | chroot "$ROOTFS/" /bin/bash -c "dpkg -i /var/cache/apt/archives/ubuntu-keyring*.deb" 61 | echo -e "${GREENBOLD}Resuming debootstrap...${RST}" >&1 >&2 62 | chroot "$ROOTFS/" /bin/bash -c "/debootstrap/debootstrap --second-stage" 63 | 64 | mountroot 65 | echo -e "${GREENBOLD}Disabling services...${RST}" >&1 >&2 66 | mkdir "$ROOTFS/fake" 67 | for i in initctl invoke-rc.d restart start stop start-stop-daemon service 68 | do 69 | ln -s /bin/true "$ROOTFS/fake/$i" || error "Cannot make link to /bin/true, stopping.." 70 | done 71 | 72 | echo -e "${GREENBOLD}Configuring APT repositories...${RST}" >&1 >&2 73 | install -m 644 patches/apt/01proxy "$ROOTFS/etc/apt/apt.conf.d/01proxy" 74 | install -m 644 patches/apt/99progressbar "$ROOTFS/etc/apt/apt.conf.d/99progressbar" 75 | install -m 644 patches/apt/90-xapt-periodic "$ROOTFS/etc/apt/apt.conf.d/90-xapt-periodic" 76 | install -m 644 patches/apt/sources.list "$ROOTFS/etc/apt/sources.list" 77 | install -m 644 patches/apt/udoo.list "$ROOTFS/etc/apt/sources.list.d/udoo.list" 78 | install -m 644 patches/apt/nodejs.list "$ROOTFS/etc/apt/sources.list.d/nodejs.list" 79 | install -m 644 patches/apt/wyliodrin.list "$ROOTFS/etc/apt/sources.list.d/wyliodrin.list" 80 | install -m 644 patches/apt/udoo.preferences "$ROOTFS/etc/apt/preferences.d/udoo" 81 | sed -e "s/UBUNTURELEASE/$UBUNTURELEASE/g" -i "$ROOTFS/etc/apt/sources.list" 82 | sed -e "s/UBUNTURELEASE/$UBUNTURELEASE/g" -i "$ROOTFS/etc/apt/sources.list.d/nodejs.list" 83 | 84 | echo -e "${GREENBOLD}Adding APT repositories keys...${RST}" >&1 >&2 85 | chroot "$ROOTFS/" /bin/bash -c "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5" #ubuntu 86 | chroot "$ROOTFS/" /bin/bash -c "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32" #ubuntu 87 | chroot "$ROOTFS/" /bin/bash -c "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 1655A0AB68576280" #nodejs 88 | chroot "$ROOTFS/" /bin/bash -c "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 71F0E740" #udoo 89 | chroot "$ROOTFS/" /bin/bash -c "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com FFDAB760" #udoo extras 90 | 91 | echo -e "${GREENBOLD}Updating APT repositories...${RST}" >&1 >&2 92 | chroot "$ROOTFS/" /bin/bash -c "apt update" 93 | 94 | echo -e "${GREENBOLD}Fixing packages and installing upgrades...${RST}" >&1 >&2 95 | chroot "$ROOTFS/" /bin/bash -c "apt -y -f install" 96 | chroot "$ROOTFS/" /bin/bash -c 'PATH=/fake:$PATH apt -y full-upgrade' 97 | 98 | echo -e "${GREENBOLD}Configuring locales...${RST}" >&1 >&2 99 | chroot "$ROOTFS/" /bin/bash -c 'PATH=/fake:$PATH apt -y install locales' 100 | chroot "$ROOTFS/" /bin/bash -c "locale-gen en_US.UTF-8 it_IT.UTF-8 en_GB.UTF-8" 101 | chroot "$ROOTFS/" /bin/bash -c "export LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8" 102 | chroot "$ROOTFS/" /bin/bash -c "export DEBIAN_FRONTEND=noninteractive" 103 | chroot "$ROOTFS/" /bin/bash -c "update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_MESSAGES=POSIX" 104 | 105 | umountroot 106 | echo -e -n "${GREENBOLD}Board-indipendent debootstrap complete! Creating a backup... ${RST}" >&1 >&2 107 | tar -czpf "debootstrap_${UBUNTURELEASE}_$(date +%Y%m%d%H%M).tar.gz" -C "$ROOTFS" . 108 | echo -e "${GREENBOLD}done!${RST}" >&1 >&2 109 | mountroot 110 | fi 111 | 112 | echo -e "${GREENBOLD}Installing core packages...${RST}" >&1 >&2 113 | chroot "$ROOTFS/" /bin/bash -c "PATH=/fake:$PATH DEBIAN_FRONTEND=noninteractive apt -y install --no-install-recommends ${BASE_PACKAGES[*]}" 114 | 115 | recipe_pkgs=PACKAGES_$FLAVOUR[*] 116 | recipe_pkgs=${!recipe_pkgs} 117 | if [ ! -z "$recipe_pkgs" ]; then 118 | echo -e "${GREENBOLD}Installing $FLAVOUR packages...${RST}" >&1 >&2 119 | chroot "$ROOTFS/" /bin/bash -c "PATH=/fake:$PATH DEBIAN_FRONTEND=noninteractive apt -y install --no-install-recommends $recipe_pkgs" 120 | fi 121 | 122 | echo -e "${GREENBOLD}Removing unwanted packages...${RST}" >&1 >&2 123 | chroot "$ROOTFS/" /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends purge ${UNWANTED_PACKAGES[*]}" 124 | 125 | echo -e "${GREENBOLD}APT cleanup...${RST}" >&1 >&2 126 | chroot "$ROOTFS/" /bin/bash -c 'PATH=/fake:$PATH apt-get autoremove -y' 127 | chroot "$ROOTFS/" /bin/bash -c 'PATH=/fake:$PATH apt-get clean -y' 128 | chroot "$ROOTFS/" /bin/bash -c 'PATH=/fake:$PATH apt-get autoclean -y' 129 | 130 | echo -e "${GREENBOLD}Restoring services...${RST}" >&1 >&2 131 | rm "$ROOTFS/etc/apt/apt.conf.d/01proxy" 132 | rm -rf "$ROOTFS/fake" 133 | 134 | umountroot 135 | 136 | set +e 137 | -------------------------------------------------------------------------------- /include/configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # UU 4 | # U UU UU 5 | # UU UU UU 6 | # UU UU UU UU 7 | # UU UU UU UU 8 | # UU UUU UU UU Filesystem Builder 9 | # 10 | # UUUUUUUUUUUUUU DDDDDDDDDD OOOOOOOO OOOOOOOOO 11 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOO OOOOOOOOOOOOO 12 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 13 | # UUUUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 14 | # UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 15 | # UUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOOOO OOOOOOOOOOOOOO 16 | # UUUUUUUUUU DDDDDDDDDDD OOOOOOOOOO OOOOOOOOOO 17 | # 18 | # Author: Francesco Montefoschi 19 | # Author: Ettore Chimenti 20 | # Based on: Igor Pečovnik's work - https://github.com/igorpecovnik/lib 21 | # License: GNU GPL version 2 22 | # 23 | ################################################################################ 24 | 25 | checkroot 26 | mountroot 27 | 28 | package_installed() { 29 | chroot "$ROOTFS/" /bin/bash -c "dpkg -l |grep $1 > /dev/null 2>&1" 30 | return $? 31 | } 32 | 33 | echo -e "${GREENBOLD}Configuring system...${RST}" >&1 >&2 34 | 35 | # configure console 36 | echo -e "${GREENBOLD}Configuring console...${RST}" >&1 >&2 37 | install -m 744 patches/ttymxc0.conf "$ROOTFS/etc/init/ttymxc0.conf" 38 | install -m 744 patches/ttymxc1.conf "$ROOTFS/etc/init/ttymxc1.conf" 39 | install -m 744 patches/ttyGS0.conf "$ROOTFS/etc/init/ttyGS0.conf" 40 | rm -f "$ROOTFS/etc/init/tty3.conf" 41 | rm -f "$ROOTFS/etc/init/tty4.conf" 42 | rm -f "$ROOTFS/etc/init/tty5.conf" 43 | rm -f "$ROOTFS/etc/init/tty6.conf" 44 | 45 | # disable root login 46 | sed -i 's/PermitRootLogin without-password/PermitRootLogin no/' "$ROOTFS/etc/ssh/sshd_config" 47 | echo manual > "$ROOTFS/etc/init/ssh.override" 48 | 49 | # fix selinux 50 | mkdir -p "$ROOTFS/selinux" 51 | 52 | # remove what's anyway not working 53 | rm -f "$ROOTFS/etc/init/ureadahead"* 54 | rm -f "$ROOTFS/etc/init/plymouth"* 55 | 56 | if [ "$BOARD" = "udoo-neo" ]; then 57 | #enable otg gadget 58 | install -m 744 patches/g_multi.sh "$ROOTFS/usr/sbin/g_multi.sh" 59 | install -m 744 patches/g_multi.conf "$ROOTFS/etc/init/g_multi.conf" 60 | fi 61 | 62 | install -m 755 patches/rc.local "$ROOTFS/etc/rc.local" 63 | install -m 644 patches/fstab "$ROOTFS/etc/fstab" 64 | 65 | # setup users 66 | echo -e "${GREENBOLD}Setting users...${RST}" >&1 >&2 67 | chroot "$ROOTFS/" /bin/bash -c "echo root:$ROOTPWD | chpasswd" 68 | if package_installed "x11vnc"; then 69 | chroot "$ROOTFS/" /bin/bash -c "x11vnc -storepasswd $USERNAMEPWD /etc/x11vnc.pass" 70 | chroot "$ROOTFS/" /bin/bash -c "useradd -U -m -G sudo,video,audio,adm,dip,plugdev,fuse,dialout $USERNAMEPWD" 71 | else 72 | chroot "$ROOTFS/" /bin/bash -c "useradd -U -m -G sudo,adm,dip,plugdev,dialout $USERNAMEPWD" 73 | fi 74 | chroot "$ROOTFS/" /bin/bash -c "echo $USERNAMEPWD:$USERNAMEPWD | chpasswd" 75 | chroot "$ROOTFS/" /bin/bash -c "chsh -s /bin/bash $USERNAMEPWD" 76 | 77 | if package_installed "xserver-xorg-core"; then 78 | echo -e "${GREENBOLD}Configuring desktop...${RST}" >&1 >&2 79 | 80 | # touchscreen conf 81 | install -m 755 -d "$ROOTFS/etc/X11/xorg.conf.d/" 82 | install -m 744 patches/90-st1232touchscreen.conf "$ROOTFS/etc/X11/xorg.conf.d/" 83 | install -m 744 patches/91-3m_touchscreen.conf "$ROOTFS/etc/X11/xorg.conf.d/" 84 | 85 | #fix autostart https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1188131 86 | sed -i 's/and plymouth-ready//' "$ROOTFS/etc/init/lightdm.conf" 87 | echo manual > "$ROOTFS/etc/init/lightdm.override" 88 | mkdir "$ROOTFS/etc/lightdm/lightdm.conf.d" 89 | install -m 644 patches/autologin.lightdm "$ROOTFS/etc/lightdm/lightdm.conf.d/10-autologin.conf" 90 | install -m 644 patches/x11vnc.conf "$ROOTFS/etc/init/x11vnc.conf" 91 | sed -e "s/USERNAMEPWD/$USERNAMEPWD/g" -i "$ROOTFS/etc/lightdm/lightdm.conf.d/10-autologin.conf" 92 | install -m 644 patches/autologin.accountservice "$ROOTFS/var/lib/AccountsService/users/$USERNAMEPWD" 93 | 94 | #wallpaper 95 | WALLPAPER_OLD="/usr/share/lubuntu/wallpapers/lubuntu-default-wallpaper.png" 96 | WALLPAPER_NEW="/usr/share/wallpapers/udoo" 97 | 98 | #check valid wallpaper 99 | if [[ -n $WALLPAPER ]] && [[ ! -f "$ROOTFS/$WALLPAPER_NEW/$WALLPAPER.png" ]] 100 | then 101 | echo -e "Cannot find wallpaper $WALLPAPER" 102 | unset WALLPAPER 103 | fi 104 | WALLPAPER_NEW+=/${WALLPAPER:-$WALLPAPER_DEF}.png 105 | sed -e "s|$WALLPAPER_OLD|$WALLPAPER_NEW|" -i "$ROOTFS/etc/xdg/pcmanfm/lubuntu/pcmanfm.conf" 106 | 107 | #desktop icons 108 | install -m 755 -o 1000 -g 1000 -d \ 109 | "$ROOTFS/home/$USERNAMEPWD/Desktop" 110 | 111 | install -m 644 -o 1000 \ 112 | "$ROOTFS/usr/share/applications/lxterminal.desktop" "$ROOTFS/home/$USERNAMEPWD/Desktop/" 113 | install -m 644 -o 1000 \ 114 | "$ROOTFS/usr/share/applications/arduino.desktop" "$ROOTFS/home/$USERNAMEPWD/Desktop/" 115 | install -m 644 -o 1000 \ 116 | "$ROOTFS/usr/share/applications/inputmethods/matchbox-keyboard.desktop" \ 117 | "$ROOTFS/home/$USERNAMEPWD/Desktop/" 118 | 119 | chroot "$ROOTFS/" /bin/bash -c "update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/chromium-egl 50" 120 | chroot "$ROOTFS/" /bin/bash -c "update-alternatives --set x-www-browser /usr/bin/chromium-egl" 121 | 122 | chroot "$ROOTFS/" /bin/bash -c "chown $USERNAMEPWD:$USERNAMEPWD /home/$USERNAMEPWD/Desktop/*" 123 | 124 | if [ "$HOSTNAME" = "udooneo" ]; then 125 | install -m 644 patches/neo-audio/asound.conf "$ROOTFS/etc/asound.conf" 126 | install -m 644 patches/neo-audio/asound.state "$ROOTFS/var/lib/alsa/asound.state" 127 | fi 128 | fi 129 | 130 | echo -e "${GREENBOLD}Installing first boot service...${RST}" >&1 >&2 131 | install -m 755 patches/firstrun "$ROOTFS/etc/init.d" 132 | chroot "$ROOTFS/" /bin/bash -c "update-rc.d firstrun defaults 2>&1 >/dev/null" 133 | 134 | # configure MIN / MAX speed for cpufrequtils 135 | sed -e "s/MIN_SPEED=\"0\"/MIN_SPEED=\"$CPUMIN\"/g" -i "$ROOTFS/etc/init.d/cpufrequtils" 136 | sed -e "s/MAX_SPEED=\"0\"/MAX_SPEED=\"$CPUMAX\"/g" -i "$ROOTFS/etc/init.d/cpufrequtils" 137 | 138 | # configure bash: reverse search and shell completion 139 | echo -e "${GREENBOLD}Configuring shell...${RST}" >&1 >&2 140 | sed -e 's/# "\\e\[5~": history\-search\-backward/"\\e[5~": history-search-backward/' -i "$ROOTFS/etc/inputrc" 141 | sed -e 's/# "\\e\[6~": history\-search\-forward/"\\e[6~": history-search-forward/' -i "$ROOTFS/etc/inputrc" 142 | sed -e '/#if ! shopt -oq posix/,+6s/#//' -i "$ROOTFS/etc/bash.bashrc" 143 | echo "alias grep='grep --color=auto'" >> "$ROOTFS/etc/bash.bashrc" 144 | echo "alias ls='ls --color=auto'" >> "$ROOTFS/etc/bash.bashrc" 145 | 146 | # set hostname 147 | echo $HOSTNAME > "$ROOTFS/etc/hostname" 148 | 149 | if [ -n "$RELEASE" ]; then 150 | cat << ISSUE > "$ROOTFS/etc/issue" 151 | UDOObuntu v$RELEASE 152 | 153 | default username:password is [$USERNAMEPWD:$USERNAMEPWD] 154 | ISSUE 155 | else 156 | cat << ISSUE >> "$ROOTFS/etc/issue" 157 | 158 | default username:password is [$USERNAMEPWD:$USERNAMEPWD] 159 | ISSUE 160 | fi 161 | 162 | echo -e "${GREENBOLD}Configuring network...${RST}" >&1 >&2 163 | install -m 644 patches/network-interfaces "$ROOTFS/etc/network/interfaces" 164 | install -m 644 patches/hosts "$ROOTFS/etc/hosts" 165 | sed -e "s/THISHOST/$HOSTNAME/g" -i "$ROOTFS/etc/hosts" 166 | 167 | cp boards/$BOARD/uEnv.txt $ROOTFS/boot/uEnv.txt 168 | 169 | if package_installed "update-manager"; then 170 | # remove updates from motd and autostart 171 | rm "$ROOTFS/etc/xdg/autostart/update-notifier.desktop" 172 | rm "$ROOTFS/etc/update-motd.d/90-updates-available" 173 | rm "$ROOTFS/etc/update-motd.d/91-release-upgrade" 174 | rm "$ROOTFS/etc/update-motd.d/98-reboot-required" 175 | chroot "$ROOTFS/" /bin/bash -c "run-parts /etc/update-motd.d/" 176 | fi 177 | 178 | # set documentation link 179 | install -m 755 patches/10-help-text "$ROOTFS/etc/update-motd.d/10-help-text" 180 | chroot "$ROOTFS/" /bin/bash -c "run-parts /etc/update-motd.d/" 181 | 182 | umountroot 183 | -------------------------------------------------------------------------------- /mkudoobuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # UU 4 | # U UU UU 5 | # UU UU UU 6 | # UU UU UU UU 7 | # UU UU UU UU 8 | # UU UUU UU UU Filesystem Builder 9 | # 10 | # UUUUUUUUUUUUUU DDDDDDDDDD OOOOOOOO OOOOOOOOO 11 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOO OOOOOOOOOOOOO 12 | # UUU UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 13 | # UUUUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 14 | # UUUUUUUUUUUUUU DDDDDDDDDDDDD OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO 15 | # UUUUUUUUUUUU DDDDDDDDDDDD OOOOOOOOOOOOOO OOOOOOOOOOOOOO 16 | # UUUUUUUUUU DDDDDDDDDDD OOOOOOOOOO OOOOOOOOOO 17 | # 18 | # Author: Francesco Montefoschi 19 | # Author: Ettore Chimenti 20 | # Based on: Igor Pečovnik's work - https://github.com/igorpecovnik/lib 21 | # License: GNU GPL version 2 22 | # 23 | ################################################################################ 24 | 25 | # Default wallpaper for lxde 26 | # 27 | # Available in udoo-artwork 28 | # UDOO-blue 29 | # UDOO-circles 30 | # UDOO-cli 31 | # UDOO-fresh 32 | # UDOO-gray 33 | # UDOO-green 34 | # UDOO-pink 35 | # UDOO-steel 36 | # UDOO-stellar 37 | 38 | WALLPAPER_DEF=UDOO-fresh 39 | 40 | HOST_PACKAGES=( debootstrap qemu-user-static apt-cacher-ng rsync ) 41 | 42 | BASE_PACKAGES=( openssh-server alsa-utils bash-completion policykit-1 43 | bluez blueman curl dosfstools fbset iw nano module-init-tools ntp unzip usbutils 44 | vlan wireless-tools wget wpasupplicant unicode-data console-data console-common 45 | pv sysfsutils cpufrequtils ntfs-3g locate command-not-found man-db git i2c-tools 46 | python-pip vim minicom crda manpages systemd-services systemd-shim wireless-regdb 47 | udoo-gpio-export ) 48 | 49 | #UDOO related 50 | BASE_PACKAGES+=( firmware-imx-9t fsl-alsa-plugins-9t imx-lib-9t imx-udev-fsl-rules 51 | imx-vpu-9t libfslcodec-9t libfslparser-9t libfslvpuwrap-9t hostapd dtweb ) 52 | 53 | #dev library 54 | BASE_PACKAGES+=( python-serial librxtx-java ) 55 | 56 | DESKTOP_PACKAGES=( evince transmission-gtk abiword file-roller libmtp-runtime 57 | scratch eog geany bluefish pavucontrol udoo-artwork xinput-calibrator x11vnc 58 | dpkg-dev matchbox-keyboard socat ) 59 | 60 | #lubuntu 61 | DESKTOP_PACKAGES+=( lubuntu-core leafpad lxterminal galculator lxtask lxappearance 62 | lxrandr lxshortcut lxinput lubuntu-software-center ) 63 | 64 | #xorg 65 | DESKTOP_PACKAGES+=( imx-gpu-viv-9t6-acc-x11 xserver-xorg-core xserver-common 66 | xserver-xorg-dev libdrm-dev ) 67 | 68 | #dev 69 | DESKTOP_PACKAGES+=( automake ) 70 | 71 | #gstreamer 72 | DESKTOP_PACKAGES+=( gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer-imx 73 | gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly 74 | gstreamer1.0-alsa ) 75 | 76 | #chromium 77 | DESKTOP_PACKAGES+=( chromium-browser chromium-browser-l10n chromium-chromedriver 78 | chromium-codecs-ffmpeg-extra chromium-egl ) 79 | 80 | # from install recommends 81 | DESKTOP_PACKAGES+=( alsa-base accountsservice avahi-daemon bluez-alsa desktop-base 82 | dialog fonts-liberation gnome-bluetooth gnome-menus gnome-screensaver gnome-user-share 83 | gvfs-fuse ibus ibus-gtk ibus-gtk3 iptables indicator-applet indicator-application 84 | indicator-bluetooth indicator-datetime indicator-keyboard indicator-messages 85 | indicator-power indicator-session indicator-sound mousetweaks network-manager 86 | network-manager-gnome obconf obexd-client policykit-1-gnome pulseaudio 87 | pulseaudio-module-x11 pulseaudio-utils samba-common samba-common-bin sessioninstaller 88 | session-migration smbclient ssl-cert ubuntu-system-service update-inetd xfonts-scalable 89 | gnome-keyring zenity zenity-common ) 90 | 91 | UDOOLXDE=${DESKTOP_PACKAGES[*]} 92 | 93 | UNWANTED_PACKAGES=( valgrind ) 94 | 95 | usage() { 96 | echo "To debootstrap a new unnamed image, use: 97 | sudo ./mkudoobuntu.sh 98 | 99 | Branded-release images can be generated with: 100 | sudo RELEASE=\"2.0 Beta6\" ./mkudoobuntu.sh 101 | 102 | To edit a previously debootstrapped rootfs, use: 103 | sudo ./mkudoobuntu.sh 104 | 105 | can be: udoo-qdl, udoo-neo. 106 | 107 | can be: 108 | install Install a deb in rootfs from repos 109 | remove Remove a deb from rootfs 110 | list List installed pkg in rootfs 111 | reimage Make a new image from a modified rootfs 112 | shell Open an interactive shell in a rootfs 113 | " 114 | } 115 | 116 | GREEN="\e[32m" 117 | RED="\e[31m" 118 | BOLD="\e[1m" 119 | RST="\e[0m" 120 | GREENBOLD=${GREEN}${BOLD} 121 | 122 | error() { 123 | local E_TEXT=$1 124 | local E_CODE=$2 125 | 126 | [[ -z $E_CODE ]] && E_CODE=1 127 | [[ -z $E_TEXT ]] || echo -e $E_TEXT >&2 128 | exit $E_CODE 129 | } 130 | 131 | ok() { 132 | local OK_TEXT=$1 133 | [[ -z $OK_TEXT ]] && OK_TEXT="Success!!" 134 | [[ -z $OK_TEXT ]] || echo $OK_TEXT 135 | exit 0 136 | } 137 | 138 | usageerror() { 139 | usage 140 | error "${RED}${BOLD}$1${RST}" "$2" 141 | } 142 | 143 | checkroot() { 144 | if [ $(id -u) -ne 0 ] 145 | then 146 | error "You're not root! Try execute: sudo $0" 147 | fi 148 | } 149 | 150 | checkPackage() { 151 | declare -a PACKAGES 152 | for i in ${HOST_PACKAGES[*]} 153 | do 154 | dpkg -l "$i" > /dev/null 155 | if [[ $? != 0 ]] 156 | then 157 | echo "Package ${i} is not installed. We need to grab it" 158 | PACKAGES+=( "$i" ) 159 | fi 160 | done 161 | 162 | if (( ${#PACKAGES[*]} )) 163 | then 164 | checkroot 165 | apt-get install ${PACKAGES[*]} 166 | fi 167 | } 168 | checkPackage $HOST_PACKAGES 169 | 170 | mountroot() { 171 | if [ -z "$ROOTFS" ] && [ "$ROOTFS" = "/" ] 172 | then 173 | error "Rootfs variable not defined. Check the recipe" 174 | fi 175 | 176 | for i in proc sys dev dev/pts 177 | do 178 | [ -d "$ROOTFS/$i" ] || error "Rootfs not present/not populated ($ROOTFS/$i)" 179 | mountpoint -q "$ROOTFS/$i" && umount -lf "$ROOTFS/$i" 180 | done 181 | checkroot 182 | mount -t proc chproc "$ROOTFS/proc" 183 | mount -t sysfs chsys "$ROOTFS/sys" 184 | mount -t devtmpfs chdev "$ROOTFS/dev" || mount --bind /dev "$ROOTFS/dev" 185 | mount -t devpts chpts "$ROOTFS/dev/pts" 186 | } 187 | 188 | umountroot() { 189 | checkroot 190 | for i in proc sys dev/pts dev 191 | do 192 | if mountpoint -q "$ROOTFS/$i" 193 | then umount -lf "$ROOTFS/$i" || error "Cannot unmount \"$i\"" 194 | fi 195 | done 196 | } 197 | 198 | chrootshell() { 199 | mountroot 200 | chroot $ROOTFS/ /bin/bash 201 | umountroot 202 | } 203 | 204 | installdeb() { 205 | (( $# )) || error "Specify packages to install" 206 | 207 | mountroot 208 | chroot $ROOTFS/ /bin/bash -c "apt update" 209 | 210 | for i in $@ 211 | do 212 | chroot $ROOTFS/ /bin/bash -c "apt -y install $i" || error 213 | done 214 | chroot $ROOTFS/ /bin/bash -c "apt-get clean -y" 215 | umountroot 216 | } 217 | 218 | removedeb() { 219 | (( $# )) || error "Specify packages to uninstall" 220 | mountroot 221 | for i in $@ 222 | do 223 | chroot $ROOTFS/ /bin/bash -c "dpkg -l $i" || 224 | error "Package \"$i\" not found" 225 | done 226 | chroot $ROOTFS/ /bin/bash -c "apt-get remove -y $@" 227 | umountroot 228 | } 229 | 230 | listdeb() { 231 | mountroot 232 | (( $# == 0 )) && chroot $ROOTFS/ /bin/bash -c "dpkg -l" 233 | for i in $@ 234 | do 235 | chroot $ROOTFS/ /bin/bash -c "dpkg -l $i" 236 | done 237 | umountroot 238 | } 239 | 240 | debootstrapfull() { 241 | validRecipe=false 242 | for flavour in "${FLAVOURS[@]}"; do 243 | if [ "$flavour" == "$1" ] ; then 244 | validRecipe=true 245 | fi 246 | done 247 | 248 | if ! $validRecipe ; then 249 | usageerror "Invalid flavour/argument: $1! Valid flavours for $BOARD are: ${FLAVOURS[*]}." 250 | fi 251 | FLAVOUR=$1 252 | 253 | #check if rootfs exist 254 | if [ -d "$ROOTFS" ]; then 255 | umountroot 256 | 257 | #delete old fs 258 | echo -n "Deleting old root filesystem $ROOTFS/ in 5 seconds... " 259 | sleep 5 260 | rm -rf "$ROOTFS" || error 261 | echo -e "${GREENBOLD}done!${RST}" 262 | fi 263 | 264 | source include/debootstrap.sh 265 | source include/configure.sh 266 | source include/imager.sh 267 | } 268 | 269 | ## START 270 | 271 | if [ "$#" -lt 2 ] || [ "$#" -gt 3 ] ; then 272 | usage 273 | exit 1 274 | fi 275 | 276 | case $1 in 277 | *help|*usage) 278 | usage 279 | exit 0 280 | ;; 281 | *) 282 | [ -e "boards/$1/board.conf" ] || usageerror "Cannot find \"$1\" board definition." 283 | source boards/$1/board.conf 284 | BOARD=$1 285 | ROOTFS=$1 286 | 287 | shift 288 | #other argument 289 | case $1 in 290 | install) shift 291 | installdeb $@ && ok 292 | ;; 293 | remove) shift 294 | removedeb $@ && ok 295 | ;; 296 | list) shift 297 | listdeb && ok 298 | ;; 299 | debootstrap) 300 | source include/debootstrap.sh 301 | ok 302 | ;; 303 | reimage) 304 | source include/imager.sh 305 | ok 306 | ;; 307 | shell) 308 | chrootshell && ok 309 | ;; 310 | *) 311 | checkroot 312 | debootstrapfull $@ 313 | ok 314 | ;; 315 | esac 316 | esac 317 | 318 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | --------------------------------------------------------------------------------