build-image.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # This file is part of PrawnOS (https://www.prawnos.com)
  3. # Copyright (c) 2020 Austin English <austinenglish@gmail.com>
  4. # PrawnOS is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License version 2
  6. # as published by the Free Software Foundation.
  7. # PrawnOS is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
  13. set -e
  14. set -x
  15. GITHUB_SHA="$1"
  16. cd "$(dirname "$0")/.."
  17. # Get dependencies
  18. apt-get update
  19. # Note: this is a copy/paste from README.md, if you add anything here, also update it!
  20. # Please make note of the "-y" that is not in the readme command. Not keeping it will break CI :)
  21. apt install --no-install-recommends --no-install-suggests \
  22. -y \
  23. bc binfmt-support bison build-essential bzip2 ca-certificates cgpt cmake cpio debhelper \
  24. debootstrap device-tree-compiler devscripts file flex g++ gawk gcc gcc-arm-none-eabi git gpg \
  25. gpg-agent kmod libc-dev libncurses-dev libssl-dev lzip make parted patch \
  26. pbuilder qemu-user-static sudo texinfo u-boot-tools udev vboot-kernel-utils wget
  27. # Note: there's an error for /proc/modules, but at least building the image works fine:
  28. # libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
  29. make image
  30. # rename the image to include git sha:
  31. mv PrawnOS-Shiba-c201.img "PrawnOS-Shiba-c201-git-${GITHUB_SHA}.img"