diff --git a/scripts/enable-installer-post.sh b/scripts/enable-installer-post.sh new file mode 100755 index 00000000..054cc992 --- /dev/null +++ b/scripts/enable-installer-post.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +echo "Enabling clr-installer on boot for $1" +systemctl --root=$1 enable clr-installer + +exit 0 diff --git a/scripts/installer-post.sh b/scripts/installer-post.sh index 7020c9d7..3a983bee 100755 --- a/scripts/installer-post.sh +++ b/scripts/installer-post.sh @@ -1,25 +1,14 @@ #!/bin/bash -echo "Enabling clr-installer on boot for $1" -systemctl --root=$1 enable clr-installer +CHROOTPATH=$1 -# Create a custom telemetry configuration to only log locally -echo "Creating custom telemetry configuration for $1" -mkdir -p $1/etc/telemetrics/ +# Enable the installer on boot +scripts/enable-installer-post.sh ${CHROOTPATH} -cp $1/usr/share/defaults/telemetrics/telemetrics.conf \ - $1/etc/telemetrics/telemetrics.conf +# Force Telemetry to use local host server +scripts/local-telemetry-post.sh ${CHROOTPATH} -sed -i -e '/server=/s/clr.telemetry.intel.com/localhost/' \ - -e '/spool_process_time/s/=900/=3600/' \ - -e '/record_retention_enabled/s/=false/=true/' \ - $1/etc/telemetrics/telemetrics.conf - -# Ensure telemetry is not enabled -touch $1/etc/telemetrics/opt-out - -# Have the installer image wait 5 seconds before launch -# Useful for users to change the boot command for debug -echo "timeout 5" >> $1/boot/loader/loader.conf +# Delay booting to give user a change to change boot params +scripts/wait-to-boot-post.sh ${CHROOTPATH} exit 0 diff --git a/scripts/live-desktop-post-install.sh b/scripts/live-desktop-post-install.sh index 8425ce7e..b313536a 100755 --- a/scripts/live-desktop-post-install.sh +++ b/scripts/live-desktop-post-install.sh @@ -4,6 +4,12 @@ set -ex CHROOTPATH=$1 +# Force Telemetry to use local host server +scripts/local-telemetry-post.sh ${CHROOTPATH} + +# Delay booting to give user a change to change boot params +scripts/wait-to-boot-post.sh ${CHROOTPATH} + GDM_DIR=$CHROOTPATH/etc/gdm/ THEMES_DIR=$CHROOTPATH/usr/share/clr-installer/themes DESKTOP_DIR=$CHROOTPATH/usr/share/applications/ diff --git a/scripts/local-telemetry-post.sh b/scripts/local-telemetry-post.sh new file mode 100755 index 00000000..55d81dbe --- /dev/null +++ b/scripts/local-telemetry-post.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Create a custom telemetry configuration to only log locally +echo "Creating custom telemetry configuration for $1" +mkdir -p $1/etc/telemetrics/ + +cp $1/usr/share/defaults/telemetrics/telemetrics.conf \ + $1/etc/telemetrics/telemetrics.conf + +sed -i -e '/server=/s/clr.telemetry.intel.com/localhost/' \ + -e '/spool_process_time/s/=900/=3600/' \ + -e '/record_retention_enabled/s/=false/=true/' \ + $1/etc/telemetrics/telemetrics.conf + +exit 0 diff --git a/scripts/wait-to-boot-post.sh b/scripts/wait-to-boot-post.sh new file mode 100755 index 00000000..b4d82895 --- /dev/null +++ b/scripts/wait-to-boot-post.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Have the installer image wait 5 seconds before launch +# Useful for users to change the boot command for debug +echo "timeout 5" >> $1/boot/loader/loader.conf + +exit 0