https://blue-build.org/ logo
Build failed error too general
# questions
a
message has been deleted
u
how can i make it work in build time
Copy code
#!/bin/bash

# Define the new hostname
NEW_HOSTNAME="my-os"

# Update /etc/hostname with the new hostname
echo "$NEW_HOSTNAME" > /etc/hostname

# Update /etc/hosts to reflect the new hostname
sed -i "s/localhost[ \t]*localhost/localhost $NEW_HOSTNAME/" /etc/hosts
this is the change-hostname.sh
or can i do this using the systemd module
Copy code
#!/bin/bash
echo "my-os" > /etc/hostname
hostnamectl set-hostname meme-os
f
I think that only using
hostnamectl
is sufficient
but not sure if even that works in build-time
u
hostnamectl is a systemd thing
f
yes
u
doesnt worrk
unless systemd module has a feature for that?
f
hmm, I'm outta ideas then
no, it doesn't have
u
do u have any idea why the error is occuring
script looks good
f
yes, but that doesn't work in build-time
u
why not
f
Not sure for the specific reason why
u
how does bazzite achieve this then? they change /etc/hostname
f
they maybe change
/usr/etc/hostname
instead of
/etc/
u
what made u think of that
they are the same?
f
ostree doesn't allow to add or modify
/etc/hosts
in build-time, but adding the file in
/usr/etc/hosts
works
maybe it's the similar case here
u
oh so it is just that during build time /etc/hostname is read-only
f
yeah, I believe that is the case
u
did set-hostname on my bazzite rn then cat /etc/hostname
it did change the file, so it is not read only?
f
Maybe Bazzite does this in runtime
didn't look into it
u
during runtime hhmm
f
you did that in runtime
that's expected to work
u
how can i do a runtime change with bluebuild?
f
it's basically a systemd service which fires script in
/usr/bin/
that's how some of those runtime changes are generally done
u
so basically i create a script that is located in /usr/bin/ and itll fire automatically?
f
that & for it to fire automatically, systemd service needs to be made
u
which is enabled by defualt ig, if not i use the systemd module then thanks
x
isn't setting the hostname something a local user should do themselves?
u
usually yes, but by default bazzite ships it with their own hostname, and I'm planning on publicly sharing my os
tho I've managed to do it
x
maybe it's in the iso? idk
u
ye maybe actually tho I've tweaked it either way