From 948a1932186b36ca0eac3707311660da4808ddc7 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Thu, 7 Sep 2023 22:53:38 +0400 Subject: [PATCH] Configure hostname --- Makefile | 1 + etc/hostname | 1 + etc/inittab | 2 ++ make/etc.mk | 4 ++++ 4 files changed, 8 insertions(+) create mode 100644 etc/hostname diff --git a/Makefile b/Makefile index 7ae200a..631725e 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ SYSROOT = $(SRC)/sysroot SYSROOT_TARGETS = \ $(SYSROOT)/bin/busybox \ $(SYSROOT)/etc/group \ + $(SYSROOT)/etc/hostname \ $(SYSROOT)/etc/hosts \ $(SYSROOT)/etc/inittab \ $(SYSROOT)/etc/passwd \ diff --git a/etc/hostname b/etc/hostname new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/etc/hostname @@ -0,0 +1 @@ +localhost diff --git a/etc/inittab b/etc/inittab index d9f2bb0..da9baa6 100644 --- a/etc/inittab +++ b/etc/inittab @@ -1,3 +1,5 @@ +::sysinit:/bin/hostname -F /etc/hostname + tty1::respawn:/sbin/getty 38400 tty1 tty2::respawn:/sbin/getty 38400 tty2 tty3::respawn:/sbin/getty 38400 tty3 diff --git a/make/etc.mk b/make/etc.mk index 544aa08..f1e88e1 100644 --- a/make/etc.mk +++ b/make/etc.mk @@ -2,6 +2,10 @@ $(SYSROOT)/etc/group: etc/group $(INSTALL) -d $(SYSROOT)/etc $(INSTALL) -m 644 etc/group $(SYSROOT)/etc/group +$(SYSROOT)/etc/hostname: etc/hostname + $(INSTALL) -d $(SYSROOT)/etc + $(INSTALL) -m 644 etc/hostname $(SYSROOT)/etc/hostname + $(SYSROOT)/etc/hosts: etc/hosts $(INSTALL) -d $(SYSROOT)/etc $(INSTALL) -m 644 etc/hosts $(SYSROOT)/etc/hosts