makedeb


ventoy-bin 1.0.99-0


An utility to directly boot image files without reformating the USB

Click here to go back to the commit logs for ventoy-bin.

Commit:


Hash: abab798af92bf4a2a1ff5c4f9f614e3b4e954410

Message: sanitize the package it's too dirty to install on arch.

Diff


diff --git a/.SRCINFO b/.SRCINFO
index 7d1f5ff..e5a3b24 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,19 +1,23 @@
 pkgbase = ventoy-bin
 	pkgdesc = A new multiboot USB solution (Binary)
 	pkgver = 1.0.12
-	pkgrel = 2
+	pkgrel = 3
 	url = http://www.ventoy.net/
 	arch = i686
 	arch = x86_64
 	license = GPL3
 	depends = bash
 	depends = util-linux
+	depends = xz
+	depends = exfat-utils
 	provides = ventoy
 	conflicts = ventoy
 	source = https://github.com/ventoy/Ventoy/releases/download/v1.0.12/ventoy-1.0.12-linux.tar.gz
 	source = ventoy
+	source = sanitize.patch
 	sha512sums = b89c4de490ec7af8358c98c7613ba2cb91e42c2db0c7e541ac62e1b3d9dfb7ff2d7550c72a71e52b0e27f7b030053e62b1b3bde3ed93fe7b00be78d4abe00865
-	sha512sums = 27fef4c8e254863896888cf3e77a39ed377100effc69a4518fe55038069c7c1e8b56f1a79d47d969eda8e5bd90920e93b34dd361aac67be948266d1e7b238dcd
+	sha512sums = 578859c4007e406e66cd5331d9ce90794cf04cd9a4b252f8188e4f8d4cbd60ae1efb09860952ffb6540552db772e36baf6acded69bf0b0a6569f374215e166bc
+	sha512sums = be2b02c4272ff2d24a9c939ace2e92e9fa725fd2ac14996a10e767442cdce5b4b51e7d221bfedfb18a9081c1957bcf11c46a4152b3fb7dd055943b0a2ebb9753
 
 pkgname = ventoy-bin
 
diff --git a/PKGBUILD b/PKGBUILD
index 515f589..c0a7e48 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,26 +4,56 @@
 
 pkgname=ventoy-bin
 pkgver=1.0.12
-pkgrel=2
+pkgrel=3
 pkgdesc='A new multiboot USB solution (Binary)'
 url='http://www.ventoy.net/'
 arch=('i686' 'x86_64')
 license=('GPL3')
-depends=('bash' 'util-linux')
+depends=('bash' 'util-linux' 'xz' 'exfat-utils')
 provides=("${pkgname%-bin}")
 conflicts=("${pkgname%-bin}")
 source=("https://github.com/ventoy/Ventoy/releases/download/v${pkgver}/${pkgname%-bin}-${pkgver}-linux.tar.gz"
-        "${pkgname%-bin}")
+        "${pkgname%-bin}" 'sanitize.patch')
 sha512sums=('b89c4de490ec7af8358c98c7613ba2cb91e42c2db0c7e541ac62e1b3d9dfb7ff2d7550c72a71e52b0e27f7b030053e62b1b3bde3ed93fe7b00be78d4abe00865'
-            '27fef4c8e254863896888cf3e77a39ed377100effc69a4518fe55038069c7c1e8b56f1a79d47d969eda8e5bd90920e93b34dd361aac67be948266d1e7b238dcd')
+            '578859c4007e406e66cd5331d9ce90794cf04cd9a4b252f8188e4f8d4cbd60ae1efb09860952ffb6540552db772e36baf6acded69bf0b0a6569f374215e166bc'
+            'be2b02c4272ff2d24a9c939ace2e92e9fa725fd2ac14996a10e767442cdce5b4b51e7d221bfedfb18a9081c1957bcf11c46a4152b3fb7dd055943b0a2ebb9753')
 
