From feb2b85dfdae60f4d87004e6131a5b2bc1fceb9f0782e6cd7bdc9dfeaa6e7978 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Sun, 24 Feb 2019 16:14:54 +0000 Subject: [PATCH] Accepting request 677164 from devel:kubic OBS-URL: https://build.opensuse.org/request/show/677164 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/microos-tools?expand=0&rev=1 --- .gitattributes | 23 + .gitignore | 1 + _service | 15 + _servicedata | 6 + create_autoyast_profile.pl | 482 +++++++++++++++++++ microos-tools-1.0+git20190218.9e72dd7.tar.xz | 3 + microos-tools.changes | 367 ++++++++++++++ microos-tools.spec | 75 +++ 8 files changed, 972 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 _servicedata create mode 100644 create_autoyast_profile.pl create mode 100644 microos-tools-1.0+git20190218.9e72dd7.tar.xz create mode 100644 microos-tools.changes create mode 100644 microos-tools.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..e3d2729 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + 1.0 + 1.0+git%cd.%h + git://github.com/kubic-project/microos-tools.git + git + enable + kukuk@suse.de + + + xz + *.tar + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..63a9a39 --- /dev/null +++ b/_servicedata @@ -0,0 +1,6 @@ + + + git://github.com/kubic-project/microos-tools.git + 9e72dd715157ffd9019b4d80e973218144accca8 + + \ No newline at end of file diff --git a/create_autoyast_profile.pl b/create_autoyast_profile.pl new file mode 100644 index 0000000..29371ed --- /dev/null +++ b/create_autoyast_profile.pl @@ -0,0 +1,482 @@ +#!/usr/bin/perl +# +# Copyright (C) 2017 Thorsten Kukuk +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# in Version 2 or later as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, see . +# + +=head1 NAME + + create_autoyast_profile - Create autoyast profile for SUSE CaaSP + +=head1 SYNOPSIS + + create_autoyast_profile [options] + +=head1 DESCRIPTION + + Create an autoyast profile for fully automatic installation of + SUSE Container as a Service Platform Cluster Node. + +=head1 OPTIONS + + -o|--output file Write autoyast profile as 'file' to disk + --salt-master Specify the name of the salt master server + --ntp-server Specify name of ntp server + --smt-url Specify url of SMT server + --regcode Specify registration code for SUSE CaaSP + --reg-email Specify email address for registration + --usage Print usage + -h|-?|--help Help + +=cut + +use strict; +use warnings; +use locale; +use Pod::Usage; +use Getopt::Long; +use Net::Domain qw(hostname hostfqdn); +use JSON qw(decode_json); + +my $outputfile = "-"; +my $saltmaster = hostfqdn(); +my $ntp_server = ""; +my $smturl = ""; +my $reg_email = ""; +my $regcode = ""; +my $help = 0; +my $man = 0; +my $usage = 0; + +GetOptions('o|output=s' => \$outputfile, + 'salt-master=s' => \$saltmaster, + 'smt-url=s' => \$smturl, + 'reg-email=s' => \$reg_email, + 'regcode=s' => \$regcode, + 'ntp-server=s'=>\$ntp_server, + 'man' => \$man, + 'u|usage' => \$usage, + 'help|h|?' => \$help) or pod2usage(2); +pod2usage(0) if $help; +pod2usage(-exitstatus => 0, -verbose => 2) if $man; +pod2usage(-exitstatus => 0, -verbose => 0) if $usage; + + + +open(OUTPUT,">$outputfile") || die("Can't open output file $outputfile: $!."); + +print_header(); +print_bootloader(); +print_general_section(); +print_languages(); +setup_networking(); +setup_ntp(); +print_software(); +print_services(); +print_scripts(); +set_root_password(); +setup_registration(); +setup_salt_minion(); +print_footer(); + +close(OUTPUT); + +#------------------------------------------------------------------------------ + +sub print_header { + print OUTPUT <<"HeaderText"; + + + +HeaderText +} + +#------------------------------------------------------------------------------ + +sub print_footer { + print OUTPUT <<"EOT"; + +EOT +} + +#------------------------------------------------------------------------------ + +sub print_bootloader { + print OUTPUT <<"EOT"; + + + true + auto + false + false + gfxterm + 8 + true + + +EOT +} + +#------------------------------------------------------------------------------ + +sub print_general_section { + print OUTPUT <<"EOT"; + + + + false + false + false + + + + align_optimal + false + + + + + all + + + /boot/efi + 200mb + 1 + vfat + + + / + 30gb + + + btrfs + /var/lib/docker + max + + + + + + false + false + +EOT +} + +#------------------------------------------------------------------------------ + +sub print_languages { + print OUTPUT <<"EOT"; + + english-us + + + en_US + + + + UTC + Etc/GMT + +EOT +} + +#------------------------------------------------------------------------------ + +sub set_root_password { + + my $password = "!"; + my $encrypted = "true"; + + open(PASSWD, '/etc/passwd'); + while () { + chomp; + my($login, $passwd, $uid, $gid, $gcos, $home, $shell) = split(/:/); + + if ($login eq "root") { + if ($passwd eq "x") { + if (open(SHADOW, '/etc/shadow')) { + while () { + chomp; + my($slogin, $spasswd, $sp_lstchg, $sp_min, $sp_max, + $sp_warn, $sp_inact, $sp_expire, $sp_flag) = split(/:/); + if ($slogin eq "root") { + $password = $spasswd; + $encrypted = "true"; + } + } + close(SHADOW); + } + } else { + $password = $passwd; + } + } + } + close(PASSWD); + + print OUTPUT <<"EOT"; + + + root +EOT + +print OUTPUT " $password\n"; +print OUTPUT " $encrypted\n"; + + print OUTPUT <<"EOT" + + +EOT +} + +#------------------------------------------------------------------------------ + +sub print_software { + print OUTPUT <<"EOT"; + + + false + + + SUSE-MicroOS + SUSE-MicroOS-hardware + SUSE-MicroOS-apparmor + SUSE-CaaSP-Stack + + +EOT +} + +#------------------------------------------------------------------------------ + +sub print_services { + print OUTPUT <<"EOT"; + + multi-user + + + purge-kernels + + + sshd + cloud-init-local + cloud-init + cloud-config + cloud-final + issue-generator + issue-add-ssh-keys + docker + container-feeder +EOT + print OUTPUT " salt-minion\n" if ($saltmaster ne ""); + print OUTPUT " systemd-timesyncd\n" if ($ntp_server eq ""); + print OUTPUT <<"EOT"; + + + +EOT +} + +#------------------------------------------------------------------------------ + +sub print_scripts { + + if ($saltmaster ne "" || $ntp_server eq "") { + print OUTPUT <<"EOT"; + + +EOT + if ($saltmaster ne "") { + print OUTPUT <<"EOT"; + +EOT +} + if ($ntp_server eq "") { + print OUTPUT <<"EOT"; + +EOT +} + print OUTPUT " \n"; + print OUTPUT " \n"; + } +} + +#------------------------------------------------------------------------------ + +sub find_smturl { + if (open(INPUTFILE, ") { + chomp; + if ( $_ =~ m/^url:/ ) { + $_ =~ s/url: //; + close (INPUTFILE); + return $_; + } + } + } + close (INPUTFILE); + return ""; +} + +sub setup_registration { + my $is_active = 0; + + if ($smturl ne "" || $regcode ne "") { + $is_active = 1; + } else { + my $connectoutput = `/usr/sbin/SUSEConnect -s 2>/dev/null`; + if ($? == 0) { + my $decoded = decode_json($connectoutput); + foreach my $prod ( @{$decoded} ) { + if ($prod->{"identifier"} eq "CAASP") { + $regcode = $prod->{"regcode"} if ($regcode eq ""); + $is_active = 1 if ($prod->{"status"} eq "Registered"); + } + } + } + } + + print OUTPUT " \n"; + if ($is_active) { + $smturl = find_smturl() if ($smturl eq ""); + + print OUTPUT " true\n"; + print OUTPUT " $reg_email\n" unless ($reg_email eq ""); + print OUTPUT " $regcode\n" if (defined $regcode && $regcode ne ""); + print OUTPUT " true\n"; + print OUTPUT " false\n"; + print OUTPUT " $smturl\n" if ($smturl ne ""); + } else { + print OUTPUT " false\n"; + } + print OUTPUT " \n"; +} + +#------------------------------------------------------------------------------ + +sub setup_salt_minion { + + if ($saltmaster ne "") { + print OUTPUT <<"EOT"; + + + /etc/salt/minion.d/master.conf + + + + root.root + 640 + + +EOT + } +} + +#------------------------------------------------------------------------------ + +sub setup_networking { + print OUTPUT <<"EOT"; + + + + AUTO + + + true + auto + false + + + + dhcp + eth0 + yes + auto + + + static + lo + no + 127.0.0.1 + 255.0.0.0 + 127.0.0.0 + 8 + nfsroot + no + + + true + true + true + false + + false + false + + +EOT +} + +#------------------------------------------------------------------------------ + +sub setup_ntp { + return if ($ntp_server eq ""); + print OUTPUT <<"EOT"; + + false + + +EOT + print OUTPUT "
$ntp_server
\n"; + print OUTPUT <<"EOT"; + iburst + server +
+
+ true + false +
+EOT +} + +#------------------------------------------------------------------------------ diff --git a/microos-tools-1.0+git20190218.9e72dd7.tar.xz b/microos-tools-1.0+git20190218.9e72dd7.tar.xz new file mode 100644 index 0000000..ed6f420 --- /dev/null +++ b/microos-tools-1.0+git20190218.9e72dd7.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02ce3e7731ca9e1278d7d6a3f06916ca4ce200594697be39839582d0cbd14ff5 +size 11312 diff --git a/microos-tools.changes b/microos-tools.changes new file mode 100644 index 0000000..6989d09 --- /dev/null +++ b/microos-tools.changes @@ -0,0 +1,367 @@ +------------------------------------------------------------------- +Mon Feb 18 16:34:12 CET 2019 - kukuk@suse.de + +- Create own standalone microos-tools package + +------------------------------------------------------------------- +Mon Feb 18 11:43:18 UTC 2019 - kukuk@suse.de + +- Update to version 1.0+git20190218.9e72dd7: + * Move SUSE CaaS Platform specific code to CaaSP directory + * Move core files to /var/tmp, /tmp could be tmpfs + * Add service to print environment for debugging + +------------------------------------------------------------------- +Wed Dec 12 14:03:26 UTC 2018 - kukuk@suse.de + +- Update to version 1.0+git20181212.c28b214: + * Store manual page uncompressed + +------------------------------------------------------------------- +Wed Dec 12 13:53:54 UTC 2018 - kukuk@suse.de + +- Update to version 1.0+git20181212.a821c06: + * Add manual page for btrfsQuota + * Fix permissions of btrfsQuota + * Add btrfsQuota command (from btrfs wiki) + +------------------------------------------------------------------- +Fri Dec 07 13:33:51 UTC 2018 - kukuk@suse.de + +- Update to version 1.0+git20181207.2d715d2: + * Don't configure systemd-timesyncd anymore on the cluster nodes, admin has to use the ntp module, which can meanwhile configure everything. + * Fix formating of bash script + * Add service, which watches /etc/sysconfig/proxy and sets the environment variables for systemd services + * Fix product name + * Move cloud-init module for caasp into caasp special sub directory + +------------------------------------------------------------------- +Wed Sep 26 11:47:42 UTC 2018 - kukuk@suse.de + +- Update to version 1.0+git20180926.e9f5cfe: + * Overwrite systemd-coredump for core files, as systemd is not + available in containers. +- Add conflict with systemd-coredump + +------------------------------------------------------------------- +Tue Aug 21 12:15:29 UTC 2018 - kukuk@suse.de + +- Update to version 1.0+git20180821.b2af3a9: + * Start timesyncd service first on cluster nodes. + * Remove start of container-feeder, does not exist anymore on SLE15 + +------------------------------------------------------------------- +Sun Jun 17 09:51:32 CEST 2018 - kukuk@suse.de + +- Create /var/adm/netconfig in %posttrans if still needed after + upgrade + +------------------------------------------------------------------- +Fri Jun 15 12:43:37 CEST 2018 - kukuk@suse.de + +- Update to version 1.0+git20180615.b5e9b2d: + * Move log file to /var/log, add timestamp + +------------------------------------------------------------------- +Fri Jun 15 12:37:21 CEST 2018 - kukuk@suse.de + +- Fix name of migration script + +------------------------------------------------------------------- +Fri Jun 15 11:11:03 CEST 2018 - kukuk@suse.de + +- Update to version 1.0+git20180615.6204c42: + * Save output in logfile +- Fix /var/lock symlink for migration from CaaSP v3 to v4. + +------------------------------------------------------------------- +Wed Jun 13 14:37:56 UTC 2018 - kukuk@suse.de + +- Update to version 1.0+git20180613.53ac895: + * Add migrate-ntp2chrony +- Call migrate-ntp2chrony from posttrans section + +------------------------------------------------------------------- +Wed Jun 13 12:20:34 UTC 2018 - kukuk@suse.de + +- Update to version 1.0+git20180613.b7f1fb1: + * Replace activate.sh call with admin-node-init.service + +------------------------------------------------------------------- +Wed Jun 13 11:47:00 UTC 2018 - kukuk@suse.de + +- Update to version 1.0+git20180613.dddd750: + * Add README.md + +------------------------------------------------------------------- +Mon Mar 5 16:14:05 UTC 2018 - rbrown@suse.com + +- Remove Kubic workaround, will now use caasp-container-manifests + +------------------------------------------------------------------- +Tue Feb 27 16:44:23 CET 2018 - kukuk@suse.de + +- Remove read-only root filesystem stuff, was moved to + read-only-root-fs +- Require read-only-root-fs + +------------------------------------------------------------------- +Wed Feb 21 11:05:54 CET 2018 - kukuk@suse.de + +- Add new hardware and apparmor pattern [bsc#1081620]. + +------------------------------------------------------------------- +Tue Jan 16 10:58:36 UTC 2018 - dimstar@opensuse.org + +- Drop systemd and dracut BuildRequires: allow to better ordering + of parallel builds, and neither of the two BRs brings much + advantage. We just have to own /usr/lib/dracut directories as a + side effect (which is allowed). + +------------------------------------------------------------------- +Tue Jan 9 14:35:10 CET 2018 - kukuk@suse.de + +- create_autoyast_profile.pl: don't create a swap partition + +------------------------------------------------------------------- +Wed Dec 20 19:03:36 CET 2017 - kukuk@suse.de + +- Version 0.27 + - Adjust that we have only /var + +------------------------------------------------------------------- +Sun Dec 17 08:40:36 UTC 2017 - kukuk@suse.com + +- Version 0.26 + - create apparmor overlay only if apparmor is installed + +------------------------------------------------------------------- +Sun Sep 24 13:03:35 CEST 2017 - kukuk@suse.de + +- On fix for cc_suse_caasp.py did go lost + +------------------------------------------------------------------- +Thu Sep 21 19:50:18 UTC 2017 - kukuk@suse.de + +- Move cc_suse_caasp.py out of tar archive and install with in the + right python directory + +------------------------------------------------------------------- +Tue Sep 12 10:18:48 CEST 2017 - kukuk@suse.de + +- setup-fstab.sys-for-overlayfs: adjust to work with building + images with kiwi + +------------------------------------------------------------------- +Tue Aug 29 12:21:02 CEST 2017 - kukuk@suse.de + +- Add /boot/efi partition to the create_autoyast_profile + script [bsc#1055795] + +------------------------------------------------------------------- +Fri Jun 30 13:20:39 CEST 2017 - kukuk@suse.de + +- Fix problem with wrong permissions of /etc/salt. + +------------------------------------------------------------------- +Wed Jun 28 13:07:22 CEST 2017 - kukuk@suse.de + +- Add /etc/salt/minion.d/grains_refresh.conf [bsc#1046212] + +------------------------------------------------------------------- +Tue Jun 27 15:31:06 CEST 2017 - kukuk@suse.de + +- Enable admin-note-setup service on admin node via cloud-init + [bsc#1046161] + +------------------------------------------------------------------- +Thu Jun 22 09:55:58 CEST 2017 - kukuk@suse.de + +- suse_caasp cloud-init module: enable salt-minion on admin node + [bsc#1045350] + +------------------------------------------------------------------- +Wed Jun 7 17:37:19 CEST 2017 - kukuk@suse.de + +- Fix syntax of /etc/fstab.sys for overlayfs mount points + +------------------------------------------------------------------- +Fri Jun 2 09:29:22 CEST 2017 - kukuk@suse.de + +- suse_caasp cloud-init module: fix order of docker start + +------------------------------------------------------------------- +Sat May 27 18:13:36 UTC 2017 - kukuk@suse.com + +- Release version 0.18 +- Enable docker and container-feeder on cluster nodes +- Cleanup build requires + +------------------------------------------------------------------- +Wed May 17 09:05:53 CEST 2017 - kukuk@suse.de + +- Adjust pattern names [bsc#1039432] + +------------------------------------------------------------------- +Tue May 9 15:04:56 CEST 2017 - kukuk@suse.de + +- Add activate.sh for openSUSE Kubic + +------------------------------------------------------------------- +Mon Apr 24 11:40:31 CEST 2017 - kukuk@suse.de + +- create_autoyast_profile: use FQDN [bsc#1035665] + +------------------------------------------------------------------- +Fri Apr 21 13:29:41 CEST 2017 - kukuk@suse.de + +- Fix order: first write config, afterwards start services + +------------------------------------------------------------------- +Fri Apr 21 11:16:06 CEST 2017 - kukuk@suse.de + +- remove not working line from autoyast.xml +- Add COPYING file + +------------------------------------------------------------------- +Thu Apr 20 17:09:50 CEST 2017 - kukuk@suse.de + +- Add suse_caasp cloud-init module +- Fix syntax of 01-network.cfg in case we don't disable cloud-init + network + +------------------------------------------------------------------- +Wed Apr 19 12:56:51 UTC 2017 - kukuk@suse.com + +- Add extra /var/lib/docker partition to autoyast profile + +------------------------------------------------------------------- +Wed Apr 19 09:54:06 CEST 2017 - kukuk@suse.de + +- Add systemd pre/post install macros + +------------------------------------------------------------------- +Tue Apr 18 17:07:30 CEST 2017 - kukuk@suse.de + +- Add apparmor directories for overlayfs + +------------------------------------------------------------------- +Tue Apr 18 16:05:19 CEST 2017 - kukuk@suse.de + +- Fix typo + +------------------------------------------------------------------- +Tue Apr 18 15:02:57 CEST 2017 - kukuk@suse.de + +- If we do the first boot and there is already a configuration file + for the network configuration, don't let cloud-init overwrite + that [bsc#1032497] + +------------------------------------------------------------------- +Wed Apr 12 15:48:50 CEST 2017 - kukuk@suse.de + +- Add systemd service to create minion id [bsc#1031623] + +------------------------------------------------------------------- +Wed Apr 12 13:58:01 CEST 2017 - kukuk@suse.de + +- Use overlayfs for /var/lib/apparmor + +------------------------------------------------------------------- +Sun Apr 2 09:35:51 UTC 2017 - kukuk@suse.de + +- Add ntpd configuration + +------------------------------------------------------------------- +Thu Feb 16 18:07:35 CET 2017 - kukuk@suse.de + +- Remove enabling services workaround + +------------------------------------------------------------------- +Mon Feb 13 14:02:48 CET 2017 - kukuk@suse.de + +- Fix typo in spec file + +------------------------------------------------------------------- +Fri Feb 10 15:11:19 CET 2017 - kukuk@suse.de + +- Add manual page for create_autoyast_profile +- Add script to generate /etc/fstab.sys (mount overlayfs in initrd) + +------------------------------------------------------------------- +Wed Feb 1 18:02:31 CET 2017 - kukuk@suse.de + +- Add workarounds to configure and enable salt-minion in autoyast + profile + +------------------------------------------------------------------- +Sun Jan 29 21:52:49 UTC 2017 - kukuk@suse.de + +- Parse SUSEConnnect -s output for registration information + +------------------------------------------------------------------- +Sun Jan 29 13:51:20 CET 2017 - kukuk@suse.de + +- Disable installer self update in autoyast profile + +------------------------------------------------------------------- +Fri Jan 20 21:19:39 CET 2017 - kukuk@suse.de + +- Adjust for openSUSE support + +------------------------------------------------------------------- +Fri Jan 20 12:14:53 CET 2017 - kukuk@suse.de + +- Replace autoyast profile with script to create it manual + +------------------------------------------------------------------- +Sat Jan 14 10:31:06 CET 2017 - kukuk@suse.de + +- Add autoyast profile caasp.xml + +------------------------------------------------------------------- +Sat Jan 14 10:28:02 CET 2017 - kukuk@suse.de + +- Rename from casp to caasp + +------------------------------------------------------------------- +Mon Dec 19 15:28:28 CET 2016 - kukuk@suse.de + +- Set "hostonly=''" for including overlay kernel module + [bnc#1016007] + +------------------------------------------------------------------- +Wed Dec 14 11:44:21 CET 2016 - kukuk@suse.de + +- Replace hardcoded device with current root device + +------------------------------------------------------------------- +Tue Nov 22 17:24:04 CET 2016 - kukuk@suse.de + +- Move cloud.cfg into own RPM + +------------------------------------------------------------------- +Mon Nov 21 19:24:44 CET 2016 - kukuk@suse.de + +- Rename "stateless" to "overlay", which fits better from the name + +------------------------------------------------------------------- +Tue Nov 15 13:12:53 CET 2016 - kukuk@suse.de + +- Move systemd presets to own package + +------------------------------------------------------------------- +Sun Nov 13 17:40:16 CET 2016 - kukuk@suse.de + +- Update cloud.cfg + +------------------------------------------------------------------- +Sun Nov 13 10:55:45 CET 2016 - kukuk@suse.de + +- Enable logrotate.timer per default + +------------------------------------------------------------------- +Mon Oct 24 15:02:01 CEST 2016 - kukuk@suse.de + +- Initial version with new name + diff --git a/microos-tools.spec b/microos-tools.spec new file mode 100644 index 0000000..14ea010 --- /dev/null +++ b/microos-tools.spec @@ -0,0 +1,75 @@ +# +# spec file for package microos-tools +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: microos-tools +Version: 1.0+git20190218.9e72dd7 +Release: 0 +Summary: Files and Scripts for openSUSE MicroOS +License: GPL-2.0-or-later +Group: Development/Tools/Other +URL: https://github.com/kubic-project/microos-tools +Source0: microos-tools-%{version}.tar.xz +Source1: create_autoyast_profile.pl +BuildRequires: distribution-release +Requires: read-only-root-fs +Conflicts: systemd-coredump +Obsoletes: caasp-tools +BuildArch: noarch + +%description +Files, scripts and directories for openSUSE Kubic. + +%prep +%setup -q + +%build + +%install +cp -a {etc,usr} %{buildroot} +mkdir -p %{buildroot}%{_sbindir} +install %{SOURCE1} %{buildroot}%{_sbindir}/create_autoyast_profile +mkdir -p %{buildroot}%{_mandir}/man8 +pod2man %{SOURCE1} > %{buildroot}%{_mandir}/man8/create_autoyast_profile.8 + +%pre +%service_add_pre setup-systemd-proxy-env.service + +%post +%service_add_post setup-systemd-proxy-env.service + +%preun +%service_del_preun setup-systemd-proxy-env.service + +%postun +%service_del_postun setup-systemd-proxy-env.service + +%files +%license COPYING +%config %{_sysconfdir}/systemd/system/systemd-firstboot.service +%dir %{_sysconfdir}/systemd +%dir %{_sysconfdir}/systemd/system +%{_unitdir} +%{_prefix}/lib/sysctl.d/51-corefiles.conf +%{_libexecdir}/MicroOS-firstboot +%{_sbindir}/btrfsQuota +%{_sbindir}/create_autoyast_profile +%{_sbindir}/setup-systemd-proxy-env +%{_mandir}/man8/btrfsQuota.8%{?ext_man} +%{_mandir}/man8/create_autoyast_profile.8%{?ext_man} + +%changelog