shr-image, shr-lite-image: for building SHR distribution
authorMartin Jansa <Martin.Jansa@gmail.com>
Wed, 18 Nov 2009 08:03:50 +0000 (09:03 +0100)
committerMartin Jansa <Martin.Jansa@gmail.com>
Wed, 18 Nov 2009 08:57:09 +0000 (09:57 +0100)
recipes/images/shr-image.bb [new file with mode: 0644]
recipes/images/shr-image.inc [new file with mode: 0644]
recipes/images/shr-image/boot/append-GTA02 [new file with mode: 0644]
recipes/images/shr-image/etc/htoprc [new file with mode: 0644]
recipes/images/shr-image/etc/logrotate.d/50freesmartphone [new file with mode: 0644]
recipes/images/shr-image/etc/profile.d/elementary.sh [new file with mode: 0755]
recipes/images/shr-lite-image.bb [new file with mode: 0644]
recipes/images/shr-lite-image/boot/append-GTA02 [new file with mode: 0644]
recipes/images/shr-lite-image/etc/htoprc [new file with mode: 0644]
recipes/images/shr-lite-image/etc/logrotate.d/50freesmartphone [new file with mode: 0644]
recipes/images/shr-lite-image/etc/profile.d/elementary.sh [new file with mode: 0755]

