Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd #9902

Closed
wants to merge 61 commits into from
Closed

systemd #9902

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8962dcc
simple systemd trial
scopatz Jul 5, 2019
f87d4fd
some fixes
scopatz Jul 5, 2019
cbd8359
Merge branch 'master' into systemd
scopatz Sep 19, 2019
8533973
python dep
scopatz Sep 19, 2019
2c72321
Merge branch 'master' into systemd
scopatz Sep 24, 2019
d52b8f5
edits with deps
scopatz Sep 24, 2019
455e76f
update sha
scopatz Sep 24, 2019
a696647
some patches
scopatz Sep 24, 2019
8358324
Merge branch 'master' into systemd
scopatz Sep 26, 2019
86c2a13
uggg
scopatz Sep 26, 2019
2074ca6
updates
scopatz Oct 10, 2019
7813249
add some missing definitions
scopatz Oct 14, 2019
9a12c3b
more patches
scopatz Oct 14, 2019
5ac014b
more compilation fixes
scopatz Oct 14, 2019
24c007e
process control fixes
scopatz Oct 14, 2019
97d5211
proc-cmdline
scopatz Oct 14, 2019
3456b73
magic
scopatz Oct 14, 2019
c52e5c4
time defs
scopatz Oct 14, 2019
965c85d
missing ioctls
scopatz Oct 14, 2019
a6c2738
typo
scopatz Oct 14, 2019
260861f
typo
scopatz Oct 14, 2019
fcd3fdf
missing neighbour
scopatz Oct 15, 2019
9e4d8b5
more patches and fixes
scopatz Oct 15, 2019
10b3c3c
more patches and edits
scopatz Oct 15, 2019
7346857
more patches
scopatz Oct 15, 2019
4a682fd
missing types
scopatz Oct 15, 2019
6f03471
securebits
scopatz Oct 15, 2019
875ec09
don't build smack
scopatz Oct 15, 2019
7c8e3f1
missing loop
scopatz Oct 15, 2019
c771947
prctl fix
scopatz Oct 15, 2019
058009a
more component fixes
scopatz Oct 15, 2019
be3b2f6
v4l fixes
scopatz Oct 15, 2019
5538b11
more neigthbor fixes
scopatz Oct 15, 2019
ce3c65c
builtin input
scopatz Oct 15, 2019
83cef6a
more
scopatz Oct 15, 2019
88e45bd
refactor
scopatz Oct 15, 2019
2a6ea1e
no tests
scopatz Oct 15, 2019
edbf15f
prctl fixes
scopatz Oct 15, 2019
f1f1aa9
move build to xonsh
scopatz Oct 16, 2019
636cf01
capability and rt linking
scopatz Oct 16, 2019
a48b8bc
missing in
scopatz Oct 16, 2019
c6a3a8a
missing fcntl
scopatz Oct 16, 2019
67947af
avoid clock_adjtime
scopatz Oct 16, 2019
5b33e09
avoid clock_adjtime
scopatz Oct 16, 2019
6dd8eb1
avoid prlimit
scopatz Oct 16, 2019
faca848
remove xonsh build
scopatz Oct 16, 2019
a9750c1
typo
scopatz Oct 16, 2019
dc705ee
some install fixes
scopatz Oct 17, 2019
72ec0d8
better O_PATH fix
scopatz Oct 17, 2019
c4219b3
more O_PATH fixes
scopatz Oct 17, 2019
0e67dc0
minstall / pkexec fix
scopatz Oct 17, 2019
9303f87
it passes!
scopatz Oct 17, 2019
4be63d9
rm sysv
scopatz Oct 17, 2019
bbe7ad7
add coreutils
scopatz Oct 18, 2019
d7a2281
add m4
scopatz Oct 18, 2019
bf6adad
add xz
scopatz Oct 18, 2019
a1d8ed6
elf and gpg
scopatz Oct 18, 2019
d8819f4
libgpg-error
scopatz Oct 18, 2019
2dcda8c
Update recipes/systemd/meta.yaml
scopatz Oct 18, 2019
62ac641
LGPL-2.1
scopatz Oct 18, 2019
3e6f9ec
Merge branch 'systemd' of github.com:scopatz/staged-recipes into systemd
scopatz Oct 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions recipes/systemd/arp-util.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/libsystemd-network/arp-util.c.orig 2019-10-15 11:47:39.117534233 -0400
+++ src/libsystemd-network/arp-util.c 2019-10-15 11:47:49.785614116 -0400
@@ -12,6 +12,8 @@
#include "unaligned.h"
#include "util.h"

+#include "linux/bpf_common.h"
+
int arp_network_bind_raw_socket(int ifindex, be32_t address, const struct ether_addr *eth_mac) {
struct sock_filter filter[] = {
BPF_STMT(BPF_LD + BPF_W + BPF_LEN, 0), /* A <- packet length */
29 changes: 29 additions & 0 deletions recipes/systemd/bpf.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- src/shared/linux/bpf.h.orig 2019-10-15 12:31:51.265235125 -0400
+++ src/shared/linux/bpf.h 2019-10-15 12:32:48.397019465 -0400
@@ -11,6 +11,8 @@
#include <linux/types.h>
#include <linux/bpf_common.h>

+#include "missing_types.h"
+
/* Extended instruction set based on top of classic BPF */

/* instruction classes */
@@ -837,14 +839,14 @@
*
* int ret;
* struct bpf_tunnel_key key = {};
- *
+ *
* ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0);
* if (ret < 0)
* return TC_ACT_SHOT; // drop packet
- *
+ *
* if (key.remote_ipv4 != 0x0a000001)
* return TC_ACT_SHOT; // drop packet
- *
+ *
* return TC_ACT_OK; // accept packet
*
* This interface can also be used with all encapsulation devices
11 changes: 11 additions & 0 deletions recipes/systemd/btrfs-util.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/basic/btrfs-util.c.orig 2019-10-17 13:31:18.688570112 -0400
+++ src/basic/btrfs-util.c 2019-10-17 13:32:14.224144351 -0400
@@ -37,6 +37,8 @@
#include "time-util.h"
#include "util.h"

+#include "missing_fcntl.h"
+
/* WARNING: Be careful with file system ioctls! When we get an fd, we
* need to make sure it either refers to only a regular file or
* directory, or that it is located on btrfs, before invoking any
80 changes: 80 additions & 0 deletions recipes/systemd/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env bash
set -ex

export CFLAGS="${CFLAGS} -I${PREFIX}/include/unicode -lrt"
export SYSTEMD_UNIT_PATH=""

# copy over missing files
basic_files="
missing_kd.h
missing_in.h
missing_loop.h
missing_time.h
missing_types.h
missing_ioctls.h
missing_inotify.h
missing_neighbour.h
missing_videodev2.h
missing_input-event-codes.h
"
for f in $basic_files
do
cp -v "$RECIPE_DIR/$f" "$SRC_DIR/src/basic/$f"
done

linux_files="
sctp.h
if_alg.h
if_vlan.h
securebits.h
"
for f in $linux_files
do
cp -v "$RECIPE_DIR/$f" "$SRC_DIR/src/basic/linux/$f"
done

# patch the meson "minstall.py" file so that we avoid trying to install
# to the system root with polkit's pkexec. Ignore such files instead
bldprefix="$(dirname $(dirname $(which meson)))"
sitepkgs="$(echo -n ${bldprefix}/lib/python3.*/site-packages)"
patch "${sitepkgs}/mesonbuild/minstall.py" "${RECIPE_DIR}/minstall.py.patch"

# finally, build it!
mkdir -p build
pushd build
meson \
--prefix=$PREFIX \
--libdir=$PREFIX/lib \
--buildtype=release \
-Ddefault-dnssec=no \
-Dblkid=true \
-Ddefault-dnssec=no \
-Dfirstboot=false \
-Dinstall-tests=false \
-Dldconfig=false \
-Dsplit-usr=true \
-Dsysusers=false \
-Drpmmacrosdir=no \
-Dsmack=false \
-Dseccomp=false \
-Dselinux=false \
-Defi=false \
-Dportabled=false \
-Dlogind=false \
-Dlibidn2=false \
-Dtests=false \
-Dremote=false \
-Drfkill=false \
-Dpolkit=false \
-Dgshadow=false \
-Dpam=false \
-Dadm-group=false \
-Dwheel-group=false \
-Drootprefix=$PREFIX \
-Drootlibdir=$PREFIX/lib \
-Ddbuspolicydir=$PREFIX/share/xml/dbus-1 \
-Dcertificate-root=$PREFIX/ssl \
--strip \
..
ninja
ninja -v install
11 changes: 11 additions & 0 deletions recipes/systemd/chown-recursive.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/core/chown-recursive.c.orig 2019-10-17 13:35:50.670486699 -0400
+++ src/core/chown-recursive.c 2019-10-17 13:36:09.986338884 -0400
@@ -14,6 +14,8 @@
#include "strv.h"
#include "user-util.h"

+#include "missing_fcntl.h"
+
static int chown_one(
int fd,
const struct stat *st,
11 changes: 11 additions & 0 deletions recipes/systemd/copy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/basic/copy.c.orig 2019-09-26 11:27:38.126352188 -0400
+++ src/basic/copy.c 2019-09-26 11:27:56.070099690 -0400
@@ -33,6 +33,8 @@
#include "user-util.h"
#include "xattr-util.h"

+#include "signal.h"
+
#define COPY_BUFFER_SIZE (16U*1024U)

/* A safety net for descending recursively into file system trees to copy. On Linux PATH_MAX is 4096, which means the
11 changes: 11 additions & 0 deletions recipes/systemd/coredump-vacuum.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/coredump/coredump-vacuum.c.orig 2019-10-16 13:07:59.214734707 -0400
+++ src/coredump/coredump-vacuum.c 2019-10-16 13:12:30.328745417 -0400
@@ -17,6 +17,8 @@
#include "time-util.h"
#include "user-util.h"

+#include "missing_fcntl.h"
+
#define DEFAULT_MAX_USE_LOWER (uint64_t) (1ULL*1024ULL*1024ULL) /* 1 MiB */
#define DEFAULT_MAX_USE_UPPER (uint64_t) (4ULL*1024ULL*1024ULL*1024ULL) /* 4 GiB */
#define DEFAULT_KEEP_FREE_UPPER (uint64_t) (4ULL*1024ULL*1024ULL*1024ULL) /* 4 GiB */
11 changes: 11 additions & 0 deletions recipes/systemd/dhcp-network.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/libsystemd-network/dhcp-network.c.orig 2019-10-15 11:13:20.549996641 -0400
+++ src/libsystemd-network/dhcp-network.c 2019-10-15 11:12:31.313614545 -0400
@@ -19,6 +19,8 @@
#include "socket-util.h"
#include "unaligned.h"

+#include "linux/bpf_common.h"
+
static int _bind_raw_socket(int ifindex, union sockaddr_union *link,
uint32_t xid, const uint8_t *mac_addr,
size_t mac_addr_len,
11 changes: 11 additions & 0 deletions recipes/systemd/dissect-image.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/shared/dissect-image.c.orig 2019-10-15 13:17:42.686739421 -0400
+++ src/shared/dissect-image.c 2019-10-15 13:20:19.995498515 -0400
@@ -47,6 +47,8 @@
#include "user-util.h"
#include "xattr-util.h"

+#include "missing_loop.h"
+
int probe_filesystem(const char *node, char **ret_fstype) {
/* Try to find device content type and return it in *ret_fstype. If nothing is found,
* 0/NULL will be returned. -EUCLEAN will be returned for ambiguous results, and an
10 changes: 10 additions & 0 deletions recipes/systemd/env-util.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- src/basic/env-util.c.orig 2019-09-24 14:40:19.050540216 -0400
+++ src/basic/env-util.c 2019-09-24 14:40:51.934330609 -0400
@@ -16,6 +16,7 @@
#include "string-util.h"
#include "strv.h"
#include "utf8.h"
+#include "missing_stdlib.h"

#define VALID_CHARS_ENV_NAME \
DIGITS LETTERS \
15 changes: 15 additions & 0 deletions recipes/systemd/fs-util.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- src/basic/fs-util.c.orig 2019-10-14 12:13:17.184969778 -0400
+++ src/basic/fs-util.c 2019-10-14 12:22:11.144439847 -0400
@@ -1346,8 +1346,12 @@
if (fd < 0)
return -errno;

+ /*
+ Old versions of Linux do not have syncfc() function.
if (syncfs(fd) < 0)
return -errno;
+ */
+ sync();

return 0;
}
43 changes: 43 additions & 0 deletions recipes/systemd/if_alg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
* if_alg: User-space algorithm interface
*
* Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
*/

#ifndef _LINUX_IF_ALG_H
#define _LINUX_IF_ALG_H

#include <linux/types.h>

struct sockaddr_alg {
__u16 salg_family;
__u8 salg_type[14];
__u32 salg_feat;
__u32 salg_mask;
__u8 salg_name[64];
};

struct af_alg_iv {
__u32 ivlen;
__u8 iv[0];
};

/* Socket options */
#define ALG_SET_KEY 1
#define ALG_SET_IV 2
#define ALG_SET_OP 3
#define ALG_SET_AEAD_ASSOCLEN 4
#define ALG_SET_AEAD_AUTHSIZE 5

/* Operations */
#define ALG_OP_DECRYPT 0
#define ALG_OP_ENCRYPT 1

#endif /* _LINUX_IF_ALG_H */
65 changes: 65 additions & 0 deletions recipes/systemd/if_vlan.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
* VLAN An implementation of 802.1Q VLAN tagging.
*
* Authors: Ben Greear <greearb@candelatech.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
*/

#ifndef _LINUX_IF_VLAN_H_
#define _LINUX_IF_VLAN_H_


/* VLAN IOCTLs are found in sockios.h */

/* Passed in vlan_ioctl_args structure to determine behaviour. */
enum vlan_ioctl_cmds {
ADD_VLAN_CMD,
DEL_VLAN_CMD,
SET_VLAN_INGRESS_PRIORITY_CMD,
SET_VLAN_EGRESS_PRIORITY_CMD,
GET_VLAN_INGRESS_PRIORITY_CMD,
GET_VLAN_EGRESS_PRIORITY_CMD,
SET_VLAN_NAME_TYPE_CMD,
SET_VLAN_FLAG_CMD,
GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
};

enum vlan_flags {
VLAN_FLAG_REORDER_HDR = 0x1,
VLAN_FLAG_GVRP = 0x2,
VLAN_FLAG_LOOSE_BINDING = 0x4,
VLAN_FLAG_MVRP = 0x8,
};

enum vlan_name_types {
VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */
VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */
VLAN_NAME_TYPE_HIGHEST
};

struct vlan_ioctl_args {
int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
char device1[24];

union {
char device2[24];
int VID;
unsigned int skb_priority;
unsigned int name_type;
unsigned int bind_type;
unsigned int flag; /* Matches vlan_dev_priv flags */
} u;

short vlan_qos;
};

#endif /* _LINUX_IF_VLAN_H_ */
38 changes: 38 additions & 0 deletions recipes/systemd/khash.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--- src/basic/khash.c.orig 2019-10-14 13:13:18.631817258 -0400
+++ src/basic/khash.c 2019-10-14 13:17:00.977799575 -0400
@@ -30,7 +30,7 @@
struct sockaddr sa;
struct sockaddr_alg alg;
} sa = {
- .alg.salg_family = AF_ALG,
+ .alg.salg_family = PF_ALG,
.alg.salg_type = "hash",
.alg.salg_name = "sha256", /* a very common algorithm */
};
@@ -41,7 +41,7 @@
_cleanup_close_ int fd1 = -1, fd2 = -1;
uint8_t buf[LONGEST_DIGEST+1];

- fd1 = socket(AF_ALG, SOCK_SEQPACKET|SOCK_CLOEXEC, 0);
+ fd1 = socket(PF_ALG, SOCK_SEQPACKET|SOCK_CLOEXEC, 0);
if (fd1 < 0) {
/* The kernel returns EAFNOSUPPORT if AF_ALG is not supported at all */
if (IN_SET(errno, EAFNOSUPPORT, EOPNOTSUPP))
@@ -90,7 +90,7 @@
struct sockaddr sa;
struct sockaddr_alg alg;
} sa = {
- .alg.salg_family = AF_ALG,
+ .alg.salg_family = PF_ALG,
.alg.salg_type = "hash",
};

@@ -116,7 +116,7 @@
if (supported == 0)
return -EOPNOTSUPP;

- fd = socket(AF_ALG, SOCK_SEQPACKET|SOCK_CLOEXEC, 0);
+ fd = socket(PF_ALG, SOCK_SEQPACKET|SOCK_CLOEXEC, 0);
if (fd < 0)
return -errno;

11 changes: 11 additions & 0 deletions recipes/systemd/l2tp.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/basic/linux/l2tp.h.orig 2019-10-15 15:35:09.466277794 -0400
+++ src/basic/linux/l2tp.h 2019-10-15 15:35:35.082388994 -0400
@@ -13,6 +13,8 @@
#include <linux/in.h>
#include <linux/in6.h>

+#include "missing_socket.h"
+
#define IPPROTO_L2TP 115

/**
11 changes: 11 additions & 0 deletions recipes/systemd/logind-session.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/login/logind-session.c.orig 2019-10-15 12:05:43.289649606 -0400
+++ src/login/logind-session.c 2019-10-15 12:06:29.681996804 -0400
@@ -39,6 +39,8 @@
#include "user-util.h"
#include "util.h"

+#include "missing_kd.h"
+
#define RELEASE_USEC (20*USEC_PER_SEC)

static void session_remove_fifo(Session *s);
Loading