diff --git a/scripts/installer/BaseDockerfile.amd64 b/scripts/installer/BaseDockerfile.amd64 index fb66cfeb..d293930c 100644 --- a/scripts/installer/BaseDockerfile.amd64 +++ b/scripts/installer/BaseDockerfile.amd64 @@ -1,14 +1,22 @@ FROM alpine # TODO: redo as cross platform, and without git etc :) +ARG VERSION +ARG KERNEL_VERSION +ENV VERSION=${VERSION} +ENV KERNEL_VERSION=${KERNEL_VERSION} + # not installed atm udev, grub2, kexe-toos # parted: partprobe, e2fsprogs: mkfs.ext4, syslinux: extlinux&syslinux RUN apk --no-cache add syslinux parted e2fsprogs COPY conf /scripts/ -#COPY ./build/vmlinuz-${KERNEL_VERSION} ./build/initrd ./build/ros /dist/ -RUN ln -s /bootiso/boot/ /dist \ - && ln -s /host/usr/bin/ros /scripts/ +COPY ./build/ros /bin/ +#OR softlink in the host one - this image should only be used when installing from ISO.. +# (except its useful for testing) +# && ln -s /host/usr/bin/ros /bin/ -ENTRYPOINT ["/scripts/ros"] +RUN ln -s /bootiso/boot/ /dist + +ENTRYPOINT ["/bin/ros"] diff --git a/scripts/installer/Dockerfile.amd64 b/scripts/installer/Dockerfile.amd64 index 746e5ad5..05145e6f 100755 --- a/scripts/installer/Dockerfile.amd64 +++ b/scripts/installer/Dockerfile.amd64 @@ -1,12 +1,11 @@ FROM rancher/os-installer -ARG VERSION -ARG KERNEL_VERSION -ENV VERSION=${VERSION} -ENV KERNEL_VERSION=${KERNEL_VERSION} - -# TODO: separate out the 3 elements below - so we can mix and match updates +# TODO: separate out the elements below - so we can mix and match updates RUN rm /dist/ \ && mkdir -p /dist/ -COPY ./build/vmlinuz-${KERNEL_VERSION} ./build/initrd ./build/ros /dist/ + +# Run docker build in the `./build/` dir +#COPY ./ros /bin/ +#needs to be a recursive copy +COPY ./ /dist/ diff --git a/scripts/package-installer b/scripts/package-installer index de4ece69..cb9695c6 100755 --- a/scripts/package-installer +++ b/scripts/package-installer @@ -12,16 +12,27 @@ if [ ! -f $DOCKERFILE ] || [ ! -f dist/artifacts/vmlinuz-${KERNEL_VERSION} ] || exit 0 fi +# TODO maybe extract the cration of the syslinux cfg files +mkdir -p ${DIST}/boot/isolinux/ +cat scripts/isolinux.cfg | envsubst > ${DIST}/boot/isolinux/isolinux.cfg +cat scripts/isolinux_label.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/linux-current.cfg +#cat scripts/isolinux_label.cfg | LABEL=debug APPEND="rancher.debug=true" envsubst > ${DIST}/boot/linux-previous.cfg +cat scripts/global.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/global.cfg + + mkdir -p ./scripts/installer/build cp ./dist/artifacts/initrd ./scripts/installer/build cp ./dist/artifacts/vmlinuz-${KERNEL_VERSION} ./scripts/installer/build cp ./bin/ros ./scripts/installer/build +cp -r ${DIST}/boot/* ./scripts/installer/build/ trap "rm -rf ./scripts/installer/build" EXIT # installer base image - can be included in iso # TODO: fix the fullinstaller Dockerfile to use the ${VERSION}${SUFFIX} docker build \ -t ${OS_REPO}/os-installer \ + --build-arg VERSION=${VERSION} \ + --build-arg KERNEL_VERSION=${KERNEL_VERSION} \ -f $BASEDOCKERFILE \ ./scripts/installer docker save -o dist/artifacts/installer.tar ${OS_REPO}/os-installer @@ -29,8 +40,6 @@ docker save -o dist/artifacts/installer.tar ${OS_REPO}/os-installer # Full installer image with initrd - used for pulling from network docker build \ -t ${OS_REPO}/os:${VERSION}${SUFFIX} \ - --build-arg VERSION=${VERSION} \ - --build-arg KERNEL_VERSION=${KERNEL_VERSION} \ -f $DOCKERFILE \ ./scripts/installer diff --git a/scripts/package-iso b/scripts/package-iso index 8da9d1be..66a23ab6 100755 --- a/scripts/package-iso +++ b/scripts/package-iso @@ -22,14 +22,11 @@ cp ${ARTIFACTS}/initrd ${CD}/boot # TODO: these move to os-kernel pwd ls dist/artifacts/vmlinuz-${KERNEL_VERSION} - cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot/ #TODO cp ${ARTIFACTS}/linuxmods-${KERNEL_VERSION} ${CD}/boot/ -cat scripts/isolinux.cfg | envsubst > ${CD}/boot/isolinux/isolinux.cfg -cat scripts/isolinux_label.cfg | LABEL=${VERSION} envsubst > ${CD}/boot/linux-current.cfg -#cat scripts/isolinux_label.cfg | LABEL=debug APPEND="rancher.debug=true" envsubst > ${CD}/boot/linux-previous.cfg -cat scripts/global.cfg | LABEL=${VERSION} envsubst > ${CD}/boot/global.cfg +# cfg files creation moved to package-installer +cp -r ${DIST}/boot/* ${CD}/boot/ cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/ cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux/