From 8bac33afa158f25da5311eb59546a71ad66177e8 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 3 Apr 2019 23:57:28 +0200 Subject: [PATCH] Chroot: Define hostname and hosts --- debian/chroot.install | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/chroot.install b/debian/chroot.install index 999a694..2550d3b 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -8,6 +8,8 @@ else printf '%b\n' "Please check the hard drive to use" exit 0 fi +## Computer hostname +new_hostname="2g" ## Volume Group name to use for LVM vgname="ovhsys" ## 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 update-grub +## }}} +## Hostname {{{ +printf '%b\n' "${new_hostname}" > /target/etc/hostname +printf '%b\n' "127.0.0.1 ${new_hostname}" >> /target/etc/hosts + ## }}} # }}} # Finish {{{