Add support for APT preferences through autoinstall in Subiquity
The autoinstall schema for "apt" now supports the "preferences" configuration. Each preference element should contain the properties described below, that 1:1 map with the keywords from apt_preferences(5): * package <-> Package: * pin <-> Pin: * pin-priority <-> Pin-Priority: These preferences are forwarded to curtin through subiquity-curtin-apt.conf. Support for these rules must be added to curtin as well. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
parent
5ae52c000b
commit
9e7bc5053b
|
@ -306,6 +306,28 @@
|
||||||
"non-free"
|
"non-free"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"preferences": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"package": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"pin": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"pin-priority": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"package",
|
||||||
|
"pin",
|
||||||
|
"pin-priority"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,6 +22,9 @@ apt:
|
||||||
disable_components:
|
disable_components:
|
||||||
- non-free
|
- non-free
|
||||||
- restricted
|
- restricted
|
||||||
|
preferences:
|
||||||
|
- {package: "python3-*", pin: "origin *ubuntu.com*", pin-priority: 200}
|
||||||
|
- {package: "python-*", pin: "origin *ubuntu.com*", pin-priority: -1}
|
||||||
packages:
|
packages:
|
||||||
- package1
|
- package1
|
||||||
- package2
|
- package2
|
||||||
|
|
|
@ -168,7 +168,11 @@ timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoi
|
||||||
--source-catalog=examples/install-sources.yaml"
|
--source-catalog=examples/install-sources.yaml"
|
||||||
validate
|
validate
|
||||||
python3 scripts/check-yaml-fields.py .subiquity/var/log/installer/subiquity-curtin-apt.conf \
|
python3 scripts/check-yaml-fields.py .subiquity/var/log/installer/subiquity-curtin-apt.conf \
|
||||||
apt.disable_components='[non-free, restricted]'
|
apt.disable_components='[non-free, restricted]' \
|
||||||
|
apt.preferences[0].pin-priority=200 \
|
||||||
|
apt.preferences[0].pin='"origin *ubuntu.com*"' \
|
||||||
|
apt.preferences[1].package='"python-*"' \
|
||||||
|
apt.preferences[1].pin-priority=-1
|
||||||
python3 scripts/check-yaml-fields.py .subiquity/var/log/installer/subiquity-curtin-install.conf \
|
python3 scripts/check-yaml-fields.py .subiquity/var/log/installer/subiquity-curtin-install.conf \
|
||||||
debconf_selections.subiquity='"eek"' \
|
debconf_selections.subiquity='"eek"' \
|
||||||
storage.config[-1].options='"errors=remount-ro"'
|
storage.config[-1].options='"errors=remount-ro"'
|
||||||
|
|
|
@ -50,6 +50,28 @@ class MirrorController(SubiquityController):
|
||||||
'enum': ['universe', 'multiverse', 'restricted',
|
'enum': ['universe', 'multiverse', 'restricted',
|
||||||
'contrib', 'non-free']
|
'contrib', 'non-free']
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"preferences": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"package": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
"pin": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
"pin-priority": {
|
||||||
|
"type": "integer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"package",
|
||||||
|
"pin",
|
||||||
|
"pin-priority",
|
||||||
|
],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue