kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Makefile: Avoid installing files in /etc
@ 2022-05-04 16:57 Guilherme G. Piccoli
  2022-05-11  1:50 ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
  0 siblings, 1 reply; 4+ messages in thread
From: Guilherme G. Piccoli @ 2022-05-04 16:57 UTC (permalink / raw)
  To: kexec

Some Linux distros rely on having files in /etc (Debian, et al.),
others in *not* having them in such directory (like Arch Linux).
Fact is that the former distros have no issues in installing files
elsewhere, whereas Arch has issues in installing files on /etc,
specially if such files are present there when user try to reinstall
the packages - it fails. Arch packaging doesn't try to be smart as dpkg
for example (that compares config files to determine if user changed that).

With all of that said, this patch moves the sample conf file to
/usr/share, a move that is well-tolerated in all distros and shouldn't
cause regressions in packaging. Also, if some Linux distribution likes
the idea of adding files in /etc, they can tune it in their packaging
configuration scripts for makedumpfile, but we shouldn't have that
as default in the Makefile. Notice that this patch intentionally skips
the change for the .spec file, which aims specific distros, by creating
RPM packages.

Cc: Coiby Xu <coxu@redhat.com>
Cc: Kazuhito Hagio <k-hagio-ab@nec.com>
Cc: Leonidas Spyropoulos <artafinde@archlinux.org>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index cc6b0120aa7d..014be8110836 100644
--- a/Makefile
+++ b/Makefile
@@ -130,6 +130,6 @@ install:
 	install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl
 	install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8
 	install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5
-	install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/etc/makedumpfile.conf.sample
 	mkdir -p ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts
