Created
February 4, 2017 21:54
-
-
Save thejhh/a8862fb9be5bfde6a367eb97fde73c34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Setup swap file | |
| # Setup non-graphical grub terminal | |
| d-i preseed/late_command string \ | |
| mkdir /target/var/swap; \ | |
| chmod 700 /target/var/swap; \ | |
| dd if=/dev/zero of=/target/var/swap/swapfile0 bs=1M count=1024; \ | |
| chmod 600 /target/var/swap/swapfile0; \ | |
| mkswap /target/var/swap/swapfile0; \ | |
| echo "/var/swap/swapfile0 swap swap defaults 0 0" >> /target/etc/fstab ; \ | |
| mv /target/etc/rc.local /target/etc/rc.local.orig; \ | |
| echo '#!/bin/sh -e' > /target/etc/rc.local; \ | |
| echo '/usr/sbin/ufw allow ssh' >> /target/etc/rc.local; \ | |
| echo 'mv -f /etc/rc.local.orig /etc/rc.local' >> /target/etc/rc.local; \ | |
| echo 'test -x /etc/rc.local && /etc/rc.local' >> /target/etc/rc.local; \ | |
| echo 'exit 0' >> /target/etc/rc.local; \ | |
| chmod +x /target/etc/rc.local; \ | |
| sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0"/g; s/# *GRUB_TERMINAL=console/GRUB_TERMINAL=console/g' /target/etc/default/grub; \ | |
| in-target update-grub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment