create core package

This commit is contained in:
aydemir
2015-02-24 11:18:35 +02:00
parent 0e4b743b82
commit 70b25d0f95
1098 changed files with 169545 additions and 0 deletions
+91
View File
@@ -0,0 +1,91 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt
from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
pisitools.cflags.add("-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64")
pisitools.cflags.sub("-O[\d]", "-Os")
def setup():
shelltools.export("SUID_CFLAGS", "-fpie")
shelltools.export("SUID_LDFLAGS", "-pie -Wl,-z,relro -Wl,-z,now")
shelltools.export("AUTOPOINT", "/bin/true")
options = "\
--disable-rpath \
--disable-silent-rules \
--disable-use-tty-group \
--disable-su \
--disable-last \
--disable-mesg \
--disable-vipw \
--disable-wall \
--disable-login \
--disable-newgrp \
--disable-nologin \
--disable-runuser \
--disable-sulogin \
--disable-utmpdump \
--disable-chfn-chsh \
--disable-mountpoint \
--disable-makeinstall-chown \
--disable-socket-activation \
"
if get.buildTYPE() == "emul32":
options += "\
--prefix=/emul32 \
--bindir=/emul32/bin \
--sbindir=/emul32/sbin \
--libdir=/usr/lib32 \
--without-ncurses \
--disable-static \
--disable-partx \
--disable-raw \
--disable-write \
--disable-mount \
--disable-fsck \
--disable-libmount \
--with-audit=no \
"
else:
options += "\
--bindir=/bin \
--sbindir=/sbin \
--enable-static \
--enable-partx \
--enable-raw \
--enable-write \
--enable-tunelp \
--with-audit \
--with-udev \
--with-utempter \
"
autotools.autoreconf("-fi")
autotools.configure(options)
pisitools.dosed("libtool", "( -shared )", r" -Wl,--as-needed\1")
# Extra fedora switches:
# --enable-login-utils will enable some utilities we ship in shadow
# --enable-kill will enable the kill utility we ship in coreutils
def build():
autotools.make()
def install():
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
#pisitools.doman("sys-utils/klogconsole.man")
pisitools.remove("/usr/share/man/man1/kill.1")
if get.buildTYPE() == "emul32": return
pisitools.dodoc("ABOUT-NLS", "AUTHORS", "ChangeLog", "COPYING", "README*")
pisitools.insinto("/%s/%s" % (get.docDIR(), get.srcNAME()), "Documentation")
@@ -0,0 +1,98 @@
From 6c373810f5b1d32824371e9dff6ee5a006388f98 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 20 Feb 2014 16:59:11 +0100
Subject: [PATCH] libmount: FS id and parent ID could be zero
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It seems that linux 3.14 is able to produce things like:
19 0 8:3 / / rw,relatime - ext4 /dev/sda3 rw,data=ordered
^
Reported-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libmount/src/tab.c | 12 ++++--------
misc-utils/findmnt.c | 5 +++--
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 4c2f8a4..332312b 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -505,7 +505,7 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root)
assert(tb);
assert(root);
- if (!tb || !root)
+ if (!tb || !root || !is_mountinfo(tb))
return -EINVAL;
DBG(TAB, mnt_debug_h(tb, "lookup root fs"));
@@ -515,8 +515,6 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root)
mnt_reset_iter(&itr, MNT_ITER_FORWARD);
while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
int id = mnt_fs_get_parent_id(fs);
- if (!id)
- break; /* @tab is not a mountinfo file? */
if (!*root || id < root_id) {
*root = fs;
@@ -524,7 +522,7 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root)
}
}
- return root_id ? 0 : -EINVAL;
+ return *root ? 0 : -EINVAL;
}
/**
@@ -545,15 +543,13 @@ int mnt_table_next_child_fs(struct libmnt_table *tb, struct libmnt_iter *itr,
struct libmnt_fs *fs;
int parent_id, lastchld_id = 0, chld_id = 0;
- if (!tb || !itr || !parent)
+ if (!tb || !itr || !parent || !is_mountinfo(tb))
return -EINVAL;
DBG(TAB, mnt_debug_h(tb, "lookup next child of '%s'",
mnt_fs_get_target(parent)));
parent_id = mnt_fs_get_id(parent);
- if (!parent_id)
- return -EINVAL;
/* get ID of the previously returned child */
if (itr->head && itr->p != itr->head) {
@@ -584,7 +580,7 @@ int mnt_table_next_child_fs(struct libmnt_table *tb, struct libmnt_iter *itr,
}
}
- if (!chld_id)
+ if (!*chld)
return 1; /* end of iterator */
/* set the iterator to the @chld for the next call */
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index fb21174..988cd73 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -822,8 +822,9 @@ static int tab_is_tree(struct libmnt_table *tb)
if (!itr)
return 0;
- if (mnt_table_next_fs(tb, itr, &fs) == 0)
- rc = mnt_fs_get_id(fs) > 0 && mnt_fs_get_parent_id(fs) > 0;
+ rc = (mnt_table_next_fs(tb, itr, &fs) == 0 &&
+ mnt_fs_is_kernel(fs) &&
+ mnt_fs_get_root(fs));
mnt_free_iter(itr);
return rc;
--
1.9.1
@@ -0,0 +1,59 @@
From 751c39383adaf5ff5a860516238d524b0e20f835 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Wed, 2 Apr 2014 10:41:30 -0400
Subject: [PATCH] switch_root: verify initramfs by f_type, not devno
As of linux 3.14, the initramfs device will have both major and
minor 0, causing our paranoia check to fail. Make this version agnostic
by checking the filesystem type, rather than a device number.
[adopted from master for backport into 2.24.x branch]
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
sys-utils/switch_root.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/sys-utils/switch_root.c b/sys-utils/switch_root.c
index f26f7da..40e222d 100644
--- a/sys-utils/switch_root.c
+++ b/sys-utils/switch_root.c
@@ -23,6 +23,7 @@
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/statfs.h>
#include <sys/param.h>
#include <fcntl.h>
#include <stdio.h>
@@ -33,6 +34,8 @@
#include <ctype.h>
#include <dirent.h>
+#include <linux/magic.h>
+
#include "c.h"
#include "nls.h"
#include "closestream.h"
@@ -174,12 +177,12 @@ static int switchroot(const char *newroot)
if (cfd >= 0) {
pid = fork();
if (pid <= 0) {
- if (fstat(cfd, &sb) == 0) {
- if (sb.st_dev == makedev(0, 1))
- recursiveRemove(cfd);
- else
- warn(_("old root filesystem is not an initramfs"));
- }
+ struct statfs stfs;
+ if (fstatfs(cfd, &stfs) == 0 &&
+ (stfs.f_type == RAMFS_MAGIC || stfs.f_type == TMPFS_MAGIC))
+ recursiveRemove(cfd);
+ else
+ warn(_("old root filesystem is not an initramfs"));
if (pid == 0)
exit(EXIT_SUCCESS);
--
1.9.1
@@ -0,0 +1,46 @@
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 3633b6a..8ae49c8 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -47,6 +47,20 @@
#include "strutils.h"
#include "loopdev.h"
+static int is_mountinfo(struct libmnt_table *tb)
+{
+ struct libmnt_fs *fs;
+
+ if (!tb)
+ return 0;
+
+ fs = list_first_entry(&tb->ents, struct libmnt_fs, ents);
+ if (fs && mnt_fs_is_kernel(fs) && mnt_fs_get_root(fs))
+ return 1;
+
+ return 0;
+}
+
/**
* mnt_new_table:
*
@@ -1229,20 +1335,6 @@ err:
return NULL;
}
-static int is_mountinfo(struct libmnt_table *tb)
-{
- struct libmnt_fs *fs;
-
- if (!tb)
- return 0;
-
- fs = list_first_entry(&tb->ents, struct libmnt_fs, ents);
- if (fs && mnt_fs_is_kernel(fs) && mnt_fs_get_root(fs))
- return 1;
-
- return 0;
-}
-
/**
* mnt_table_is_fs__mounted:
* @tb: /proc/self/mountinfo file
@@ -0,0 +1,12 @@
diff -Nuar util-linux-2.21.2.orig/libblkid/src/superblocks/ntfs.c util-linux-2.21.2/libblkid/src/superblocks/ntfs.c
--- util-linux-2.21.2.orig/libblkid/src/superblocks/ntfs.c 2012-05-24 13:22:56.000000000 +0300
+++ util-linux-2.21.2/libblkid/src/superblocks/ntfs.c 2012-06-05 14:21:57.967967774 +0300
@@ -160,7 +160,7 @@
const struct blkid_idinfo ntfs_idinfo =
{
- .name = "ntfs",
+ .name = "ntfs-3g",
.usage = BLKID_USAGE_FILESYSTEM,
.probefunc = probe_ntfs,
.magics =
@@ -0,0 +1,11 @@
diff -up util-linux-2.21-rc1/login-utils/login.c.kzak util-linux-2.21-rc1/login-utils/login.c
--- util-linux-2.21-rc1/login-utils/login.c.kzak 2012-01-19 13:19:54.886299587 +0100
+++ util-linux-2.21-rc1/login-utils/login.c 2012-01-19 13:20:40.853451212 +0100
@@ -499,7 +499,7 @@ static void log_lastlog(struct login_con
if (!cxt->pwd)
return;
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
if (fd < 0)
return;
+219
View File
@@ -0,0 +1,219 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>util-linux</Name>
<Homepage>http://userweb.kernel.org/~kzak/util-linux-ng/</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>GPLv2</License>
<IsA>app:console</IsA>
<IsA>library</IsA>
<Summary>Various useful Linux utilities</Summary>
<Description>The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function.</Description>
<Archive sha1sum="ecf75bbb77bba874fc11fc27423aa67b395b7ae5" type="tarxz">http://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.1.tar.xz</Archive>
<BuildDependencies>
<Dependency>zlib</Dependency>
<Dependency>audit</Dependency>
<Dependency>shadow</Dependency>
<Dependency>ncurses</Dependency>
<Dependency>libcap-ng-devel</Dependency>
<Dependency releaseFrom="2">utempter-devel</Dependency>
</BuildDependencies>
<Patches>
<Patch level="1">ntfs-3g.patch</Patch>
<Patch level="1">0001-libmount-FS-id-and-parent-ID-could-be-zero.patch</Patch>
<Patch level="1">0001-switch_root-verify-initramfs-by-f_type-not-devno.patch</Patch>
<Patch level="1">move_is_mountinfo.patch</Patch>
<!-- makeing /var/log/lastlog -->
<Patch level="1">upstream/util-linux-ng-2.21-login-lastlog.patch</Patch>
</Patches>
</Source>
<Package>
<Name>util-linux</Name>
<RuntimeDependencies>
<Dependency version="current">libuuid</Dependency>
<Dependency version="current">libblkid</Dependency>
<Dependency>zlib</Dependency>
<Dependency>perl</Dependency>
<Dependency>audit</Dependency>
<Dependency>ncurses</Dependency>
<Dependency>libudev</Dependency>
<Dependency>utempter</Dependency>
<Dependency>libcap-ng</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="config">/etc</Path>
<Path fileType="executable">/bin</Path>
<Path fileType="executable">/sbin</Path>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="executable">/usr/sbin</Path>
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="man">/usr/share/man</Path>
<Path fileType="info">/usr/share/info</Path>
<Path fileType="data">/usr/share/misc</Path>
<Path fileType="data">/usr/share/getopt</Path>
<Path fileType="data">/usr/share/bash-completion/completions</Path>
<Path fileType="localedata">/usr/share/locale</Path>
<Path fileType="header">/usr/include</Path>
<Path fileType="library">/usr/lib</Path>
<Path fileType="library">/lib</Path>
</Files>
</Package>
<Package>
<Name>uuidd</Name>
<IsA>service</IsA>
<IsA>app:console</IsA>
<PartOf>util.misc</PartOf>
<Summary>Helper daemon to guarantee uniqueness of time-based UUIDs</Summary>
<RuntimeDependencies>
<Dependency>libuuid</Dependency>
</RuntimeDependencies>
<!-- FIXME: Add COMAR service -->
<Files>
<Path fileType="executable">/usr/bin/uuidgen</Path>
<Path fileType="executable">/usr/sbin/uuidd</Path>
<Path fileType="man">/usr/share/man/man1/uuidgen.1</Path>
<Path fileType="man">/usr/share/man/man8/uuidd.8</Path>
</Files>
</Package>
<Package>
<Name>libuuid</Name>
<IsA>library</IsA>
<Summary>A library for UUID processing</Summary>
<Files>
<Path fileType="man">/usr/share/man/man3/uuid*</Path>
<Path fileType="library">/lib/libuuid.*</Path>
<Path fileType="library">/usr/lib/libuuid.so</Path>
</Files>
</Package>
<Package>
<Name>libuuid-devel</Name>
<IsA>header</IsA>
<PartOf>system.devel</PartOf>
<Summary>libuuid header files</Summary>
<RuntimeDependencies>
<Dependency release="current">libuuid</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/uuid/*</Path>
<Path fileType="data">/usr/lib/pkgconfig/</Path>
<Path fileType="data">/usr/lib32/pkgconfig/uuid.pc</Path>
<Path fileType="data">/usr/lib32/pkgconfig/blkid.pc</Path>
</Files>
</Package>
<Package>
<Name>libblkid</Name>
<IsA>library</IsA>
<Summary>A library for block device identifying</Summary>
<RuntimeDependencies>
<Dependency>libuuid</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="man">/usr/share/man/man3/libblkid*</Path>
<Path fileType="man">/usr/share/man/man8/blkid*</Path>
<Path fileType="library">/lib/libblkid.*</Path>
<Path fileType="library">/usr/lib/libblkid.so</Path>
</Files>
</Package>
<Package>
<Name>libblkid-devel</Name>
<IsA>header</IsA>
<PartOf>system.devel</PartOf>
<Summary>libblkid header files</Summary>
<RuntimeDependencies>
<Dependency release="current">libblkid</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/blkid/*</Path>
<Path fileType="data">/usr/lib/pkgconfig/blkid.pc</Path>
</Files>
</Package>
<Package>
<Name>libuuid-32bit</Name>
<PartOf>emul32</PartOf>
<Summary>32-bit shared libraries for libuuid</Summary>
<BuildType>emul32</BuildType>
<RuntimeDependencies>
<Dependency release="current">libuuid</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib32/libuuid.*</Path>
</Files>
</Package>
<Package>
<Name>libblkid-32bit</Name>
<PartOf>emul32</PartOf>
<Summary>32-bit shared libraries for libblkid</Summary>
<BuildType>emul32</BuildType>
<RuntimeDependencies>
<Dependency release="current">libblkid</Dependency>
<Dependency release="current">libuuid-32bit</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib32/libblkid.*</Path>
</Files>
</Package>
<History>
<Update release="7">
<Date>2014-05-11</Date>
<Version>2.24.1</Version>
<Comment>Release bump.</Comment>
<Name>Marcin Bojara</Name>
<Email>marcin@pisilinux.org</Email>
</Update>
<Update release="6">
<Date>2014-04-08</Date>
<Version>2.24.1</Version>
<Comment>Version bump.</Comment>
<Name>Marcin Bojara</Name>
<Email>marcin@pisilinux.org</Email>
</Update>
<Update release="5">
<Date>2014-01-20</Date>
<Version>2.24</Version>
<Comment>Version bump.</Comment>
<Name>Marcin Bojara</Name>
<Email>marcin@pisilinux.org</Email>
</Update>
<Update release="4">
<Date>2013-07-27</Date>
<Version>2.22.2</Version>
<Comment>Move pc files to devel pack, rebuild</Comment>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Update>
<Update release="3">
<Date>2013-07-26</Date>
<Version>2.22.2</Version>
<Comment>Release bump for rebuild.</Comment>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Update>
<Update release="2">
<Date>2013-01-14</Date>
<Version>2.22.2</Version>
<Comment>New release</Comment>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2012-11-17</Date>
<Version>2.22.1</Version>
<Comment>First release</Comment>
<Name>Marcin Bojara</Name>
<Email>marcin@pisilinux.org</Email>
</Update>
</History>
</PISI>
+29
View File
@@ -0,0 +1,29 @@
<?xml version="1.0" ?>
<PISI>
<Source>
<Name>util-linux</Name>
<Summary xml:lang="tr">Çeşitli kullanışlı Linux araçları</Summary>
<Summary xml:lang="fr">Divers utilitaires Linux utiles.</Summary>
<Description xml:lang="tr">util-linux paketi, bir Linux sisteminin işlevsel olması için gerekli olan birçok düşük seviye sistem uygulamasını içerir.</Description>
</Source>
<Package>
<Name>libuuid</Name>
<Summary xml:lang="tr">UUID üretimi için bir kitaplık</Summary>
</Package>
<Package>
<Name>libblkid</Name>
<Summary xml:lang="tr">Disk tanımlama için bir kitaplık</Summary>
</Package>
<Package>
<Name>uuidd</Name>
<Summary xml:lang="tr">Zaman tabanlı UUID'lerin benzersizliğini garantileyen sistem hizmeti</Summary>
</Package>
<Package>
<Name>libuuid-32bit</Name>
<Summary xml:lang="tr">libuuid için 32-bit paylaşımlı kitaplıklar</Summary>
</Package>
</PISI>