Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ONL installer gets unknown onie_platform in latest ONIE #283

Closed
david56 opened this issue Dec 29, 2017 · 4 comments
Closed

ONL installer gets unknown onie_platform in latest ONIE #283

david56 opened this issue Dec 29, 2017 · 4 comments

Comments

@david56
Copy link

david56 commented Dec 29, 2017

Hello @carlroth, @jnealtowns , @cbrune ,

In latest ONIE, I had removed machine.conf from the initrd image. i.e., machine.conf is generated at ONIE run-time dynamically rather than putting a static one in the image. ONL had been revised to use onie-sysinfo on Dec 27 (#280 ). We found ONL install failed because it unpacks the image to execute onie-sysinfo to get onie_platform. In the unpacked environment, machine.conf is not existent so that onie-sysinfo will reply unknown to ONL installer. It will try to import a module named unknown:

Traceback (most recent call last):
  File "/usr/bin/onl-install", line 6, in <module>
    import onl.install.App
  File "/usr/lib/python2.7/dist-packages/onl/install/App.py", line 21, in <module>
    import ConfUtils, BaseInstall
  File "/usr/lib/python2.7/dist-packages/onl/install/ConfUtils.py", line 14, in <module>
    from onl.sysconfig import sysconfig
  File "/usr/lib/python2.7/dist-packages/onl/sysconfig/__init__.py", line 13, in <module>
    from onl.platform.current import OnlPlatform
  File "/usr/lib/python2.7/dist-packages/onl/platform/current.py", line 62, in <module>
    OnlPlatform = import_subsystem_platform_class()
  File "/usr/lib/python2.7/dist-packages/onl/platform/current.py", line 57, in import_subsystem_platform_class
    m = importlib.import_module('%s.platform.%s' % (subsystem, platform_module))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named unknown
Install failed.

It looks that it is necessary to keep machine.conf in the image to make the installer go smoothly. But onie-sysinfo still lacks machine-live.conf (which is also generated dynamically at ONIE run-time) for calculating the real onie_platform. We need to discuss how to fix the issue.

I would appreciate your opinions. Thank you very much.

Cheers,
David

@david56
Copy link
Author

david56 commented Dec 29, 2017

I did a test on AS7712_32X having a revised ONIE keeping machine.conf in the initrd image which can install latest ONL normally.

@jnealtowns
Copy link
Collaborator

jnealtowns commented Dec 29, 2017

@david56
The existing design was a convenience since the installer itself runs as part of the Loader initrd in multiple envirnonments. But it isn't necessary (especially if it no longer works).

@carlroth Lets modify the platform detection logic to remove the chroot into ONIE.
This means the platform id must be passed as a configuration parameter to the installer prior to entering the Loader initrd instead of the installer detecting it itself.

Environment override

  1. if $ONL_INSTALL_PLATFORM then echo "platform=$ONL_INSTALL_PLATFORM" >> installer.conf

Installing from ONIE
2. If ONIE: echo "platform=onie-sysinfo -p >> installer.conf

Installing form ONL
3. If ONL : echo "platform=$(cat /etc/onl/platform)" >> installer.conf
etc.

What do you think?

cc @cbrune

@carlroth
Copy link
Contributor

carlroth commented Jan 4, 2018

see #287

@david56
Copy link
Author

david56 commented Jan 10, 2018

The latest ONL can be installed via latest ONIE normally now. Thank you.

@david56 david56 closed this as completed Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants