wok-next rev 18145

Add defragfs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jun 18 16:31:01 2015 +0200 (2015-06-18)
parents 6c61376778ea
children 8809751bb68d
files defragfs/receipt syslinux/stuff/iso2exe/bootloader.S syslinux/stuff/iso2exe/taziso
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/defragfs/receipt	Thu Jun 18 16:31:01 2015 +0200
     1.3 @@ -0,0 +1,20 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="defragfs"
     1.7 +VERSION="1.1.1"
     1.8 +CATEGORY="misc"
     1.9 +SHORT_DESC="Measurement and Report and Defrag fs/file fragmentation."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +LICENSE="GPL3"
    1.12 +TARBALL="$PACKAGE-$VERSION.gz"
    1.13 +WEB_SITE="http://defragfs.sourceforge.net/"
    1.14 +WGET_URL="http://vorboss.dl.sourceforge.net/project/$PACKAGE/$PACKAGE/$PACKAGE-${VERSION%.*}/$TARBALL"
    1.15 +
    1.16 +DEPENDS="perl"
    1.17 +
    1.18 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.19 +genpkg_rules()
    1.20 +{
    1.21 +	mkdir -p $fs/usr/bin
    1.22 +	zcat $src/$TARBALL > $fs/usr/bin/defragfs
    1.23 +}
     2.1 --- a/syslinux/stuff/iso2exe/bootloader.S	Thu Jun 18 02:57:32 2015 +0300
     2.2 +++ b/syslinux/stuff/iso2exe/bootloader.S	Thu Jun 18 16:31:01 2015 +0200
     2.3 @@ -65,7 +65,7 @@
     2.4  	movw	$zeroed+1, %cx		# clear gdt + offset, %ds, limits, cmdline=""
     2.5  	rep				# don't worry about cld
     2.6  	stosb				# already done above
     2.7 -	decw	%di
     2.8 +	//decw	%di
     2.9  #else
    2.10  	movw	$zeroed/2, %cx		# clear gdt + offset, %ds, limits
    2.11  	rep				# don't worry about cld
    2.12 @@ -96,6 +96,7 @@
    2.13  #
    2.14  # High doesn't hurt.  Low does.  Let's use the max: 63
    2.15  
    2.16 +	cli
    2.17  	ldsw	0x78(%bx), %si		# %ds:%bx+0x78 is parameter table address
    2.18  	popw	%di
    2.19  	pushw	%es
    2.20 @@ -112,7 +113,6 @@
    2.21  	popw	%ds			# now %ds = %es = %ss = INITSEG
    2.22  	popl	%fs:0x78(%bx)		# update parameter table address
    2.23  	movb	$63, 0x4-12(%di)	# patch sector count, %di = stacktop
    2.24 -	cli
    2.25  
    2.26  	xchg	%ax, %di		# sector count
    2.27  	popw	%ax			# limits = 0
    2.28 @@ -138,9 +138,6 @@
    2.29  	movw	$0xA33F, cmd_line_ptr-2-7(%bx)
    2.30  #endif
    2.31  	call	puts
    2.32 -#if defined(MOVE_CMDLINE) || (defined(EDIT_CMDLINE) && defined(KEYBOARDLESS_SUPPORT))
    2.33 -	pushw	%di
    2.34 -#endif
    2.35  #ifdef	EDIT_CMDLINE
    2.36  cmdlp:
    2.37  	movb	$0x20, %al		# clear end of line
    2.38 @@ -179,9 +176,6 @@
    2.39  	rep
    2.40  	  movsb
    2.41  #endif
    2.42 -#if defined(EDIT_CMDLINE) || (defined(MOVE_CMDLINE) && defined(KEYBOARD_TIMEOUT))
    2.43 -	popw	%di
    2.44 -#endif
    2.45  nocmdline:
    2.46  #endif
    2.47  
    2.48 @@ -194,7 +188,7 @@
    2.49  	movb	$0x88, %ah
    2.50  	int	$0x15
    2.51  	//jc	NeedMoreRAM			# error code 80 or 86
    2.52 -	cmpw	$0xC000, %ax			# more than 49M ?
    2.53 +	cmpw	$0xB000, %ax			# more than 45M ?
    2.54  	jb	NeedMoreRAM
    2.55  	movb	%ch, bootsect_dst_base_hi(%si)	# initramfs @ 32M
    2.56  	movb	%ch, ramdisk_image_ofs+3-\base
    2.57 @@ -306,6 +300,7 @@
    2.58  	pushw	%bx
    2.59  	movl	-4(%bx), %ebx
    2.60  	addl	%ebx, ramdisk_size_ofs-cur_initrd_size_ofs(%di)
    2.61 +	movb	$swap_floppy2-0x100, %cs:dpy_swap_floppy-2+0x7C00
    2.62  	popw	%bx
    2.63  	cmpb	2(%di), %bl
    2.64  	jb	initrdlp
    2.65 @@ -409,6 +404,7 @@
    2.66  	movb	$0,%ch			# first cylinder
    2.67  	pushaw
    2.68  	movw	$swap_floppy,%si
    2.69 +dpy_swap_floppy:
    2.70  #ifdef KEYBOARDLESS_SUPPORT
    2.71  	pushw	%bx
    2.72  	call	puts
    2.73 @@ -419,7 +415,10 @@
    2.74  	jne	waitfloppydone
    2.75  #ifdef MULTI_INITRD
    2.76  	decb	(%si)			# max_timeouts	
    2.77 -	jz	gobootit
    2.78 +gobootit:
    2.79 +	//movw	ramdisk_size+2-max_timeouts(%si), %cx
    2.80 +	.byte	0x8B, 0x4C, ramdisk_size+2-max_timeouts
    2.81 +	jz	bootit
    2.82  #endif
    2.83  	pushw	%dx			# some bios break dx...
    2.84  	cbw
    2.85 @@ -442,14 +441,9 @@
    2.86  #ifdef MULTI_INITRD
    2.87  	orb	$0x20, %al
    2.88  	cmp	$'b', %al
    2.89 -        jnz	read_sectorslp
    2.90 -gobootit:
    2.91 -	//movw	ramdisk_size+2-max_timeouts(%si), %cx
    2.92 -	.byte	0x8B, 0x4C, ramdisk_size+2-max_timeouts
    2.93 -	jmp	bootit
    2.94 -#else
    2.95 +        jz	gobootit
    2.96 +#endif
    2.97          jmp	read_sectorslp
    2.98 -#endif
    2.99  
   2.100  putcdot:
   2.101  	movb	$'.'+3, %al	// . = success, - = failure
   2.102 @@ -496,10 +490,11 @@
   2.103  	jg	putcs
   2.104  	ret	
   2.105  
   2.106 -swap_floppy:
   2.107  #ifdef MULTI_INITRD
   2.108 +swap_floppy2:
   2.109  	.ascii	"B or "
   2.110  #endif
   2.111 +swap_floppy:
   2.112  	.ascii	"Next!"
   2.113  	.byte	7,13,0			# swap detection needs 13, 0
   2.114  #ifdef MULTI_INITRD
     3.1 --- a/syslinux/stuff/iso2exe/taziso	Thu Jun 18 02:57:32 2015 +0300
     3.2 +++ b/syslinux/stuff/iso2exe/taziso	Thu Jun 18 16:31:01 2015 +0200
     3.3 @@ -1057,6 +1057,17 @@
     3.4  parse_isolinux()
     3.5  {
     3.6  	awk 'BEGIN { IGNORECASE=1 }
     3.7 +function multi(n)
     3.8 +{
     3.9 +	auto=$n
    3.10 +	for (--n; n < NF; n+=2) {
    3.11 +		s=$n
    3.12 +		if (s ~ /M$/) s = substr(s,0,length(s)-1)
    3.13 +		else s /= 1024
    3.14 +		sizes=int(s) " " sizes
    3.15 +	}
    3.16 +	next
    3.17 +}
    3.18  {
    3.19  	if ($1 == "LABEL") {
    3.20  		label=$2
    3.21 @@ -1066,13 +1077,10 @@
    3.22  	if ($1 == "INITRD") initrd[label]=$2
    3.23  	if ($1 == "APPEND") {
    3.24  		i=2
    3.25 -		if (kernel[label] ~ "ifmem.c32") {
    3.26 -			auto=$3
    3.27 -			next
    3.28 -		}
    3.29 +		if (kernel[label] ~ "ifmem.c32") multi(3)
    3.30  		if (kernel[label] ~ "c32box.c32") {
    3.31  			if ($2 == "linux") { kernel[label]=$3; i=4 }
    3.32 -			if ($2 == "ifmem") { auto=$4; next }
    3.33 +			if ($2 == "ifmem") multi(4)
    3.34  		}
    3.35  		if (kernel[label] ~ "ifcpu64.c32") { auto=$4; next }
    3.36  		while (i <= NF) {
    3.37 @@ -1086,6 +1094,7 @@
    3.38  	print "KERNEL=\"" kernel[auto] "\""
    3.39  	print "INITRD=\"" initrd[auto] "\""
    3.40  	print "CMDLINE=\"" substr(cmdline[auto],2) "\""
    3.41 +	print "SIZES=\"" sizes "\""
    3.42  }'
    3.43  }
    3.44