Loading build-cross.sh +36 −1 Changes for build-cross.sh: 36 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ # plus uImage and DTB # 10. installer RAM-bootable installer (initramfs as U-Boot ramdisk) with # boards/<board>/installer/<board>-install and the images # not in the default run: # packages the FenrirOS specs as RPMs (host rpmbuild, cross toolchain) # repo those RPMs as dnf5 repository $WORK/repo/<arch> (REPO_UPLOAD) # # Usage: ./build-cross.sh [step...] (default: all steps in order) # ./build-cross.sh clean Loading Loading @@ -774,12 +777,44 @@ step_clean() { ALL_STEPS=(headers systempp builtins toolchain fresh syslite kernel rootfs image installer) # not in the default run: packages (needs the FenrirOS specs, FENRIR_FILES) # repo: the RPMs of 'packages' as an rpm-md repository for dnf5 on the # board, laid out as build-chroot.sh's (<repo>/<arch>/Packages, repodata/; # fenriros.repo: .../fenriros/$basearch). Packages built before stay, so # systems still find their dependencies; an update needs a higher # Version-Release. createrepo_c is the x86 build chroot's (REPO_CHROOT). # REPO_UPLOAD: rsync target, e.g. host:/srv/www/fenriros step_repo() { local chroot="${REPO_CHROOT:-/build/$USER/systempp/build-chroot/chroot}" local repo="$WORK/repo" arch="$RPM_ARCH" rpm n=0 [[ -x $chroot/usr/bin/createrepo_c ]] || die "no createrepo_c in $chroot (set REPO_CHROOT)" mkdir -p "$repo/$arch/Packages" for rpm in "$WORK"/rpmbuild/RPMS/*/*.rpm; do [[ -e $rpm ]] || continue if [[ ! -e $repo/$arch/Packages/${rpm##*/} || $rpm -nt $repo/$arch/Packages/${rpm##*/} ]]; then cp -p "$rpm" "$repo/$arch/Packages/" n=$((n + 1)) fi done msg "repo: $n new or rebuilt RPMs, metadata for $repo/$arch" mkdir -p "$chroot/mnt/repo" run repo unshare -rm sh -c 'mount --bind "$1" "$2/mnt/repo" && exec chroot "$2" /usr/bin/env -i PATH=/usr/bin:/bin createrepo_c --update --general-compress-type=zstd /mnt/repo' \ sh "$repo/$arch" "$chroot" if [[ -n ${REPO_UPLOAD:-} ]]; then msg "repo: uploading to $REPO_UPLOAD" # the packages first, then the metadata that refers to them run repo rsync -a "$repo/" "$REPO_UPLOAD/" --exclude repodata run repo rsync -a --delete "$repo/$arch/repodata/" "$REPO_UPLOAD/$arch/repodata/" fi msg "repo ready: $repo/$arch" } steps=("$@") ((${#steps[@]})) || steps=("${ALL_STEPS[@]}") for s in "${steps[@]}"; do case "$s" in headers|systempp|builtins|toolchain|fresh|syslite|kernel|rootfs|image|installer|packages) headers|systempp|builtins|toolchain|fresh|syslite|kernel|rootfs|image|installer|packages|repo) check_deps; mkdir -p "$WORK" "$BUILD"; "step_$s" ;; clean) step_clean ;; -h|--help) sed -n '2,/^$/s/^# \{0,1\}//p' "$0"; exit 0 ;; Loading Loading
build-cross.sh +36 −1 Changes for build-cross.sh: 36 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ # plus uImage and DTB # 10. installer RAM-bootable installer (initramfs as U-Boot ramdisk) with # boards/<board>/installer/<board>-install and the images # not in the default run: # packages the FenrirOS specs as RPMs (host rpmbuild, cross toolchain) # repo those RPMs as dnf5 repository $WORK/repo/<arch> (REPO_UPLOAD) # # Usage: ./build-cross.sh [step...] (default: all steps in order) # ./build-cross.sh clean Loading Loading @@ -774,12 +777,44 @@ step_clean() { ALL_STEPS=(headers systempp builtins toolchain fresh syslite kernel rootfs image installer) # not in the default run: packages (needs the FenrirOS specs, FENRIR_FILES) # repo: the RPMs of 'packages' as an rpm-md repository for dnf5 on the # board, laid out as build-chroot.sh's (<repo>/<arch>/Packages, repodata/; # fenriros.repo: .../fenriros/$basearch). Packages built before stay, so # systems still find their dependencies; an update needs a higher # Version-Release. createrepo_c is the x86 build chroot's (REPO_CHROOT). # REPO_UPLOAD: rsync target, e.g. host:/srv/www/fenriros step_repo() { local chroot="${REPO_CHROOT:-/build/$USER/systempp/build-chroot/chroot}" local repo="$WORK/repo" arch="$RPM_ARCH" rpm n=0 [[ -x $chroot/usr/bin/createrepo_c ]] || die "no createrepo_c in $chroot (set REPO_CHROOT)" mkdir -p "$repo/$arch/Packages" for rpm in "$WORK"/rpmbuild/RPMS/*/*.rpm; do [[ -e $rpm ]] || continue if [[ ! -e $repo/$arch/Packages/${rpm##*/} || $rpm -nt $repo/$arch/Packages/${rpm##*/} ]]; then cp -p "$rpm" "$repo/$arch/Packages/" n=$((n + 1)) fi done msg "repo: $n new or rebuilt RPMs, metadata for $repo/$arch" mkdir -p "$chroot/mnt/repo" run repo unshare -rm sh -c 'mount --bind "$1" "$2/mnt/repo" && exec chroot "$2" /usr/bin/env -i PATH=/usr/bin:/bin createrepo_c --update --general-compress-type=zstd /mnt/repo' \ sh "$repo/$arch" "$chroot" if [[ -n ${REPO_UPLOAD:-} ]]; then msg "repo: uploading to $REPO_UPLOAD" # the packages first, then the metadata that refers to them run repo rsync -a "$repo/" "$REPO_UPLOAD/" --exclude repodata run repo rsync -a --delete "$repo/$arch/repodata/" "$REPO_UPLOAD/$arch/repodata/" fi msg "repo ready: $repo/$arch" } steps=("$@") ((${#steps[@]})) || steps=("${ALL_STEPS[@]}") for s in "${steps[@]}"; do case "$s" in headers|systempp|builtins|toolchain|fresh|syslite|kernel|rootfs|image|installer|packages) headers|systempp|builtins|toolchain|fresh|syslite|kernel|rootfs|image|installer|packages|repo) check_deps; mkdir -p "$WORK" "$BUILD"; "step_$s" ;; clean) step_clean ;; -h|--help) sed -n '2,/^$/s/^# \{0,1\}//p' "$0"; exit 0 ;; Loading