Chroot: Define hostname and hosts

This commit is contained in:
Jeremy Gardais 2019-04-03 23:57:28 +02:00
parent 17a32b701d
commit 8bac33afa1
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 7 additions and 0 deletions

View File

@ -8,6 +8,8 @@ else
printf '%b\n' "Please check the hard drive to use" printf '%b\n' "Please check the hard drive to use"
exit 0 exit 0
fi fi
## Computer hostname
new_hostname="2g"
## Volume Group name to use for LVM ## Volume Group name to use for LVM
vgname="ovhsys" vgname="ovhsys"
## If the script should manage the partitions (delete, add,…) ## If the script should manage the partitions (delete, add,…)
@ -247,6 +249,11 @@ chroot /target aptitude install --assume-yes --without-recommends -- linux-image
chroot /target grub-install "${hdd}" chroot /target grub-install "${hdd}"
chroot /target update-grub chroot /target update-grub
## }}}
## Hostname {{{
printf '%b\n' "${new_hostname}" > /target/etc/hostname
printf '%b\n' "127.0.0.1 ${new_hostname}" >> /target/etc/hosts
## }}} ## }}}
# }}} # }}}
# Finish {{{ # Finish {{{