anaconda / initial-setup / gnome-initial-setup: can we do this better?

David Woodhouse dwmw2 at infradead.org
Mon Jul 15 21:26:49 UTC 2013


On Wed, 2013-05-22 at 05:18 -0400, Martin Sivak wrote:
> > One thing that doesn't seem to have been covered in the discussion —
> > what about third-party firstboot modules?
> > 
> > For an install on a corporate machine we have a firstboot module which
> > asks for the Active Directory credentials, joins the Samba domain,
> > obtains SSL certificates for VPN and WPA2-enterprise wifi and provisions
> > those in NetworkManager, adds a local user with the appropriate
> > username, provisions accounts in Evolution-EWS and pidgin-sipe, etc.
> > 
> > With firstboot gone, what form should our plugin take?
> > 
> 
> Firstboot stays available in RHEL for this reason (legacy plugins).
> Fedora modules will probably have to be updated. At least that was the
> plan. It is very easy to write a new module with the new API. Ping
> vpodzime, he has a development guide.

Thanks. Delayed response... I've finally got everything else working
nicely on Fedora 19 and I'm looking at this. I see firstboot is still
available, but it doesn't seem to *work*.

First it wants python-ethtool to be installed but didn't have the
appropriate dependency, and then it's still using pygtk while my own
code has been updated to pygobject and gtk3. (Which was done because
some other code I was *importing* had been upgraded, so I couldn't mix
the two. I don't think you get far with pygtk these days, do you?)

So I'm guessing that it's probably not worth looking at firstboot any
harder, and I should proceed straight to using initial-setup.

The UI part of my tool is a separate python module which can run
standalone too. The firstboot module is therefore fairly trivial, and
looks like this. Any pointers on converting to initial-setup would be
much appreciated. I note /usr/share/initial-setup/modules/README.txt is
a zero-length file... :)

#
# Xu Li <xu.li at intel.com>
# Chris Lumens <clumens at redhat.com>
#
# Copyright 2009 Intel Corp.
# Copyright 2008 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2.  This program is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the
# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  Any Red Hat
# trademarks that are incorporated in the source code or documentation are not
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc. 
#
from gi.repository import Gtk, GObject
import os, string, sys

from firstboot.config import *
from firstboot.constants import *
from firstboot.functions import *
from firstboot.module import *

import logging
log = logging.getLogger("firstboot")

import gettext
_ = lambda x: gettext.ldgettext("firstboot", x)
N_ = lambda x: x

sys.path.append("/usr/share/intel-user-setup")
from iusMainWindow import iusMainWindow

class moduleClass(Module):
    def __init__(self):
        Module.__init__(self)
        self.priority = 99
        self.sidebarTitle = N_("Intel User Setup")
        self.title = N_("Intel User Setup")
        self.icon = ""
        self.ius = None
        self.needreboot = False

    def apply(self, interface, testing=False):
        if testing:
            return RESULT_SUCCESS

        try:
            rc = self.ius.apply()
            if rc == True:
                # This should make it jump over the *normal* create_user page
                interface.moveToPage(pageNum = interface._control.currentPage + 1)
                self.needreboot=True
                return RESULT_SUCCESS
            else:
                return self.showRetryDialog()
        except Exception, e:
            return self.showRetryDialog()

    def createScreen(self, interface=None):
        log.info("Display Intel user setup screen")

        self.vbox = Gtk.VBox(spacing=5)
        self.ius = iusMainWindow()
        self.vbox.pack_start(self.ius.firstboot_widget(), False, False)

    def initializeUI(self):
        self.ius.local_users()

    def showRetryDialog(self):
        dlg = Gtk.MessageDialog(None, 0, Gtk.MESSAGE_ERROR, Gtk.BUTTONS_NONE, "Intel user setup failed!")
        dlg.add_button("Back", RESULT_FAILURE)
        dlg.add_button("Ignore", RESULT_SUCCESS)
        dlg.set_position(Gtk.WIN_POS_CENTER)
        dlg.set_modal(True)
        rc = dlg.run()
        dlg.destroy()
        return rc

    def needsReboot(self):
        return self.needreboot

-- 
dwmw2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/devel/attachments/20130715/190aec8e/attachment.bin>


More information about the devel mailing list