build-image.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. # This file is part of PrawnOS (http://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. apt-get -y install --no-install-recommends --no-install-suggests bc binfmt-support bison bzip2 ca-certificates cgpt cmake cpio debootstrap device-tree-compiler file flex g++ gawk gcc gcc-arm-none-eabi git gpg gpg-agent kmod libc-dev libncurses-dev libssl-dev lzip make parted patch qemu-user-static sudo texinfo u-boot-tools udev vboot-kernel-utils wget
  21. # Note: there's an error for /proc/modules, but at least building the image works fine:
  22. # libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
  23. make image
  24. # rename the image to include git sha:
  25. mv PrawnOS-Shiba-c201.img "PrawnOS-Shiba-c201-git-${GITHUB_SHA}.img"