summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2013-07-16 23:12:28 (GMT)
committer Jaromil <jaromil@dyne.org>2013-11-13 19:54:53 (GMT)
commit03f04149af7ceecfa9be47dcf360990ad7f10f9b (patch)
tree303fc6dbff8ea38b92271c808d64d42abc2695bc
parent32422ca98c6cc0b3fb4430dd6e23e46a5cdf9e3e (diff)
refactoring of pack command
now dojos are present as flavours of zshaolin one can choose to pack a light or mid sized zshaolin app also generic fixes and versioning
-rw-r--r--.gitignore2
-rw-r--r--TODO7
-rw-r--r--build/conf.zsh3
-rw-r--r--pack/conf.zsh200
-rw-r--r--pack/dojos/light/opkg.tree17
-rw-r--r--pack/dojos/light/system.aliases (renamed from pack/system.aliases)0
-rw-r--r--pack/dojos/light/system.tree25
-rw-r--r--pack/dojos/mid/opkg.tree (renamed from pack/opkg.tree)0
-rw-r--r--pack/dojos/mid/system.aliases9
-rw-r--r--pack/dojos/mid/system.tree25
-rw-r--r--pack/dojos/mid/text.aliases (renamed from pack/text.aliases)0
-rw-r--r--pack/dojos/mid/text.tree (renamed from pack/text.tree)0
-rw-r--r--pack/dojos/old/lang.tree (renamed from pack/lang.tree)0
-rw-r--r--pack/dojos/old/media.tree (renamed from pack/media.tree)0
-rw-r--r--pack/dojos/old/opkg.tree20
-rw-r--r--pack/dojos/old/system.aliases9
-rw-r--r--pack/dojos/old/system.tree (renamed from pack/system.tree)0
-rw-r--r--pack/dojos/old/text.aliases5
-rw-r--r--pack/dojos/old/text.tree6
-rw-r--r--pack/dojos/old/toys.tree (renamed from pack/toys.tree)0
-rw-r--r--termapk/AndroidManifest.xml3
-rw-r--r--termapk/src/org/dyne/zshaolin/startup/installer.java4
-rwxr-xr-xzmake19
23 files changed, 287 insertions, 67 deletions
diff --git a/.gitignore b/.gitignore
index af1b166..0bdead2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,8 @@
*.done
*.log
*.installed
+.#*
+*.lzma
!conf.zsh
bootstrap/crosstool-ng*
bootstrap/build*
diff --git a/TODO b/TODO
index 6652bd7..30435ed 100644
--- a/TODO
+++ b/TODO
@@ -1,2 +1,9 @@
build using NDK and scripts in
http://dan.drown.org/android/src/
+
+or in new NDKs:
+botbrew_toolchain() {
+ ${G_NDKPATH}/build/tools/make-standalone-toolchain.sh --arch=arm --platform=android-${G_NDKAPI} --install-dir=
+${G_ROOT}/${G_TOOLCHAIN}
+ touch ${G_ROOT}/${G_TOOLCHAIN}/.d
+}
diff --git a/build/conf.zsh b/build/conf.zsh
index 01dbc7e..a929ac3 100644
--- a/build/conf.zsh
+++ b/build/conf.zsh
@@ -10,9 +10,12 @@ pkgs=(
sound
lang
toys
+
# daemons
)
+{ test "$module" = "list" } && {
+ notice "Build modules: $pkgs"; return 0 }
{ test "$module" = "all" } || { pkgs=("$module") }
diff --git a/pack/conf.zsh b/pack/conf.zsh
index 7b36fe1..42c3046 100644
--- a/pack/conf.zsh
+++ b/pack/conf.zsh
@@ -5,54 +5,68 @@
# just one module for now
-sync_module() {
- notice "Syncing from system"
- rm -rf system
- mkdir -p system
-
- rm -f all.tree && touch all.tree
- rm -f all.aliases && touch all.aliases
- for t in `find . -name '*.tree'`; do
+ver=`cat ${ZHOME}/VERSION`
+
+
+streamline_zshaolin() {
+ act "including core scripts in dojo"
+
+ # list of core configurations
+ rm -f zshaolin.etc
+ cat <<EOF > zshaolin.etc
+./var/pid
+./var/log
+./etc/grmlrc
+./etc/zlogin
+./etc/zinit
+./etc/init.d
+./etc/skel
+EOF
+ # do the copy
+ rsync -dar --files-from=zshaolin.etc $ZHOME/system floor/
+ # zcompile the big stuff
+ zcompile floor/etc/grmlrc
+
+ rm -f zshaolin.etc
+}
+
+
+
+streamline() {
+ module=$1
+ act "streamlining $module"
+
+ # reset from previous streamlining
+ mkdir -p tmp && rm -rf tmp/* > /dev/null 2>/dev/null
+
+ # find file trees in the selected dojo
+ trees=(`find $module -name '*.tree'`)
+ for t in ${=trees}; do
# only first arg (2nd for rename, would break rsync)
- cat $t | awk '{print $1}' | sort >> all.tree; done
- for a in `find . -name '*.aliases'`; do
- cat $a | sort >> all.aliases; done
-
- rsync -dar --files-from=all.tree $ZHOME/system/ system/
+ act "reading $t"
+ cat $t | awk '{print $1}' | sort >> tmp/all.tree; done
+
+ # find aliases to be set for the selected dojo
+ shadows=(`find $module -name '*.aliases'`);
+ for a in ${=shadows}; do
+ act "reading $a"
+ cat $a | sort >> tmp/all.aliases; done
+
+ # do the actual copy into the new system
+ rsync -dar --files-from=tmp/all.tree $ZHOME/system/ floor/
# rename those that need it (2nd arg in .tree)
- for t in `find . -name '*.tree'`; do
- for i in `cat ${t} | awk '{if($2) print $1 ";" $2}'`; do
+ for i in `cat tmp/all.tree | awk '{if($2) print $1 ";" $2}'`; do
src=${i[(ws:;:)1]}
dst=${i[(ws:;:)2]}
act "rename $src in $dst"
- mv system/${src} system/${dst}
- done
- done
-
-}
-
-strip_module() {
- notice "Stripping binaries"
- for i in `find system -type f`; do
- file $i | grep -e 'ELF.*executable' > /dev/null
- if [ $? = 0 ]; then
- act "strip executable $i"
- $TOOLCHAIN/bin/$TARGET-strip $i
- fi
+ mv floor/${src} floor/${dst}
done
-}
-
-zcompile_module() {
- notice "Zcompiling zsh scripts"
- zcompile system/etc/grmlrc
-}
-alias_module() {
- notice "Setting aliases"
- if [ -r $ZHOME/pack/all.aliases ]; then
- aa=`cat all.aliases`
- pushd system
+ if [ -r tmp/all.aliases ]; then
+ act "placing aliases in $module"
+ aa=`cat tmp/all.aliases`
+ pushd floor
for a in ${(f)aa}; do
dir=`dirname ${a}`
{ test -r $dir } || continue
@@ -63,38 +77,102 @@ alias_module() {
done
popd
fi
+
}
-pack_module() {
- ver=${ver:-`cat ${ZHOME}/VERSION`}
- notice "Packing system version: $ver"
- tar cf system-${ver}.tar system
- { test -r system-${ver}.tar.lzma } && { rm -f system-${ver}.tar.lzma }
- lzma -z -7 system-${ver}.tar
- act "ready to be included in assets:"
- ls -lh system-${ver}.tar.lzma
+clean_floor() {
+ # deletes contents from last packaging, preparing for the new one
+ act "cleaning up the floor"
+ { test -r floor } && { rm -rf floor }
+ mkdir floor && cp $ZHOME/VERSION floor/
}
-install_module() {
- ver=${ver:-`cat ${ZHOME}/VERSION`}
- cp $ZHOME/pack/system-$ver.tar.lzma $ZHOME/termapk/assets/system-$ver.tar.lzma.mp3
- act "Including busybox binary:"
+strip_floor() {
+ notice "Stripping binaries on the floor"
+ for i in `find floor -type f`; do
+ file $i | grep -e 'ELF.*executable' > /dev/null
+ if [ $? = 0 ]; then
+ act "strip executable $i"
+ $TOOLCHAIN/bin/$TARGET-strip $i
+ fi
+ done
+}
+
+pack_dojo() {
+ notice "Compressing dojo..."
+ rm -rf system # clear old dojo
+ mv floor system # renames the floor to dojo
+
+ tar cf system.tar system
+ { test -r system.tar.lzma } && { rm -f system.tar.lzma }
+ lzma -z -7 --verbose system.tar
+
+ notice "Including dojo in assets"
+ ls -lh system.tar.lzma
+ cp -v system.tar.lzma $ZHOME/termapk/assets/system.tar.lzma.mp3
+
+ act "including busybox in assets"
ls -l $ZHOME/build/busybox/busybox.bin && \
- cp $ZHOME/build/busybox/busybox.bin \
+ cp -v $ZHOME/build/busybox/busybox.bin \
$ZHOME/termapk/assets/busybox.mp3
+
+}
+
+pack_weapon() {
+ w=${1:-all}
+ notice "Packing weapon: $module"
+ rm -rf $w
+ mv floor $w
+
+ tar cf $w.tar $w
+ { test -r $w.tar.lzma } && { rm -f $w.tar.lzma }
+ lzma -z -7 --verbose $w.tar
+ mv $w.tar.lzma weapons/
+
}
-ver=`cat ${ZHOME}/VERSION`
-notice "Packing system version $ver"
+# MAIN()
+
+notice "Packaging ZShaolin version $ver"
+
+# module is set by zmake from commandline args, defaults to "list"
+typeset -U weap # remove duplicates from array
+dojo=(); weap=();
+{ test "$module" = "list" } && {
+ for i in `ls dojos/`; do dojo+=($i); done
+ for w in `ls weapons/`; do weap+=(${w[(ws:.:)1]}); done
+ notice "Choose dojo: ${dojo}"
+ notice "Available weapons: ${weap}"
+ return 0
+}
+
+act "module: $module"
+
+{ test -r dojos/$module } && {
+ notice "Streamlining dojo: $module"
+
+ clean_floor # clean first and every time a new pack is done
+
+# create the dojo
+ streamline_zshaolin # scripts
+ streamline dojos/$module # binaries
+ strip_floor # strips all in floor
+ pack_dojo # pack and copy into assets
+ return 0
+}
+
+{ test -r weapons/$module } && {
+ notice "Packing weapon: $module"
+ clean_floor
+ streamline weapons/$module
+ strip_floor
+ pack_weapon $module
+ return 0
+}
-sync_module
-strip_module
-zcompile_module
-alias_module
-pack_module
-install_module
+error "No pack action for module $module"
# cd $ZHOME
# VER=`cat VERSION`
diff --git a/pack/dojos/light/opkg.tree b/pack/dojos/light/opkg.tree
new file mode 100644
index 0000000..22aa0f4
--- /dev/null
+++ b/pack/dojos/light/opkg.tree
@@ -0,0 +1,17 @@
+./share/ncat
+./share/git-core
+./bin/xxd
+./bin/ndiff
+./bin/scp ./bin/scp.bin
+./bin/scp.wrap ./bin/scp
+./bin/rsync
+./bin/opkg-key
+./bin/dropbearkey
+./bin/dbclient
+./bin/sqlite3
+./bin/dropbear
+./bin/dropbearconvert
+./bin/git
+./etc/service
+./libexec
+
diff --git a/pack/system.aliases b/pack/dojos/light/system.aliases
index 1f160d7..1f160d7 100644
--- a/pack/system.aliases
+++ b/pack/dojos/light/system.aliases
diff --git a/pack/dojos/light/system.tree b/pack/dojos/light/system.tree
new file mode 100644
index 0000000..94bc5af
--- /dev/null
+++ b/pack/dojos/light/system.tree
@@ -0,0 +1,25 @@
+./share/terminfo
+./share/awk
+./share/zsh
+./share/tabset
+./share/misc
+./share/man/man1
+./share/man/man4
+./share/man/man5
+./share/man/man7
+./share/doc/most
+./share/doc/slang
+./bin/sed
+./bin/htop
+./bin/most
+./bin/gawk
+./bin/diff
+./bin/zsh
+./bin/grep
+./bin/mandoc
+./bin/demandoc
+./libexec
+./libexec/awk
+./libexec/awk/grcat
+./libexec/awk/pwcat
+./busybox
diff --git a/pack/opkg.tree b/pack/dojos/mid/opkg.tree
index 8179f4d..8179f4d 100644
--- a/pack/opkg.tree
+++ b/pack/dojos/mid/opkg.tree
diff --git a/pack/dojos/mid/system.aliases b/pack/dojos/mid/system.aliases
new file mode 100644
index 0000000..1f160d7
--- /dev/null
+++ b/pack/dojos/mid/system.aliases
@@ -0,0 +1,9 @@
+sbin/dropbear sshd
+bin/dbclient ssh
+bin/dropbearkey ssh-keygen
+bin/htop top
+bin/zsh sh
+bin/zsh ash
+bin/zsh bash
+bin/gawk awk
+
diff --git a/pack/dojos/mid/system.tree b/pack/dojos/mid/system.tree
new file mode 100644
index 0000000..94bc5af
--- /dev/null
+++ b/pack/dojos/mid/system.tree
@@ -0,0 +1,25 @@
+./share/terminfo
+./share/awk
+./share/zsh
+./share/tabset
+./share/misc
+./share/man/man1
+./share/man/man4
+./share/man/man5
+./share/man/man7
+./share/doc/most
+./share/doc/slang
+./bin/sed
+./bin/htop
+./bin/most
+./bin/gawk
+./bin/diff
+./bin/zsh
+./bin/grep
+./bin/mandoc
+./bin/demandoc
+./libexec
+./libexec/awk
+./libexec/awk/grcat
+./libexec/awk/pwcat
+./busybox
diff --git a/pack/text.aliases b/pack/dojos/mid/text.aliases
index 3afc7e8..3afc7e8 100644
--- a/pack/text.aliases
+++ b/pack/dojos/mid/text.aliases
diff --git a/pack/text.tree b/pack/dojos/mid/text.tree
index 2918409..2918409 100644
--- a/pack/text.tree
+++ b/pack/dojos/mid/text.tree
diff --git a/pack/lang.tree b/pack/dojos/old/lang.tree
index d9dd666..d9dd666 100644
--- a/pack/lang.tree
+++ b/pack/dojos/old/lang.tree
diff --git a/pack/media.tree b/pack/dojos/old/media.tree
index 4e269d6..4e269d6 100644
--- a/pack/media.tree
+++ b/pack/dojos/old/media.tree
diff --git a/pack/dojos/old/opkg.tree b/pack/dojos/old/opkg.tree
new file mode 100644
index 0000000..8179f4d
--- /dev/null
+++ b/pack/dojos/old/opkg.tree
@@ -0,0 +1,20 @@
+./share/ncat
+./share/opkg
+./share/git-core
+./bin/xxd
+./bin/ndiff
+./bin/scp ./bin/scp.bin
+./bin/scp.wrap ./bin/scp
+./bin/rsync
+./bin/opkg-key
+./bin/dropbearkey
+./bin/dbclient
+./bin/opkg
+./bin/sqlite3
+./bin/dropbear
+./bin/dropbearconvert
+./bin/git
+./etc/opkg.conf
+./etc/service
+./libexec
+
diff --git a/pack/dojos/old/system.aliases b/pack/dojos/old/system.aliases
new file mode 100644
index 0000000..1f160d7
--- /dev/null
+++ b/pack/dojos/old/system.aliases
@@ -0,0 +1,9 @@
+sbin/dropbear sshd
+bin/dbclient ssh
+bin/dropbearkey ssh-keygen
+bin/htop top
+bin/zsh sh
+bin/zsh ash
+bin/zsh bash
+bin/gawk awk
+
diff --git a/pack/system.tree b/pack/dojos/old/system.tree
index 4ef418f..4ef418f 100644
--- a/pack/system.tree
+++ b/pack/dojos/old/system.tree
diff --git a/pack/dojos/old/text.aliases b/pack/dojos/old/text.aliases
new file mode 100644
index 0000000..3afc7e8
--- /dev/null
+++ b/pack/dojos/old/text.aliases
@@ -0,0 +1,5 @@
+bin/vim ex
+bin/vim rview
+bin/vim rvim
+bin/vim view
+bin/vim vimdiff
diff --git a/pack/dojos/old/text.tree b/pack/dojos/old/text.tree
new file mode 100644
index 0000000..2918409
--- /dev/null
+++ b/pack/dojos/old/text.tree
@@ -0,0 +1,6 @@
+./bin/nroff
+./bin/preconv
+./bin/mandoc
+./bin/demandoc
+./bin/vim
+./share/vim
diff --git a/pack/toys.tree b/pack/dojos/old/toys.tree
index c4fc8ce..c4fc8ce 100644
--- a/pack/toys.tree
+++ b/pack/dojos/old/toys.tree
diff --git a/termapk/AndroidManifest.xml b/termapk/AndroidManifest.xml
index 3e2ad7d..a14b832 100644
--- a/termapk/AndroidManifest.xml
+++ b/termapk/AndroidManifest.xml
@@ -54,7 +54,8 @@
</application>
- <uses-sdk android:minSdkVersion="4"/>
+ <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
+ <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
<!-- <uses-feature android:name="android.hardware.touchscreen" android:required="false" />-->
</manifest>
diff --git a/termapk/src/org/dyne/zshaolin/startup/installer.java b/termapk/src/org/dyne/zshaolin/startup/installer.java
index 1b2f9ac..28a4c61 100644
--- a/termapk/src/org/dyne/zshaolin/startup/installer.java
+++ b/termapk/src/org/dyne/zshaolin/startup/installer.java
@@ -31,8 +31,8 @@ public class installer extends Activity implements OnClickListener{
//THE MAIN INSTALL VALUE
public static int CURRENT_INSTALL_SYSTEM_NUM = 10;
- public static String CURRENT_INSTALL_SYSTEM = "System v0.7.1";
- public static String CURRENT_INSTALL_ASSETFILE = "system-0.7.1.tar.lzma.mp3";
+ public static String CURRENT_INSTALL_SYSTEM = "System v0.8";
+ public static String CURRENT_INSTALL_ASSETFILE = "system.tar.lzma.mp3";
private ProgressDialog mInstallProgress;
diff --git a/zmake b/zmake
index 81b519d..5a0a285 100755
--- a/zmake
+++ b/zmake
@@ -190,7 +190,7 @@ prepare_sources() {
;;
## IPK
- .ipk)
+ *.ipk)
mkdir -p extract
pushd extract
ln -sf ../${file} ${name}${ver}.tar.gz
@@ -206,8 +206,8 @@ prepare_sources() {
;;
## BARE SOURCE
- .tar.gz) tar xfz ${file}; mv ${name}${ver} ${name} ;;
- .tar.bz2) tar xfj ${file}; mv ${name}${ver} ${name} ;;
+ *.tar.gz) tar xfz ${file}; mv ${name}${ver} ${name} ;;
+ *.tar.bz2) tar xfj ${file}; mv ${name}${ver} ${name} ;;
*) error "compression not supported: $arch"
esac
@@ -388,30 +388,43 @@ typeset -h operation
typeset -h module
+
case "$1" in
+
+# here module is set with the second argument, after the commands listed here:
build)
operation=build
module=${2:-all}
enter build/ ${=@}
;;
+
+# same here. if no setting specified, it becomes "all".
+# internal conf.zsh supports also "list" to list options
pack)
operation=pack
+ module=${2:-list}
enter pack/ ${=@}
;;
+
clean)
operation=clean
module=${2:-all}
{ test $module = all } && { rm -rf $PREFIX }
enter build/ ${=@}
;;
+
+ # this can be called from commandline
compile)
args=($@) && shift args
operation=compile
zconfigure ${args}
;;
+
+ # this initialized the current shell with the zshaolin setup
test)
ZHOME=$ZHOME zsh system/etc/zlogin
;;
+
source)
return ;;
list)