wok rev 14335

Add linux-uml
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 13 15:34:35 2013 +0200 (2013-04-13)
parents b932b8cd3cfa
children 3eea66e3605c
files linux-uml/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linux-uml/receipt	Sat Apr 13 15:34:35 2013 +0200
     1.3 @@ -0,0 +1,110 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="linux-uml"
     1.7 +SOURCE="linux"
     1.8 +VERSION="3.2.40"
     1.9 +KBASEVER="${VERSION:0:3}"
    1.10 +CATEGORY="base-system"
    1.11 +SHORT_DESC="The User Mode Linux kernel."
    1.12 +BUILD_DEPENDS="slitaz-toolchain perl"
    1.13 +MAINTAINER="pascal.bellard@slitaz.org"
    1.14 +TARBALL="$SOURCE-$VERSION.tar.bz2"
    1.15 +WEB_SITE="http://www.kernel.org/"
    1.16 +WGET_URL="ftp://ftp.kernel.org/pub/linux/kernel/v3.0/$TARBALL"
    1.17 +
    1.18 +# Rules to configure and make the package.
    1.19 +compile_rules()
    1.20 +{
    1.21 +	cd $src
    1.22 +	if [ "$KBASEVER" != "$VERSION" ]; then
    1.23 +		PATCH="$(dirname $WGET_URL)/patch-$VERSION.xz"
    1.24 +		[ -s $SRC/$(basename $PATCH) ] ||
    1.25 +		wget $PATCH -O $SRC/$(basename $PATCH)
    1.26 +		xzcat $SRC/$(basename $PATCH) | patch -Np1
    1.27 +		touch done.patch-$VERSION
    1.28 +	fi
    1.29 +	sed -i 's/uname -m/echo i386/;s|/bin/bash|/bin/ash|g' Makefile
    1.30 +	make ARCH=um mrproper	
    1.31 +	cat > mini.config << EOF &&
    1.32 +CONFIG_BINFMT_ELF=y
    1.33 +CONFIG_LBD=y
    1.34 +CONFIG_BLK_DEV=y
    1.35 +CONFIG_BLK_DEV_LOOP=y
    1.36 +CONFIG_STDERR_CONSOLE=y
    1.37 +CONFIG_SSL=y
    1.38 +CONFIG_UNIX98_PTYS=y
    1.39 +CONFIG_PROC_FS=y
    1.40 +CONFIG_SYSFS_FS=y
    1.41 +CONFIG_IKCONFIG=y
    1.42 +CONFIG_IKCONFIG_PROC=y
    1.43 +CONFIG_UML_NET=y
    1.44 +CONFIG_UML_NET_TUNTAP=y
    1.45 +CONFIG_STATIC_LINK=y
    1.46 +CONFIG_BLK_DEV_INITRD=y
    1.47 +CONFIG_PTY_CHAN=y
    1.48 +CONFIG_TTY_CHAN=y
    1.49 +CONFIG_NET=y
    1.50 +CONFIG_INET=y
    1.51 +CONFIG_UML_NET=y
    1.52 +CONFIG_UML_NET_TUNTAP=y
    1.53 +CONFIG_BLK_DEV_UBD=y
    1.54 +CONFIG_EXT4_FS=y
    1.55 +CONFIG_EXT4_USE_FOR_EXT23=y
    1.56 +CONFIG_EXT4_FS_XATTR=y
    1.57 +CONFIG_EXT4_FS_POSIX_ACL=y
    1.58 +CONFIG_FUSE_FS=y
    1.59 +CONFIG_ISO9660_FS=y
    1.60 +CONFIG_VFAT_FS=y
    1.61 +CONFIG_TMPFS=y
    1.62 +CONFIG_SWAP=y
    1.63 +CONFIG_SYSVIPC=y
    1.64 +CONFIG_SYSVIPC_SYSCTL=y
    1.65 +CONFIG_SYSVIPC_COMPAT=y
    1.66 +CONFIG_PACKET=y            
    1.67 +CONFIG_UNIX=y              
    1.68 +CONFIG_NETFILTER=y        
    1.69 +CONFIG_NETFILTER_ADVANCED=y
    1.70 +CONFIG_NF_CONNTRACK=y
    1.71 +CONFIG_NETFILTER_XTABLES=y
    1.72 +CONFIG_NF_DEFRAG_IPV4=y
    1.73 +CONFIG_NF_CONNTRACK_IPV4=y
    1.74 +CONFIG_NF_CONNTRACK_PROC_COMPAT=y
    1.75 +CONFIG_IP_NF_IPTABLES=y
    1.76 +CONFIG_IP_NF_FILTER=y
    1.77 +CONFIG_IP_NF_TARGET_REJECT=y
    1.78 +CONFIG_NF_NAT=y
    1.79 +CONFIG_NF_NAT_NEEDED=y
    1.80 +CONFIG_IP_NF_TARGET_MASQUERADE=y
    1.81 +CONFIG_IP_NF_TARGET_REDIRECT=y
    1.82 +CONFIG_NETDEVICES=y
    1.83 +CONFIG_TUN=y
    1.84 +EOF
    1.85 +	make ARCH=um allnoconfig KCONFIG_ALLCONFIG=mini.config &&
    1.86 +	make ARCH=um
    1.87 +} 
    1.88 +
    1.89 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.90 +genpkg_rules()
    1.91 +{
    1.92 +	mkdir -p $fs/boot
    1.93 +	cp $src/linux $fs/boot/linux-uml-$VERSION
    1.94 +	cat > $fs/boot/vm-uml <<EOT
    1.95 +#!/bin/sh
    1.96 +
    1.97 +# /etc/inittab: "tty21::respawn:/bin/su -c '/boot/vm-uml 1 /boot/guests/slitaz.img 2 512m' nobody"
    1.98 +tap=tap\${1:-0}
    1.99 +n=\${tap#tap}
   1.100 +args="rw root=/dev/null"
   1.101 +dev="initrd=\$(ls -r /boot/rootfs*.gz | sed q)"
   1.102 +if [ -n "\$2" ]; then
   1.103 +	args="ro root=620\${3:-1} screen=text sound=noconf"
   1.104 +	dev="ubd0=\$2"
   1.105 +fi
   1.106 +
   1.107 +cd \$(dirname \$0)
   1.108 +ifconfig \$tap 192.168.\${tap#tap}.1
   1.109 +./linux-uml-$VERSION \$dev mem=\${4:-512m} fakehd fake_ide ubd=3 con=pts ssl=pts \\
   1.110 +	con0=fd:0,fd:1 eth0=tuntap,\$tap,fe:f0:00:00:00:0\$n,192.168.\$n.1 \$args
   1.111 +EOT
   1.112 +	chmod 755 $fs/boot/vm-uml
   1.113 +}