Rexx Installation - UPDCD Nummer 1 - AHCI

(DE) System, Installation, Konfiguration, Hardware, Treiber, Netzwerk, Virtualisierung, etc.
(EN) System, Installation, Configuration, Hardware, Drivers, Network, Virtualisation, etc.
Antworten
Benutzeravatar
Sigurd
Beiträge: 995
Registriert: Mo 23. Dez 2013, 08:35
Kontaktdaten:

Rexx Installation - UPDCD Nummer 1 - AHCI

Beitrag von Sigurd »

12. Oktober 2015

Heute starten nun meine Versuche, mit Eurer Hilfe neue Installationsskripte in UPDCD einzuspielen.

Leider sind meine Rexx Kentnisse ja noch immer sehr bescheiden (sprich nicht vorhanden), so habe ich mir als erstes den vermeintlich einfachsten Teil herausgenommen, die Integration des AHCI Treibers (zunächst erstmal als ADDON).

Hierzu habe ich die AHCI132.wpi mit WPIView extrahiert und einen Ordner

35_AHCID

angelegt und die extrahierten Dateien dort einkopiert.

Die Addons werden ja jeweils mit einer ADDONINS.CMD installiert, hier habe ich mir als Vorbild die entsprechende Datei aus dem Addon zur Installation des DANISIDE Treibers herausgenommen.

Dieses Skript für den DANIS sieht im Original so aus:

Code: Alles auswählen

/* Install script for the DANI IDE driver                              */
/* Place the following files in this directory from the DANI package:  */
/* DaniS506.ADD, DaniS506.DOC, DiskInfo.exe, DumpIDE.EXE               */
/* You may optionally put the up2TB.flt driver in this directory to    */
/* provide support for ultra large drives.                             */
/* 05.20.2002: added support for uninstallation                        */
/* 04.20.2004: added support for up2TB.flt                             */
/* 11.06.2004: up2tb support has been moved to boot image              */
/* 09.30.2005: aligned with os2mt                                      */
/* 10.20.2005: added overwrite mode                                    */

parse arg target source mode

/* get additional parameters from environment */
product_log       = value("PRODUCT_LOG"      , ,"OS2ENVIRONMENT")
inst_dir          = value("INST_DIR"         , ,"OS2ENVIRONMENT")

/* check if we are in uninstall mode */
if mode = 'UNINSTALL' then do
	call uninstall
	exit
end

/* exit if package does not exist */
if stream(inst_dir'\DaniS506.ADD', 'c', 'query exists') = '' then exit 9

Say
Say 'Updating files...'

/* copy files but do not overwrite them if they are already there */
if stream(target'\os2\boot\DaniS506.ADD', 'c', 'query exists') = '' | mode = 'OVERWRITE' then do
	'@copy 'inst_dir'\DaniS506.ADD 'target'\os2\boot\. >> 'product_log
end
if stream(target'\os2\help\DaniS506.DOC', 'c', 'query exists') = '' | mode = 'OVERWRITE' then do
	'@copy 'inst_dir'\DaniS506.DOC 'target'\os2\help\. >> 'product_log
end
if stream(target'\os2\DiskInfo.exe', 'c', 'query exists') = '' | mode = 'OVERWRITE' then do
	'@copy 'inst_dir'\DiskInfo.exe 'target'\os2\. >> 'product_log
end
if stream(target'\os2\DumpIDE.EXE', 'c', 'query exists') = '' | mode = 'OVERWRITE' then do
	'@copy 'inst_dir'\DumpIDE.EXE  'target'\os2\. >> 'product_log
end

/* change config.sys if needed */
Say 
Say 'Updating Config.Sys...'
cfgfile = target'\config.sys'
q = 1
found. = 0
do while lines(cfgfile)
	l.q = linein(cfgfile)
	if pos('DANIS506.ADD', translate(l.q)) > 0 & substr(translate(l.q), 1, 3) <> 'REM'
		then found.add = 1
	q = q+1
end
rc = lineout(cfgfile)
l.0 = q-1

/* backup config.sys */
if found.add = 0 | found.flt = 0 then do
	'@copy 'cfgfile target'\os2\install\config.dni' 
	'@del 'cfgfile
	do q=1 to l.0
		if pos('IBM1S506.ADD', translate(l.q)) > 0 then do
			rc = lineout(cfgfile, ' ')
			rc = lineout(cfgfile, 'REM UpdCD')
			if found.add = 0 then do
				/* add DANI driver */
				rc = lineout(cfgfile, 'BASEDEV=DANIS506.ADD')
				/* rem IBM driver out */
				l.q = 'REM UpdCD '||l.q 
			end
		end
		rc = lineout(cfgfile, l.q)
	end
	rc = lineout(cfgfile)
