build-image.sh 1.6 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 listed in README.md:
  18. apt-get update
  19. apt-get -y install --no-install-recommends --no-install-suggests bc binfmt-support bison cgpt cmake debootstrap device-tree-compiler flex g++ gawk gcc gcc-arm-none-eabi git libc-dev libncurses-dev libssl-dev lzip make parted patch qemu-user-static texinfo u-boot-tools vboot-kernel-utils wget
  20. # And install stuff that is missing from the Debian/buster container:
  21. apt-get -y install --no-install-recommends --no-install-suggests bzip2 ca-certificates cpio file gpg gpg-agent kmod udev
  22. # Note: there's an error for /proc/modules, but at least building the image works fine:
  23. # libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
  24. make image
  25. # rename the image to include git sha:
  26. mv PrawnOS-Shiba-c201.img "PrawnOS-Shiba-c201-git-${GITHUB_SHA}.img"