CRUX-ARM :
Home
Home
::
Documentation
::
Download
::
Development
::
Community
::
Ports
::
Packages
::
Bugs
::
Links
::
About
::
Donors
development
/
devtools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c4c9084
)
Improved makeRootfs script and added changes for next 2.8
author
Jose V Beneyto
<sepen@crux.nu>
Fri, 19 Oct 2012 02:19:46 +0000
(
02:19
+0000)
committer
Jose V Beneyto
<sepen@crux.nu>
Fri, 19 Oct 2012 02:19:46 +0000
(
02:19
+0000)
makeRootfs.sh
patch
|
blob
|
blame
|
history
diff --git
a/makeRootfs.sh
b/makeRootfs.sh
index fb1fb56c9a20bc807c4dca054822e5159484511e..eb062e7895488a093dbeac6a23e9c7155e6c2550 100755
(executable)
--- a/
makeRootfs.sh
+++ b/
makeRootfs.sh
@@
-2,19
+2,13
@@
# msgUsage: show a usage message and exit
msgUsage() {
# msgUsage: show a usage message and exit
msgUsage() {
- echo "Usage: $(basename $0)
[TMP_DIR] [PKG_DIR] [RELEASE_DIR] [RELEASE_NAME]
"
+ echo "Usage: $(basename $0)
<tmp-dir> <pkg-dir> <release-dir> <release-name>
"
echo "Examples:"
echo "Examples:"
- echo " \$ $(basename $0) tmp ports/core-cross releases crux-arm-rootfs-2.7"
- echo " \$ $(basename $0) tmp ports/core-cross releases crux-arm-rootfs-2.6"
- echo " \$ $(basename $0) tmp ports/core-cross-noeabi releases crux-arm-rootfs-2.6-noeabi"
+ echo " \$ $(basename $0) /tmp/rootfs ports/core-cross . minirootfs-XX"
+ echo " \$ $(basename $0) /tmp/rootfs /pub/pkg releases crux-arm-rootfs-XX"
exit 0
}
exit 0
}
-# msgWarn: show a warning message
-msgWarn() {
- echo "Warning, $@" 2>&1
-}
-
# msgError: show a error message and exit
msgError() {
echo "Error, $@" 2>&1
# msgError: show a error message and exit
msgError() {
echo "Error, $@" 2>&1
@@
-33,58
+27,57
@@
checkCommands() {
# checkVars: checks for user given arguments
#
# params:
# checkVars: checks for user given arguments
#
# params:
-# $1 - TMP
_
DIR
-# $2 - PKG
_
DIR
+# $1 - TMPDIR
+# $2 - PKGDIR
# $3 - RELEASE_DIR
# $4 - RELEASE_NAME
checkVars() {
[ $# -lt 1 ] && msgUsage
# $3 - RELEASE_DIR
# $4 - RELEASE_NAME
checkVars() {
[ $# -lt 1 ] && msgUsage
- [ ! -z "$1" ] && TMP
_
DIR="$1"
- [ "$TMP
_DIR" = "/tmp" ] && msgError "you can't use /tmp as TMP_
DIR"
- [ ! -z "$2" ] && PKG
_
DIR="$2"
+ [ ! -z "$1" ] && TMPDIR="$1"
+ [ "$TMP
DIR" = "/tmp" ] && msgError "you can't use /tmp as TMP
DIR"
+ [ ! -z "$2" ] && PKGDIR="$2"
[ ! -z "$3" ] && RELEASE_DIR="$3"
[ ! -z "$4" ] && RELEASE_NAME="$4"
# check for directories, if not create them
[ ! -z "$3" ] && RELEASE_DIR="$3"
[ ! -z "$4" ] && RELEASE_NAME="$4"
# check for directories, if not create them
- for dir in $TMP
_
DIR $RELEASE_DIR; do
+ for dir in $TMPDIR $RELEASE_DIR; do
if [ ! -d "$dir" ]; then
if [ ! -d "$dir" ]; then
- msgWarn "creating directory '$dir'" && install -d $dir || exit 1
+ install -d $dir || msgError "can't create directory $dir"
fi
done
fi
done
- TMP
_DIR="$(cd $TMP_
DIR; pwd)"
- PKG
_DIR="$(cd $PKG_
DIR; pwd)"
+ TMP
DIR="$(cd $TMP
DIR; pwd)"
+ PKG
DIR="$(cd $PKG
DIR; pwd)"
RELEASE_DIR="$(cd $RELEASE_DIR; pwd)"
RELEASE_DIR="$(cd $RELEASE_DIR; pwd)"
- [ -z "$PACKAGES" ] && PACKAGES="$(find $PKG
_DIR -type f -name '*#*pkg.tar.gz
')"
+ [ -z "$PACKAGES" ] && PACKAGES="$(find $PKG
DIR -type f -name '*#*pkg.tar.*
')"
}
# global variables
PWD_DIR="$(pwd)"
}
# global variables
PWD_DIR="$(pwd)"
-TMP_DIR="$PWD_DIR/tmp"
-PKG_DIR="$PWD_DIR/pkg"
-RELEASE_DIR="$PWD_DIR/releases"
-RELEASE_NAME="crux-arm-rootfs-2.7"
-PACKAGES=""
+TMPDIR="$PWD_DIR/tmp"
+PKGDIR="$PWD_DIR/pkg"
checkCommands
checkVars $@
# create the database stuff for pkgutils
checkCommands
checkVars $@
# create the database stuff for pkgutils
-sudo install -d -m 0755 $TMP
_
DIR/var/lib/pkg
-sudo touch $TMP
_
DIR/var/lib/pkg/db
-sudo chmod 0444 $TMP
_
DIR/var/lib/pkg/db
+sudo install -d -m 0755 $TMPDIR/var/lib/pkg
+sudo touch $TMPDIR/var/lib/pkg/db
+sudo chmod 0444 $TMPDIR/var/lib/pkg/db
# install all packages
pkgnum=0
# install all packages
pkgnum=0
+echo "Please wait for results..."
for pkg in $PACKAGES; do
for pkg in $PACKAGES; do
- sudo pkgadd -r $TMP
_DIR $pkg && echo "Installing $pkg" || exit 1
+ sudo pkgadd -r $TMP
DIR $pkg || msgError "failed to install $pkg"
let pkgnum=$pkgnum+1
done
# create the tarball and the md5sum
let pkgnum=$pkgnum+1
done
# create the tarball and the md5sum
-cd $TMP_DIR && sudo tar cvjf $RELEASE_DIR/$RELEASE_NAME.tar.bz2 * && cd ..
-cd $RELEASE_DIR && md5sum $RELEASE_NAME.tar.bz2 > $RELEASE_NAME.tar.bz2.md5 && cd ..
+cd $TMPDIR && sudo tar cJf $RELEASE_DIR/$RELEASE_NAME.tar.xz * && cd -
+cd $RELEASE_DIR && md5sum $RELEASE_NAME.tar.xz > $RELEASE_NAME.tar.xz.md5 && cd -
+
+echo "- Installed $pkgnum packages"
+echo "- Finished $RELEASE_DIR/$RELEASE_NAME.tar.xz"
-echo "Installed packages: $pkgnum"
-sudo rm -rf $TMP_DIR
-echo "Release done: $RELEASE_DIR/$RELEASE_NAME.tar.bz2"
+sudo rm -rf $TMPDIR
# End of file
# End of file