start to split behaviour on presence of network or not

This commit is contained in:
Michael Hudson-Doyle 2019-02-24 08:28:49 +04:00
parent 6de5dbbd8e
commit 181792f783
3 changed files with 10 additions and 3 deletions

View File

@ -15,13 +15,14 @@ setup_overlay () {
$PY -m curtin apt-config
setup_overlay $TARGET_MOUNT_POINT/etc/apt
setup_overlay $TARGET_MOUNT_POINT/var/lib/apt/lists
cat > "/tmp/sources.list" <<EOF
deb file:///run/cdrom $(lsb_release -sc) main restricted
EOF
if [ $HAS_NETWORK = 'true' ]; then
cat "$TARGET_MOUNT_POINT/etc/apt/sources.list" >> "/tmp/sources.list"
else
setup_overlay $TARGET_MOUNT_POINT/var/lib/apt/lists
fi
mv /tmp/sources.list "$TARGET_MOUNT_POINT/etc/apt/sources.list"
$PY -m curtin in-target -- apt-get update

View File

@ -298,8 +298,14 @@ class InstallProgressController(BaseController):
else:
cmds = [
["umount", self.tpath('etc/apt')],
["umount", self.tpath('var/lib/apt/lists')],
]
if self.base_model.network.has_network:
cmds.append([
sys.executable, "-m", "curtin", "in-target", "-t",
"/target", "--", "apt-get", "update",
])
else:
cmds.append(["umount", self.tpath('var/lib/apt/lists')])
for cmd in cmds:
self._bg_run_command_logged(cmd)

View File

@ -158,7 +158,7 @@ class SubiquityModel:
'curthooks_commands': {
'000-configure-apt': [
'/snap/bin/subiquity.subiquity-configure-apt',
sys.executable, 'true',
sys.executable, str(self.network.has_network).lower(),
],
},