wok rev 25485

BootProg/fat32: active fat support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 01 16:13:12 2022 +0000 (17 months ago)
parents 4d54d3979862
children f7324cde07d7
files BootProg/receipt BootProg/stuff/boot32.asm BootProg/stuff/bootprog.sh cups-filters-dev/receipt cups-filters/receipt gnustep-back/receipt gnustep-make/receipt gxine/receipt opencore-amr-dev/receipt opencore-amr/receipt ortp-dev/receipt ortp/receipt secure-delete/receipt xine-ui/receipt
line diff
     1.1 --- a/BootProg/receipt	Mon Oct 17 07:58:57 2022 +0100
     1.2 +++ b/BootProg/receipt	Tue Nov 01 16:13:12 2022 +0000
     1.3 @@ -14,11 +14,16 @@
     1.4  compile_rules()
     1.5  {
     1.6  	mkdir -p $src && cd $src
     1.7 -	sed '1,/^exit/!d' $stuff/bootprog.sh > bootprog
     1.8 -	for i in boot16 boot32 bootex ; do
     1.9 +	bs="boot16 bootex boot32"
    1.10 +	for i in $bs ; do
    1.11  		cp $stuff/$i.asm .
    1.12 -		nasm $i.asm -f bin -o $i.bin -l $i.lst && cat $i.bin
    1.13 -	done | xz -z --format=lzma --lzma1=lc=0,pb=0,nice=102,dict=4k >> bootprog
    1.14 +		nasm $i.asm -f bin -o $i.bin -l $i.lst || return 1
    1.15 +	done
    1.16 +	sed '1,2!d' $stuff/bootprog.sh > bootprog
    1.17 +	{
    1.18 +		sed "1,2d;s|FAT32SZ|$(stat -c %s boot32.bin)|" $stuff/bootprog.sh
    1.19 +		cat ${bs// /.bin }.bin
    1.20 +	} | xz -z --format=lzma --lzma1=lc=0,pb=0,nice=33,dict=4k >> bootprog
    1.21  	chmod +x bootprog
    1.22  }
    1.23  
     2.1 --- a/BootProg/stuff/boot32.asm	Mon Oct 17 07:58:57 2022 +0100
     2.2 +++ b/BootProg/stuff/boot32.asm	Tue Nov 01 16:13:12 2022 +0000
     2.3 @@ -79,16 +79,18 @@
     2.4  
     2.5  %define bx(label)       bx+label-boot
     2.6  %define si(label)       si+label-boot
     2.7 +ExtraBootSector         equ     1
     2.8  ClusterMask             equ     1               ; +9 bytes
     2.9  NullEntryCheck          equ     1               ; +5 bytes
    2.10 +CheckAttrib             equ     1               ; +6 bytes
    2.11 +NonMirroredFATs         equ     1               ; +18 bytes
    2.12  ReadRetry               equ     1               ; +7 bytes
    2.13  LBA48bits               equ     1               ; +15 bytes
    2.14 -CHSsupport              equ     1               ; +27 bytes
    2.15 -CHSupTo8GB              equ     1               ; +11 bytes
    2.16 -CHSupTo32MB             equ     1               ; +7 bytes
    2.17 -SectorOf512Bytes        equ     1               ; -5 bytes
    2.18 +CHSsupport              equ     1               ; +27 bytes max 16MB, 32MB or 8GB
    2.19 +CHSupTo32MB             equ     1               ; +6 bytes
    2.20 +CHSupTo8GB              equ     1               ; +14 bytes
    2.21 +SectorOf512Bytes        equ     0               ; -5 bytes
    2.22  Always2FATs             equ     0               ; -4 bytes
    2.23 -CheckAttrib             equ     0               ; +6 bytes
    2.24  
    2.25  [BITS 16]
    2.26  
    2.27 @@ -173,8 +175,10 @@
    2.28  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.29  
    2.30          mov     es, ax          ; cs:0 = ds:0 = ss:0 -> top - 512 - StackSize
    2.31 +%if ExtraBootSector == 0
    2.32          mov     ss, ax
    2.33          mov     sp, 512+StackSize ; bytes 0-511 are reserved for the boot code
    2.34 +%endif
    2.35  
    2.36  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.37  ;; Copy ourselves to top of memory ;;
    2.38 @@ -192,13 +196,25 @@
    2.39  ;;;;;;;;;;;;;;;;;;;;;;
    2.40  
    2.41          push    byte main
    2.42 +        push    es
    2.43 +        pop     ds
    2.44          retf
    2.45  
    2.46  main:
    2.47 -        push    cs
    2.48 -        pop     ds
    2.49 -
    2.50          xor     ebx, ebx
    2.51 +%if ExtraBootSector != 0
    2.52 +        add     al, 32
    2.53 +        mov     es, ax
    2.54 +        mov     eax, [bx(bpbHiddenSectors)]
    2.55 +        inc     eax
    2.56 + %if LBA48bits != 0
    2.57 +        mov     [bx(HiLBA)], bx
    2.58 + %endif
    2.59 +        call    ReadSectorBoot
    2.60 +        push    ds
    2.61 +        pop     ss
    2.62 +        mov     sp, 512+StackSize ; bytes 0-511 are reserved for the boot code
    2.63 +%endif
    2.64  
    2.65  %if ClusterMask != 0
    2.66          and     byte [bx(bsRootDirectoryClusterNo+3)], 0Fh ; mask cluster value
    2.67 @@ -305,7 +321,12 @@
    2.68          mov     ss, bp
    2.69          xor     sp, sp
    2.70          push    bp                      ; cs, ds and es
    2.71 +%if ExtraBootSector != 0
    2.72 +        jmp     Run
    2.73 +%macro BootFileName 0
    2.74 +%else
    2.75          jmp     short Run
    2.76 +%endif
    2.77  
    2.78  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.79  ;; Relocate, setup and run a .EXE program     ;;
    2.80 @@ -356,6 +377,9 @@
    2.81  ;; All done, transfer control to the program now ;;
    2.82  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.83          retf
    2.84 +%if ExtraBootSector != 0
    2.85 +%endm
    2.86 +%endif
    2.87  
    2.88  ;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.89  ;; Error Messaging Code ;;
    2.90 @@ -413,8 +437,19 @@
    2.91          div     esi                             ; eax=FAT sector #, edx=entry # in sector
    2.92  
    2.93          imul    si, dx, byte 4                  ; si=entry # in sector, clear C
    2.94 -%if LBA48bits != 0
    2.95 +%if NonMirroredFATs != 0
    2.96 +        cwde
    2.97 +        or      dl, byte [bx(bsExtendedFlags)]
    2.98 +        jns     MirroredFATs                    ; Non-mirrored FATs ?
    2.99 +        and     dl, 0Fh
   2.100 +        imul    edx, dword [bx(bsSectorsPerFAT32)] ; we need to read the active one
   2.101 +        add     eax, edx
   2.102 +MirroredFATs:
   2.103 +        cwde
   2.104 +%else
   2.105 + %if LBA48bits != 0
   2.106          xor     dx, dx
   2.107 + %endif
   2.108  %endif
   2.109          call    ReadSectorLBAfromFAT            ; read 1 FAT32 sector
   2.110  
   2.111 @@ -464,6 +499,7 @@
   2.112  %if LBA48bits != 0
   2.113          adc     word [bx(HiLBA)], bx
   2.114  %endif
   2.115 +ReadSectorBoot:
   2.116          mov     dx, [bx(DriveNumber)]   ; restore BIOS boot drive number
   2.117          pusha
   2.118  
   2.119 @@ -572,3 +608,10 @@
   2.120  ;;;;;;;;;;;;;;;;;;;;;;;;;;
   2.121  
   2.122                  dw      0AA55h          ; BIOS checks for this ID
   2.123 +
   2.124 +%if ExtraBootSector != 0
   2.125 +                dd      61415252h       ; "RRaA"
   2.126 +                BootFileName
   2.127 +                times (996-($-$$)) db 0
   2.128 +;                dd      41617272h       ; "rrAa"
   2.129 +%endif
     3.1 --- a/BootProg/stuff/bootprog.sh	Mon Oct 17 07:58:57 2022 +0100
     3.2 +++ b/BootProg/stuff/bootprog.sh	Tue Nov 01 16:13:12 2022 +0000
     3.3 @@ -1,33 +1,33 @@
     3.4  #!/bin/sh
     3.5 -
     3.6 -set -- "$1" "${2:-startup.bin}"
     3.7 +p=/tmp/bp$$;sed '1,2d' $0|unlzma>$p;sh $p $0 "$@";s=$?;rm $p;exit $s
     3.8 +set -- "$2" "${3:-startup.bin}" $1
     3.9  [ ! -e "$1" ] && cat<<S && exit 2
    3.10 -Usage: [FS=<FAT12|FAT16|FAT32|EXFAT>] $0 device [file]
    3.11 -Example: $0 /dev/fd0 $2
    3.12 +Usage: [FS=<FAT12|FAT16|FAT32|EXFAT>] $3 device [file]
    3.13 +Example: $3 /dev/fd0 $1
    3.14  S
    3.15  r="dd if=$1 count"
    3.16  w="dd of=$1 bs=1 conv=notrunc seek"
    3.17 -while read c o b f
    3.18 +while read c o b s f
    3.19  do	[ "${FS:-$($r=5 bs=1 skip=$c)}" = "$f" ] || continue
    3.20  	echo "Install $f bootsector on $1."
    3.21 -	for a in "$o skip=$((o+b)) count=$((512-o))" "0 skip=$b count=11"
    3.22 -	do sed '1,/^exit/d' $0 | unlzma | $w=$a; done
    3.23 +	for a in "$o skip=$((o+b)) count=$((s-o))" "0 skip=$b count=11"
    3.24 +	do sed '1,/^exit/d' $0 | $w=$a; done
    3.25  	echo -n $f | $w=$c
    3.26  	echo "Set boot file $2" && echo -n "$2" | case "$f" in
    3.27  	E*)	sed 's| |.|;s| ||g' | cat - /dev/zero;;
    3.28  	*)	tr a-z A-Z | sed 's|\.|       |;s|^\(.\{8\}\) *|\1|;s|$|   |'
    3.29  	esac | $w=499 count=11
    3.30  	case "$f" in
    3.31 -	*32)	$w=1536 if=$1 count=512;;
    3.32 +	*32)	$w=$(($(od -An -j50 -N2 -d $1)<<9)) if=$1 count=$s;;
    3.33  	E*)	$r=11 bs=1b | od -vAn -tu1 -w1 - | LANG=C awk 'BEGIN { a=0;i=-1;m=0xFFFFFFFE }
    3.34  { if (++i!=106 && i!=107 && i!=112) a=or(and(lshift(a,31),m),and(rshift(a,1),m/2))+$1 }
    3.35  END { b=a/256;c=b/256; for (;i>0;i-=44) printf "%c%c%c%c",a%256,b%256,c%256,(c/256)%256 }' | $w=5632
    3.36  	esac
    3.37  	exit 0
    3.38  done<<S 2>/dev/null
    3.39 -54	59	0	FAT12
    3.40 -54	59	0	FAT16
    3.41 -82	87	512	FAT32
    3.42 -3	113	1024	EXFAT
    3.43 +54	59	0	512	FAT12
    3.44 +54	59	0	512	FAT16
    3.45 +3	113	512	512	EXFAT
    3.46 +82	87	1024	FAT32SZ	FAT32
    3.47  S
    3.48  exit 1
     4.1 --- a/cups-filters-dev/receipt	Mon Oct 17 07:58:57 2022 +0100
     4.2 +++ b/cups-filters-dev/receipt	Tue Nov 01 16:13:12 2022 +0000
     4.3 @@ -7,7 +7,7 @@
     4.4  MAINTAINER="mojo@slitaz.org"
     4.5  LICENSE="GPL"
     4.6  WANTED="cups-filters"
     4.7 -WEB_SITE="http://www.linuxfoundation.org/collaborate/workgroups/openprinting"
     4.8 +WEB_SITE="https://wiki.linuxfoundation.org/openprinting/cups-filters"
     4.9  
    4.10  DEPENDS="cups-filters pkg-config"
    4.11  
     5.1 --- a/cups-filters/receipt	Mon Oct 17 07:58:57 2022 +0100
     5.2 +++ b/cups-filters/receipt	Tue Nov 01 16:13:12 2022 +0000
     5.3 @@ -6,7 +6,7 @@
     5.4  SHORT_DESC="OpenPrinting CUPS Filters"
     5.5  MAINTAINER="mojo@slitaz.org"
     5.6  LICENSE="GPL"
     5.7 -WEB_SITE="http://www.linuxfoundation.org/collaborate/workgroups/openprinting"
     5.8 +WEB_SITE="https://wiki.linuxfoundation.org/openprinting/cups-filters"
     5.9  
    5.10  TARBALL="$PACKAGE-$VERSION.tar.xz"
    5.11  WGET_URL="https://www.openprinting.org/download/cups-filters/$TARBALL"
     6.1 --- a/gnustep-back/receipt	Mon Oct 17 07:58:57 2022 +0100
     6.2 +++ b/gnustep-back/receipt	Tue Nov 01 16:13:12 2022 +0000
     6.3 @@ -9,7 +9,7 @@
     6.4  WEB_SITE="http://www.gnustep.org/"
     6.5  
     6.6  TARBALL="$PACKAGE-$VERSION.tar.gz"
     6.7 -WGET_URL="http://ftp.gnustep.org/pub/gnustep/core/$TARBALL"
     6.8 +WGET_URL="https://web.archive.org/web/20210518140736/http://ftp.gnustep.org/pub/gnustep/core/$TARBALL"
     6.9  
    6.10  DEPENDS="audiofile aspell cairo freetype giflib gnustep-base gnustep-gui
    6.11  	 gnutls icu libart_lgpl libbfd libtasn1 util-linux-uuid xorg-libXmu"
     7.1 --- a/gnustep-make/receipt	Mon Oct 17 07:58:57 2022 +0100
     7.2 +++ b/gnustep-make/receipt	Tue Nov 01 16:13:12 2022 +0000
     7.3 @@ -9,7 +9,8 @@
     7.4  WEB_SITE="http://www.gnustep.org/"
     7.5  
     7.6  TARBALL="$PACKAGE-$VERSION.tar.gz"
     7.7 -WGET_URL="http://ftp.gnustep.org/pub/gnustep/core/$TARBALL"
     7.8 +#WGET_URL="http://ftp.gnustep.org/pub/gnustep/core/$TARBALL"
     7.9 +WGET_URL="https://kacabenggala.uny.ac.id/gentoo/distfiles/40/$TARBALL"
    7.10  
    7.11  DEPENDS=""
    7.12  
     8.1 --- a/gxine/receipt	Mon Oct 17 07:58:57 2022 +0100
     8.2 +++ b/gxine/receipt	Tue Nov 01 16:13:12 2022 +0000
     8.3 @@ -7,7 +7,7 @@
     8.4  MAINTAINER="jozee@slitaz.org"
     8.5  LICENSE="GPL2"
     8.6  TARBALL="$PACKAGE-$VERSION.tar.bz2"
     8.7 -WEB_SITE="https://www.xine-project.org/"
     8.8 +WEB_SITE="https://xine-project.org/"
     8.9  WGET_URL="https://sourceforge.net/projects/xine/files/$PACKAGE/$VERSION/$TARBALL"
    8.10  
    8.11  DEPENDS="xine-lib libvorbis gtk+ spidermonkey dbus"
     9.1 --- a/opencore-amr-dev/receipt	Mon Oct 17 07:58:57 2022 +0100
     9.2 +++ b/opencore-amr-dev/receipt	Tue Nov 01 16:13:12 2022 +0000
     9.3 @@ -6,7 +6,7 @@
     9.4  SHORT_DESC="Adaptive Multi Rate (AMR) speech codec - development files."
     9.5  MAINTAINER="domcox@slitaz.org"
     9.6  LICENSE="Apache"
     9.7 -WEB_SITE="https://opencore-amr.sourceforge.io/"
     9.8 +WEB_SITE="https://sourceforge.net/projects/opencore-amr/"
     9.9  
    9.10  DEPENDS="pkg-config"
    9.11  WANTED="opencore-amr"
    10.1 --- a/opencore-amr/receipt	Mon Oct 17 07:58:57 2022 +0100
    10.2 +++ b/opencore-amr/receipt	Tue Nov 01 16:13:12 2022 +0000
    10.3 @@ -6,7 +6,7 @@
    10.4  SHORT_DESC="Adaptive Multi Rate (AMR) speech codec."
    10.5  MAINTAINER="domcox@slitaz.org"
    10.6  LICENSE="Apache"
    10.7 -WEB_SITE="https://opencore-amr.sourceforge.io/"
    10.8 +WEB_SITE="https://sourceforge.net/projects/opencore-amr/"
    10.9  
   10.10  TARBALL="$PACKAGE-$VERSION.tar.gz"
   10.11  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    11.1 --- a/ortp-dev/receipt	Mon Oct 17 07:58:57 2022 +0100
    11.2 +++ b/ortp-dev/receipt	Tue Nov 01 16:13:12 2022 +0000
    11.3 @@ -6,7 +6,7 @@
    11.4  SHORT_DESC="Library implementing the Real-time Transport Protocol (RFC3550), development files."
    11.5  MAINTAINER="pascal.bellard@slitaz.org"
    11.6  LICENSE="LGPL2.1"
    11.7 -WEB_SITE="http://freecode.com/projects/ortp"
    11.8 +WEB_SITE="https://linphone.org/"
    11.9  WANTED="ortp"
   11.10  
   11.11  DEPENDS="ortp pkg-config"
    12.1 --- a/ortp/receipt	Mon Oct 17 07:58:57 2022 +0100
    12.2 +++ b/ortp/receipt	Tue Nov 01 16:13:12 2022 +0000
    12.3 @@ -7,7 +7,7 @@
    12.4  MAINTAINER="pascal.bellard@slitaz.org"
    12.5  LICENSE="LGPL2.1"
    12.6  TARBALL="$PACKAGE-$VERSION.tar.gz"
    12.7 -WEB_SITE="http://freecode.com/projects/ortp"
    12.8 +WEB_SITE="https://linphone.org/"
    12.9  WGET_URL="http://download-mirror.savannah.gnu.org/releases/linphone/$PACKAGE/sources/$TARBALL"
   12.10  
   12.11  # What is the latest version available today?
    13.1 --- a/secure-delete/receipt	Mon Oct 17 07:58:57 2022 +0100
    13.2 +++ b/secure-delete/receipt	Tue Nov 01 16:13:12 2022 +0000
    13.3 @@ -8,7 +8,7 @@
    13.4  LICENSE="MIT"
    13.5  SOURCE="secure_delete"
    13.6  TARBALL="$SOURCE-$VERSION.tar.gz"
    13.7 -WEB_SITE="http://www.thc.org/"
    13.8 +WEB_SITE="https://www.thc.org/"
    13.9  WGET_URL="http://deb.debian.org/debian/pool/main/s/$PACKAGE/${PACKAGE}_$VERSION.orig.tar.gz"
   13.10  
   13.11  DEPENDS="glibc-base"
    14.1 --- a/xine-ui/receipt	Mon Oct 17 07:58:57 2022 +0100
    14.2 +++ b/xine-ui/receipt	Tue Nov 01 16:13:12 2022 +0000
    14.3 @@ -7,7 +7,7 @@
    14.4  MAINTAINER="pankso@slitaz.org"
    14.5  LICENSE="GPL2"
    14.6  TARBALL="$PACKAGE-$VERSION.tar.xz"
    14.7 -WEB_SITE="https://www.xine-project.org/"
    14.8 +WEB_SITE="https://xine-project.org/"
    14.9  WGET_URL="$SF_MIRROR/project/xine/xine-ui/$VERSION/$TARBALL"
   14.10  
   14.11  # Keep Xine small for Live system, we have MPlaye or VLC has big video player.