slitaz-modular view initramfs/usr/bin/taz2xz @ rev 179

makegraphs: tune cpuinfo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 15 08:09:01 2021 +0000 (2021-01-15)
parents 3960f7d3f3a3
children
line source
1 #!/bin/bash
3 PATH=.:$(dirname $0):/usr/lib:$PATH
4 . liblinuxlive || exit 1
6 . /etc/slitaz/slitaz.conf
8 INSTALL_FILES="receipt files.list md5sum volatile.cpio.gz"
9 INCOMING_REPOSITORY="$SLITAZ_DIR/$SLITAZ_VERSION/packages-incoming"
11 if [ "$1" = "" ]; then
12 echo
13 echo "Convert package into .xz compressed module"
14 echo "usage: $0 pkgname"
15 exit 1
16 fi
18 if [ -d "$2" ]; then
19 CUR_DIR="$2"
20 else
21 CUR_DIR="$PWD"
22 fi
25 look_for_dep()
26 {
27 grep -m1 ^$1$'\t' $INCOMING_REPOSITORY/wok-depends.txt | cut -f 2 | sed 's|^[ \t]*||g' | sed 's| |\n|g'
28 }
30 tmp_dir=/tmp/taz2xz-$$
31 mkdir -p $tmp_dir
32 cd $tmp_dir
34 tazpkg get $1 || exit 1
35 PACKAGE_FILE="$(find -name "$1-*.tazpkg")"
36 { cpio --quiet -i receipt > /dev/null 2>&1; } < $PACKAGE_FILE
37 unset PKGNAME PACKAGE VERSION EXTRAVERSION
38 source receipt || exit 1
39 PKGNAME="${PACKAGE}-${VERSION}${EXTRAVERSION}"
40 tazpkg extract $PKGNAME.tazpkg
41 for i in $INSTALL_FILES; do
42 if [ -f "$PKGNAME/$i" ]; then
43 mkdir -p $PKGNAME/fs/$INSTALLED/$PACKAGE
44 cp -a $PKGNAME/$i $PKGNAME/fs/$INSTALLED/$PACKAGE/$i
45 fi
46 done
47 md5sum $PKGNAME.tazpkg > $PKGNAME/fs/$INSTALLED/$PACKAGE/pkgmd5
48 create_module $PKGNAME/fs $CUR_DIR/$PKGNAME.xz -comp xz -Xbcj x86
50 cd $CUR_DIR
51 rm -rf $tmp_dir
52 #[ -f $tmp_dir/receipt ] && rm -rf $tmp_dir/receipt
53 #[ -d $tmp_dir/$PACKAGE-$VERSION ] && rm -rf $tmp_dir/$PACKAGE-$VERSION
54 #[ -f $tmp_dir/$PACKAGE-$VERSION.tazpkg ] & rm -rf $tmp_dir/$PACKAGE-$VERSION.tazpkg