start to split behaviour on presence of network or not
This commit is contained in:
parent
6de5dbbd8e
commit
181792f783
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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(),
|
||||
],
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue