summaryrefslogtreecommitdiffstats
path: root/base/initrd/Pkgfile
blob: 04de71253ac655d2d793b99a87e60b8162dd6094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Description: L'initrd avec le système de maintenance
# URL:  http://www.kernel.org
# Maintainer: NuTyX core team
# Packager: thierryn1 at hispeed dot ch

name=initrd
version=2.6.33.1
release=3
_tools=02042010
_baseversion=2.6.33
SCRIPT_VERSION="2009.3"
source=()
build(){
wget http://kiao.no-ip.info/NuTyX/tools/install-${SCRIPT_VERSION}.ash
wget http://kiao.no-ip.info/NuTyX/2009.3/`uname -m`/release/kernel%23$version-1.pkg.tar.gz
WDIR=$SRC/installtools
tar xf kernel*
mkdir -p $WDIR
wget http://kiao.no-ip.info/NuTyX/tools/installtools-${_tools}.tar.gz
tar -C $WDIR --use-compress-program=gzip -xf installtools-${_tools}.tar.gz

mkdir -p $WDIR/rootfs/lib/modules/${_baseversion}-NuTyX/kernel/{drivers,fs}
cp -a lib/modules/${_baseversion}-NuTyX/kernel/crypto \
$WDIR/rootfs/lib/modules/${_baseversion}-NuTyX/kernel/
for i in ata block input ide hid message parport \
serial misc net pcmcia scsi usb md rtc
do
	if [ -d lib/modules/${_baseversion}-NuTyX/kernel/drivers/$i ]; then
		cp -a lib/modules/${_baseversion}-NuTyX/kernel/drivers/$i \
		$WDIR/rootfs/lib/modules/${_baseversion}-NuTyX/kernel/drivers/
	fi
done
for i in wireless irda wan bonding \
hamradio appletalk cxgb3 mlx4 sfc
do 
	rm -r $WDIR/rootfs/lib/modules/${_baseversion}-NuTyX/kernel/drivers/net/$i
done
for i in fat ntfs smbfs vfat ext4 fs nfs nfs_common nfsd lockd
do
	if [ -d lib/modules/${_baseversion}-NuTyX/kernel/fs/$i ]; then
		cp -a lib/modules/${_baseversion}-NuTyX/kernel/fs/$i \
		$WDIR/rootfs/lib/modules/${_baseversion}-NuTyX/kernel/fs/
	fi
done
if [ -d lib/modules/${_baseversion}-NuTyX/kernel/net/sunrpc ]; then
	mkdir -p $WDIR/rootfs/lib/modules/${_baseversion}-NuTyX/kernel/net/
	cp -a lib/modules/${_baseversion}-NuTyX/kernel/net/sunrpc \
	$WDIR/rootfs/lib/modules/${_baseversion}-NuTyX/kernel/net/
fi
$WDIR/rootfs/sbin/depmod -b $WDIR/rootfs ${_baseversion}-NuTyX
	
cp install-${SCRIPT_VERSION}.ash $WDIR/rootfs/root/
	
# Compression des modules
cd $WDIR/rootfs/lib/modules/${_baseversion}-NuTyX
find . -name "*.ko" -exec gzip '{}' \;
sed -i 's/\.ko/.ko.gz/g' modules.dep
cd -
sed -i "s/#version#/$version/" $WDIR/iso/isolinux/boot.msg
cp  boot/kernel-$version $WDIR/iso/isolinux/kernel
sh $WDIR/script/mkinitrd $WDIR
mkdir -p $PKG/boot
cp $WDIR/iso/isolinux/initrd $PKG/boot/nutyx-initrd
}