nilmbuntu/customize.sh

55 lines
1.8 KiB
Bash
Raw Permalink Normal View History

2013-08-17 22:28:49 -04:00
#!/bin/bash
. config || exit 0
set -e
set -x
# Customize the outer ISO image
2013-08-18 12:42:11 -04:00
sed -i -s -e \
"s/DISKNAME.*/DISKNAME NILMbuntu $VERSION/" \
2013-08-17 22:28:49 -04:00
${ISO}/README.diskdefines
# The .disk/info file is important -- it's used by ubiquity to extract
# out the distro name in dialogs, and I think casper might use it too
echo "NILMbuntu $VERSION" > ${ISO}/.disk/info
2013-08-17 22:28:49 -04:00
# Set up preseed file by appending preseed.cfg to the Xubuntu
# default one
2020-08-07 12:29:31 -04:00
cat ${ISO}/preseed/xubuntu.seed files/preseed.cfg > ${ISO}/preseed/nilmbuntu.seed
2013-08-17 22:28:49 -04:00
2013-08-19 11:58:48 -04:00
# Set up isolinux how we want by editing its config
TRY="Boot ^NILMbuntu ${VERSION}"
2020-08-07 12:29:31 -04:00
cp files/splash.png ${ISO}/isolinux/splash.png
2013-08-19 11:58:48 -04:00
perl -n -i \
-e '$n=1 if /^label/; $n=2 if /^label live-install/; next if $n==2;' \
2020-08-07 12:29:31 -04:00
-e "s/menu label.*Try Xubuntu without installing/menu label $TRY/g;" \
2020-08-07 15:09:24 -04:00
-e "s,preseed/.*[.]seed,preseed/nilmbuntu.seed,g;" \
2013-08-19 11:58:48 -04:00
-e "s/ quiet splash//g;" \
-e "print;" \
${ISO}/isolinux/txt.cfg
sed -i -s -e "s/^menu margin .*/menu margin 2/g;" ${ISO}/isolinux/menu.cfg
2013-08-19 11:58:48 -04:00
sed -i -s -e "s/^ui gfxboot/# ui gfxboot/g;" ${ISO}/isolinux/isolinux.cfg
2013-08-17 22:28:49 -04:00
2013-08-19 11:58:48 -04:00
# Set up grub similarly
TRY="Boot NILMbuntu ${VERSION}"
2013-08-19 11:58:48 -04:00
perl -n -i \
-e "next if /menuentry \"Install/../^}$/;" \
-e "next if /menuentry \"OEM install/../^}$/;" \
2020-08-07 12:29:31 -04:00
-e "s/Try Xubuntu without installing/${TRY}/g;" \
-e "s,preseed/.*[.]seed,preseed/nilmbuntu.seed,g;" \
2013-08-19 11:58:48 -04:00
-e "s/ quiet splash//g;" \
-e "print;" \
${ISO}/boot/grub/{grub,loopback}.cfg
2013-08-17 22:28:49 -04:00
2020-08-07 17:23:34 -04:00
# Prevent some packages from being removed after install
perl -n -i -e 'print unless /gparted/' ${ISO}/casper/filesystem.manifest-remove
sudo install -D -m 0644 files/fallback_dns.conf ${FS}/etc/systemd/resolved.conf.d/fallback_dns.conf
2013-08-19 11:58:48 -04:00
if ! [ "$1" == "skip" ] ; then
2013-08-18 20:53:22 -04:00
2013-08-17 22:28:49 -04:00
# Run the customize-inner.sh script inside the chroot
./enter.sh "cd /root ; files/customize-inner.sh"
2013-08-19 11:58:48 -04:00
fi