repo: use/repo/main for vm targets

use/repo/main for vm targets will now create and enable the main
repository in /ALTLinux on rootfs.
This commit is contained in:
Anton Midyukov 2020-10-29 00:02:00 +07:00
parent 9795eaf827
commit d1c947de31
3 changed files with 53 additions and 1 deletions

View File

@ -1,8 +1,15 @@
use/repo:
@$(call add_feature)
@$(call add,STAGE1_PACKAGES,gnupg)
@$(call xport,ROOTFS_MAIN)
use/repo/main: sub/main use/repo; @:
use/repo/main:: sub/main use/repo; @:
ifeq (vm,$(IMAGE_CLASS))
use/repo/main::
@$(call set,ROOTFS_MAIN,1)
@$(call add,THE_PACKAGES,apt-repo-tools)
endif
use/repo/addon: use/repo/main
@$(call set,MAIN_SUFFIX,addon)

View File

@ -0,0 +1,33 @@
#!/bin/sh -eu
[ -n "$GLOBAL_ROOTFS_MAIN" ] || exit 0
mv /ALTLinux /srv/ALT
PREFIX=/srv/ALT
cd "$PREFIX"
COMPS="$(find -mindepth 1 -maxdepth 1 -type d -name 'RPMS.*' -printf '%f\n' |
sed 's/^RPMS\.//')"
[ -z "$GLOBAL_VERBOSE" ] || echo "** COMPS=$COMPS" >&2
[ -n "$COMPS" ] || exit 1
for comp in $COMPS; do
for f in RPMS.$comp/*rpm; do
[ "$f" = "RPMS.$comp/$(rpm -qp $f).rpm" ] || mv $f RPMS.$comp/$(rpm -qp $f).rpm
done
done
genbasedir \
--topdir="/" \
--no-oldhashfile \
--partial \
--xz \
--bz2 \
--create \
--notautomatic=false \
$PREFIX $COMPS
### drop this when genbasedir is fixed (--no-uncompressed)
for c in $COMPS; do rm -f base/{pkg,src}list.$c; done

View File

@ -0,0 +1,12 @@
#!/bin/sh -efu
# configure package repository of the image (provided by sub/main);
# this script will be run iff both live and repo features are used
[ -n "$GLOBAL_ROOTFS_MAIN" ] || exit 0
DIR=/etc/apt/sources.list.d
mkdir -p $DIR && {
echo "# for real stuff you'll need full repo, see apt-repo"
echo "rpm file:/srv/ ALT main"
} > $DIR/main.list