wok-next rev 4645
linux-source: add missing files.
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Sat Dec 26 11:02:36 2009 +0100 (2009-12-26) |
parents | 116984a54f50 |
children | 0fdd833f5ff2 |
files | linux-source/stuff/buildtaz linux-source/stuff/make-tazpkg.u |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/linux-source/stuff/buildtaz Sat Dec 26 11:02:36 2009 +0100 1.3 @@ -0,0 +1,80 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +# buildtaz 1.0 1.7 +# This script generate a SliTaz package for linux kernel and modules. 1.8 +# Inspired from builddeb script. 1.9 +# 1.10 +# (C) 2009 SliTaz - GNU General Public License v3. 1.11 +# 1.12 +# Author: Eric Joseph-Alexandre <erjo@slitaz.org> 1.13 + 1.14 +set -e 1.15 + 1.16 +LOCALVERSION=$(grep ^CONFIG_LOCALVERSION $objtree/.config | sed -e "s/CONFIG_LOCALVERSION=\"\(.*\)\"/\1/") 1.17 +PACKAGE="linux${LOCALVERSION}" 1.18 +VERSION=${KERNELVERSION} 1.19 +V=$KERNELRELEASE 1.20 +DIR="$objtree/taz/$PACKAGE-$VERSION" 1.21 +fs="$DIR/fs" 1.22 + 1.23 +# Setup directories 1.24 +rm -rf "$objtree/taz" 1.25 +mkdir -p "$fs/lib" "$fs/boot" 1.26 + 1.27 +# Build and install kernel 1.28 +cp System.map "$fs/boot/System.map-$KERNELRELEASE" 1.29 +cp $KBUILD_IMAGE "$fs/boot/vmlinuz-$KERNELRELEASE" 1.30 + 1.31 +# Build and compress modules if needed 1.32 +if grep -q '^CONFIG_MODULES=y' .config ; then 1.33 + INSTALL_MOD_PATH="$fs" make KBUILD_SRC= modules_install 1.34 + $objtree/slitaz/gztazmod.sh $fs/lib/modules/${VERSION}${LOCALVERSION} 1.35 +fi 1.36 + 1.37 +# Create Slitaz package 1.38 +cat > $DIR/receipt <<EOT 1.39 +# SliTaz package receipt. 1.40 + 1.41 +PACKAGE="${PACKAGE}" 1.42 +VERSION="${VERSION}" 1.43 +CATEGORY="base-system" 1.44 +SHORT_DESC="Customized Linux Kernel" 1.45 +WEB_SITE="http://www.kernel.org" 1.46 +DEPENDS="depmod" 1.47 + 1.48 +post_install() 1.49 +{ 1.50 + echo "Processing post-install commands..." 1.51 + chroot "\$1/" depmod -a $V 1.52 + if [ -f "\$1/boot/grub/menu.lst" ]; then 1.53 + root_dev="`cat \$1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`" 1.54 + grub_dev="`cat \$1/boot/grub/menu.lst | grep "root (" | head -n 1`" 1.55 + # Add new kernel entry in case of upgrade for installed system. 1.56 + if ! grep -q \$PACKAGE-\$VERSION \$1/boot/grub/menu.lst; then 1.57 + echo " 1.58 + 1.59 +title SliTaz GNU/Linux (Kernel $V) 1.60 +"\$grub_dev" 1.61 +kernel /boot/vmlinuz-$V root=\$root_dev" >> \$1/boot/grub/menu.lst 1.62 + fi 1.63 + 1.64 + # Display information message. 1.65 + echo " 1.66 +---- 1.67 +GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: 1.68 + 1.69 +title SliTaz GNU/Linux (Kernel $V) 1.70 +\$grub_dev 1.71 +kernel /boot/vmlinuz-$V root=\$root_dev 1.72 +---- 1.73 +" 1.74 + fi 1.75 +} 1.76 +EOT 1.77 + 1.78 +# Pack 1.79 +cd $objtree/taz 1.80 +tazpkg pack $PACKAGE-$VERSION 1.81 +mv *.tazpkg $objtree 1.82 +cd - 1.83 +exit 0
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/linux-source/stuff/make-tazpkg.u Sat Dec 26 11:02:36 2009 +0100 2.3 @@ -0,0 +1,24 @@ 2.4 +--- linux-2.6.30.6-slitaz.ori/scripts/package/Makefile Wed Sep 9 05:39:34 2009 2.5 ++++ linux-2.6.30.6-slitaz/scripts/package/Makefile Fri Dec 25 22:03:55 2009 2.6 +@@ -83,7 +83,15 @@ 2.7 + 2.8 + clean-dirs += $(objtree)/tar-install/ 2.9 + 2.10 ++# tazpkg target 2.11 ++# --------------------------------------------------------------------------- 2.12 ++tazpkg: FORCE 2.13 ++ $(MAKE) KBUILD_SRC= 2.14 ++ $(CONFIG_SHELL) $(srctree)/scripts/package/buildtaz 2.15 + 2.16 ++clean-dirs += $(objtree)/taz/ 2.17 ++ 2.18 ++ 2.19 + # Help text displayed when executing 'make help' 2.20 + # --------------------------------------------------------------------------- 2.21 + help: FORCE 2.22 +@@ -93,4 +101,5 @@ 2.23 + @echo ' tar-pkg - Build the kernel as an uncompressed tarball' 2.24 + @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' 2.25 + @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' 2.26 ++ @echo ' tazpkg - Build the kernel as a SliTaz package' 2.27 +