+	install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/usr/share/makedumpfile-${VERSION}/makedumpfile.conf.sample
 	install -m 644 -t ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts/ $(VPATH)eppic_scripts/*
-- 
2.36.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] Makefile: Avoid installing files in /etc
  2022-05-04 16:57 [PATCH] Makefile: Avoid installing files in /etc Guilherme G. Piccoli
@ 2022-05-11  1:50 ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
  2022-05-11 11:40   ` Guilherme G. Piccoli
  0 siblings, 1 reply; 4+ messages in thread
From: HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?= @ 2022-05-11  1:50 UTC (permalink / raw)
  To: kexec

-----Original Message-----
> Some Linux distros rely on having files in /etc (Debian, et al.),
> others in *not* having them in such directory (like Arch Linux).
> Fact is that the former distros have no issues in installing files
> elsewhere, whereas Arch has issues in installing files on /etc,
> specially if such files are present there when user try to reinstall
> the packages - it fails. Arch packaging doesn't try to be smart as dpkg
> for example (that compares config files to determine if user changed that).
> 
> With all of that said, this patch moves the sample conf file to
> /usr/share, a move that is well-tolerated in all distros and shouldn't
> cause regressions in packaging. Also, if some Linux distribution likes
> the idea of adding files in /etc, they can tune it in their packaging
> configuration scripts for makedumpfile, but we shouldn't have that
> as default in the Makefile.

Fair enough, and as far as I've checked:

- The makedumpfile.conf.sample file does not need to be in /etc, because
makedumpfile does not have any default path for it and reads a config
file only when specified with --config option.
(and IMO it's better to place such a sample config file, used rarely,
in /usr/share.)

- Fedora/RHEL kexec-tools packaging does not use "make install" and have
their own install command, at least this patch will not affect them:
https://src.fedoraproject.org/rpms/kexec-tools/blob/main/f/kexec-tools.spec#_225

- Debian/Ubuntu makedumpfile packages apparently do not have the file:
https://packages.debian.org/sid/amd64/makedumpfile/filelist

On the whole I will accept this.

> Notice that this patch intentionally skips
> the change for the .spec file, which aims specific distros, by creating
> RPM packages.

However, the .spec file depends on "make install", so I will add this:

diff --git a/makedumpfile.spec b/makedumpfile.spec
index ef619b8c8af9..fd9efa0639cc 100644
--- a/makedumpfile.spec
+++ b/makedumpfile.spec
@@ -25,7 +25,6 @@ make LINKTYPE=dynamic
 %install
 rm -rf %{buildroot}
 mkdir -p %{buildroot}/usr/sbin
-mkdir -p %{buildroot}/etc
 mkdir -p %{buildroot}/usr/share/man/man5
 mkdir -p %{buildroot}/usr/share/man/man8
 mkdir -p %{buildroot}/usr/share/%{name}-%{version}/eppic-scripts/
@@ -35,11 +34,11 @@ make install DESTDIR=%{buildroot}
 rm -rf %{buildroot}
 
 %files
-/etc/makedumpfile.conf.sample
 /usr/sbin/makedumpfile
 /usr/sbin/makedumpfile-R.pl
 /usr/share/man/man5/makedumpfile.conf.5.gz
 /usr/share/man/man8/makedumpfile.8.gz
+/usr/share/%{name}-%{version}/makedumpfile.conf.sample
 /usr/share/%{name}-%{version}/eppic_scripts/
 
 %changelog

> 
> Cc: Coiby Xu <coxu@redhat.com>
> Cc: Kazuhito Hagio <k-hagio-ab@nec.com>
> Cc: Leonidas Spyropoulos <artafinde@archlinux.org>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index cc6b0120aa7d..014be8110836 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -130,6 +130,6 @@ install:
>  	install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl
>  	install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8
>  	install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5
> -	install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/etc/makedumpfile.conf.sample
>  	mkdir -p ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts
> +	install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/usr/share/makedumpfile-${VERSION}/makedumpfile.conf.sample
>  	install -m 644 -t ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts/ $(VPATH)eppic_scripts/*
> --
> 2.36.0

The creation of ${DESTDIR}/etc is also not needed, will remove it and merge.

install:
-	install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8 ${DESTDIR}/etc
+	install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8
 	install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl

Please let me know if any problem.

Thanks,
Kazu



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] Makefile: Avoid installing files in /etc
  2022-05-11  1:50 ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
@ 2022-05-11 11:40   ` Guilherme G. Piccoli
  2022-05-12  0:55     ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
  0 siblings, 1 reply; 4+ messages in thread
From: Guilherme G. Piccoli @ 2022-05-11 11:40 UTC (permalink / raw)
  To: kexec

On 10/05/2022 22:50, HAGIO KAZUHITO(?? ??) wrote:
> [...]
> 
> Fair enough, and as far as I've checked:
> 
> - The makedumpfile.conf.sample file does not need to be in /etc, because
> makedumpfile does not have any default path for it and reads a config
> file only when specified with --config option.
> (and IMO it's better to place such a sample config file, used rarely,
> in /usr/share.)
> 
> - Fedora/RHEL kexec-tools packaging does not use "make install" and have
> their own install command, at least this patch will not affect them:
> https://src.fedoraproject.org/rpms/kexec-tools/blob/main/f/kexec-tools.spec#_225
> 
> - Debian/Ubuntu makedumpfile packages apparently do not have the file:
> https://packages.debian.org/sid/amd64/makedumpfile/filelist
> 
> On the whole I will accept this.
> 
>> Notice that this patch intentionally skips
>> the change for the .spec file, which aims specific distros, by creating
>> RPM packages.
> 
> However, the .spec file depends on "make install", so I will add this:
> 
> diff --git a/makedumpfile.spec b/makedumpfile.spec
> index ef619b8c8af9..fd9efa0639cc 100644
> --- a/makedumpfile.spec
> +++ b/makedumpfile.spec
> @@ -25,7 +25,6 @@ make LINKTYPE=dynamic
>  %install
>  rm -rf %{buildroot}
>  mkdir -p %{buildroot}/usr/sbin
> -mkdir -p %{buildroot}/etc
>  mkdir -p %{buildroot}/usr/share/man/man5
>  mkdir -p %{buildroot}/usr/share/man/man8
>  mkdir -p %{buildroot}/usr/share/%{name}-%{version}/eppic-scripts/
> @@ -35,11 +34,11 @@ make install DESTDIR=%{buildroot}
>  rm -rf %{buildroot}
>  
>  %files
> -/etc/makedumpfile.conf.sample
>  /usr/sbin/makedumpfile
>  /usr/sbin/makedumpfile-R.pl
>  /usr/share/man/man5/makedumpfile.conf.5.gz
>  /usr/share/man/man8/makedumpfile.8.gz
> +/usr/share/%{name}-%{version}/makedumpfile.conf.sample
>  /usr/share/%{name}-%{version}/eppic_scripts/
>  
>  %changelog
> 
>> [...]
> The creation of ${DESTDIR}/etc is also not needed, will remove it and merge.
> 
> install:
> -	install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8 ${DESTDIR}/etc
> +	install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8
>  	install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl
> 
> Please let me know if any problem.
> 
> Thanks,
> Kazu
> 

Hi Kazu, this is perfect - thanks a bunch for the great analysis. Feel
free to merge with your changes, it's much appreciated =)

Cheers,


Guilherme


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Makefile: Avoid installing files in /etc
  2022-05-11 11:40   ` Guilherme G. Piccoli
@ 2022-05-12  0:55     ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
  0 siblings, 0 replies; 4+ messages in thread
From: HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?= @ 2022-05-12  0:55 UTC (permalink / raw)
  To: kexec

-----Original Message-----
> On 10/05/2022 22:50, HAGIO KAZUHITO(?? ??) wrote:
> > [...]
> >
> > Fair enough, and as far as I've checked:
> >
> > - The makedumpfile.conf.sample file does not need to be in /etc, because
> > makedumpfile does not have any default path for it and reads a config
> > file only when specified with --config option.
> > (and IMO it's better to place such a sample config file, used rarely,
> > in /usr/share.)
> >
> > - Fedora/RHEL kexec-tools packaging does not use "make install" and have
> > their own install command, at least this patch will not affect them:
> > https://src.fedoraproject.org/rpms/kexec-tools/blob/main/f/kexec-tools.spec#_225
> >
> > - Debian/Ubuntu makedumpfile packages apparently do not have the file:
> > https://packages.debian.org/sid/amd64/makedumpfile/filelist
> >
> > On the whole I will accept this.
> >
> >> Notice that this patch intentionally skips
> >> the change for the .spec file, which aims specific distros, by creating
> >> RPM packages.
> >
> > However, the .spec file depends on "make install", so I will add this:
> >
> > diff --git a/makedumpfile.spec b/makedumpfile.spec
> > index ef619b8c8af9..fd9efa0639cc 100644
> > --- a/makedumpfile.spec
> > +++ b/makedumpfile.spec
> > @@ -25,7 +25,6 @@ make LINKTYPE=dynamic
> >  %install
> >  rm -rf %{buildroot}
> >  mkdir -p %{buildroot}/usr/sbin
> > -mkdir -p %{buildroot}/etc
> >  mkdir -p %{buildroot}/usr/share/man/man5
> >  mkdir -p %{buildroot}/usr/share/man/man8
> >  mkdir -p %{buildroot}/usr/share/%{name}-%{version}/eppic-scripts/
> > @@ -35,11 +34,11 @@ make install DESTDIR=%{buildroot}
> >  rm -rf %{buildroot}
> >
> >  %files
> > -/etc/makedumpfile.conf.sample
> >  /usr/sbin/makedumpfile
> >  /usr/sbin/makedumpfile-R.pl
> >  /usr/share/man/man5/makedumpfile.conf.5.gz
> >  /usr/share/man/man8/makedumpfile.8.gz
> > +/usr/share/%{name}-%{version}/makedumpfile.conf.sample
> >  /usr/share/%{name}-%{version}/eppic_scripts/
> >
> >  %changelog
> >
> >> [...]
> > The creation of ${DESTDIR}/etc is also not needed, will remove it and merge.
> >
> > install:
> > -	install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8
> ${DESTDIR}/etc
> > +	install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8
> >  	install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl
> >
> > Please let me know if any problem.
> >
> > Thanks,
> > Kazu
> >
> 
> Hi Kazu, this is perfect - thanks a bunch for the great analysis. Feel
> free to merge with your changes, it's much appreciated =)

Thanks, applied with the changes.
https://github.com/makedumpfile/makedumpfile/commit/09b5c879b9f787c52f1963555d8d46127c457f2a

Kazu


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-12  0:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 16:57 [PATCH] Makefile: Avoid installing files in /etc Guilherme G. Piccoli
2022-05-11  1:50 ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=
2022-05-11 11:40   ` Guilherme G. Piccoli
2022-05-12  0:55     ` HAGIO KAZUHITO =?unknown-8bit?b?6JCp5bC+IOS4gOS7gQ==?=

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).