Skip to content

Commit b31a177

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 04aed4c commit b31a177

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

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

Lines changed: 52 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,32 @@ 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: trixie
39+
Components: main
40+
Trusted: true
41+
EOF
42+
43+
apt update
44+
apt -y upgrade
45+
{{- end }}
46+
2047
- action: run
2148
description: Modernize APT sources
2249
chroot: true
@@ -290,6 +317,31 @@ actions:
290317
rm -vf /root/*.deb
291318
{{- end }}
292319

320+
{{- if ne $aptlocalrepo "none" }}
321+
- action: run
322+
description: APT update without local APT repository
323+
chroot: true
324+
command: |
325+
set -eux
326+
rm -v /etc/apt/sources.list.d/apt-local-repo.sources
327+
apt update
328+
329+
- action: run
330+
description: Remove bind mount of local APT repository
331+
chroot: false
332+
command: |
333+
set -eux
334+
umount "${ROOTDIR}/media/apt-local-repo"
335+
rmdir -v "${ROOTDIR}/media/apt-local-repo"
336+
337+
- action: run
338+
description: APT update and upgrade with local APT repository
339+
chroot: true
340+
command: |
341+
set -eux
342+
cat >/etc/apt/sources.list.d/apt-local-repo.sources <<EOF
343+
{{- end }}
344+
293345
- action: run
294346
description: Create DTBs tarball
295347
chroot: false

0 commit comments

Comments
 (0)