You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

59 lines
2.0 KiB

  1. #!/bin/bash
  2. . config || exit 0
  3. set -e
  4. set -x
  5. # Customize the outer ISO image
  6. sed -i -s -e \
  7. "s/DISKNAME.*/DISKNAME NilmDBuntu $VERSION by Jim Paris/" \
  8. ${ISO}/README.diskdefines
  9. # The .disk/info file is important -- it's used by ubiquity to extract
  10. # out the distro name in dialogs, and I think casper might use it too
  11. echo "NilmDBuntu $VERSION by Jim Paris" > ${ISO}/.disk/info
  12. rm -f ${ISO}/.disk/release_notes_url
  13. # Set up preseed file
  14. cp ${ISO}/preseed/xubuntu.seed ${ISO}/preseed/nilmdbuntu.seed
  15. cat >> ${ISO}/preseed/nilmdbuntu.seed <<"EOF"
  16. # Late commands:
  17. # - Regenerate SSH host keys
  18. # - Remove "quiet splash" from grub command line
  19. d-i preseed/late_command string \
  20. in-target rm /etc/ssh/ssh_host_*; \
  21. in-target dpkg-reconfigure openssh-server; \
  22. in-target sed -i -s 's/quiet splash//g' /etc/default/grub; \
  23. in-target update-grub; \
  24. echo "done"
  25. # Default user. Ubiquity should let them change this
  26. d-i passwd/user-fullname string NILM User
  27. d-i passwd/username string nilm
  28. #d-i passwd/user-password password nilm
  29. #d-i passwd/user-password-again password nilm
  30. d-i user-setup/allow-password-weak boolean true
  31. d-i passwd/auto-login boolean true
  32. EOF
  33. # Rename Xubuntu to NilmDBuntu in boot scripts; also changes
  34. # preseed file to the custom one
  35. sed -i -s \
  36. -e "s/Xubuntu/NilmDBuntu/g;" \
  37. -e "s/Kubuntu/NilmDBuntu/g;" \
  38. -e "s/Ubuntu/NilmDBuntu/g;" \
  39. -e "s-preseed/xubuntu-preseed/nilmdbuntu-g;" \
  40. -e "s-preseed/kubuntu-preseed/nilmdbuntu-g;" \
  41. -e "s-preseed/ubuntu-preseed/nilmdbuntu-g;" \
  42. ${ISO}/isolinux/txt.cfg ${ISO}/boot/grub/{grub,loopback}.cfg
  43. # Remove quiet and splash from boot command lines. Easier than a
  44. # custom plymouth theme and it's helpful.
  45. sed -i -s -e "s/ quiet splash//g;" \
  46. ${ISO}/isolinux/txt.cfg ${ISO}/boot/grub/{grub,loopback}.cfg
  47. # Run the customize-inner.sh script inside the chroot
  48. sudo cp customize-inner.sh ${FS}/root/customize-inner.sh
  49. sudo chmod +x ${FS}/root/customize-inner.sh
  50. ./enter.sh "cd /root ; ./customize-inner.sh"