Pārlūkot izejas kodu

mklive.sh: move installer.sh to build-x86-images.sh

Running mklive.sh without any arguments produces a minimal image that
doesn't have dialog installed which is required for installer.sh. Let's
move installing the installer script up a level to
build-x86-64-images.sh which already adds a dialog dependency.
Michal Vasilek 2 gadi atpakaļ
vecāks
revīzija
b28b64f5f6
2 mainītis faili ar 15 papildinājumiem un 2 dzēšanām
  1. 15 1
      build-x86-images.sh.in
  2. 0 1
      mklive.sh.in

+ 15 - 1
build-x86-images.sh.in

@@ -22,6 +22,13 @@ esac
 done
 shift $((OPTIND - 1))
 
+INCLUDEDIR=$(mktemp -d)
+trap "cleanup" INT TERM
+
+cleanup() {
+    rm -r "$INCLUDEDIR"
+}
+
 build_variant() {
     variant="$1"
     shift
@@ -74,7 +81,7 @@ build_variant() {
         ;;
     esac
 
-    ./mklive.sh -a "$ARCH" -o "$IMG" -p "$PKGS" -S "$SERVICES" ${REPO} "$@"
+    ./mklive.sh -a "$ARCH" -o "$IMG" -p "$PKGS" -S "$SERVICES" -I "$INCLUDEDIR" ${REPO} "$@"
 }
 
 if [ ! -x mklive.sh ]; then
@@ -82,6 +89,13 @@ if [ ! -x mklive.sh ]; then
     exit 1
 fi
 
+if [ -x installer.sh ]; then
+    install -Dm755 installer.sh "$INCLUDEDIR"/usr/bin/void-installer
+else
+    echo installer.sh not found >&2
+    exit 1
+fi
+
 for image in $IMAGES; do
     build_variant "$image" "$@"
 done

+ 0 - 1
mklive.sh.in

@@ -133,7 +133,6 @@ install_packages() {
     fi
     chroot "$ROOTFS" env -i xbps-reconfigure -a
 
-    install -Dm755 installer.sh "$ROOTFS"/usr/sbin/void-installer
     # Cleanup and remove useless stuff.
     rm -rf "$ROOTFS"/var/cache/* "$ROOTFS"/run/* "$ROOTFS"/var/run/*
 }