wok-6.x rev 11396

Update linux-libre according to changes made to linux (since months)
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sat Dec 10 06:11:04 2011 +0100 (2011-12-10)
parents 93f683705964
children 08db442f295b
files linux-libre-api-headers/receipt linux-libre-source/stuff/get-linux-source linux-libre/receipt linux-libre/stuff/bootloader.sh linux-libre/stuff/check_modules.sh linux-libre/stuff/linux-libre-2.6.37-libre-slitaz.config
line diff
     1.1 --- a/linux-libre-api-headers/receipt	Sat Dec 10 06:08:28 2011 +0100
     1.2 +++ b/linux-libre-api-headers/receipt	Sat Dec 10 06:11:04 2011 +0100
     1.3 @@ -6,7 +6,7 @@
     1.4  SHORT_DESC="Kernel headers sanitized for use in userspace."
     1.5  MAINTAINER="gokhlayeh@slitaz.org"
     1.6  PROVIDE="linux-api-headers"
     1.7 -SOURCE="linux"
     1.8 +SOURCE="linux-libre"
     1.9  TARBALL="$SOURCE-$VERSION.tar.bz2"
    1.10  WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/"
    1.11  WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL"
    1.12 @@ -15,7 +15,6 @@
    1.13  cook_tmp_toolchain()
    1.14  {
    1.15  	cd $src
    1.16 -
    1.17  	make mrproper &&
    1.18  	make headers_check &&
    1.19  	make INSTALL_HDR_PATH=dest headers_install &&
    1.20 @@ -26,7 +25,6 @@
    1.21  compile_rules()
    1.22  {
    1.23  	cd $src
    1.24 -
    1.25  	make mrproper &&
    1.26  	make headers_check &&
    1.27  	make INSTALL_HDR_PATH=$DESTDIR/usr headers_install
    1.28 @@ -37,7 +35,6 @@
    1.29  {
    1.30  	mkdir -p $fs/usr
    1.31  	cp -a $_pkg/usr/include $fs/usr
    1.32 -
    1.33  	rm -f $(find ${fs} -name .install -or -name ..install.cmd)
    1.34  }
    1.35  
     2.1 --- a/linux-libre-source/stuff/get-linux-source	Sat Dec 10 06:08:28 2011 +0100
     2.2 +++ b/linux-libre-source/stuff/get-linux-source	Sat Dec 10 06:11:04 2011 +0100
     2.3 @@ -6,6 +6,10 @@
     2.4  VERSION=XXX
     2.5  
     2.6  url=$(cat /usr/src/kernel-patches/slitaz/url)
     2.7 +for i in http://linux-kernel.uio.no/pub http://www.gtlib.gatech.edu/pub/kernel.org http://www.kernel.org/pub ; do
     2.8 +	busybox wget -s $url && break
     2.9 +	url=$(echo $url | sed "s|.*/linux/kernel|$i/linux/kernel|")
    2.10 +done
    2.11  
    2.12  if [ ! -d $SOURCES_REPOSITORY ]; then
    2.13  	mkdir -p $SOURCES_REPOSITORY
    2.14 @@ -40,6 +44,8 @@
    2.15  done < slitaz/patches
    2.16  [ ! -f System.map ] && cp slitaz/config .config &&
    2.17  make oldconfig && make modules_prepare
    2.18 +ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build
    2.19 +ln -s linux-$VERSION /usr/src/linux
    2.20  
    2.21  	cat <<EOT
    2.22  ----
     3.1 --- a/linux-libre/receipt	Sat Dec 10 06:08:28 2011 +0100
     3.2 +++ b/linux-libre/receipt	Sat Dec 10 06:11:04 2011 +0100
     3.3 @@ -24,20 +24,20 @@
     3.4  	#do
     3.5  	#	sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
     3.6  	#done
     3.7 -	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report open-bloc
     3.8 +
     3.9 +	[ ! -x /usr/bin/cook ] && report open-bloc
    3.10  
    3.11  	# Check for Aufs and cook it if unbuilt.
    3.12  	echo "Checking for Aufs packages..."
    3.13  	_AUFSVER=`grep  ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
    3.14 -	if [ -x /usr/bin/cook ]; then
    3.15 +	if [ ! -d "$AUFSDIR" ] && [ -x /usr/bin/cook ]; then
    3.16  		# Give info an redirect to /dev/null since aufs got it own log.
    3.17  		AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER}
    3.18 -		[ -d "$AUFSDIR" ] && rm -rf $AUFSDIR
    3.19  		echo "Cook: aufs $_AUFSVER"
    3.20  		cook aufs > /dev/null
    3.21 -	elif [ -x /usr/bin/tazwok ]; then
    3.22 -		# we just need aufs source. Also cooking now is a bad idea since it
    3.23 -		# needs linux-module-headers. The one your cooking not the one from the web.
    3.24 +	elif [ ! -x /usr/bin/cook ]; then
    3.25 +		# We only need aufs source. Also cooking now is a bad idea since it
    3.26 +		# needs linux-module-headers.
    3.27  		AUFSDIR=$WOK/aufs/aufs-${_AUFSVER}
    3.28  		[ -d "$AUFSDIR" ] && rm -rf $AUFSDIR
    3.29  		tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
    3.30 @@ -46,16 +46,15 @@
    3.31  	echo "Copying Aufs files and patches..."
    3.32  	cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
    3.33  	cp -a $AUFSDIR/*.patch $stuff
    3.34 -
    3.35 +	
    3.36  	# SliTaz db
    3.37 -	[ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null
    3.38 -	mkdir $WOK/$PACKAGE/slitaz
    3.39 +	rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz
    3.40  	echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
    3.41  	cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
    3.42  	cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
    3.43  	
    3.44  	# Apply patches
    3.45 -	echo "Applying patches"
    3.46 +	echo "Applying patches..."
    3.47  	while read patch_file; do
    3.48  		echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
    3.49  		cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
    3.50 @@ -64,11 +63,7 @@
    3.51  			continue
    3.52  		fi
    3.53  		echo "Apply $patch_file"
    3.54 -		if [ -x /usr/bin/cook ]; then
    3.55 -			patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || return 1
    3.56 -		elif [ -x /usr/bin/tazwok ]; then
    3.57 -			patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
    3.58 -		fi
    3.59 +		patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
    3.60  		touch done.$patch_file
    3.61  	done <<EOT
    3.62  $PACKAGE-diff-$VERSION.u
    3.63 @@ -83,19 +78,16 @@
    3.64  004-squashfs-add-xz-compression-support.patch
    3.65  005-squashfs-add-xz-compression-configuration-option.patch
    3.66  EOT
    3.67 -	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest"
    3.68 +
    3.69 +	[ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest"
    3.70  	
    3.71  	make mrproper
    3.72  	cd Documentation/lguest
    3.73 -	if [ -x /usr/bin/cook ]; then
    3.74 -		make lguest || return 1
    3.75 -	elif [ -x /usr/bin/tazwok ]; then
    3.76 -		make lguest || { report close-bloc; return 1; }
    3.77 -	fi
    3.78 +	make $MAKEFLAGS lguest || { report close-bloc; return 1; }
    3.79  	cd $src
    3.80  
    3.81 -	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Make bzImage without modules first"
    3.82 -	
    3.83 +	[ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first"
    3.84 +
    3.85  	# Build bzImage without modules first
    3.86  	cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
    3.87  	sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
    3.88 @@ -105,31 +97,35 @@
    3.89  	       -e 's/^CONFIG_R8187SE/#&/' \
    3.90  	       -e 's/^CONFIG_RT2870/#&/' .config
    3.91  	yes '' | make oldconfig
    3.92 -	make -j 4 bzImage || { report close-bloc; return 1; }
    3.93 -	[ -d $DESTDIR ] || mkdir -p $DESTDIR
    3.94 -	mv arch/x86/boot/bzImage $DESTDIR
    3.95 +	make $MAKEFLAGS bzImage || { report close-bloc; return 1; }
    3.96 +	[ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
    3.97 +	mv arch/x86/boot/bzImage $PWD/_pkg
    3.98  	mv System.map System.map-without-modules
    3.99  
   3.100 -	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Now build bzImage with modules"
   3.101 +	[ -x /usr/bin/cook ] && report step "Now build bzImage with modules"
   3.102  	
   3.103  	# Build bzImage with modules
   3.104  	cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
   3.105  	make oldconfig
   3.106  	ln .config $WOK/$PACKAGE/slitaz/config
   3.107 -	make -j 4 bzImage &&
   3.108 -	make -j 4 modules &&
   3.109 -	make INSTALL_MOD_PATH=$DESTDIR modules_install &&
   3.110 -	make INSTALL_HDR_PATH=$DESTDIR/usr headers_install &&
   3.111 -	#[ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
   3.112 -	mkdir -p $DESTDIR/boot 2> /dev/null
   3.113 -	mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz
   3.114 -
   3.115 +	make $MAKEFLAGS bzImage &&
   3.116 +	make $MAKEFLAGS modules &&
   3.117 +	make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
   3.118 +	make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
   3.119 +	[ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
   3.120 +	mkdir -p $PWD/_pkg/boot 2> /dev/null
   3.121 +	mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
   3.122 +	
   3.123 +	[ ! -x /usr/bin/cook ] && report step "Compressing all modules"
   3.124 +	
   3.125  	# Compress all modules.
   3.126 -	echo "Compressing all modules"
   3.127 -	$stuff/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz
   3.128 +	$stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
   3.129  	ln System.map System.map-modules
   3.130  	ln Module.symvers Module.symvers-modules
   3.131 -	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report close-bloc
   3.132 +	
   3.133 +	if [ ! -x /usr/bin/cook ]; then
   3.134 +		report close-bloc
   3.135 +	fi
   3.136  }
   3.137  
   3.138  # Rules to gen a SliTaz package suitable for Tazpkg.
   3.139 @@ -138,7 +134,7 @@
   3.140      local path
   3.141      cp -a $_pkg/boot $fs
   3.142      # Compress all modules.
   3.143 -    $stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
   3.144 +    #$stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
   3.145      path=$fs/lib/modules/$VERSION-slitaz/kernel
   3.146      mkdir -p $path
   3.147      cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
   3.148 @@ -148,7 +144,7 @@
   3.149      export _pkg
   3.150      mkdir $WOK/$PACKAGE/tmp
   3.151      $stuff/list_modules.sh \
   3.152 -	$(cat $stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
   3.153 +	$(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
   3.154      while read module; do
   3.155      	dir=$(dirname $module)
   3.156      	[ -d $path/$dir ] || mkdir -p $path/$dir
   3.157 @@ -157,7 +153,6 @@
   3.158      # Remove unresolved links
   3.159      rm -f $fs/lib/modules/$VERSION-slitaz/build
   3.160      rm -f $fs/lib/modules/$VERSION-slitaz/source
   3.161 -
   3.162      # Check and echo any module in kernel .config that's not added to 
   3.163      # one of linux-* pkgs
   3.164  	$stuff/check_modules.sh 
     4.1 --- a/linux-libre/stuff/bootloader.sh	Sat Dec 10 06:08:28 2011 +0100
     4.2 +++ b/linux-libre/stuff/bootloader.sh	Sat Dec 10 06:11:04 2011 +0100
     4.3 @@ -15,90 +15,60 @@
     4.4  
     4.5  Default values: --format 1440 --tracks 80 --prefix floppy.
     4.6  
     4.7 +Or:	cat fd0*.img | $0 --extract
     4.8 +
     4.9 +Create the kernel, cmdline and rootfs files from a floppy set
    4.10 +
    4.11  Example:
    4.12 -$0 /boot/vmlinuz-2.6.30.6 --rdev /dev/ram0 --video -3 --cmdline 'rw lang=fr_FR kmap=fr-latin1 laptop autologin' --initrd /boot/rootfs.gz --initrd ./myconfig.gz
    4.13 +$0 /boot/vmlinuz-2.6.30.6 --rdev /dev/ram0 --video -3 \
    4.14 +--cmdline 'rw lang=fr_FR kmap=fr-latin1 laptop autologin' \
    4.15 +--initrd /boot/rootfs.gz --initrd ./myconfig.gz
    4.16  EOT
    4.17  exit 1
    4.18  }
    4.19  
    4.20 -KERNEL=""
    4.21 -INITRD=""
    4.22 -CMDLINE=""
    4.23 -PREFIX="floppy."
    4.24 -FORMAT="1440"
    4.25 -RDEV=""
    4.26 -VIDEO=""
    4.27 -FLAGS=""
    4.28 -TRACKS=""
    4.29 -DEBUG=""
    4.30 -while [ -n "$1" ]; do
    4.31 -	case "$1" in
    4.32 -	--c*|-c*)  CMDLINE="$2"; shift;;
    4.33 -	--i*|-i*)  INITRD="$INITRD $2"; shift;;
    4.34 -	--p*|-p*)  PREFIX="$2"; shift;;
    4.35 -	--fo*|-f*) FORMAT="$2"; shift;;
    4.36 -	--fl*)     FLAGS="$2"; shift;;	# 1 read-only, 0 read-write
    4.37 -	--r*|-r*)  RDEV="$2"; shift;;	# /dev/???
    4.38 -	--v*|-v*)  VIDEO="$2"; shift;;	# -3 .. n
    4.39 -	--t*|-t*)  TRACKS="$2"; shift;; # likely 81 .. 84
    4.40 -	--debug)   DEBUG="1";;
    4.41 -	*) KERNEL="$1";;
    4.42 -	esac
    4.43 -	shift
    4.44 -done
    4.45 -[ -n "$KERNEL" -a -f "$KERNEL" ] || usage
    4.46 -if [ -n "$TRACKS" ]; then
    4.47 -	if [ $(( $FORMAT % $TRACKS )) -ne 0 ]; then
    4.48 -		echo "Invalid track count for format $FORMAT."
    4.49 -		usage
    4.50 -	fi
    4.51 -fi
    4.52 +ddq()
    4.53 +{
    4.54 +	dd $@ 2> /dev/null
    4.55 +}
    4.56  
    4.57 -# write a 16 bits data
    4.58 -# usage: store16 offset data16 file
    4.59 -store16()
    4.60 +dbg()
    4.61  {
    4.62 -	n=$2; i=2; while [ $i -ne 0 ]; do
    4.63 -		printf '\\\\x%02X' $(($n & 255))
    4.64 -		i=$(($i-1)); n=$(($n >> 8))
    4.65 -	done | xargs echo -en | \
    4.66 -		dd bs=2 conv=notrunc of=$3 seek=$(( $1 / 2 )) 2> /dev/null
    4.67 -	[ -n "$DEBUG" ] && printf "store16(%04X) = %04X\n" $1 $2 1>&2
    4.68 +	[ -n "$DEBUG" ] && echo "$@" 1>&2
    4.69  }
    4.70  
    4.71  # write a 32 bits data
    4.72 -# usage: storelong offset data32 file
    4.73 -storelong()
    4.74 +# usage: put offset data32 file [bytes]
    4.75 +put()
    4.76  {
    4.77 -	n=$2; i=4; while [ $i -ne 0 ]; do
    4.78 +	n=$2; for i in $(seq 1 ${4:-4}); do
    4.79  		printf '\\\\x%02X' $(($n & 255))
    4.80 -		i=$(($i-1)); n=$(($n >> 8))
    4.81 -	done | xargs echo -en | \
    4.82 -		dd bs=4 conv=notrunc of=$3 seek=$(( $1 / 4 )) 2> /dev/null
    4.83 -	[ -n "$DEBUG" ] && printf "storelong(%04X) = %08X\n" $1 $2 1>&2
    4.84 +		n=$(($n >> 8))
    4.85 +	done | xargs echo -en | ddq bs=1 conv=notrunc of=$3 seek=$1
    4.86 +	[ -n "$DEBUG" ] && printf "put$4(%04X) = %X\n" $1 $2 1>&2
    4.87  }
    4.88  
    4.89  # read a 32 bits data
    4.90 -# usage: getlong offset file
    4.91 -getlong()
    4.92 +# usage: get offset file [bytes]
    4.93 +get()
    4.94  {
    4.95 -	dd if=$2 bs=1 skip=$(( $1 )) count=4 2> /dev/null | \
    4.96 -		hexdump -e '"" 1/4 "%d" "\n"'
    4.97 +	ddq if=$2 bs=1 skip=$(($1)) count=${3:-4} | hexdump -e '"" 1/4 "%d"'
    4.98  }
    4.99  
   4.100 +SetupSzOfs=0x1F1
   4.101 +SyssizeOfs=0x1F4
   4.102 +RamfsLenOfs=0x21C
   4.103 +ArgPtrOfs=0x228
   4.104 +
   4.105  floppyset()
   4.106  {
   4.107  	# bzImage offsets
   4.108 -	CylinderCount=496
   4.109 -	SetupSzOfs=497
   4.110 -	FlagsOfs=498
   4.111 -	SyssizeOfs=500
   4.112 -	VideoModeOfs=506
   4.113 -	RootDevOfs=508
   4.114 +	CylinderCount=0x1F0
   4.115 +	FlagsOfs=0x1F2
   4.116 +	VideoModeOfs=0x1FA
   4.117 +	RootDevOfs=0x1FC
   4.118  	CodeAdrOfs=0x214
   4.119  	RamfsAdrOfs=0x218
   4.120 -	RamfsLenOfs=0x21C
   4.121 -	ArgPtrOfs=0x228
   4.122  
   4.123  	# boot+setup address
   4.124  	SetupBase=0x90000
   4.125 @@ -109,8 +79,8 @@
   4.126  
   4.127  	# Get and patch boot sector
   4.128  	# See  http://hg.slitaz.org/wok/raw-file/711d076b277c/linux/stuff/linux-header-2.6.34.u
   4.129 -	dd if=$KERNEL bs=512 count=1 of=$bs 2> /dev/null
   4.130 -	uudecode <<EOT | dd of=$bs conv=notrunc 2> /dev/null
   4.131 +	ddq if=$KERNEL bs=512 count=1 of=$bs
   4.132 +	uudecode <<EOT | ddq of=$bs conv=notrunc
   4.133  begin-base64 644 -
   4.134  /L+6nWgAkAcGF4n8McC5HQDzq1sfD6mg8X1ABlfFd3ixBvOlZWaPR3gGH8ZF
   4.135  +D/6l1hB6DQBvgACA3QO6HYBWwseKAJ0LFNH6AoBXuhmAbAgzRCwCM0QTuhl
   4.136 @@ -128,35 +98,33 @@
   4.137  EOT
   4.138  
   4.139  	# Get setup
   4.140 -	setupsz=$(getlong $SetupSzOfs $bs)
   4.141 -	setupszb=$(( $setupsz & 255 ))
   4.142 -	dd if=$KERNEL bs=512 skip=1 count=$setupszb 2> /dev/null >> $bs
   4.143 +	setupsz=$(get $SetupSzOfs $bs 1)
   4.144 +	ddq if=$KERNEL bs=512 skip=1 count=$setupsz >> $bs
   4.145  
   4.146  	if [ -n "$TRACKS" ]; then
   4.147 -		[ -n "$DEBUG" ] && echo -n "--tracks " 1>&2
   4.148 -		n=$(getlong $CylinderCount $bs)
   4.149 -		store16 $CylinderCount $(( ($n & -256) + $TRACKS )) $bs
   4.150 +		dbg -n "--tracks "
   4.151 +		put $CylinderCount $TRACKS $bs 1
   4.152  	fi
   4.153  	if [ -n "$FLAGS" ]; then
   4.154 -		[ -n "$DEBUG" ] && echo -n "--flags " 1>&2
   4.155 -		store16 $FlagsOfs $FLAGS $bs
   4.156 +		dbg -n "--flags "
   4.157 +		put $FlagsOfs $FLAGS $bs 2
   4.158  	fi
   4.159  	if [ -n "$VIDEO" ]; then
   4.160 -		[ -n "$DEBUG" ] && echo -n "--video " 1>&2
   4.161 -		store16 $VideoModeOfs $VIDEO $bs
   4.162 +		dbg -n "--video "
   4.163 +		put $VideoModeOfs $VIDEO $bs 2
   4.164  	fi
   4.165  	if [ -n "$RDEV" ]; then
   4.166 -		[ -n "$DEBUG" ] && echo -n "--rdev " 1>&2
   4.167 +		dbg -n "--rdev "
   4.168  		n=$(stat -c '0x%02t%02T' $RDEV 2> /dev/null)
   4.169  		[ -n "$n" ] || n=$RDEV
   4.170 -		store16 $RootDevOfs $n $bs
   4.171 +		put $RootDevOfs $n $bs 2
   4.172  	fi
   4.173  
   4.174  	# Store cmdline after setup
   4.175  	if [ -n "$CMDLINE" ]; then
   4.176 -		[ -n "$DEBUG" ] && echo -n "--cmdline '$CMDLINE' " 1>&2
   4.177 -		echo -n "$CMDLINE" | dd bs=512 count=1 conv=sync 2> /dev/null >> $bs
   4.178 -		storelong $ArgPtrOfs $(( $SetupBase + $stacktop )) $bs
   4.179 +		dbg -n "--cmdline '$CMDLINE' "
   4.180 +		echo -n "$CMDLINE" | ddq bs=512 count=1 conv=sync >> $bs
   4.181 +		put $ArgPtrOfs $(( $SetupBase + $stacktop )) $bs
   4.182  	fi
   4.183  
   4.184  	# Compute initramfs size
   4.185 @@ -164,39 +132,39 @@
   4.186  	padding=0
   4.187  	for i in $( echo $INITRD | sed 's/,/ /' ); do
   4.188  		[ -s "$i" ] || continue
   4.189 -		[ -n "$DEBUG" ] && echo "--initrd $i " 1>&2
   4.190 +		dbg "--initrd $i "
   4.191  		initrdlen=$(( $initrdlen + $padding ))
   4.192  		padding=$(stat -c %s $i)
   4.193  		initrdlen=$(( $initrdlen + $padding ))
   4.194  		padding=$(( 4096 - ($padding & 4095) ))
   4.195  		[ $padding -eq 4096 ] && padding=0
   4.196  	done
   4.197 -	Ksize=$(( $(getlong $SyssizeOfs $bs)*16 ))
   4.198 +	Ksize=$(( $(get $SyssizeOfs $bs)*16 ))
   4.199  	Kpad=$(( (($Ksize+4095)/4096)*4096 - Ksize ))
   4.200  	if [ $initrdlen -ne 0 ]; then
   4.201 -		[ -n "$DEBUG" ] && echo "initrdlen = $initrdlen " 1>&2
   4.202 -		Kbase=$(getlong $CodeAdrOfs $bs)
   4.203 -		storelong $RamfsAdrOfs \
   4.204 +		dbg "initrdlen = $initrdlen "
   4.205 +		Kbase=$(get $CodeAdrOfs $bs)
   4.206 +		put $RamfsAdrOfs \
   4.207  			$(( (0x1000000 - $initrdlen) & 0xFFFF0000 )) $bs
   4.208 -		storelong $RamfsLenOfs $(( ($initrdlen + 3) & -4 )) $bs
   4.209 +		put $RamfsLenOfs $(( ($initrdlen + 3) & -4 )) $bs
   4.210  	fi
   4.211  
   4.212  	# Output boot sector + setup + cmdline
   4.213 -	dd if=$bs 2> /dev/null
   4.214 +	ddq if=$bs
   4.215  
   4.216  	# Output kernel code
   4.217 -	dd if=$KERNEL bs=512 skip=$(( $setupszb + 1 )) 2> /dev/null
   4.218 +	ddq if=$KERNEL bs=512 skip=$(( $setupsz + 1 ))
   4.219  
   4.220  	# Pad to next sector
   4.221  	Kpad=$(( 512 - ($(stat -c %s $KERNEL) & 511) ))
   4.222 -	[ $Kpad -eq 512 ] || dd if=/dev/zero bs=1 count=$Kpad 2> /dev/null
   4.223 +	[ $Kpad -eq 512 ] || ddq if=/dev/zero bs=1 count=$Kpad
   4.224  
   4.225  	# Output initramfs
   4.226  	padding=0
   4.227  	for i in $( echo $INITRD | sed 's/,/ /' ); do
   4.228  		[ -s "$i" ] || continue
   4.229 -		[ $padding -ne 0 ] && dd if=/dev/zero bs=1 count=$padding 2> /dev/null
   4.230 -		dd if=$i 2> /dev/null
   4.231 +		[ $padding -ne 0 ] && ddq if=/dev/zero bs=1 count=$padding
   4.232 +		ddq if=$i
   4.233  		padding=$(( 4 - ($(stat -c %s $i) & 3) ))
   4.234  		[ $padding -eq 4 ] && padding=0
   4.235  	done
   4.236 @@ -205,6 +173,47 @@
   4.237  	rm -f $bs
   4.238  }
   4.239  
   4.240 +KERNEL=""
   4.241 +INITRD=""
   4.242 +CMDLINE=""
   4.243 +PREFIX="floppy."
   4.244 +FORMAT="1440"
   4.245 +RDEV=""
   4.246 +VIDEO=""
   4.247 +FLAGS=""
   4.248 +TRACKS=""
   4.249 +DEBUG=""
   4.250 +while [ -n "$1" ]; do
   4.251 +	case "${1/--/-}" in
   4.252 +	-c*)	CMDLINE="$2"; shift;;
   4.253 +	-i*)	INITRD="$INITRD $2"; shift;;
   4.254 +	-p*)	PREFIX="$2"; shift;;
   4.255 +	-fl*)	FLAGS="$2"; shift;;	# 1 read-only, 0 read-write
   4.256 +	-f*)	FORMAT="$2"; shift;;
   4.257 +	-r*)	RDEV="$2"; shift;;	# /dev/???
   4.258 +	-v*)	VIDEO="$2"; shift;;	# -3 .. n
   4.259 +	-t*)	TRACKS="$2"; shift;; 	# likely 81 .. 84
   4.260 +	-d*)	DEBUG="1";;
   4.261 +	-e*)	ddq bs=512 count=2 > kernel
   4.262 +		setupsz=$(get $SetupSzOfs kernel 1)
   4.263 +		ddq bs=512 count=$(($setupsz - 1)) >> kernel
   4.264 +		[ $(get $ArgPtrOfs kernel) -ne 0 ] && 
   4.265 +			ddq bs=512 count=1 | strings > cmdline
   4.266 +		syssz=$(get $SyssizeOfs kernel)
   4.267 +		ddq bs=512 count=$(( ($syssz + 31) / 32 )) >> kernel
   4.268 +		ddq bs=16 seek=$(($syssz + 32 + $setupsz*32)) count=0 of=kernel
   4.269 +		ramsz=$(get $RamfsLenOfs kernel)
   4.270 +		ddq bs=512 count=$((($ramsz + 511) / 512)) of=rootfs
   4.271 +		ddq bs=1 seek=$ramsz count=0 of=rootfs
   4.272 +		exit ;;
   4.273 +	*) KERNEL="$1";;
   4.274 +	esac
   4.275 +	shift
   4.276 +done
   4.277 +[ -n "$KERNEL" -a -f "$KERNEL" ] || usage
   4.278 +[ -n "$TRACKS" ] && [ $(( $FORMAT % $TRACKS )) -ne 0 ] &&
   4.279 +	echo "Invalid track count for format $FORMAT." && usage
   4.280 +
   4.281  if [ "$FORMAT" == "0" ]; then # unsplitted
   4.282  	floppyset > $PREFIX
   4.283  	exit
   4.284 @@ -213,7 +222,7 @@
   4.285  i=1
   4.286  ls floppy$$* | while read file ; do
   4.287  	output=$PREFIX$(printf "%03d" $i)
   4.288 -	cat $file /dev/zero | dd bs=1k count=$FORMAT conv=sync of=$output 2> /dev/null
   4.289 +	cat $file /dev/zero | ddq bs=1k count=$FORMAT conv=sync of=$output
   4.290  	echo $output
   4.291  	rm -f $file
   4.292  	i=$(( $i + 1 ))
     5.1 --- a/linux-libre/stuff/check_modules.sh	Sat Dec 10 06:08:28 2011 +0100
     5.2 +++ b/linux-libre/stuff/check_modules.sh	Sat Dec 10 06:11:04 2011 +0100
     5.3 @@ -24,20 +24,20 @@
     5.4  for i in $(cd $WOK; ls -d linux-libre-*)
     5.5  do
     5.6  	tazpath="taz/$i-$VERSION"
     5.7 -	for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz")
     5.8 -	do
     5.9 -		basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list	
    5.10 -	done 	
    5.11 +		for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz")
    5.12 +		do
    5.13 +			basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list	
    5.14 +		done
    5.15  done
    5.16  # get the original list in .config
    5.17 -for i in $(find $_pkg -iname "*.ko.gz") 
    5.18 +for i in $(find $_pkg -iname "*.ko.gz")
    5.19  do
    5.20  	basename $i >> $WOK/$PACKAGE/tmp/originial-"$VERSION".list
    5.21  done
    5.22  # compare original .config and pkged modules
    5.23 -for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list)   
    5.24 -do		
    5.25 -	if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then 
    5.26 +for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list)
    5.27 +do
    5.28 +	if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then
    5.29  		modpath=`find $_pkg -iname "$i"`
    5.30  		echo "Orphan module: $i"
    5.31  		echo "$i : $modpath" >> $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list
     6.1 --- a/linux-libre/stuff/linux-libre-2.6.37-libre-slitaz.config	Sat Dec 10 06:08:28 2011 +0100
     6.2 +++ b/linux-libre/stuff/linux-libre-2.6.37-libre-slitaz.config	Sat Dec 10 06:11:04 2011 +0100
     6.3 @@ -1,7 +1,7 @@
     6.4  #
     6.5  # Automatically generated make config: don't edit
     6.6  # Linux/i386 2.6.37 Kernel Configuration
     6.7 -# Mon Feb 14 03:03:39 2011
     6.8 +# Wed May 18 19:02:59 2011
     6.9  #
    6.10  # CONFIG_64BIT is not set
    6.11  CONFIG_X86_32=y
    6.12 @@ -27,8 +27,8 @@
    6.13  CONFIG_GENERIC_HWEIGHT=y
    6.14  CONFIG_GENERIC_GPIO=y
    6.15  CONFIG_ARCH_MAY_HAVE_PC_FDC=y
    6.16 -# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
    6.17 -CONFIG_RWSEM_XCHGADD_ALGORITHM=y
    6.18 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
    6.19 +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
    6.20  CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
    6.21  CONFIG_GENERIC_CALIBRATE_DELAY=y
    6.22  # CONFIG_GENERIC_TIME_VSYSCALL is not set
    6.23 @@ -273,8 +273,8 @@
    6.24  CONFIG_PARAVIRT_CLOCK=y
    6.25  CONFIG_NO_BOOTMEM=y
    6.26  # CONFIG_MEMTEST is not set
    6.27 -# CONFIG_M386 is not set
    6.28 -CONFIG_M486=y
    6.29 +CONFIG_M386=y
    6.30 +# CONFIG_M486 is not set
    6.31  # CONFIG_M586 is not set
    6.32  # CONFIG_M586TSC is not set
    6.33  # CONFIG_M586MMX is not set
    6.34 @@ -300,19 +300,13 @@
    6.35  CONFIG_X86_GENERIC=y
    6.36  CONFIG_X86_CPU=y
    6.37  CONFIG_X86_INTERNODE_CACHE_SHIFT=6
    6.38 -CONFIG_X86_CMPXCHG=y
    6.39 +# CONFIG_X86_CMPXCHG is not set
    6.40  CONFIG_X86_L1_CACHE_SHIFT=6
    6.41 -CONFIG_X86_XADD=y
    6.42  CONFIG_X86_PPRO_FENCE=y
    6.43  CONFIG_X86_F00F_BUG=y
    6.44  CONFIG_X86_INVD_BUG=y
    6.45 -CONFIG_X86_WP_WORKS_OK=y
    6.46 -CONFIG_X86_INVLPG=y
    6.47 -CONFIG_X86_BSWAP=y
    6.48 -CONFIG_X86_POPAD_OK=y
    6.49 -CONFIG_X86_ALIGNMENT_16=y
    6.50  CONFIG_X86_INTEL_USERCOPY=y
    6.51 -CONFIG_X86_MINIMUM_CPU_FAMILY=4
    6.52 +CONFIG_X86_MINIMUM_CPU_FAMILY=3
    6.53  CONFIG_CPU_SUP_INTEL=y
    6.54  CONFIG_CPU_SUP_CYRIX_32=y
    6.55  CONFIG_CPU_SUP_AMD=y
    6.56 @@ -3557,7 +3551,7 @@
    6.57  CONFIG_CRYPTO_MANAGER=y
    6.58  CONFIG_CRYPTO_MANAGER2=y
    6.59  CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
    6.60 -# CONFIG_CRYPTO_GF128MUL is not set
    6.61 +CONFIG_CRYPTO_GF128MUL=m
    6.62  # CONFIG_CRYPTO_NULL is not set
    6.63  # CONFIG_CRYPTO_PCRYPT is not set
    6.64  CONFIG_CRYPTO_WORKQUEUE=y