diff --git a/features.in/repo/config.mk b/features.in/repo/config.mk index 865b0401..ddcf1e02 100644 --- a/features.in/repo/config.mk +++ b/features.in/repo/config.mk @@ -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) diff --git a/features.in/repo/rootfs/image-scripts.d/01-genbasedir-rootfs b/features.in/repo/rootfs/image-scripts.d/01-genbasedir-rootfs new file mode 100755 index 00000000..12e53e20 --- /dev/null +++ b/features.in/repo/rootfs/image-scripts.d/01-genbasedir-rootfs @@ -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 diff --git a/features.in/repo/rootfs/image-scripts.d/80-repo-rootfs-main b/features.in/repo/rootfs/image-scripts.d/80-repo-rootfs-main new file mode 100755 index 00000000..dede61a5 --- /dev/null +++ b/features.in/repo/rootfs/image-scripts.d/80-repo-rootfs-main @@ -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