end

Say
Say 'Completed.'

exit

uninstall:

	/* update config.sys */
	found. = 0
	cfgfile = target'\config.sys'
	q = 1
	do while lines(cfgfile)
		l.q = linein(cfgfile)
		if pos('REM UPDCD BASEDEV=IBM1S506.ADD', translate(l.q)) > 0 then found.ibmide = 1
		q=q+1
	end
	call lineout cfgfile
	l.0=q-1
	'copy 'cfgfile target'\os2\install\config.dni >> 'product_log 
	'del 'cfgfile' >> 'product_log 
	do q=1 to l.0
		if pos('DANIS506.ADD', translate(l.q)) > 0 then iterate
		if pos('UP2TB.FLT',    translate(l.q)) > 0 then l.q = 'REM 'l.q
		if pos('REM UPDCD BASEDEV=IBM1S506.ADD', translate(l.q)) > 0 then l.q = 'BASEDEV=IBM1S506.ADD'
		call lineout cfgfile, l.q
	end
	if found.ibmide = 0 then call lineout cfgfile, 'BASEDEV=IBM1S506.ADD'
	call lineout cfgfile

	/* delete files */
	'del 'target'\os2\boot\danis506.add >> 'product_log
	'del 'target'\os2\help\danis506.doc >> 'product_log
	'del 'target'\os2\DiskInfo.exe      >> 'product_log
	'del 'target'\os2\DumpIDE.EXE       >> 'product_log

return
Dieses Skript habe ich nun wie folgt angepasst:

Code: Alles auswählen

/* Install script for the ACHI driver                              */
/* Place the following files in this directory from the AHCI.WPI package:  */
/* os2ahci.add, os2ahci.sym, smartahci.exe               */
/* You may need to extract the wpi with wpiview    */
/* 10.12.2015: first attempt                                    */

parse arg target source mode

/* get additional parameters from environment */
product_log       = value("PRODUCT_LOG"      , ,"OS2ENVIRONMENT")
inst_dir          = value("INST_DIR"         , ,"OS2ENVIRONMENT")

/* check if we are in uninstall mode */
if mode = 'UNINSTALL' then do
	call uninstall
	exit
end

/* exit if package does not exist */
if stream(inst_dir'\OS2AHCI.ADD', 'c', 'query exists') = '' then exit 9

Say
Say 'Updating files...'

/* copy files but do not overwrite them if they are already there */
if stream(target'\os2\boot\OS2AHCI.ADD', 'c', 'query exists') = '' | mode = 'OVERWRITE' then do
	'@copy 'inst_dir'\OS2AHCI.ADD 'target'\os2\boot\. >> 'product_log
end
if stream(target'\os2\smartahci.exe', 'c', 'query exists') = '' | mode = 'OVERWRITE' then do
	'@copy 'inst_dir'\smartahci.exe 'target'\os2\. >> 'product_log
end

/* change config.sys if needed */
Say 
Say 'Updating Config.Sys...'
cfgfile = target'\config.sys'
q = 1
found. = 0
do while lines(cfgfile)
	l.q = linein(cfgfile)
	if pos('OS2AHCI.ADD', translate(l.q)) > 0 & substr(translate(l.q), 1, 3) <> 'REM'
		then found.add = 1
	q = q+1
end
rc = lineout(cfgfile)
l.0 = q-1

/* backup config.sys */
if found.add = 0 | found.flt = 0 then do
	'@copy 'cfgfile target'\os2\install\config.dni' 
	'@del 'cfgfile
	do q=1 to l.0
		if pos('IBM1S506.ADD', translate(l.q)) > 0 then do
			rc = lineout(cfgfile, ' ')
			rc = lineout(cfgfile, 'REM UpdCD')
			if found.add = 0 then do
				/* add AHCI driver */
				rc = lineout(cfgfile, 'BASEDEV=OS2AHCI.ADD')
				/* rem IBM driver out */
				l.q = 'REM UpdCD '||l.q 
			end
		end
		rc = lineout(cfgfile, l.q)
	end
	rc = lineout(cfgfile)
end

Say
Say 'Completed.'

exit

uninstall:

	/* update config.sys */
	found. = 0
	cfgfile = target'\config.sys'
	q = 1
	do while lines(cfgfile)
		l.q = linein(cfgfile)
		if pos('REM UPDCD BASEDEV=IBM1S506.ADD', translate(l.q)) > 0 then found.ibmide = 1
		q=q+1
	end
	call lineout cfgfile
	l.0=q-1
	'copy 'cfgfile target'\os2\install\config.dni >> 'product_log 
	'del 'cfgfile' >> 'product_log 
	do q=1 to l.0
		if pos('OS2AHCI.ADD', translate(l.q)) > 0 then iterate
		if pos('REM UPDCD BASEDEV=IBM1S506.ADD', translate(l.q)) > 0 then l.q = 'BASEDEV=IBM1S506.ADD'
		call lineout cfgfile, l.q
	end
	if found.ibmide = 0 then call lineout cfgfile, 'BASEDEV=IBM1S506.ADD'
	call lineout cfgfile

	/* delete files */
	'del 'target'\os2\boot\os2ahci.add >> 'product_log
	'del 'target'\os2\smartahci.exe      >> 'product_log
	
return
Ich habe dabei, so "logisch" wie es mir erschien, Zeilen und Zeichen ersetzt oder gelöscht. In der Praxis kann ich dies nicht testen, es wäre so aufwendig jedesmal eine DVD zu brennen.

ZWEI ganz wichtige Optionen müßten aber ebenfalls mit im Rahmen der Änderung der config.sys berücksichtigt werden:

1. der AHCI Treiber muss auf jeden Fall VOR dem DANIS Treiber eingetragen sein
2. der AHCI Treiber muss auf jeden Fall NACH den USB Treibern geladen werden (ansonsten geht booten von USB CD nicht)

hat jemand Zeit, Lust und Laune hier etwas Zeit zu investieren?

Auf jeden Fall schon einmal recht herzlichen Dank!
OS/2 versus Hardware - Maximum Warp!
Benutzeravatar
wilfried
Beiträge: 667
Registriert: Mo 23. Dez 2013, 18:26
Wohnort: Barsinghausen
Kontaktdaten:

Beitrag von wilfried »

Hallo Sigurd,

ich schaue mir das heute abend an.
Benutzeravatar
wilfried
Beiträge: 667
Registriert: Mo 23. Dez 2013, 18:26
Wohnort: Barsinghausen
Kontaktdaten:

Beitrag von wilfried »

Hallo Sigurd,

hier mein Testcode. Ich habe mich hier nur auf die Reihenfolgenproblematik konzentriert.
Nur wenn die Reihenfolge von USBMSD.ADD und (IBM1S506.ADD oder DANIS506.ADD) stimmt wird die CONFIG.SYS verändert.
Ansonsten gibt es einen Messageblock mit Infos was wo gefunden wurde.

Den Sinn der UNINSTALL-Routine habe ich nicht verstanden bzw. untersucht.

HTH

Code: Alles auswählen

/* REXX                                                            */
/* Install script for the ACHI driver                              */
/* Place the following files in this directory from the AHCI.WPI package:  */
/* os2ahci.add, os2ahci.sym, smartahci.exe               */
/* You may need to extract the wpi with wpiview    */
/* 10.12.2015: first attempt                                    */

target = 'F:\TEMP\UPDCD_TEST_SIGURD'

/* change config.sys if needed */
Say
Say 'Updating Config.Sys...'
cfgfile = target'\config.sys'
q = 0
found. = 0
do while lines(cfgfile)
   q = q+1
   l.q = linein(cfgfile)
   if pos('OS2AHCI.ADD', translate(l.q)) > 0 & substr(translate(l.q), 1, 7) = 'BASEDEV'
      then found.ahci = q
   if pos('IBM1S506.ADD', translate(l.q)) > 0 & substr(translate(l.q), 1, 7) = 'BASEDEV'
      then found.IBM  = q
   if pos('DANIS506.ADD', translate(l.q)) > 0 & substr(translate(l.q), 1, 7) = 'BASEDEV'
      then found.DANI = q
   if pos('USBMSD.ADD', translate(l.q)) > 0 & substr(translate(l.q), 1, 7) = 'BASEDEV'
      then found.USB = q
end
rc = lineout(cfgfile)
l.0 = q

if found.ahci = 0 then do
   /* backup config.sys */
   '@copy 'cfgfile target'\os2\install\config.dni'
   '@del 'cfgfile
   /* INSERT OS2AHCI */
   select
    when found.ibm > 0,
       & found.dani = 0,
       & found.ahci = 0,
       & found.usb > 0,
       & found.usb < found.ibm then,
        do
         von = 1
         bis = found.ibm - 1
         call copy_range
         rc = lineout(cfgfile, ' ')
         rc = lineout(cfgfile, 'REM UpdCD')
         rc = lineout(cfgfile, 'BASEDEV=OS2AHCI.ADD')
         rc = lineout(cfgfile, ' ')
         von = found.ibm
         bis = l.0
         call copy_range
         rc = lineout(cfgfile)
        end
    when found.ibm = 0,
       & found.dani > 0,
       & found.ahci = 0,
       & found.usb > 0,
       & found.usb < found.dani then,
        do
         von = 1
         bis = found.dani - 1
         call copy_range
         rc = lineout(cfgfile, ' ')
         rc = lineout(cfgfile, 'REM UpdCD')
         rc = lineout(cfgfile, 'BASEDEV=OS2AHCI.ADD')
         rc = lineout(cfgfile, ' ')
         von = found.dani
         bis = l.0
         call copy_range
         rc = lineout(cfgfile)
        end
    otherwise,
     do
      say 'Houston we have a problem'
      say 'OS2AHCI.ADD in line' found.ahci
      say 'IBM1S506.ADD in line' found.ibm
      say 'DANIS506.ADD in line' found.dani
      say 'USBMSD.ADD in line' found.USB
      von = 1
      bis = l.0
      call copy_range
      rc = lineout(cfgfile)
     end
   end
end

Say
Say 'Completed.'

exit

copy_range:
   do q = von to bis
      rc = lineout(cfgfile, l.q)
   end
return

uninstall:

   /* update config.sys */
   found. = 0
   cfgfile = target'\config.sys'
   q = 1
   do while lines(cfgfile)
      l.q = linein(cfgfile)
      if pos('REM UPDCD BASEDEV=IBM1S506.ADD', translate(l.q)) > 0 then found.ibmide = 1
      q=q+1
   end
   call lineout cfgfile
   l.0=q-1
   'copy 'cfgfile target'\os2\install\config.dni >> 'product_log
   'del 'cfgfile' >> 'product_log
   do q=1 to l.0
      if pos('OS2AHCI.ADD', translate(l.q)) > 0 then iterate
      if pos('REM UPDCD BASEDEV=IBM1S506.ADD', translate(l.q)) > 0 then l.q = 'BASEDEV=IBM1S506.ADD'
      call lineout cfgfile, l.q
   end
   if found.ibmide = 0 then call lineout cfgfile, 'BASEDEV=IBM1S506.ADD'
   call lineout cfgfile

   /* delete files */
   'del 'target'\os2\boot\os2ahci.add >> 'product_log
   'del 'target'\os2\smartahci.exe      >> 'product_log

return

Benutzeravatar
Sigurd
Beiträge: 995
Registriert: Mo 23. Dez 2013, 08:35
Kontaktdaten:

Beitrag von Sigurd »

Hallo Wilfried,

schon einmal vielen Dank, ich werde versuchen in Kürze einen Testlauf zu starten.

Ich habe dazu noch eine Frage:

Wofür steht die Zeile:

target = 'F:\TEMP\UPDCD_TEST_SIGURD'

Bei mir sind ja keine festen Laufwerksbuchstaben vergeben oder hat das damit nichts zu tun?

Zum "Uninstall": Zsolt hat für fast jedes ADDON auch die Möglichkeit der Deinstallation, also der Rückkehr zum Zustand vor Installation des ADDON, vorgesehen. Ich habe diese so übernommen.

Nochmals Danke!
OS/2 versus Hardware - Maximum Warp!
Benutzeravatar
wilfried
Beiträge: 667
Registriert: Mo 23. Dez 2013, 18:26
Wohnort: Barsinghausen
Kontaktdaten:

Beitrag von wilfried »

Sigurd hat geschrieben:target = 'F:\TEMP\UPDCD_TEST_SIGURD'
Das ist nur eine Testhilfe.
Ich habe den Code ausserhalb von UPDCD ausgetestet. Daher musste ich diese Variable hart-codieren.
Antworten