Skip to content

Commit e8ed9ae

Browse files
author
jiang jianjun
committed
first commit
0 parents  commit e8ed9ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4187
-0
lines changed

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# NOTE! Don't add files that are generated in specific
3+
# subdirectories here. Add them in the ".gitignore" file
4+
# in that subdirectory instead.
5+
#
6+
# Normal rules
7+
#
8+
9+
*~
10+
11+
#
12+
# Top-level generic files
13+
#
14+
/build
15+
/build/*
16+
/downloads
17+
/downloads/*
18+
/release
19+
/release/*

common.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/sh
2+
#
3+
# Description : Common functions.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
10+
# Download, unpack, and patch a tarball from any one of the given URLs.
11+
# If the tarball already exists, don't download it.
12+
# Assumes that the tarball unpacks to a name guessable from its url,
13+
# and that patches already exist locally in a directory named after the tarball.
14+
GetUnpackAndPatch() {
15+
for arg; do
16+
case $arg in
17+
*.gz|*.bz2|*.tgz) ;;
18+
*) echo "unknown suffix on url $arg"; return 1 ;;
19+
esac
20+
21+
ARCHIVE_NAME=`echo $arg | sed 's,.*/,,;'`
22+
BASENAME=`echo $ARCHIVE_NAME | sed 's,\.tar\.gz$,,;s,\.tar\.bz2$,,;s,\.tgz,,;'`
23+
24+
# download the source code.
25+
if [ ! -f "$DOWNLOADS_DIR/$ARCHIVE_NAME" ]; then
26+
wget --continue --directory-prefix $DOWNLOADS_DIR $arg || { return 1; }
27+
fi
28+
29+
# unpack the source code.
30+
rm -Rf "$BUILD_DIR/$BASENAME" && tar xfv "$DOWNLOADS_DIR/$ARCHIVE_NAME" -C $BUILD_DIR || { return 1; }
31+
32+
# enter the BASENAME directory.
33+
cd "$BUILD_DIR/$BASENAME"|| { echo "Error: Could not enter the $BASENAME directory."; return 1; }
34+
35+
# patch the BASENAME, if need.
36+
if test -d $PATCHS_DIR/$BASENAME; then
37+
for p in $PATCHS_DIR/$BASENAME/*patch* $PATCHS_DIR/$BASENAME/*.diff; do
38+
if test -f $p; then
39+
echo "applying patch $p"
40+
patch -g0 --fuzz=1 -p1 -f < $p > patch$$.log 2>&1 || { cat patch$$.log; echo "patch $p failed"; return 1; }
41+
cat patch$$.log
42+
egrep -q "^No file to patch. Skipping patch.|^Hunk .* FAILED at" patch$$.log && { echo "patch $p failed"; return 1; }
43+
rm -f patch$$.log
44+
fi
45+
done
46+
fi
47+
done
48+
return 0;
49+
}
50+
51+
# do loop scripts.
52+
LoopScripts() {
53+
if [ $1 ] && [ -d $1 ]; then
54+
local LOOP_SCRIPTS=(`ls $1/*.sh | sort`)
55+
for SCRIPT in ${LOOP_SCRIPTS[@]}; do "$SCRIPT" || { echo "$SCRIPT: Failed."; return 1; } done
56+
return 0;
57+
else
58+
return 1;
59+
fi
60+
}
61+
62+
Stripping() {
63+
if [ $1 ] && [ -d $1 ]; then
64+
for dir in $1/{,usr/{,local/}}{bin,sbin}; do
65+
[ -d $dir ] && find $dir -type f -exec ${CROSS}strip --strip-all '{}' ';';
66+
done
67+
for dir in $1/{,usr/{,local/}}lib; do
68+
[ -d $dir ] && find $dir -type f -exec ${CROSS}strip --strip-debug '{}' ';';
69+
done
70+
return 0;
71+
else
72+
return 1;
73+
fi
74+
}

config

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/sh
2+
#
3+
# Description : The config file for mkinitrd.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
10+
############################################################
11+
# The environment of compiler.
12+
export CROSS=/usr/local/arm/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
13+
export SHARE_LIB_DIR=/usr/local/arm/arm-none-linux-gnueabi/arm-none-linux-gnueabi/libc/lib/
14+
export BUILD=x86
15+
export HOST=arm-linux
16+
export TARGET=arm-linux
17+
18+
# The BASIC SOURCE file's version which will be compiled.
19+
export BUSYBOX_CFG=busybox-1.13.4
20+
export UDEV_CFG=udev-141
21+
export USPLASH_CFG=usplash-0.5.31
22+
export LRZSZ_CFG=lrzsz-0.12.20
23+
export MTDUTILS_CFG=mtd-utils-1.2.0
24+
export FBSET_CFG=fbset-2.1
25+
export STRACE_CFG=strace-4.5.16
26+
export GDB_CFG=gdb-6.8
27+
export MADPLAY_CFG=madplay-0.15.2b
28+
export WIRELESS_TOOLS_CFG=wireless_tools.29
29+
export FMTOOLS_CFG=fmtools-1.0.2
30+
export ALSA_UTILS_CFG=alsa-utils-1.0.21
31+
export I2CTOOLS_CFG=i2c-tools-3.0.2
32+
33+
############################################################
34+
# The BASIC control flag for mkinitrd script.
35+
export RESOURCE_ENABLE=y
36+
export INITRD_ENABLE=y
37+
export MKDIR_ENABLE=y
38+
export MKDEV_ENABLE=y
39+
export CPGLIBC_ENABLE=y
40+
41+
export BUSYBOX_ENABLE=y
42+
export UDEV_ENABLE=y
43+
export USPLASH_ENABLE=n
44+
export LRZSZ_ENABLE=y
45+
export MTDUTILS_ENABLE=y
46+
export FBSET_ENABLE=y
47+
export STRACE_ENABLE=n
48+
export GDB_ENABLE=n
49+
export MADPLAY_ENABLE=y
50+
export WIRELESS_TOOLS_ENABLE=y
51+
export FMTOOLS_ENABLE=y
52+
export ALSA_UTILS_ENABLE=y
53+
export I2CTOOLS_ENABLE=y
54+
55+
56+

depends/check-autoconf.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
#
3+
# Description : Check the tool of autoconf.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
# check for autoconf.
10+
echo "Checking for autoconf...";
11+
autoconf --version 1> /dev/null || { echo "Error: Install autoconf before continuing."; exit 1; }
12+

depends/check-automake.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
#
3+
# Description : Check the tool of automake.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
# check for automake.
10+
echo "Checking for automake...";
11+
automake --version 1> /dev/null || { echo "Error: Install automake before continuing."; exit 1; }

depends/check-bison.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
#
3+
# Description : Check the tool of bison.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
10+
# check for bison.
11+
echo "Checking for bison...";
12+
bison --version 1> /dev/null || { echo "Error: Install bison before continuing."; exit 1; }

depends/check-cpio.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
#
3+
# Description : Check the tool of cpio.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
10+
# Check for cpio.
11+
echo "Checking for cpio...";
12+
cpio --version 1> /dev/null || { echo "Error: Install cpio before continuing."; exit 1; }

depends/check-cross.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
#
3+
# Description : Check for cross compiler.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
10+
# check for cross compiler.
11+
echo "Checking for cross compiler...";
12+
$CROSS"gcc" --version 1> /dev/null || { echo "Error: Install CROSS gcc before continuing.($CROSS)"; exit 1; }

depends/check-flex.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
#
3+
# Description : Check the tool of flex.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
10+
# check for flex.
11+
echo "Checking for flex...";
12+
flex --version 1> /dev/null || { echo "Error: Install flex before continuing."; exit 1; }

depends/check-gcc.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
#
3+
# Description : Check the tool of gcc.
4+
# Authors : jianjun jiang - [email protected]
5+
# Version : 0.01
6+
# Notes : None
7+
#
8+
9+
10+
# check for gcc.
11+
echo "Checking for gcc...";
12+
gcc --version 1> /dev/null || { echo "Error: Install gcc before continuing."; exit 1; }

0 commit comments

Comments
 (0)