Skip to content

Commit

Permalink
Merge pull request #1750 from mwhudson/move-setupcon
Browse files Browse the repository at this point in the history
call setupcon directly in keyboard controller
  • Loading branch information
mwhudson authored Aug 2, 2023
2 parents f088fa2 + 08f978b commit ff0a98f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
12 changes: 0 additions & 12 deletions subiquity/models/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,6 @@ def render(self):
"permissions": 0o644,
},
},
"curthooks_commands": {
# The below command must be run after updating
# etc/default/keyboard on the target so that the initramfs uses
# the keyboard mapping selected by the user. See LP #1894009
"002-setupcon-save-only": [
"curtin",
"in-target",
"--",
"setupcon",
"--save-only",
],
},
}

def setting_for_lang(self, lang):
Expand Down
2 changes: 2 additions & 0 deletions subiquity/server/controllers/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ async def setup_target(self, context):
return
mirror = self.app.controllers.Mirror
await mirror.final_apt_configurer.setup_target(context, self.tpath())
keyboard = self.app.controllers.Keyboard
await keyboard.setup_target(context=context)

@with_context(description="executing curtin install {name} step")
async def run_curtin_step(
Expand Down
15 changes: 15 additions & 0 deletions subiquity/server/controllers/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from subiquity.common.serialize import Serializer
from subiquity.common.types import AnyStep, KeyboardSetting, KeyboardSetup
from subiquity.server.controller import SubiquityController
from subiquity.server.curtin import run_curtin_command
from subiquitycore.context import with_context
from subiquitycore.utils import arun_command

Expand Down Expand Up @@ -256,6 +257,20 @@ async def set_input_source(self, layout: str, variant: str, **kwargs):
]
await self._run_gui_command(gsettings, **kwargs)

@with_context(description="configuring keyboard")
async def setup_target(self, context):
await run_curtin_command(
self.app,
context,
"in-target",
"-t",
self.app.base_model.target,
"--",
"setupcon",
"--save-only",
private_mounts=False,
)

async def _run_gui_command(
self, command: Sequence[str], user: Optional[str] = None
):
Expand Down

0 comments on commit ff0a98f

Please sign in to comment.