Project

General

Profile

Bug #488

hdactl-new-installer will need to be re-written to support ubuntu.

Added by anzenketh about 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
hdactl/installer
Target version:
-
Start date:
03/24/2010
Due date:
% Done:

100%


Description

Differences.
A lot of this could and should handled and should be handled by the packaging systems.

Networking is configured in /etc/network/interfaces for ip address info and /etc/resolv.conf for dns info
See manual pages for interfaces and resolv.conf for more info.

chkconfig is not installed by default need to add to debian packaging control file.
NetworkManager init demon is called by network-manager
network init demon is called by networking.
hddpd init deamon is called by is named apache2
named init demon is called by bind9
dhcp init demon is called by dhcp3-server
mysql init demon is called by mysql
samba init demon is called by samba
nmb is taken care of by the samba demon

Could not find eqivlents for demons as not on my production server hda fedora box.
'hplip', 'isdn', 'kudzu',

The following deamons are not installed on my ubuntu development server with required packages for hdactl installed.
  1. this may need double checking.
    'dhcrelay', 'ldap', 'iptables'

Ubuntu's equivalent to yum is apt-get/aptitude. All necessary packages to install should be installed by the packaging system before hdactl is installed using debian/ubuntu packaging management system. For ubuntu installer. You can remove all rpm's requesting to be installed. So the following code does not apply.

rpms = Array.new
rpms << "fedora-release yum-fastestmirror"
rpms << "mysql-server perl-libwww-perl bind"
rpms << "php php-mysql dhcp dhclient openvpn monit perl-Authen-PAM"
rpms << "ruby-devel ruby-racc ruby-irb ruby-ri"
rpms << "ruby-bdb ruby-libs ruby-rdoc ruby-mysql"
rpms << "eruby eruby-libs ruby-docs hddtemp ruby-augeas"
rpms << "rubygems rubygem-actionmailer rubygem-actionpack"
rpms << "rubygem-activerecord rubygem-activeresource rubygem-activesupport"
rpms << "rubygem-rails rubygem-rake rubygem-hoe pluginfactory rubygem-rubyforge"
  1. NOTE: these below are needed for F12
    rpms << "rubygem-rails rubygem-rake rubygem-hoe boost"
    rpms << "rubygem-passenger rubygem-gruff rubygem-gd2 rubygem-fastthread"
rpms_to_remove = ["gnome-packagekit"]
rpms_to_remove.each do |rpm|
do_system_silent "killall yum-updatesd"
puts "RPM UNINSTALL OF: #{rpm}";
do_system_silent "killall yum"
ret = do_system_multiple("rpm -e #{rpm}")
message "WARNING: rpm uninstall failed ... please run\n\t rpm -e #{rpm}\n\tby hand until it uninstalls correctly" unless

History

#1 Updated by anzenketh about 10 years ago

lsb_release should really be used to figure out what distro you are running.

I know people in fedora use /etc/issue but that is not what /etc/issue is for. /etc/issue is used as a display message and using it is more of a hack then anything else. We may have to require installing of lsb_release for fedora. The output of ldb_release to find the distro ID is much cleaner.

tuxmaster@Chikio-Linux:~$ lsb_release -i
Distributor ID: Ubuntu
tuxmaster@kazumi:~$ lsb_release -i
Distributor ID: Fedora

#2 Updated by anzenketh about 10 years ago

tuxmaster@kazumi:~$ lsb_release -i -r
Distributor ID: Fedora
Release: 12

tuxmaster@Chikio-Linux:~$ lsb_release -i -r
Distributor ID: Ubuntu
Release: 9.10

or by codename

tuxmaster@Chikio-Linux:~$ lsb_release -i -c
Distributor ID: Ubuntu
Codename: karmic

tuxmaster@kazumi:~$ lsb_release -i -c
Distributor ID: Fedora
Codename: Constantine

#3 Updated by anzenketh about 10 years ago

def get_os_version

        if File.exists?('/etc/system-release')
                file = nil
                begin
                        file = File.new "/etc/system-release", "r" 
                rescue
                        return "cannot-open-sys-release-file" 
                end
                return file.read.chomp()
        end
        "no-sys-release-file" 
end

Will not work in ubuntu

def get_os_version

        if File.exists?('/etc/system-release')
                file = nil
                begin
                        file = File.new "/etc/system-release", "r" 
                rescue
                        return "cannot-open-sys-release-file" 
                end
                return file.read.chomp()
        end
        "no-sys-release-file" 
end

This should be replaced with input from lsb_release.

#4 Updated by anzenketh about 10 years ago

  • Status changed from New to Assigned
  • Assignee set to anzenketh

Update notes for coding.

UBUNTU

irb
>> open("|lsb_release -i -r") { |f| f.readlines }
=> ["Distributor ID:\tUbuntu\n", "Release:\t9.10\n"]
>> release = open("|lsb_release -i -r") { |f| f.readlines }
=> ["Distributor ID:\tUbuntu\n", "Release:\t9.10\n"]
>> puts release
Distributor ID: Ubuntu
Release:        9.10

Fedora

irb
irb(main):001:0> release = open("|lsb_release -i -r") { |f| f.readlines }
=> ["Distributor ID:\tFedora\n", "Release:\t12\n"]
irb(main):002:0> puts release
Distributor ID: Fedora
Release:        12
=> nil
irb(main):003:0>

#5 Updated by anzenketh about 10 years ago

To run lsb_release need redhat-lsb package for fedora.

NOTES
Put results into two variables @distro and @release
then make some methods called fedora?
and ubuntu?
etc.

Put in a class.

#6 Updated by anzenketh about 10 years ago

Could assign the variables like this. Due to the output is standardised by the linux foundation.
See The following:
http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/lsbrelease.html

@distro = open("|lsb_release -i) { |f| f.readlines }
@release = open("|lsb_release -r) { |f| f.readlines }

#7 Updated by cpg about 10 years ago

the latest hda-new-installer has support for parsing the output of lsb_release in a method called

identify_os

returns a pair like ["Fedora", "12"]

it's not being used yet.

#8 Updated by anzenketh about 10 years ago

Next thing to work on.

The function do_network.

I would probably create one that is do_network_debian

Networking is configured in /etc/network/interfaces for ip address info and /etc/resolv.conf for dns info
See manual pages for interfaces and resolv.conf for more info.

See the following links for how to set-up a static ip in ubuntu.
http://www.cyberciti.biz/tips/howto-ubuntu-linux-convert-dhcp-network-configuration-to-static-ip-configuration.html
http://www.howtogeek.com/howto/ubuntu/change-ubuntu-server-from-dhcp-to-a-static-ip-address/

A default file may look like the following.

auto lo
iface lo inet loopback

A default resolveconfig may look like the following.
  1. Generated by NetworkManager
    domain domain.actdsltmp
    search domain.actdsltmp
    nameserver 192.168.0.1
    nameserver 192.168.0.10

#9 Updated by cpg about 10 years ago

  • Project changed from installer to ubuntu
  • Category deleted (ubuntu)

#10 Updated by cale250 about 10 years ago

  • Category set to hdactl/installer
  • % Done changed from 0 to 70

Rewrote the whole thing so the whole script works. It may still be missing some dependencies, and still needs to be refactored so as to be merged with Fedora code.

#11 Updated by cale250 about 10 years ago

  • Assignee changed from anzenketh to cale250

#12 Updated by cale250 about 10 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 70 to 100

Spent more time getting it to work since I was missing pieces; it now works! Still needs to be refactored.

#13 Updated by eFfeM about 9 years ago

  • Status changed from Resolved to Closed
  • Assignee deleted (cale250)

Also available in: Atom