diff --git a/recipes/images/shr-image.bb b/recipes/images/shr-image.bb
new file mode 100644 (file)
index 0000000..e889f2d
--- /dev/null
@@ -0,0 +1,30 @@
+require shr-image.inc
+
+IMAGE_BASENAME = "full"
+
+DEPENDS += "task-shr"
+RDEPENDS += "\
+    task-shr-apps \
+    task-shr-games \
+    task-shr-gtk \
+"
+
+IMAGE_INSTALL += "\
+  task-shr-apps \
+  task-shr-games \
+  task-shr-gtk \
+"
+
+# perform some SHR convenience tweaks to the rootfs
+shr_rootfs_postprocess_append() {
+    curdir=$PWD
+    cd ${IMAGE_ROOTFS}
+
+
+    #Replace desktop files
+    echo "Icon=pidgin.png" >> ./usr/share/applications/pidgin.desktop
+    sed -i "s/^X-Icon-path.*$//g" ./usr/share/applications/vagalume.desktop
+
+    cd $curdir
+}
+
diff --git a/recipes/images/shr-image.inc b/recipes/images/shr-image.inc
new file mode 100644 (file)
index 0000000..7f1968e
--- /dev/null
@@ -0,0 +1,167 @@
+#------------------------------------------------------
+# SHR Image Recipe
+#------------------------------------------------------
+
+PV = "2.0"
+PR = "r7"
+
+
+DEPENDS += "task-shr-minimal"
+
+RDEPENDS += "\
+  ${MACHINE_TASK_PROVIDER} \
+  task-base \
+  task-shr-minimal-base \
+  task-shr-minimal-cli \
+  task-shr-minimal-fso \
+  task-shr-minimal-apps \
+  task-shr-minimal-audio \
+  task-shr-minimal-gtk \
+  task-shr-minimal-x \
+  task-x11-illume \
+  task-fso2-compliance \
+  task-fonts-truetype-core \
+"
+
+IMAGE_INSTALL += "\
+  ${MACHINE_TASK_PROVIDER} \
+  task-base \
+  task-shr-minimal-base \
+  task-shr-minimal-cli \
+  task-shr-minimal-apps \
+  task-shr-minimal-audio \
+  task-shr-minimal-gtk \
+  task-shr-minimal-x \
+  task-x11-illume \
+  task-fso-compliance \
+  task-fonts-truetype-core \
+"
+
+inherit image
+
+# perform some SHR convenience tweaks to the rootfs
+shr_rootfs_postprocess() {
+    dirs=`find ${FILESDIR} -type d -printf "%P\n" | grep -v "^.$" | grep -v ".git"`
+    for dir in $dirs; do
+        mkdir -p ${IMAGE_ROOTFS}/$dir
+    done
+    files=`find ${FILESDIR} -type f -printf "%P\n" | grep -v ".git"`
+    for file in $files; do
+        cp -f ${FILESDIR}/$file ${IMAGE_ROOTFS}/$file
+    done
+
+    curdir=$PWD
+    cd ${IMAGE_ROOTFS}
+    # date/time
+    date "+%m%d%H%M%Y" >./etc/timestamp
+    # alias foo
+    echo "alias pico=nano" >>./etc/profile
+    echo "alias fso='cd /local/pkg/fso'" >>./etc/profile
+    echo "alias ipkg='opkg'" >>./etc/profile
+    # dns
+    echo "nameserver 208.67.222.222" >./etc/resolv.conf
+    echo "nameserver 208.67.220.220" >>./etc/resolv.conf
+    # nfs
+    mkdir -p ./local/pkg
+    echo >>./etc/fstab
+    echo "# NFS Host" >>./etc/fstab
+    echo "192.168.0.200:/local/pkg /local/pkg nfs noauto,nolock,soft,rsize=32768,wsize=32768 0 0" >>./etc/fstab
+    # fix .desktop files for illume
+    #desktop=`find ./usr/share/applications -name "*.desktop"`
+    #for file in $desktop; do
+    #    echo "Categories=Office;" >>$file
+    #done
+
+    echo "Exec=vala-terminal -e htop" >> ./usr/share/applications/htop.desktop
+
+    # minimal gtk theme foo
+    # this should be set in postinst phase of installed gtk-theme package
+    #mkdir -p ./etc/gtk-2.0/
+    #echo 'gtk-font-name = "Sans 5"' >> ./etc/gtk-2.0/gtkrc.default
+    #echo 'gtk-theme-name = "shr-theme-gtk-e17lookalike"' >> ./etc/gtk-2.0/gtkrc.default
+    #echo 'gtk-icon-theme-name = "openmoko-standard"' >> ./etc/gtk-2.0/gtkrc.default
+    #echo 'style "treeview"' >> ./etc/gtk-2.0/gtkrc.default
+    #echo '{   ' >> ./etc/gtk-2.0/gtkrc.default
+    #echo '    GtkTreeView::expander-size = 40' >> ./etc/gtk-2.0/gtkrc.default
+    #echo '}' >> ./etc/gtk-2.0/gtkrc.default
+    #echo 'widget_class "*TreeView*" style "treeview"' >> ./etc/gtk-2.0/gtkrc.default
+    #update-alternatives --install /etc/gtk-2.0/gtkrc gtk-theme /etc/gtk-2.0/gtkrc.default 1
+
+    # elementary theme foo
+    ELM_PROFILE_SCR=./etc/profile.d/elementary.sh
+    echo 'export ELM_ENGINE=x11' > ${ELM_PROFILE_SCR}
+    echo 'export ELM_THEME=gry' >> ${ELM_PROFILE_SCR}
+    echo 'export ELM_SCALE=2' >> ${ELM_PROFILE_SCR}
+    echo 'export ELM_FINGER_SIZE=70' >> ${ELM_PROFILE_SCR}
+    chmod +x ${ELM_PROFILE_SCR}
+
+    echo '' >> ./etc/ld.so.conf
+    # fix strange iconv/gconf bug
+    ln -s libc.so.6 ./lib/libc.so
+
+    #font cache optimization, persistent cache
+    sed -i "s/<cachedir>.*\/var\/cache\/\(.*\)<\/cachedir>/<cachedir>\/var\/local\/\1<\/cachedir>/g" ./etc/fonts/fonts.conf
+
+    #set up a nice gentoo-like PS1
+    echo "export PS1=\"\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] \"">> ./etc/profile
+
+    #load modules on boot
+    [ -d ./etc/modutils ] || mkdir ./etc/modutils
+    echo "g_ether" > ./etc/modutils/g_ether
+    echo "ppp_generic" > ./etc/modutils/ppp_generic
+    # FIXME: Only do this for GTA02
+    # FIXME: investigate why module_autoload in machine config doesn't work
+    echo "snd-soc-neo1973-gta02-wm8753" > ./etc/modutils/snd-soc-neo
+
+    #set up some variables to improve default settings
+    echo "if [ \"\$DISPLAY\" = \"\" ]" >> ./etc/profile
+    echo "then" >> ./etc/profile
+    echo "    export DISPLAY=localhost:0" >> ./etc/profile
+    echo "fi" >> ./etc/profile
+    echo "export HISTFILESIZE=1000" >> ./etc/profile
+    echo "export HISTSIZE=1000" >> ./etc/profile
+    echo "alias rm='rm -i'; alias cp='cp -i'; alias mv='mv -i'" >> ./etc/profile
+    echo "alias la='ls $LS_OPTIONS -ltrA'; alias lh='ls $LS_OPTIONS -ltrh'; alias lr='ls $LS_OPTIONS -ltr';" >> ./etc/profile
+    echo "alias lR='ls $LS_OPTIONS -ltrR'" >> ./etc/profile
+    echo "# set your locale here:" >> ./etc/profile
+    echo "export LANG=en_US.UTF-8" >> ./etc/profile
+
+    # Add some missing entries to the passwd and group file; but do so carefully
+    # since this will be fixed upstream at some point.
+    grep -q '^tss:' ./etc/passwd || echo 'tss:x:93:93:Linux TSS User:/bin:/bin/sh' >>./etc/passwd
+    grep -q '^scanner:' ./etc/group || echo 'scanner:*:91:' >>./etc/group
+    grep -q '^nvram:'   ./etc/group || echo 'nvram:*:92:'   >>./etc/group
+    grep -q '^tss:'     ./etc/group || echo 'tss:*:93:'     >>./etc/group
+    grep -q '^fuse:'    ./etc/group || echo 'fuse:*:94:'    >>./etc/group
+    grep -q '^kvm:'     ./etc/group || echo 'kvm:*:95:'     >>./etc/group
+    grep -q '^rdma:'    ./etc/group || echo 'rdma:*:96:'    >>./etc/group
+
+    cd $curdir
+}
+
+shr_rootfs_gta02_postprocess() {
+    curdir=$PWD
+    cd ${IMAGE_ROOTFS}
+    cd ${IMAGE_ROOTFS}/boot
+    ln -s uImage uImage-GTA02.bin
+    cd $curdir
+    #sed -i 's/#SCORouting=PCM/SCORouting=PCM/' ${IMAGE_ROOTFS}/etc/bluetooth/audio.conf
+}
+
+shr_rootfs_gta01_postprocess() {
+    curdir=$PWD
+    cd ${IMAGE_ROOTFS}
+    cd ${IMAGE_ROOTFS}/boot
+    ln -s uImage uImage-GTA01.bin
+    cd $curdir
+    #sed -i 's/#SCORouting=PCM/SCORouting=PCM/' ${IMAGE_ROOTFS}/etc/bluetooth/audio.conf
+}
+
+ROOTFS_POSTPROCESS_COMMAND += " shr_rootfs_postprocess"
+
+ROOTFS_POSTPROCESS_COMMAND_append_om-gta02 = ";shr_rootfs_gta02_postprocess"
+ROOTFS_POSTPROCESS_COMMAND_append_om-gta01 = ";shr_rootfs_gta01_postprocess"
+
+#do_testlab() {
+#      :
+#}
diff --git a/recipes/images/shr-image/boot/append-GTA02 b/recipes/images/shr-image/boot/append-GTA02
new file mode 100644 (file)
index 0000000..4901a09
--- /dev/null
@@ -0,0 +1,2 @@
+loglevel=1 quiet splash 
+
diff --git a/recipes/images/shr-image/etc/htoprc b/recipes/images/shr-image/etc/htoprc
new file mode 100644 (file)
index 0000000..e7bb5b7
--- /dev/null
@@ -0,0 +1,21 @@
+# Beware! This file is rewritten every time htop exits.
+# The parser is also very primitive, and not human-friendly.
+# (I know, it's in the todo list).
+fields=39 46 47 49 1 
+sort_key=46
+sort_direction=1
+hide_threads=0
+hide_kernel_threads=1
+hide_userland_threads=0
+shadow_other_users=0
+highlight_base_name=0
+highlight_megabytes=1
+tree_view=0
+header_margin=0
+detailed_cpu_time=1
+color_scheme=0
+delay=15
+left_meters=AllCPUs Memory 
+left_meter_modes=1 1 
+right_meters=Tasks LoadAverage Uptime 
+right_meter_modes=2 2 2
diff --git a/recipes/images/shr-image/etc/logrotate.d/50freesmartphone b/recipes/images/shr-image/etc/logrotate.d/50freesmartphone
new file mode 100644 (file)
index 0000000..2d3fb81
--- /dev/null
@@ -0,0 +1,11 @@
+/var/log/frameworkd.log { 
+    rotate 5 
+    weekly 
+    compress 
+} 
+
+/var/log/ophonekitd.log { 
+    rotate 5 
+    weekly 
+    compress 
+} 
diff --git a/recipes/images/shr-image/etc/profile.d/elementary.sh b/recipes/images/shr-image/etc/profile.d/elementary.sh
new file mode 100755 (executable)
index 0000000..da43596
--- /dev/null
@@ -0,0 +1,4 @@
+export ELM_ENGINE=x11
+export ELM_THEME=default
+export ELM_SCALE=2
+export ELM_FINGER_SIZE=70
diff --git a/recipes/images/shr-lite-image.bb b/recipes/images/shr-lite-image.bb
new file mode 100644 (file)
index 0000000..fa1a7ac
--- /dev/null
@@ -0,0 +1,5 @@
+require shr-image.inc
+
+IMAGE_BASENAME = "lite"
+
+IMAGES_LINGUAS="en-us"
diff --git a/recipes/images/shr-lite-image/boot/append-GTA02 b/recipes/images/shr-lite-image/boot/append-GTA02
new file mode 100644 (file)
index 0000000..4901a09
--- /dev/null
@@ -0,0 +1,2 @@
+loglevel=1 quiet splash 
+
diff --git a/recipes/images/shr-lite-image/etc/htoprc b/recipes/images/shr-lite-image/etc/htoprc
new file mode 100644 (file)
index 0000000..e7bb5b7
--- /dev/null
@@ -0,0 +1,21 @@
+# Beware! This file is rewritten every time htop exits.
+# The parser is also very primitive, and not human-friendly.
+# (I know, it's in the todo list).
+fields=39 46 47 49 1 
+sort_key=46
+sort_direction=1
+hide_threads=0
+hide_kernel_threads=1
+hide_userland_threads=0
+shadow_other_users=0
+highlight_base_name=0
+highlight_megabytes=1
+tree_view=0
+header_margin=0
+detailed_cpu_time=1
+color_scheme=0
+delay=15
+left_meters=AllCPUs Memory 
+left_meter_modes=1 1 
+right_meters=Tasks LoadAverage Uptime 
+right_meter_modes=2 2 2
diff --git a/recipes/images/shr-lite-image/etc/logrotate.d/50freesmartphone b/recipes/images/shr-lite-image/etc/logrotate.d/50freesmartphone
new file mode 100644 (file)
index 0000000..2d3fb81
--- /dev/null
@@ -0,0 +1,11 @@
+/var/log/frameworkd.log { 
+    rotate 5 
+    weekly 
+    compress 
+} 
+
+/var/log/ophonekitd.log { 
+    rotate 5 
+    weekly 
+    compress 
+} 
diff --git a/recipes/images/shr-lite-image/etc/profile.d/elementary.sh b/recipes/images/shr-lite-image/etc/profile.d/elementary.sh
new file mode 100755 (executable)
index 0000000..da43596
--- /dev/null
@@ -0,0 +1,4 @@
+export ELM_ENGINE=x11
+export ELM_THEME=default
+export ELM_SCALE=2
+export ELM_FINGER_SIZE=70