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

make "ubuntu-image snap" work even without dpkg installed #157

Merged
merged 2 commits into from Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions ubuntu_image/__main__.py
Expand Up @@ -11,7 +11,7 @@
from ubuntu_image.assertion_builder import ModelAssertionBuilder
from ubuntu_image.classic_builder import ClassicBuilder
from ubuntu_image.helpers import (
DoesNotFit, PrivilegeError, as_size, get_host_arch,
DoesNotFit, PrivilegeError, as_size,
get_host_distro)
from ubuntu_image.hooks import HookError
from ubuntu_image.i18n import _
Expand Down Expand Up @@ -254,7 +254,7 @@ def parseargs(argv=None):
help=_("""Distribution name to be specified to livecd-rootfs."""))
classic_cmd.add_argument(
'-a', '--arch',
default=get_host_arch(), metavar='CPU-ARCHITECTURE',
default=None, metavar='CPU-ARCHITECTURE',
help=_("""CPU architecture to be specified to livecd-rootfs.
default value is builder arch."""))
classic_cmd.add_argument(
Expand Down
5 changes: 4 additions & 1 deletion ubuntu_image/classic_builder.py
Expand Up @@ -9,7 +9,7 @@
from tempfile import gettempdir
from ubuntu_image.common_builder import AbstractImageBuilderState
from ubuntu_image.helpers import (
check_root_privilege, live_build, run)
check_root_privilege, get_host_arch, live_build, run)
from ubuntu_image.parser import (
BootLoader, FileSystemType, StructureRole)

Expand Down Expand Up @@ -67,6 +67,9 @@ def prepare_image(self):
env['EXTRA_PPAS'] = self.args.extra_ppas
# Only genereate a single rootfs tree for classic image creation.
env['IMAGEFORMAT'] = 'none'
# ensure ARCH is set
if self.args.arch is None:
env['ARCH'] = get_host_arch()
live_build(self.unpackdir, env)
except CalledProcessError:
if self.args.debug:
Expand Down