mirror of https://git.48k.eu/ogclient
postinstall: linux does not allow more than 64 bytes long hostnames
As per: $ getconf HOST_NAME_MAX 64 truncate it to the maximum.master
parent
e9ee1b1c9f
commit
fd64b84bcc
|
@ -69,6 +69,10 @@ def set_windows_hostname(disk, partition, name):
|
|||
def set_linux_hostname(disk, partition, name):
|
||||
logging.info(f'Setting Linux hostname to {name}')
|
||||
|
||||
if len(name) > 64:
|
||||
logging.warning(f'Linux does not permit hostnames that exceed 64 characters. Truncating {name}')
|
||||
name = name[0:64]
|
||||
|
||||
device = get_partition_device(disk, partition)
|
||||
mountpoint = device.replace('dev', 'mnt')
|
||||
|
||||
|
|
Loading…
Reference in New Issue