Skip to content

Commit 9a32db5

Browse files
committed
feat: debos: Option for local APT repository
Pass a local directory to bind-mount and use as a local APT repository during rootfs creation. This should eventually allow simplifying kernel and local-debs logic. Signed-off-by: Loïc Minier <[email protected]>
1 parent d273de7 commit 9a32db5

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

debos-recipes/qualcomm-linux-debian-rootfs.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{- $xfcedesktop := or .xfcedesktop "false" }}
22
{{- $experimentalkernel := or .experimentalkernel "false" }}
33
{{- $localdebs := or .localdebs "none" }}
4+
{{- $aptlocalrepo := or .aptlocalrepo "none" }}
45
{{- $kernelpackage := or .kernelpackage "linux-image-arm64" }}
56

67
architecture: arm64
@@ -17,6 +18,31 @@ actions:
1718
mirror: http://deb.debian.org/debian
1819
variant: minbase
1920

21+
{{- if ne $aptlocalrepo "none" }}
22+
- action: run
23+
description: Setup bind mount of local APT repository
24+
chroot: false
25+
command: |
26+
set -eux
27+
mkdir -v "${ROOTDIR}/media/apt-local-repo"
28+
mount --bind {{$aptlocalrepo}} "${ROOTDIR}/media/apt-local-repo"
29+
30+
- action: run
31+
description: APT update and upgrade with local APT repository
32+
chroot: true
33+
command: |
34+
set -eux
35+
cat >/etc/apt/sources.list.d/apt-local-repo.sources <<EOF
36+
Types: deb
37+
URIs: file:///media/apt-local-repo
38+
Suites: /
39+
Trusted: true
40+
EOF
41+
42+
apt update
43+
apt -y upgrade
44+
{{- end }}
45+
2046
- action: run
2147
description: Modernize APT sources
2248
chroot: true
@@ -290,6 +316,24 @@ actions:
290316
rm -vf /root/*.deb
291317
{{- end }}
292318

319+
{{- if ne $aptlocalrepo "none" }}
320+
- action: run
321+
description: Remove bind mount of local APT repository
322+
chroot: false
323+
command: |
324+
set -eux
325+
umount "${ROOTDIR}/media/apt-local-repo"
326+
rmdir -v "${ROOTDIR}/media/apt-local-repo"
327+
328+
- action: run
329+
description: APT update without local APT repository
330+
chroot: true
331+
command: |
332+
set -eux
333+
rm -v /etc/apt/sources.list.d/apt-local-repo.sources
334+
apt update
335+
{{- end }}
336+
293337
- action: run
294338
description: Create DTBs tarball
295339
chroot: false

0 commit comments

Comments
 (0)