home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
boot
/
i386
/
root
/
usr
/
share
/
YaST2
/
modules
/
Vendor.ycp
< prev
next >
Wrap
Text File
|
2006-11-29
|
2KB
|
78 lines
/**
* File:
* Vendor.ycp
*
* Module:
* Vendor
*
* Summary:
* provide vendor/driver update disk functions
*
* $Id: Vendor.ycp 33360 2006-10-12 14:45:22Z locilka $
*
* Author:
* Klaus Kaempf <kkaempf@suse.de>
*
*/
{
module "Vendor";
import "Installation";
import "Directory";
import "String";
// --------------------------------------------------------------
// driver update ?!
/**
* DriverUpdate
* copy /update/* to target:/tmp/update/
* !! can only be called in inst_finish !!
*/
global define void DriverUpdate1 ()
{
list<string> updatefiles = (list<string>)WFM::Read (.local.dir, ["/update", []]);
if (size (updatefiles) <= 0)
return;
// clean up, just in case
SCR::Execute(.target.bash, "/bin/rm -rf /tmp/update");
// copy log file
WFM::Execute(.local.bash, "l=/var/log/driverupdate.log ; [ -f $l ] && /bin/cat $l " +
">> '" + String::Quote (Installation::destdir) + "$l'");
// copy all update files
WFM::Execute(.local.bash, "/bin/cp -a /update " +
"'" + String::Quote (Installation::destdir) + "/tmp/update'");
// unpack update files and run update.post scripts
SCR::Execute(.target.bash,
"cd / ; " +
"echo \"Installing driver update\" >> " + Directory::logdir + "/y2logRPM ; " +
"for i in /tmp/update/[0-9]*/install ; do " +
" [ -f \"$i/update.tar.gz\" ] && /bin/tar -zxf \"$i/update.tar.gz\" ; " +
" rpm -Uv $i/*.rpm 2 >> " + Directory::logdir + "/y2logRPM ; " +
" [ -f \"$i/update.post\" ] && /bin/chmod +x \"$i/update.post\" && \"$i/update.post\" \"$i\" ; " +
"done");
}
global define void DriverUpdate2 ()
{
list<string> updatefiles = (list<string>)WFM::Read (.local.dir, ["/update", []]);
if (size (updatefiles) <= 0)
return;
// run update.post2 scripts
SCR::Execute(.target.bash,
"cd / ; " +
"for i in /tmp/update/[0-9]*/install ; do " +
" [ -f \"$i/update.post2\" ] && /bin/chmod +x \"$i/update.post2\" && \"$i/update.post2\" \"$i\" ; " +
"done");
// remove driver update dir
SCR::Execute(.target.bash, "/bin/rm -rf /tmp/update");
}
}