# HG changeset patch # User Antoine Bodin # Date 1323493864 -3600 # Node ID 903c03d31ebff0b650cc746ccc6530fc1269b250 # Parent 93f683705964b459684f5580b9d8744539dc971e Update linux-libre according to changes made to linux (since months) diff -r 93f683705964 -r 903c03d31ebf linux-libre-api-headers/receipt --- a/linux-libre-api-headers/receipt Sat Dec 10 06:08:28 2011 +0100 +++ b/linux-libre-api-headers/receipt Sat Dec 10 06:11:04 2011 +0100 @@ -6,7 +6,7 @@ SHORT_DESC="Kernel headers sanitized for use in userspace." MAINTAINER="gokhlayeh@slitaz.org" PROVIDE="linux-api-headers" -SOURCE="linux" +SOURCE="linux-libre" TARBALL="$SOURCE-$VERSION.tar.bz2" WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL" @@ -15,7 +15,6 @@ cook_tmp_toolchain() { cd $src - make mrproper && make headers_check && make INSTALL_HDR_PATH=dest headers_install && @@ -26,7 +25,6 @@ compile_rules() { cd $src - make mrproper && make headers_check && make INSTALL_HDR_PATH=$DESTDIR/usr headers_install @@ -37,7 +35,6 @@ { mkdir -p $fs/usr cp -a $_pkg/usr/include $fs/usr - rm -f $(find ${fs} -name .install -or -name ..install.cmd) } diff -r 93f683705964 -r 903c03d31ebf linux-libre-source/stuff/get-linux-source --- a/linux-libre-source/stuff/get-linux-source Sat Dec 10 06:08:28 2011 +0100 +++ b/linux-libre-source/stuff/get-linux-source Sat Dec 10 06:11:04 2011 +0100 @@ -6,6 +6,10 @@ VERSION=XXX url=$(cat /usr/src/kernel-patches/slitaz/url) +for i in http://linux-kernel.uio.no/pub http://www.gtlib.gatech.edu/pub/kernel.org http://www.kernel.org/pub ; do + busybox wget -s $url && break + url=$(echo $url | sed "s|.*/linux/kernel|$i/linux/kernel|") +done if [ ! -d $SOURCES_REPOSITORY ]; then mkdir -p $SOURCES_REPOSITORY @@ -40,6 +44,8 @@ done < slitaz/patches [ ! -f System.map ] && cp slitaz/config .config && make oldconfig && make modules_prepare +ln -s /usr/src/linux-$VERSION /lib/modules/$VERSION-slitaz/build +ln -s linux-$VERSION /usr/src/linux cat < /dev/null - elif [ -x /usr/bin/tazwok ]; then - # we just need aufs source. Also cooking now is a bad idea since it - # needs linux-module-headers. The one your cooking not the one from the web. + elif [ ! -x /usr/bin/cook ]; then + # We only need aufs source. Also cooking now is a bad idea since it + # needs linux-module-headers. AUFSDIR=$WOK/aufs/aufs-${_AUFSVER} [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } @@ -46,16 +46,15 @@ echo "Copying Aufs files and patches..." cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src cp -a $AUFSDIR/*.patch $stuff - + # SliTaz db - [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null - mkdir $WOK/$PACKAGE/slitaz + rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz # Apply patches - echo "Applying patches" + echo "Applying patches..." while read patch_file; do echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches cp $stuff/$patch_file $WOK/$PACKAGE/slitaz @@ -64,11 +63,7 @@ continue fi echo "Apply $patch_file" - if [ -x /usr/bin/cook ]; then - patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || return 1 - elif [ -x /usr/bin/tazwok ]; then - patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; } - fi + patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; } touch done.$patch_file done < /dev/null - mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz - + make $MAKEFLAGS bzImage && + make $MAKEFLAGS modules && + make INSTALL_MOD_PATH=$PWD/_pkg modules_install && + make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install && + [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } + mkdir -p $PWD/_pkg/boot 2> /dev/null + mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz + + [ ! -x /usr/bin/cook ] && report step "Compressing all modules" + # Compress all modules. - echo "Compressing all modules" - $stuff/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz + $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz ln System.map System.map-modules ln Module.symvers Module.symvers-modules - [ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report close-bloc + + if [ ! -x /usr/bin/cook ]; then + report close-bloc + fi } # Rules to gen a SliTaz package suitable for Tazpkg. @@ -138,7 +134,7 @@ local path cp -a $_pkg/boot $fs # Compress all modules. - $stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz + #$stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz path=$fs/lib/modules/$VERSION-slitaz/kernel mkdir -p $path cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \ @@ -148,7 +144,7 @@ export _pkg mkdir $WOK/$PACKAGE/tmp $stuff/list_modules.sh \ - $(cat $stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list + $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list while read module; do dir=$(dirname $module) [ -d $path/$dir ] || mkdir -p $path/$dir @@ -157,7 +153,6 @@ # Remove unresolved links rm -f $fs/lib/modules/$VERSION-slitaz/build rm -f $fs/lib/modules/$VERSION-slitaz/source - # Check and echo any module in kernel .config that's not added to # one of linux-* pkgs $stuff/check_modules.sh diff -r 93f683705964 -r 903c03d31ebf linux-libre/stuff/bootloader.sh --- a/linux-libre/stuff/bootloader.sh Sat Dec 10 06:08:28 2011 +0100 +++ b/linux-libre/stuff/bootloader.sh Sat Dec 10 06:11:04 2011 +0100 @@ -15,90 +15,60 @@ Default values: --format 1440 --tracks 80 --prefix floppy. +Or: cat fd0*.img | $0 --extract + +Create the kernel, cmdline and rootfs files from a floppy set + Example: -$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 +$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 EOT exit 1 } -KERNEL="" -INITRD="" -CMDLINE="" -PREFIX="floppy." -FORMAT="1440" -RDEV="" -VIDEO="" -FLAGS="" -TRACKS="" -DEBUG="" -while [ -n "$1" ]; do - case "$1" in - --c*|-c*) CMDLINE="$2"; shift;; - --i*|-i*) INITRD="$INITRD $2"; shift;; - --p*|-p*) PREFIX="$2"; shift;; - --fo*|-f*) FORMAT="$2"; shift;; - --fl*) FLAGS="$2"; shift;; # 1 read-only, 0 read-write - --r*|-r*) RDEV="$2"; shift;; # /dev/??? - --v*|-v*) VIDEO="$2"; shift;; # -3 .. n - --t*|-t*) TRACKS="$2"; shift;; # likely 81 .. 84 - --debug) DEBUG="1";; - *) KERNEL="$1";; - esac - shift -done -[ -n "$KERNEL" -a -f "$KERNEL" ] || usage -if [ -n "$TRACKS" ]; then - if [ $(( $FORMAT % $TRACKS )) -ne 0 ]; then - echo "Invalid track count for format $FORMAT." - usage - fi -fi +ddq() +{ + dd $@ 2> /dev/null +} -# write a 16 bits data -# usage: store16 offset data16 file -store16() +dbg() { - n=$2; i=2; while [ $i -ne 0 ]; do - printf '\\\\x%02X' $(($n & 255)) - i=$(($i-1)); n=$(($n >> 8)) - done | xargs echo -en | \ - dd bs=2 conv=notrunc of=$3 seek=$(( $1 / 2 )) 2> /dev/null - [ -n "$DEBUG" ] && printf "store16(%04X) = %04X\n" $1 $2 1>&2 + [ -n "$DEBUG" ] && echo "$@" 1>&2 } # write a 32 bits data -# usage: storelong offset data32 file -storelong() +# usage: put offset data32 file [bytes] +put() { - n=$2; i=4; while [ $i -ne 0 ]; do + n=$2; for i in $(seq 1 ${4:-4}); do printf '\\\\x%02X' $(($n & 255)) - i=$(($i-1)); n=$(($n >> 8)) - done | xargs echo -en | \ - dd bs=4 conv=notrunc of=$3 seek=$(( $1 / 4 )) 2> /dev/null - [ -n "$DEBUG" ] && printf "storelong(%04X) = %08X\n" $1 $2 1>&2 + n=$(($n >> 8)) + done | xargs echo -en | ddq bs=1 conv=notrunc of=$3 seek=$1 + [ -n "$DEBUG" ] && printf "put$4(%04X) = %X\n" $1 $2 1>&2 } # read a 32 bits data -# usage: getlong offset file -getlong() +# usage: get offset file [bytes] +get() { - dd if=$2 bs=1 skip=$(( $1 )) count=4 2> /dev/null | \ - hexdump -e '"" 1/4 "%d" "\n"' + ddq if=$2 bs=1 skip=$(($1)) count=${3:-4} | hexdump -e '"" 1/4 "%d"' } +SetupSzOfs=0x1F1 +SyssizeOfs=0x1F4 +RamfsLenOfs=0x21C +ArgPtrOfs=0x228 + floppyset() { # bzImage offsets - CylinderCount=496 - SetupSzOfs=497 - FlagsOfs=498 - SyssizeOfs=500 - VideoModeOfs=506 - RootDevOfs=508 + CylinderCount=0x1F0 + FlagsOfs=0x1F2 + VideoModeOfs=0x1FA + RootDevOfs=0x1FC CodeAdrOfs=0x214 RamfsAdrOfs=0x218 - RamfsLenOfs=0x21C - ArgPtrOfs=0x228 # boot+setup address SetupBase=0x90000 @@ -109,8 +79,8 @@ # Get and patch boot sector # See http://hg.slitaz.org/wok/raw-file/711d076b277c/linux/stuff/linux-header-2.6.34.u - dd if=$KERNEL bs=512 count=1 of=$bs 2> /dev/null - uudecode < /dev/null + ddq if=$KERNEL bs=512 count=1 of=$bs + uudecode < /dev/null >> $bs + setupsz=$(get $SetupSzOfs $bs 1) + ddq if=$KERNEL bs=512 skip=1 count=$setupsz >> $bs if [ -n "$TRACKS" ]; then - [ -n "$DEBUG" ] && echo -n "--tracks " 1>&2 - n=$(getlong $CylinderCount $bs) - store16 $CylinderCount $(( ($n & -256) + $TRACKS )) $bs + dbg -n "--tracks " + put $CylinderCount $TRACKS $bs 1 fi if [ -n "$FLAGS" ]; then - [ -n "$DEBUG" ] && echo -n "--flags " 1>&2 - store16 $FlagsOfs $FLAGS $bs + dbg -n "--flags " + put $FlagsOfs $FLAGS $bs 2 fi if [ -n "$VIDEO" ]; then - [ -n "$DEBUG" ] && echo -n "--video " 1>&2 - store16 $VideoModeOfs $VIDEO $bs + dbg -n "--video " + put $VideoModeOfs $VIDEO $bs 2 fi if [ -n "$RDEV" ]; then - [ -n "$DEBUG" ] && echo -n "--rdev " 1>&2 + dbg -n "--rdev " n=$(stat -c '0x%02t%02T' $RDEV 2> /dev/null) [ -n "$n" ] || n=$RDEV - store16 $RootDevOfs $n $bs + put $RootDevOfs $n $bs 2 fi # Store cmdline after setup if [ -n "$CMDLINE" ]; then - [ -n "$DEBUG" ] && echo -n "--cmdline '$CMDLINE' " 1>&2 - echo -n "$CMDLINE" | dd bs=512 count=1 conv=sync 2> /dev/null >> $bs - storelong $ArgPtrOfs $(( $SetupBase + $stacktop )) $bs + dbg -n "--cmdline '$CMDLINE' " + echo -n "$CMDLINE" | ddq bs=512 count=1 conv=sync >> $bs + put $ArgPtrOfs $(( $SetupBase + $stacktop )) $bs fi # Compute initramfs size @@ -164,39 +132,39 @@ padding=0 for i in $( echo $INITRD | sed 's/,/ /' ); do [ -s "$i" ] || continue - [ -n "$DEBUG" ] && echo "--initrd $i " 1>&2 + dbg "--initrd $i " initrdlen=$(( $initrdlen + $padding )) padding=$(stat -c %s $i) initrdlen=$(( $initrdlen + $padding )) padding=$(( 4096 - ($padding & 4095) )) [ $padding -eq 4096 ] && padding=0 done - Ksize=$(( $(getlong $SyssizeOfs $bs)*16 )) + Ksize=$(( $(get $SyssizeOfs $bs)*16 )) Kpad=$(( (($Ksize+4095)/4096)*4096 - Ksize )) if [ $initrdlen -ne 0 ]; then - [ -n "$DEBUG" ] && echo "initrdlen = $initrdlen " 1>&2 - Kbase=$(getlong $CodeAdrOfs $bs) - storelong $RamfsAdrOfs \ + dbg "initrdlen = $initrdlen " + Kbase=$(get $CodeAdrOfs $bs) + put $RamfsAdrOfs \ $(( (0x1000000 - $initrdlen) & 0xFFFF0000 )) $bs - storelong $RamfsLenOfs $(( ($initrdlen + 3) & -4 )) $bs + put $RamfsLenOfs $(( ($initrdlen + 3) & -4 )) $bs fi # Output boot sector + setup + cmdline - dd if=$bs 2> /dev/null + ddq if=$bs # Output kernel code - dd if=$KERNEL bs=512 skip=$(( $setupszb + 1 )) 2> /dev/null + ddq if=$KERNEL bs=512 skip=$(( $setupsz + 1 )) # Pad to next sector Kpad=$(( 512 - ($(stat -c %s $KERNEL) & 511) )) - [ $Kpad -eq 512 ] || dd if=/dev/zero bs=1 count=$Kpad 2> /dev/null + [ $Kpad -eq 512 ] || ddq if=/dev/zero bs=1 count=$Kpad # Output initramfs padding=0 for i in $( echo $INITRD | sed 's/,/ /' ); do [ -s "$i" ] || continue - [ $padding -ne 0 ] && dd if=/dev/zero bs=1 count=$padding 2> /dev/null - dd if=$i 2> /dev/null + [ $padding -ne 0 ] && ddq if=/dev/zero bs=1 count=$padding + ddq if=$i padding=$(( 4 - ($(stat -c %s $i) & 3) )) [ $padding -eq 4 ] && padding=0 done @@ -205,6 +173,47 @@ rm -f $bs } +KERNEL="" +INITRD="" +CMDLINE="" +PREFIX="floppy." +FORMAT="1440" +RDEV="" +VIDEO="" +FLAGS="" +TRACKS="" +DEBUG="" +while [ -n "$1" ]; do + case "${1/--/-}" in + -c*) CMDLINE="$2"; shift;; + -i*) INITRD="$INITRD $2"; shift;; + -p*) PREFIX="$2"; shift;; + -fl*) FLAGS="$2"; shift;; # 1 read-only, 0 read-write + -f*) FORMAT="$2"; shift;; + -r*) RDEV="$2"; shift;; # /dev/??? + -v*) VIDEO="$2"; shift;; # -3 .. n + -t*) TRACKS="$2"; shift;; # likely 81 .. 84 + -d*) DEBUG="1";; + -e*) ddq bs=512 count=2 > kernel + setupsz=$(get $SetupSzOfs kernel 1) + ddq bs=512 count=$(($setupsz - 1)) >> kernel + [ $(get $ArgPtrOfs kernel) -ne 0 ] && + ddq bs=512 count=1 | strings > cmdline + syssz=$(get $SyssizeOfs kernel) + ddq bs=512 count=$(( ($syssz + 31) / 32 )) >> kernel + ddq bs=16 seek=$(($syssz + 32 + $setupsz*32)) count=0 of=kernel + ramsz=$(get $RamfsLenOfs kernel) + ddq bs=512 count=$((($ramsz + 511) / 512)) of=rootfs + ddq bs=1 seek=$ramsz count=0 of=rootfs + exit ;; + *) KERNEL="$1";; + esac + shift +done +[ -n "$KERNEL" -a -f "$KERNEL" ] || usage +[ -n "$TRACKS" ] && [ $(( $FORMAT % $TRACKS )) -ne 0 ] && + echo "Invalid track count for format $FORMAT." && usage + if [ "$FORMAT" == "0" ]; then # unsplitted floppyset > $PREFIX exit @@ -213,7 +222,7 @@ i=1 ls floppy$$* | while read file ; do output=$PREFIX$(printf "%03d" $i) - cat $file /dev/zero | dd bs=1k count=$FORMAT conv=sync of=$output 2> /dev/null + cat $file /dev/zero | ddq bs=1k count=$FORMAT conv=sync of=$output echo $output rm -f $file i=$(( $i + 1 )) diff -r 93f683705964 -r 903c03d31ebf linux-libre/stuff/check_modules.sh --- a/linux-libre/stuff/check_modules.sh Sat Dec 10 06:08:28 2011 +0100 +++ b/linux-libre/stuff/check_modules.sh Sat Dec 10 06:11:04 2011 +0100 @@ -24,20 +24,20 @@ for i in $(cd $WOK; ls -d linux-libre-*) do tazpath="taz/$i-$VERSION" - for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz") - do - basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list - done + for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz") + do + basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list + done done # get the original list in .config -for i in $(find $_pkg -iname "*.ko.gz") +for i in $(find $_pkg -iname "*.ko.gz") do basename $i >> $WOK/$PACKAGE/tmp/originial-"$VERSION".list done # compare original .config and pkged modules -for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list) -do - if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then +for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list) +do + if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then modpath=`find $_pkg -iname "$i"` echo "Orphan module: $i" echo "$i : $modpath" >> $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list diff -r 93f683705964 -r 903c03d31ebf linux-libre/stuff/linux-libre-2.6.37-libre-slitaz.config --- a/linux-libre/stuff/linux-libre-2.6.37-libre-slitaz.config Sat Dec 10 06:08:28 2011 +0100 +++ b/linux-libre/stuff/linux-libre-2.6.37-libre-slitaz.config Sat Dec 10 06:11:04 2011 +0100 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux/i386 2.6.37 Kernel Configuration -# Mon Feb 14 03:03:39 2011 +# Wed May 18 19:02:59 2011 # # CONFIG_64BIT is not set CONFIG_X86_32=y @@ -27,8 +27,8 @@ CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_GPIO=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y -# CONFIG_RWSEM_GENERIC_SPINLOCK is not set -CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y CONFIG_GENERIC_CALIBRATE_DELAY=y # CONFIG_GENERIC_TIME_VSYSCALL is not set @@ -273,8 +273,8 @@ CONFIG_PARAVIRT_CLOCK=y CONFIG_NO_BOOTMEM=y # CONFIG_MEMTEST is not set -# CONFIG_M386 is not set -CONFIG_M486=y +CONFIG_M386=y +# CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set @@ -300,19 +300,13 @@ CONFIG_X86_GENERIC=y CONFIG_X86_CPU=y CONFIG_X86_INTERNODE_CACHE_SHIFT=6 -CONFIG_X86_CMPXCHG=y +# CONFIG_X86_CMPXCHG is not set CONFIG_X86_L1_CACHE_SHIFT=6 -CONFIG_X86_XADD=y CONFIG_X86_PPRO_FENCE=y CONFIG_X86_F00F_BUG=y CONFIG_X86_INVD_BUG=y -CONFIG_X86_WP_WORKS_OK=y -CONFIG_X86_INVLPG=y -CONFIG_X86_BSWAP=y -CONFIG_X86_POPAD_OK=y -CONFIG_X86_ALIGNMENT_16=y CONFIG_X86_INTEL_USERCOPY=y -CONFIG_X86_MINIMUM_CPU_FAMILY=4 +CONFIG_X86_MINIMUM_CPU_FAMILY=3 CONFIG_CPU_SUP_INTEL=y CONFIG_CPU_SUP_CYRIX_32=y CONFIG_CPU_SUP_AMD=y @@ -3557,7 +3551,7 @@ CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_MANAGER2=y CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -# CONFIG_CRYPTO_GF128MUL is not set +CONFIG_CRYPTO_GF128MUL=m # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_PCRYPT is not set CONFIG_CRYPTO_WORKQUEUE=y