From 19259aeb656df5cbc7bda89599442dd51d80a7a8 Mon Sep 17 00:00:00 2001 From: Tuan Hoang Date: Tue, 1 Oct 2019 17:23:57 +0200 Subject: [PATCH] zipl: ship a minimal zipl.conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ship a minimal zipl configuration file at /lib/s390-tools/zipl.conf by default which would help systems using BLS files, without having to create the traditional /etc/zipl.conf file. GitHub-ID: https://github.com/ibm-s390-tools/s390-tools/issues/70 GitHub-ID: https://github.com/ibm-s390-tools/s390-tools/pull/71 Signed-off-by: Tuan Hoang Signed-off-by: Stefan Haberland Signed-off-by: Jan Höppner --- zipl/Makefile | 1 + zipl/doc/zipl.conf.minimal | 10 ++++++++++ zipl/man/Makefile | 10 ++++++++-- zipl/man/{zipl.8 => zipl.8.in} | 2 +- zipl/man/{zipl.conf.5 => zipl.conf.5.in} | 17 ++++++++++++++--- 5 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 zipl/doc/zipl.conf.minimal rename zipl/man/{zipl.8 => zipl.8.in} (99%) rename zipl/man/{zipl.conf.5 => zipl.conf.5.in} (96%) diff --git a/zipl/Makefile b/zipl/Makefile index a02e9976..931b1135 100644 --- a/zipl/Makefile +++ b/zipl/Makefile @@ -8,6 +8,7 @@ all: install: all $(MAKE) -C src install $(MAKE) -C man install + $(INSTALL) -g $(GROUP) -o $(OWNER) -m 644 doc/zipl.conf.minimal $(DESTDIR)$(TOOLS_LIBDIR)/zipl.conf clean: $(MAKE) -C src clean diff --git a/zipl/doc/zipl.conf.minimal b/zipl/doc/zipl.conf.minimal new file mode 100644 index 00000000..9d6fa5e4 --- /dev/null +++ b/zipl/doc/zipl.conf.minimal @@ -0,0 +1,10 @@ +# This is an example of a minimal zipl.conf file that can be used when the +# sections are defined in BootLoaderSpec fragments files. +# +# See the zipl and zipl.conf man page for more details. +[defaultboot] +defaultauto +prompt=1 +timeout=5 +secure=auto +target=/boot diff --git a/zipl/man/Makefile b/zipl/man/Makefile index 6439205c..1d8dbe3d 100644 --- a/zipl/man/Makefile +++ b/zipl/man/Makefile @@ -6,7 +6,13 @@ all: install: $(INSTALL) -d -m 755 $(DESTDIR)$(MANDIR)/man5 $(INSTALL) -d -m 755 $(DESTDIR)$(MANDIR)/man8 - $(INSTALL) -m 644 -c zipl.8 $(DESTDIR)$(MANDIR)/man8 - $(INSTALL) -m 644 -c zipl.conf.5 $(DESTDIR)$(MANDIR)/man5 + sed -e 's@%SYSCONFDIR%@$(SYSCONFDIR)@' \ + -e 's@%TOOLS_LIBDIR%@$(TOOLS_LIBDIR)@' zipl.8.in \ + > $(DESTDIR)$(MANDIR)/man8/zipl.8 + sed -e 's@%SYSCONFDIR%@$(SYSCONFDIR)@' \ + -e 's@%TOOLS_LIBDIR%@$(TOOLS_LIBDIR)@' zipl.conf.5.in \ + > $(DESTDIR)$(MANDIR)/man5/zipl.conf.5 + chmod 644 $(DESTDIR)$(MANDIR)/man8/zipl.8 \ + $(DESTDIR)$(MANDIR)/man5/zipl.conf.5 clean: diff --git a/zipl/man/zipl.8 b/zipl/man/zipl.8.in similarity index 99% rename from zipl/man/zipl.8 rename to zipl/man/zipl.8.in index 9b6d3d19..70e61343 100644 --- a/zipl/man/zipl.8 +++ b/zipl/man/zipl.8.in @@ -120,7 +120,7 @@ Print version information, then exit. .TP .BR "\-c " " or " "\-\-config=" Use the specified . If none is supplied, the environment -variable ZIPLCONF is evaluated if set, otherwise /etc/zipl.conf is used. +variable ZIPLCONF is evaluated if set, otherwise %SYSCONFDIR%/zipl.conf is used. .TP .BR "\-b " " or " "\-\-blsdir=" diff --git a/zipl/man/zipl.conf.5 b/zipl/man/zipl.conf.5.in similarity index 96% rename from zipl/man/zipl.conf.5 rename to zipl/man/zipl.conf.5.in index 0eadddd5..37e1307e 100644 --- a/zipl/man/zipl.conf.5 +++ b/zipl/man/zipl.conf.5.in @@ -17,8 +17,13 @@ boot loader tool .BR zipl (8)). .br -By default this configuration file is located at /etc/zipl.conf. A different -location may be specified either using the '\-\-config' option of +By default +.B zipl +checks for +.I zipl.conf +at /run/zipl/zipl.conf, %SYSCONFDIR%/zipl.conf, %TOOLS_LIBDIR%/zipl.conf in that +order - whichever is found first will be used. Users can specifically choose a +location using the '\-\-config' option of .B zipl or by setting the ZIPLCONF shell environment variable. .br @@ -138,7 +143,13 @@ initrd /initramfs-4.15.9 options root=/dev/dasda1 console=ttyS0 .PP -The location of the linux and initrd has to be specified relative to the boot partition. The BLS config files are only used to specify the IPL sections, a zipl.conf configuration files is still needed for global parameters. +The location of the linux and initrd has to be specified relative to the boot +partition. The BLS config files are only used to specify the IPL sections, a +zipl.conf configuration file is still needed for global parameters. For this +purpose, a minimal zipl.conf configuration file is shipped at +%TOOLS_LIBDIR%/zipl.conf which would help when used with BLS config files, by +not requiring users to create the traditional configuration file at +%SYSCONFDIR%/zipl.conf. .B Boot menu