self.settings.add_string_setting(['customize'],
'run SCRIPT after setting up system',
metavar='SCRIPT')
+ self.settings.add_string_setting(['hostname'],
+ 'set name to HOSTNAME (%default)',
+ metavar='HOSTNAME',
+ default='debian')
def process_args(self, args):
if not self.settings['image']:
self.mkfs(rootdev)
rootdir = self.mount(rootdev)
self.debootstrap(rootdir)
+ self.set_hostname(rootdir)
self.set_root_password(rootdir)
self.remove_udev_persistent_rules(rootdir)
self.setup_networking(rootdir)
rootdir,
self.settings['mirror']])
+ def set_hostname(self, rootdir):
+ hostname = self.settings['hostname']
+ f = open(os.path.join(rootdir, 'etc', 'hostname'), 'w')
+ f.write(hostname)
+ f.close()
+
def set_root_password(self, rootdir):
if self.settings['root-password']:
self.message('Setting root password')
after setting up the new system image.
The script will get a single parameters:
the path to the root directory of the newly installed system.
+.TP
+.BR \-\-hostname =\fINAME
+Set system hostname to
+.IR NAME .
+The default is
+.IR debian .
.SH EXAMPLE
To create an image for the stable release of Debian:
.nf