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.

преди 4 години
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash -e
  2. install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/"
  3. install -d "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d"
  4. install -m 644 files/ttyoutput.conf "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/"
  5. install -m 644 files/50raspi "${ROOTFS_DIR}/etc/apt/apt.conf.d/"
  6. install -m 644 files/console-setup "${ROOTFS_DIR}/etc/default/"
  7. install -m 755 files/rc.local "${ROOTFS_DIR}/etc/"
  8. on_chroot << EOF
  9. systemctl disable hwclock.sh
  10. systemctl disable nfs-common
  11. systemctl disable rpcbind
  12. if [ "${ENABLE_SSH}" == "1" ]; then
  13. systemctl enable ssh
  14. else
  15. systemctl disable ssh
  16. fi
  17. systemctl enable regenerate_ssh_host_keys
  18. EOF
  19. if [ "${USE_QEMU}" = "1" ]; then
  20. echo "enter QEMU mode"
  21. install -m 644 files/90-qemu.rules "${ROOTFS_DIR}/etc/udev/rules.d/"
  22. on_chroot << EOF
  23. systemctl disable resize2fs_once
  24. EOF
  25. echo "leaving QEMU mode"
  26. else
  27. on_chroot << EOF
  28. systemctl enable resize2fs_once
  29. EOF
  30. fi
  31. on_chroot <<EOF
  32. for GRP in input spi i2c gpio; do
  33. groupadd -f -r "\$GRP"
  34. done
  35. for GRP in adm dialout cdrom audio users sudo video games plugdev input gpio spi i2c netdev; do
  36. adduser $FIRST_USER_NAME \$GRP
  37. done
  38. EOF
  39. on_chroot << EOF
  40. setupcon --force --save-only -v
  41. EOF
  42. on_chroot << EOF
  43. usermod --pass='*' root
  44. EOF
  45. rm -f "${ROOTFS_DIR}/etc/ssh/"ssh_host_*_key*