|
|
@ -60,8 +60,8 @@ Calamares::JobResult SetHostNameJob::exec()
|
|
|
|
return Calamares::JobResult::error( tr( "Cannot write hostname to target system" ) );
|
|
|
|
return Calamares::JobResult::error( tr( "Cannot write hostname to target system" ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTextStream out( &hostfile );
|
|
|
|
QTextStream hostfileout( &hostfile );
|
|
|
|
out << m_hostname << "\n";
|
|
|
|
hostfileout << m_hostname << "\n";
|
|
|
|
hostfile.close();
|
|
|
|
hostfile.close();
|
|
|
|
|
|
|
|
|
|
|
|
QFile hostsfile( destDir + "/etc/hosts" );
|
|
|
|
QFile hostsfile( destDir + "/etc/hosts" );
|
|
|
@ -72,13 +72,13 @@ Calamares::JobResult SetHostNameJob::exec()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// We also need to write the appropriate entries for /etc/hosts
|
|
|
|
// We also need to write the appropriate entries for /etc/hosts
|
|
|
|
QTextStream out( &hostsfile );
|
|
|
|
QTextStream hostsfileout( &hostsfile );
|
|
|
|
// ipv4 support
|
|
|
|
// ipv4 support
|
|
|
|
out << "127.0.0.1" << "\t" << "localhost" << "\n";
|
|
|
|
hostsfileout << "127.0.0.1" << "\t" << "localhost" << "\n";
|
|
|
|
out << "127.0.1.1" << "\t" << m_hostname << "\n";
|
|
|
|
hostsfileout << "127.0.1.1" << "\t" << m_hostname << "\n";
|
|
|
|
// ipv6 support
|
|
|
|
// ipv6 support
|
|
|
|
out << "::1" << "\t" << "localhost ip6-localhost ip6-loopback" << "\n";
|
|
|
|
hostsfileout << "::1" << "\t" << "localhost ip6-localhost ip6-loopback" << "\n";
|
|
|
|
out << "ff02::1 ip6-allnodes" << "\n" << "ff02::2 ip6-allrouters" << "\n";
|
|
|
|
hostsfileout << "ff02::1 ip6-allnodes" << "\n" << "ff02::2 ip6-allrouters" << "\n";
|
|
|
|
hostsfile.close();
|
|
|
|
hostsfile.close();
|
|
|
|
|
|
|
|
|
|
|
|
return Calamares::JobResult::ok();
|
|
|
|
return Calamares::JobResult::ok();
|
|
|
|