1. Field of the Invention
The present invention relates generally to the data processing field, and more particularly, to a computer implemented method, system and computer usable program code for porting an application intended for a first operating system distribution to a second operating system distribution.
2. Description of the Related Art
Operating system distributions (OS distributions) are different versions of an operating system. A Linux™ distribution, for example, is a common type of distribution, and generally comprises the Linux kernel, GNU operating system (a non-proprietary software system developed by the Free Software Foundation) and other assorted programs. Numerous Linux distributions are available including RedHat, SuSe and Fedora.
A problem that is encountered is that many of the various OS distributions are not compatible such that an application created for one OS distribution cannot be used on other OS distributions. As a result, an application must oftentimes be modified for the various file systems found on different OS distributions. This modifying is currently done by hand resulting in significant costs.
There is, accordingly, a need for a mechanism for porting an application intended for a first OS distribution to a second OS distribution.
Exemplary embodiments provide a computer implemented method, system and computer usable program code for porting an application intended for a first operating system distribution to a second operating system distribution in a data processing system. A computer implemented method for porting an application intended for a first operating system distribution to a second operating system distribution in a data processing system includes identifying a problem when the application is run on the second operating system distribution. A determination is made if a known solution to the identified problem is available. If a known solution to the identified problem is not available, a search is conducted to identify a solution to the problem. At least one modification to the second operating system distribution is created according to the identified solution, wherein the application is enabled to run on the second operating system distribution.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an exemplary embodiment when read in conjunction with the accompanying drawings, wherein:
With reference now to the figures and in particular with reference to
With reference now to the figures,
In the depicted example, server 104 and server 106 connect to network 102 along with storage unit 108. In addition, clients 110, 112, and 114 connect to network 102. These clients 110, 112, and 114 may be, for example, personal computers or network computers. In the depicted example, server 104 provides data, such as boot files, operating system images, and applications to clients 110, 112, and 114. Clients 110, 112, and 114 are clients to server 104 in this example. Network data processing system 100 may include additional servers, clients, and other devices not shown.
In the depicted example, network data processing system 100 is the Internet with network 102 representing a worldwide collection of networks and gateways that use the Transmission Control Protocol/Internet Protocol (TCP/IP) suite of protocols to communicate with one another. At the heart of the Internet is a backbone of high-speed data communication lines between major nodes or host computers, consisting of thousands of commercial, governmental, educational and other computer systems that route data and messages. Of course, network data processing system 100 also may be implemented as a number of different types of networks, such as for example, an intranet, a local area network (LAN), or a wide area network (WAN).
With reference now to
In the depicted example, data processing system 200 employs a hub architecture including a north bridge and memory controller hub (MCH) 202 and a south bridge and input/output (I/O) controller hub (ICH) 204. Processor 206, main memory 208, and graphics processor 210 are coupled to north bridge and memory controller hub 202. Graphics processor 210 may be coupled to the MCH through an accelerated graphics port (AGP), for example.
In the depicted example, local area network (LAN) adapter 212 is coupled to south bridge and I/O controller hub 204 and audio adapter 216, keyboard and mouse adapter 220, modem 222, read only memory (ROM) 224, universal serial bus (USB) ports and other communications ports 232, and PCI/PCIe devices 234 are coupled to south bridge and I/O controller hub 204 through bus 238, and hard disk drive (HDD) 226 and CD-ROM drive 230 are coupled to south bridge and I/O controller hub 204 through bus 240. PCI/PCIe devices may include, for example, Ethernet adapters, add-in cards, and PC cards for notebook computers. PCI uses a card bus controller, while PCIe does not. ROM 224 may be, for example, a flash binary input/output system (BIOS). Hard disk drive 226 and CD-ROM drive 230 may use, for example, an integrated drive electronics (IDE) or serial advanced technology attachment (SATA) interface. A super I/O (SIO) device 236 may be coupled to south bridge and I/O controller hub 204.
An operating system runs on processor 206 and coordinates and provides control of various components within data processing system 200 in
Instructions for the operating system, the object-oriented programming system, and applications or programs are located on storage devices, such as hard disk drive 226, and may be loaded into main memory 208 for execution by processor 206. The processes of the illustrative embodiments may be performed by processor 206 using computer implemented instructions, which may be located in a memory such as, for example, main memory 208, read only memory 224, or in one or more peripheral devices.
The hardware in
In some illustrative examples, data processing system 200 may be a personal digital assistant (PDA), which is generally configured with flash memory to provide non-volatile memory for storing operating system files and/or user-generated data. A bus system may be comprised of one or more buses, such as a system bus, an I/O bus and a PCI bus. Of course the bus system may be implemented using any type of communications fabric or architecture that provides for a transfer of data between different components or devices attached to the fabric or architecture. A communications unit may include one or more devices used to transmit and receive data, such as a modem or a network adapter. A memory may be, for example, main memory 208 or a cache such as found in north bridge and memory controller hub 202. A processing unit may include one or more processors or CPUs. The depicted examples in
Exemplary embodiments provide a mechanism for porting an application intended for a first operating system distribution to a second operating system distribution in a data processing system. More particularly, exemplary embodiments provide a mechanism for automatically porting an application from its originally intended OS distribution to an OS distribution of choice. The mechanism allows a user to point the application to a correct file location in order to run the application on the OS distribution of the user's choice.
According to an exemplary embodiment, a “find” command is used to locate alternate files and prompt a user regarding alternate file locations for a given application. The user is able to choose the file location among the alternate file locations which corresponds most closely to the file on the OS distribution for which the application was originally intended. The mechanism then creates a symbolic link “in between” the correct file location and the expected file location so that the application can run on the new OS distribution. Alternatively, rather than creating a link in between the correct file location and the expected file location, the mechanism may modify the system in other ways to enable the application to run on the second operating system distribution. For example, the mechanism may copy the file if a link is not acceptable. In other instances, a solution might require creating a file that previously did not exist or changing a certain configuration or setting. It should be understood, accordingly, that exemplary embodiments are not limited to creating a link, and that the application can be enabled to run on the second operating system distribution in various ways without departing from exemplary embodiments. If successful, the user is prompted to hold the symbolic link or the other type of modification in a table for future reference. At the end of a run, the user may be asked if a script should be made to save all symbolic links for that particular application. Once the application is uninstalled, the user is asked if the system should be returned to its original state.
Analysis tool 304 is responsible for analyzing the output of an application to be ported, for example, application 302 in
Analysis tool 304 identifies all the problems the application encounters when running on the second OS distribution and invokes find/link tool 308 with respect to each of the identified problems if solutions are not already available in GTT 306. Arrows 322 and 324 in
GTT 306 is a trainable unit that is modified as exemplary embodiments are run on multiple platforms. GTT 306 keeps track of solutions to problems that have been previously implemented. This is achieved, according to an exemplary embodiment, by providing a table-like format that contains the original and ported-to distribution, as well as the problem that was encountered and its solution. GTT 306 improves performance and usability by making it unnecessary to perform a find/link analysis each time an application is run. In addition, GTT 306 also decreases the amount of time necessary to port an application that has not been run previously from one distribution to another by holding various links in memory which might be needed by multiple applications.
If not clearly identified within the application, the original OS the application was written for may be identified by prompting the user, however, this mechanism has the ability to identify the OS that the application is attempting to run on in the second OS by examining certain release information files. This information is used to identify the “original” and “ported to” distribution (items 402 and 404 in
As one application is run on an OS distribution different from the one that it was intended for, various error or warning messages may be generated. These messages are appropriately parsed or shown to the user for further identification of the problem; this information will populate the “problem encountered” column (item 406) of the table in
Once the cause is identified, and a solution is determined (for example, by creating a link, modifying a configuration or environment variable, disabling/enabling a service or a daemon, etc.), a description of the solution is populated in the “solution” column (item 408).
It should be recognized that the GTT need not always be in a table format. For example, the GTT may also be implemented as a text file, an XML file, a HTML file or in another suitable manner without departing from exemplary embodiments.
Returning to
Script generator 310 allows the user to generate a script containing all the links and modifications that have been performed on the system. The script can be used independently of exemplary embodiments to create an environment for the application in the future.
System cleaner 312 is responsible for restoring the system to its original state, i.e., by removing all links that have been created.
If a known solution is not available (No output of Step 508), a determination is made whether the user wishes to find alternate file locations needed for the application (Step 510). If the user wishes to find alternate file locations (Yes output of Step 510), a search is conducted to identify alternate file locations which correspond most closely to the file on the OS distribution for which the application was originally intended (Step 512). When found on the system, a link with an appropriate name is created in the second OS distribution (Step 516) to enable the application to run on the second OS distribution. Alternatively, and as indicated previously, rather than creating a link, another modification such as modifying a configuration or environment variable, disabling/enabling a service or a daemon, and the like can be created to enable the application to run on the second OS distribution. If a plurality of alternate file locations is found, the user is prompted to select a desired one of the plurality of found file locations to which the link is to be created (Step 514) before the link is created. Information regarding the newly created link is then stored in the GTT for future reference (Step 518).
A determination is then made whether the user wishes a script to be generated containing all the links and modifications that have been performed (Step 520). Such a script can be used independently of the exemplary embodiments to create an environment for the application in the future, and the determination can be made by the user in response to a prompt requesting the user to indicate whether or not the script should be generated. If the user does not want a script to be generated (No output of Step 520), the method goes to Step 524 to determine if the system should be restored. If the user wishes a script to be generated, (Yes output of Step 520), the script is generated (Step 522), and the method goes to Step 524 to determine if the system should be restored.
The determination of whether the system should be restored to its original state in Step 524 can also be made by the user in response to a prompt. If the user decides that the system should not be restored (No output to Step 524, the method goes to Step 530 to determine if another problem has been identified. If the user indicates that the system should be restored (Yes output of Step 524), the system is restored, for example, by enabling a system cleaner to remove all created links (Step 526), and the method goes to Step 530. It should be understood that both the script generation and the system cleaning operations are optional, and may or may not be included in the overall method. If another problem is found (Yes output of Step 530), the method returns to Step 508 to determine if a solution is available for another problem.
Returning to Step 504, if the application is determined to be the same as or similar to an application that has previously been run (Yes output of Step 504), the method ends. Similarly, if it is determined that a solution to an identified problem is available (Yes output of Step 508), or that there are no more problems to be analyzed (No output to Step 530), the method also ends.
The exemplary embodiments thus provide a computer implemented method, system and computer usable program code for porting an application intended for a first operating system distribution to a second operating system distribution in a data processing system. A computer implemented method for porting an application intended for a first operating system distribution to a second operating system distribution in a data processing system includes identifying a problem when the application is run on the second operating system distribution. A determination is made if a known solution to the identified problem is available. If a known solution to the identified problem is not available, a search is conducted to identify a solution to the problem. At least one modification to the second operating system distribution is created according to the identified solution, wherein the application is enabled to run on the second operating system distribution.
The invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any tangible apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.