could someone help build a batch updater for freedos?

Discussion/announcements about test/beta releases of UBCD will be posted here.

Moderators: Icecube, StopSpazzing

Post Reply
as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

could someone help build a batch updater for freedos?

Post by as702 » Mon Jul 28, 2008 3:48 am

viewtopic.php?t=1422

ok, i plan to update the page (linked above) pretty frequently. to aid users affect a trouble-free update, i was wondering if someone could possibly supply a working script to do the following:

1) explode the target UBCD .iso (should auto-detect version 4.1.1 or 5.xx)

2) inject and replace dosubcd.imz with the newer distribution from the following directories:

for v4.1.1

Code: Select all

/ubcd/images/


for v5.xx

Code: Select all

/images/


3) remaster the .iso

i'm not too familiar with what's out there for linux/windows, but it would certainly help me roll-out updates more frequently.

volunteers would be appreciated.

Icecube
Posts: 1278
Joined: Fri Jan 11, 2008 2:52 pm
Contact:

Post by Icecube » Mon Jul 28, 2008 6:57 am

2) inject and replace dosubcd.imz with the newer distribution from the following directories:

for v4.1.1
Code:
/ubcd/images/

for v5.xx
Code:
/images/

You probably mean /images/ for v4.1.1 and /ubcd/images/ for v5.xx :) .

See: viewtopic.php?t=1429&highlight=7zip+perl
I don't know if he is working on it now, but I hope so.

But the only thing you probably need:
7za (7zip to extract the iso to some place)
Some "if file exists" stuff do determine which version of ubcd it is.
The iso remastering stuff is easy.

I will look at it later, I almost finished the upgrade of cpustress image.

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

Post by as702 » Mon Jul 28, 2008 7:55 am

Icecube wrote:You probably mean /images/ for v4.1.1 and /ubcd/images/ for v5.xx :) .


heh, actually no. Rev1.2 is joint-compatible with 4.1.1 and 5.xx (i.e. single distribution).

Icecube wrote:I will look at it later, I almost finished the upgrade of cpustress image.


i'd appreciate it, icecube. anything you could come up with would be of use.

