mvallim / live-custom-ubuntu-from-scratch

(Yes, the project is still alive 😃) This procedure shows how to create a bootable and installable Ubuntu Live (along with the automatic hardware detection and configuration) from scratch.
https://mvallim.github.io/live-custom-ubuntu-from-scratch/
GNU General Public License v3.0
397 stars 186 forks source link

Allow to copy files to the chroot environment and purge these files after the chroot script was executed. #35

Open dangoncalves opened 3 years ago

kgilmer commented 3 years ago

It would also be helpful to understand how this PR works by providing a sample. The full end-to-end of how this feature is expected to be used.

asharrem commented 1 year ago

My solution was to host the files on github and call them in config.sh after the last package.

function customize_image() {
  # install graphics and desktop
    apt-get install -y \
    plymouth-theme-ubuntu-logo \
...

  case $TARGET_UBUNTU_VERSION in
      "focal" | "bionic")
          apt-get install -y cockpit-dashboard
          ;;
      *)
          echo "Package cockpit-dashboard is not needed. Skipping."
          ;;
  esac

  # wget & install nxos-default-settings
  file_name="nxos-default-settings.deb"
  # Hosted Files location
  WebHostFiles="https://asharrem.github.io"
  wget -q "$WebHostFiles/$file_name"
  if [ -f "$file_name" ]; then
    # ugly hack --force-overwrite is required to replace some default files
    dpkg --force-overwrite -i $file_name
    rm $file_name
  fi
}