-package() {
-  cd "${pkgname%-bin}-${pkgver}"
+prepare() {
+  msg2 "Decompress tools..."
+  cd "$srcdir/${pkgname%-bin}-${pkgver}/tool"
+  for file in $(ls *.xz); do
+    xzcat $file > ${file%.xz}
+    chmod +x ${file%.xz}
+  done
+  
+  msg2 "Cleaning up .xz crap..."
+  rm -fv ./*.xz
+  
+  msg2 "Applying sanitize patch..."
+  cd ..
+  patch -p0 < "$srcdir/sanitize.patch"
+  
+  msg2 "Cleaning up unused binaries..."
+  rm -fv tool/{mkextfatfs_{32,64},mount.exfat-fuse_{32,64},ash,hexdump,xzcat}
+}
 
-  install -Dm644 boot/* -t "$pkgdir/opt/${pkgname%-bin}/boot/"
-  install -Dm644 "${pkgname%-bin}"/* -t "$pkgdir/opt/${pkgname%-bin}/${pkgname%-bin}/"
-  install -Dm755 tool/* -t "$pkgdir/opt/${pkgname%-bin}/tool/"
-  install -Dm755 *.sh -t "$pkgdir/opt/${pkgname%-bin}/"
+package() {
+  cd "$srcdir/${pkgname%-bin}-${pkgver}"
 
+  msg2 "Copying package files..."
+  install -Dm644 -t "$pkgdir/opt/${pkgname%-bin}/boot/"            boot/*
+  install -Dm644 -t "$pkgdir/opt/${pkgname%-bin}/${pkgname%-bin}/" "${pkgname%-bin}"/* 
+  install -Dm755 -t "$pkgdir/opt/${pkgname%-bin}/tool/"            tool/*
+  install -Dm755 -t "$pkgdir/opt/${pkgname%-bin}/"                 *.sh
+  
+  msg2 "Linking system binaries..."
+  ln -svf /usr/bin/xzcat   "$pkgdir/opt/${pkgname%-bin}/tool/"
+  ln -svf /usr/bin/hexdump "$pkgdir/opt/${pkgname%-bin}/tool/"
+  ln -svf /usr/bin/mkfs.exfat "$pkgdir/opt/${pkgname%-bin}/tool/mkextfatfs_32"
+  ln -svf /usr/bin/mkfs.exfat "$pkgdir/opt/${pkgname%-bin}/tool/mkextfatfs_64"
+  ln -svf /usr/bin/mount.exfat-fuse "$pkgdir/opt/${pkgname%-bin}/tool/mkextfatfs_32"
+  ln -svf /usr/bin/mount.exfat-fuse "$pkgdir/opt/${pkgname%-bin}/tool/mkextfatfs_64"
+  
+  msg2 "Creating /usr/bin entries..."
   install -Dm755 "$srcdir/${pkgname%-bin}" -t "$pkgdir"/usr/bin/
 }
diff --git a/sanitize.patch b/sanitize.patch
new file mode 100644
index 0000000..445aa7b
--- /dev/null
+++ b/sanitize.patch
@@ -0,0 +1,110 @@
+Author: DuckSoft <realducksoft@gmail.com>
+
+I just cannot stand such a dirty package. 
+Let me do some optimisations.
+
+If you are interested to improve this patch, welcome to mail me.
+
+--- Ventoy2Disk.sh
++++ Ventoy2Disk.sh
+@@ -8,43 +8,4 @@
+ echo '***********************************************************'
+ echo ''
+ 
+-OLDDIR=$PWD
+-
+-if ! [ -f ./tool/xzcat ]; then
+-    if [ -f ${0%Ventoy2Disk.sh}/tool/xzcat ]; then
+-        cd ${0%Ventoy2Disk.sh}    
+-    fi
+-fi
+-
+-if ! [ -f ./boot/boot.img ]; then
+-    if [ -d ./grub ]; then
+-        echo "Don't run Ventoy2Disk.sh here, please download the released install package, and run the script in it."
+-    else
+-        echo "Please run under the correct directory!" 
+-    fi
+-    exit 1
+-fi
+-
+-echo "############# Ventoy2Disk $* ################" >> ./log.txt
+-
+-#decompress tool
+-if ! [ -f ./tool/ash ]; then
+-    cd tool
+-    chmod +x ./xzcat
+-    for file in $(ls *.xz); do
+-        ./xzcat $file > ${file%.xz}
+-        chmod +x ${file%.xz}
+-    done
+-    cd ../
+-
+-    if ! [ -f ./tool/ash ]; then
+-        echo 'Failed to decompress tools ...'
+-        cd $OLDDIR
+-        exit 1
+-    fi
+-fi
+-
+-./tool/ash ./tool/VentoyWorker.sh $*
+-
+-cd $OLDDIR
+-
++./tool/VentoyWorker.sh $*
+--- tool/ventoy_lib.sh
++++ tool/ventoy_lib.sh
+@@ -36,7 +36,7 @@ vterr() {
+ }
+ 
+ vtdebug() {
+-    echo "$*" >> ./log.txt
++    true
+ }
+ 
+ check_tool_work_ok() {
+@@ -51,30 +51,6 @@ check_tool_work_ok() {
+         vtoyfat=vtoyfat_32
+     fi
+     
+-    if echo 1 | ./tool/hexdump > /dev/null; then
+-        vtdebug "hexdump test ok ..."
+-    else
+-        vtdebug "hexdump test fail ..."
+-        ventoy_false
+-        return
+-    fi
+-   
+-    if ./tool/$mkexfatfs -V > /dev/null; then
+-        vtdebug "$mkexfatfs test ok ..."
+-    else
+-        vtdebug "$mkexfatfs test fail ..."
+-        ventoy_false
+-        return
+-    fi
+-    
+-    if ./tool/$vtoyfat -T; then
+-        vtdebug "$vtoyfat test ok ..."
+-    else
+-        vtdebug "$vtoyfat test fail ..."
+-        ventoy_false
+-        return
+-    fi
+-    
+     vtdebug "tool check success ..."
+     ventoy_true
+ }
+@@ -132,13 +108,6 @@ is_disk_contains_ventoy() {
+         return
+     fi
+     
+-    # PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | ./tool/hexdump -n1 -e  '1/1 "%02X"')
+-    # if [ "$PART1_TYPE" != "07" ]; then
+-        # vtdebug "part1 type is $PART2_TYPE not 07"
+-        # ventoy_false
+-        # return
+-    # fi
+-    
+     if [ -e /sys/class/block/${PART1#/dev/}/start ]; then
+         PART1_START=$(cat /sys/class/block/${PART1#/dev/}/start)
+     fi