(-:

deadite
Posts: 15
Joined: Mon Aug 11, 2008 1:19 pm

VBScript Updater

Post by deadite » Mon Aug 11, 2008 7:28 pm

I had a free minute and put this little vbscript together that will update your ISO. Just copy and paste the script in a file called "updateDosUBCD.vbs", put the script in the same directory as your UBCD ISO, and your dosubcd.igz file, then double click on the vbscript. It will give you a message box if it receives an error, otherwise it'll display "Finished" when done.

Code: Select all

' ***************************************************************************************
' updateDosUBCD.vbs
'
' PURPOSE:
' This script extracts an UBCD ISO, updates dosubcd.igz, and creates an updated ISO file
'
' REQUIREMENTS:
' This script requires that 7-Zip is installed, a new dosubcd.igz file, and an UBCD ISO.
'
' NOTES:
' It is recommended to use the default variables, but you can customize their paths under the custom
' variables section.  Please see that section for the default values.  This script has been tested and will
' work with UBCD 4.x and 5.x
' ***************************************************************************************

' Force Explicit Variable Declaration and Ignore All Errors
Option Explicit
On Error Resume Next





' Custom Variables - Set these paths to override the defaults
' ***************************************************************************************
Dim path7Zip: path7Zip = ""         '(Default = %PROGRAMFILES%\7-Zip\7z.exe)
Dim pathIMG: pathIMG = ""         '(Default = Same Directory as this Script)
Dim pathISO: pathISO = ""         '(Default = Same Directory as this Script)
Dim pathUBCD: pathUBCD = ""         '(Default = Same Directory as this script)
Dim pathMKISOFS: pathMKISOFS = ""   '(Default = Uses mkisofs.exe from the UBCD ISO)





' Default Variables - Default Variables, Do Not Modify These
' ***************************************************************************************
' Create Objects
Dim objShell: Set objShell = WScript.CreateObject("WScript.Shell")
Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")

' Get Path to Current Script
Dim scriptPath: scriptPath = Left(WScript.ScriptFullName,InstrRev(WScript.ScriptFullName,"\"))

' Set Path to 7-Zip
If Not objFSO.FileExists(path7Zip) Then
   path7Zip = objShell.ExpandEnvironmentStrings("%PROGRAMFILES%\7-Zip\7z.exe")
   If Not objFSO.FileExists(path7Zip) Then
      Wscript.Echo "!~ERROR~! 7-Zip Couldn't Be located in the Default Location:" & vbCrLf & _
                path7Zip & vbCrLf & _
                "Quitting Script!"
      Wscript.Quit
   End If
End If

' Set Path to dosubcd.igz
If Not objFSO.FileExists(pathIMG) Then
   pathIMG = scriptPath & "dosubcd.igz"
   If Not objFSO.FileExists(pathIMG) Then
      Wscript.Echo "!~ERROR~! dosubcd.igz Couldn't Be located in the Default Location:" & vbCrLf & _
                pathIMG & vbCrLf & _
                "Quitting Script!"
      Wscript.Quit
   End If
End If

' Set Path to UBCD ISO
If Not objFSO.FileExists(pathISO) Then
   Dim objFiles: Set objFiles = objFSO.GetFolder(scriptPath).Files
   Dim file
   For Each file in objFiles
      If InStr(1,file.Name,"ubcd",1) > 0 Then
         If InStr(1,file.Name,".iso",1) > 0 Then
            pathISO = file.Path
         End If
      End If
   Next
   If Not objFSO.FileExists(pathISO) Then
      Wscript.Echo "!~ERROR~! UBCD ISO Couldn't Be located in the Default Location:" & vbCrLf & _
                pathISO & vbCrLf & _
                "Quitting Script!"
      Wscript.Quit
   End If
End If

' Set Path to Extract UBCD ISO Files
pathUBCD = scriptPath & "ubcd"





' Process Files - Do Not Modify This Section
' ***************************************************************************************
' Extract UBCD ISO
Dim intRunError
intRunError = objShell.Run(chr(34) & path7Zip & chr(34) & " x -o" & chr(34) & pathUBCD & chr(34) & " " & chr(34) & pathISO & chr(34), 1, TRUE)
If intRunError <> 0 Then
   Wscript.Echo "!~ERROR~! - Extracting UBCD ISO with 7-Zip" & vbCrLf & _
             "Quitting Script!"
   Wscript.Quit
End If

' Update dosubcd.igz (Compatible with versions 4.x and 5.x)
Dim strVer: strVer = ""
If objFSO.FolderExists(pathUBCD & "\images") Then
   ' UBCD 4.x Detected
   strVer = "4.x"
   ' Copy File
   objFSO.CopyFile pathIMG, pathUBCD & "\images\dosubcd.igz", True
   ' Set Path MKISOFS
   If Not objFSO.FileExists(pathMKISOFS) Then
      ' Use Default From Extracted ISO
      pathMKISOFS = pathUBCD & "\tools\ubcd2iso\mkisofs.exe"
      If Not objFSO.FileExists(pathMKISOFS) Then
         Wscript.Echo "!~ERROR~! - Couldn't find mkisofs.exe in:" & vbCrLf & _
                   pathMKISOFS & vbCrLf & _
                   "Quitting Script!"
         Wscript.Quit
      End If
   End If
Elseif objFSO.FolderExists(pathUBCD & "\ubcd\images") Then
   ' UBCD 5.x Detected
   strVer = "5.x"
   ' Copy File
   objFSO.CopyFile pathIMG, pathUBCD & "\ubcd\images\dosubcd.igz", True
   ' Set Path MKISOFS
   If Not objFSO.FileExists(pathMKISOFS) Then
      ' Use Default From Extracted ISO
      pathMKISOFS = pathUBCD & "\ubcd\tools\ubcd2iso\mkisofs.exe"
      If Not objFSO.FileExists(pathMKISOFS) Then
         Wscript.Echo "!~ERROR~! - Couldn't find mkisofs.exe in:" & vbCrLf & _
                   pathMKISOFS & vbCrLf & _
                   "Quitting Script!"
         Wscript.Quit
      End If
   End If
Else
   Wscript.Echo "!~ERROR~! - Couldn't Find Extracted UBCD 4.x Or 5.x Files in:" & vbCrLf & _
             pathUBCD & "\images" & vbCrLf & _
             "OR" & vbCrLf & _
             pathUBCD & "\ubcd\images" & vbCrLf & _
             "Quitting Script!"
   Wscript.Quit
End If

' Create ISO
intRunError = objShell.Run(chr(34) & pathMKISOFS & chr(34) & " -N -J -joliet-long -D -V " & chr(34) & "UBCD" & strVer & chr(34) & " -o " & chr(34) & Replace(scriptPath,"\","/") & "UBCD.iso" & chr(34) & " -b " & chr(34) & "isolinux/isolinux.bin" & chr(34) & " -no-emul-boot -boot-load-size 4 -boot-info-table " & chr(34) & Replace(pathUBCD,"\","/") & chr(34), 1, True)
If intRunError <> 0 Then
   Wscript.Echo "!~ERROR~! - Making UBCD ISO with mkisofs.exe" & vbCrLf & _
             "Quitting Script!"
   Wscript.Quit
End If





' Cleanup Objects and Finish
' ***************************************************************************************
Set objShell = nothing
Set objFSO = nothing
Wscript.Echo "Finished"

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

Post by as702 » Tue Aug 12, 2008 1:24 am

Wow, thank you. My vbscript skills are a little rusty but I'll definitely have a look at it.

deadite
Posts: 15
Joined: Mon Aug 11, 2008 1:19 pm

Script

Post by deadite » Tue Aug 12, 2008 1:48 am

If you have questions, let me know... it should be straight forward to run though...

If you are running Linux let me know and I can rewrite it for Linux using PERL

Icecube
Posts: 1278
Joined: Fri Jan 11, 2008 2:52 pm
Contact:

Post by Icecube » Tue Aug 12, 2008 1:53 am

I am running linux. I think a bash script can solve this easily, but if you prefer Perl, make it in Perl. I have a script to make the iso, so I only have to replace dosubcd.igz and double click on the bash script.

By default, I think it is better that the new iso has another name as the original one (e.g UBCDb4-freedosV1.28.iso)
Last edited by Icecube on Tue Aug 12, 2008 2:00 am, edited 1 time in total.

deadite
Posts: 15
Joined: Mon Aug 11, 2008 1:19 pm

Post by deadite » Tue Aug 12, 2008 1:56 am

hmm I just noticed a small caveat.... If you run the script more than once and the extracted UBCD folder or the new ISO exist, it will return a result other than 0 (ie: an error). So you can delete them everytime, or just comment out the Wscript.Quit when it checks for intRunError <> 0.

deadite
Posts: 15
Joined: Mon Aug 11, 2008 1:19 pm

Post by deadite » Tue Aug 12, 2008 1:57 am

OK, It'll prob take me some time to get a BASH Script together.... I don't have a Linux Box running at the moment, so I'll have to install one..

Icecube
Posts: 1278
Joined: Fri Jan 11, 2008 2:52 pm
Contact:

Post by Icecube » Tue Aug 12, 2008 2:02 am

You can download unxutils: http://unxutils.sourceforge.net/. It works on windows and contains the most important linux programs (native programs, no cygwin ports).

Change:

Code: Select all

' Set Path to Extract UBCD ISO Files
pathUBCD = scriptPath & "ubcd"

To:

Code: Select all

' Set Path to Extract UBCD ISO Files
pathUBCD = scriptPath & "ubcd-extract"

The UBCD5 version contains a folder ubcd, so that can be confusing.

PS: you can edit your post with your script.

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

Post by as702 » Tue Aug 12, 2008 2:09 am

When it rains, it pours.

Great effort, guys. (-:

Icecube
Posts: 1278
Joined: Fri Jan 11, 2008 2:52 pm
Contact:

Post by Icecube » Tue Aug 12, 2008 2:15 am

@as702
If you add the next dosubcd.igz in a zip file "dosubcd-<Version>.zip" like I already mentioned, deadite can use the filename of the zip file to determine the version number which "must" be added to the iso image.

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

Post by as702 » Tue Aug 12, 2008 2:42 am

Consider it done. From this day forth, ALL future releases will contain the suffix "-<VERSION>.zip"

deadite
Posts: 15
Joined: Mon Aug 11, 2008 1:19 pm

Post by deadite » Wed Aug 13, 2008 7:05 pm

I just wanted to check on this to make sure I have it correct. You want the variable for dosubcd.igz to be modified to look for dosubcd-<VERSION>.zip, extract the dosubcd.igz in that file, and then copy it to the extracted ISO?

Consider it done.

I will update the vbscript as well as put out a BASH script later tonight

deadite
Posts: 15
Joined: Mon Aug 11, 2008 1:19 pm

Post by deadite » Wed Aug 13, 2008 9:39 pm

OK, I revised the vbscript and will get the BASH script written later tonight

Code: Select all

' ***************************************************************************************
' updateDosUBCD.vbs
'
' PURPOSE:
' This script extracts an UBCD ISO, updates dosubcd.igz, and creates an updated ISO file
'
' REQUIREMENTS:
' This script requires that 7-Zip is installed, a new dosubcd.igz file, and an UBCD ISO.
'
' NOTES:
' It is recommended to use the default variables, but you can customize their paths under the custom
' variables section.  Please see that section for the default values.  This script has been tested and will
' work with UBCD 4.x and 5.x
' ***************************************************************************************

' Force Explicit Variable Declaration and Ignore All Errors
Option Explicit
On Error Resume Next





' User Script Variables - Set to Customize Script
' ***************************************************************************************
' Custom Variable Paths to Override the Default Paths
Dim path7Zip: path7Zip = ""               '(Default = %PROGRAMFILES%\7-Zip\7z.exe)
Dim pathIMG: pathIMG = ""                '(Default = Same Directory as this Script)
Dim pathISO: pathISO = ""                '(Default = Same Directory as this Script)
Dim pathMKISOFS: pathMKISOFS = ""         '(Default = Uses mkisofs.exe from the UBCD ISO)

' User Defined Variables THESE MUST BE SET
Dim nameIMG: nameIMG = "dosubcd_r128.zip"   '(Name of the dosubcd zip file)
Dim nameISO: nameISO = "ubcd411.iso"      '(Name of UBCD ISO)
Dim repIMGExtract: repIMGExtract = True      '(Replace dosubcd.igz when extracting dosubcd_<version>.zip)
Dim repISOExtract: repISOExtract = True      '(Replace dosubcd.igz when extracting dosubcd_<version>.zip)





' Default Variables - Do Not Modify This Section
' ***************************************************************************************
' Create Objects & Variables
Dim objShell: Set objShell = WScript.CreateObject("WScript.Shell")
Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim verISO

' Get Path to Current Script
Dim scriptPath: scriptPath = Left(WScript.ScriptFullName,InstrRev(WScript.ScriptFullName,"\"))

' Set Path to 7-Zip
If Not objFSO.FileExists(path7Zip) Then
   path7Zip = objShell.ExpandEnvironmentStrings("%PROGRAMFILES%\7-Zip\7z.exe")
   If Not objFSO.FileExists(path7Zip) Then
      Wscript.Echo "!~ERROR~! 7-Zip Couldn't Be located in the Location:" & vbCrLf & _
                path7Zip & vbCrLf & _
                "Quitting Script!"
      Wscript.Quit
   End If
End If

' Set Path to dosubcd_<version>.zip
If objFSO.FolderExists(pathIMG) Then
   If Right(pathIMG, 1) <> "\" Then pathIMG = pathIMG & "\"
Else
   pathIMG = scriptPath
   If Right(pathIMG, 1) <> "\" Then pathIMG = pathIMG & "\"
End If
If Not objFSO.FileExists(pathIMG & nameIMG) Then
   Wscript.Echo "!~ERROR~! dosubcd_<version>.zip Couldn't Be located in the Location:" & vbCrLf & _
             pathIMG & nameIMG & vbCrLf & _
             "Quitting Script!"
   Wscript.Quit
End If

' Set Path to UBCD ISO
If objFSO.FolderExists(pathISO) Then
   If Right(pathISO, 1) <> "\" Then pathISO = pathISO & "\"
Else
   pathISO = scriptPath
   If Right(pathISO, 1) <> "\" Then pathISO = pathISO & "\"   
End If
If Not objFSO.FileExists(pathISO & nameISO) Then
   Wscript.Echo "!~ERROR~! UBCD ISO Couldn't Be located in the Location:" & vbCrLf & _
             pathISO & nameISO & vbCrLf & _
             "Quitting Script!"
   Wscript.Quit
End If

' Get UBCD ISO Version and Append It
verISO = Replace(nameISO, ".iso", "")
verISO = Replace(verISO, "ubcd", "") & "1"

' Path to Extract UBCD ISO
Dim pathUBCDExtract: pathUBCDExtract = scriptPath & "ubcd-extract\"
If Right(pathUBCDExtract, 1) <> "\" Then pathUBCDExtract = pathUBCDExtract & "\"





' Process Files - Do Not Modify This Section
' ***************************************************************************************
' Extract dosubcd_<version>.zip
If repIMGExtract = True Then
   objShell.Run chr(34) & path7Zip & chr(34) & " x -y -o" & chr(34) & pathIMG & chr(34) & " " & chr(34) & pathIMG & nameIMG & chr(34), 1, TRUE
Else
   objShell.Run chr(34) & path7Zip & chr(34) & " x -o" & chr(34) & pathIMG & chr(34) & " " & chr(34) & pathIMG & nameIMG & chr(34), 1, TRUE
End If

' Extract UBCD ISO
If repISOExtract = True Then
   objShell.Run chr(34) & path7Zip & chr(34) & " x -y -o" & chr(34) & pathUBCDExtract & chr(34) & " " & chr(34) & pathISO & nameISO & chr(34), 1, TRUE
Else
   objShell.Run chr(34) & path7Zip & chr(34) & " x -o" & chr(34) & pathUBCDExtract & chr(34) & " " & chr(34) & pathISO & nameISO & chr(34), 1, TRUE
End If

' Update dosubcd.igz (Compatible with versions 4.x and 5.x)
If objFSO.FolderExists(pathUBCDExtract & "images") Then
   ' UBCD 4.x Detected
   ' Copy File
   objFSO.CopyFile pathIMG & nameIMG, pathUBCDExtract & "images\dosubcd.igz", True
   ' Set Path MKISOFS
   If Not objFSO.FileExists(pathMKISOFS) Then
      ' Use Default From Extracted ISO
      pathMKISOFS = pathUBCDExtract & "tools\ubcd2iso\mkisofs.exe"
      If Not objFSO.FileExists(pathMKISOFS) Then
         Wscript.Echo "!~ERROR~! - Couldn't find mkisofs.exe in:" & vbCrLf & _
                   pathMKISOFS & vbCrLf & _
                   "Quitting Script!"
         Wscript.Quit
      End If
   End If
Elseif objFSO.FolderExists(pathUBCDExtract & "ubcd\images") Then
   ' UBCD 5.x Detected
   ' Copy File
   objFSO.CopyFile pathIMG & nameIMG, pathUBCDExtract & "ubcd\images\dosubcd.igz", True
   ' Set Path MKISOFS
   If Not objFSO.FileExists(pathMKISOFS) Then
      ' Use Default From Extracted ISO
      pathMKISOFS = pathUBCDExtract & "ubcd\tools\ubcd2iso\mkisofs.exe"
      If Not objFSO.FileExists(pathMKISOFS) Then
         Wscript.Echo "!~ERROR~! - Couldn't find mkisofs.exe in:" & vbCrLf & _
                   pathMKISOFS & vbCrLf & _
                   "Quitting Script!"
         Wscript.Quit
      End If
   End If
Else
   Wscript.Echo "!~ERROR~! - Couldn't Find Extracted UBCD 4.x Or 5.x Files in:" & vbCrLf & _
             pathUBCDExtract & "images" & vbCrLf & _
             "OR" & vbCrLf & _
             pathUBCDExtract & "ubcd\images" & vbCrLf & _
             "Quitting Script!"
   Wscript.Quit
End If

' Create ISO
If objFile.Exists(scriptPath & "UBCD.iso") Then
   objFSO.DeleteFile(scriptPath & "UBCD.iso"), True
End If
Wscript.Sleep(3000)
objShell.Run chr(34) & pathMKISOFS & chr(34) & " -N -J -joliet-long -D -V " & chr(34) & "UBCD" & verISO & chr(34) & " -o " & chr(34) & Replace(scriptPath,"\","/") & "UBCD.iso" & chr(34) & " -b " & chr(34) & "isolinux/isolinux.bin" & chr(34) & " -no-emul-boot -boot-load-size 4 -boot-info-table " & chr(34) & Replace(pathUBCDExtract,"\","/") & chr(34), 1, True





' Cleanup Objects and Finish
' ***************************************************************************************
Set objShell = nothing
Set objFSO = nothing
Wscript.Echo "Finished"

deadite
Posts: 15
Joined: Mon Aug 11, 2008 1:19 pm

Post by deadite » Wed Aug 27, 2008 11:45 pm

Sorry for the delay, but I finally just finished this... I had to change some of the code around because some commands didn't match up. I'm not entirely sure if the mkisofs command will actually work on your computer, but the rest should be ok.

Code: Select all

#!/bin/bash          
pathIMG=""          #(Default = Same Directory as this Script)

pathISO=""          #(Default = Same Directory as this Script)

# User Defined Variables THESE MUST BE SET

nameIMG="dosubcd_r128.zip"   #(Name of the dosubcd zip file)

nameISO="ubcd50b4.iso"      #(Name of UBCD ISO)

repIMGExtract="true"      #(Replace dosubcd.igz when extracting dosubcd_<version>.zip)

repISOExtract="true"      #(Replace dosubcd.igz when extracting dosubcd_<version>.zip)

#

# Default Variables - Do Not Modify This Section

# ***************************************************************************************

# Set Path to Current Script

scriptPath=`pwd`
#[[ $scriptPath != */ ]] && scriptPath="$scriptPath"/

# Set Path to dosubcd_<version>.zip
if test -n $pathIMG; then
   pathIMG="$scriptPath"
fi
[[ $pathIMG != */ ]] && pathIMG="$pathIMG"/

# Ensure dosubcd_<version>.zip Exists
if [ ! -f "$pathIMG$nameIMG" ]; then
   echo "ERROR dosubcd_version.zip Couldnt be located at:" "$pathIMG$nameIMG"
   echo "Quitting Script!"
   exit
fi

# Set Path to UBCD ISO
if test -n $pathISO; then
   pathISO="$scriptPath"
fi
[[ $pathISO != */ ]] && pathISO="$pathISO"/

# Ensure UBCD ISO Exists
if [ ! -f "$pathISO$nameISO" ]; then
   echo "ERROR UBCD ISO Couldnt be located at:" "$pathISO$nameISO"
   echo "Quitting Script!"
   exit
fi

# Get UBCD ISO Version and Append It
verISO=${nameISO%.*}
verISO=${verISO#ubcd}1

# Set Path to Extract UBCD ISO
pathMount="$scriptPath"
[[ $pathMount != */ ]] && pathMount="$pathMount"/
pathMount="$pathMount"ubcdmount/
pathUBCDExtract="$scriptPath"
[[ $pathUBCDExtract != */ ]] && pathUBCDExtract="$pathUBCDExtract"/
pathUBCDExtract="$pathUBCDExtract"ubcd-extract/

# Ensure MKISOFS Exists
if ! hash mkisofs 2>/dev/null; then
   echo "ERROR Couldnt locate mkisofs"
   echo "Quitting Script!"
   exit
fi





# Process Files - Do Not Modify This Section
# ***************************************************************************************
# Extract dosubcd_<version>.zip
if [ $repIMGExtract = "true" ]; then
   unzip -o "$pathIMG$nameIMG" -d $pathIMG
else
   unzip "$pathIMG$nameIMG" -d $pathIMG
fi

# Extract UBCD ISO
if [ ! -d "$pathMount" ]; then
   mkdir "$pathMount"
fi
if [ ! -d "$pathUBCDExtract" ]; then
   mkdir "$pathUBCDExtract"
fi
mount -o loop -t iso9660 "$pathISO$nameISO" "$pathMount"
#cp -Rp "$pathMount" "$pathUBCDExtract"
cp -pr "$pathMount" "$pathUBCDExtract"
umount "$pathMount"
pathUBCDExtract="$pathUBCDExtract"ubcdmount/

# Update dosubcd.igz (Compatible with versions 4.x and 5.x)
if [ -d "$pathUBCDExtract"images ]; then
   echo version4
   cp "$pathIMG"dosubcd.igz "$pathUBCDExtract"images
elif [ -d "$pathUBCDExtract"ubcd/images ]; then
   echo version5
   cp "$pathIMG"dosubcd.igz "$pathUBCDExtract"ubcd/images
else
   echo "ERROR Couldnt find Extracted UBCD 4.x or 5.x Files in:"
   echo "$pathUBCDExtract"images
   echo OR
   echo "$pathUBCDExtract"ubcd/images
   echo "Quitting Script!"
   exit
fi

# Create ISO
if [ -f "$scriptPath"ubcd.iso ]; then
   rm "$scriptPath"ubcd.iso
fi
mkisofs -N -J -joliet-long -D -V "UBCD$verISO" -o "$scriptPath"ubcd.iso -b "isolinux/isolinux.bin" -no--emul-boot -boot-load-size 4 -boot-info-table "$pathUBCDExtract"
 

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

Post by as702 » Thu Aug 28, 2008 6:53 am

thanks, deadite. i'll give it a go later this evening.

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

Post by as702 » Sat Aug 30, 2008 3:52 am

Code: Select all

mount -o loop -t iso9660 "$pathISO$nameISO" "$pathMount"
#cp -Rp "$pathMount" "$pathUBCDExtract"
cp -pr "$pathMount" "$pathUBCDExtract"
umount "$pathMount"
pathUBCDExtract="$pathUBCDExtract"ubcdmount/


how are you managing to extract/mount the ISO? is it still dependent on users requiring 7zip to be installed on their system?
"If you think things can't get any worse it's probably because you lack sufficient imagination."

deadite
Posts: 15
Joined: Mon Aug 11, 2008 1:19 pm

Post by deadite » Wed Sep 17, 2008 6:52 pm

All this block of code does is create a temp folder and mount the ISO to the temp folder. It then copies out the files from the temp mount to a working directory and unmounts the ISO. 7zip is not required.

It should be a pretty standard way to mount ISO's on Linux, but I did see a couple variations on the following line:

mount -o loop -t iso9660 "$pathISO$nameISO" "$pathMount"

I have verified that this works on Fedora Core 9. If you need further help, let me know.

Post Reply