-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add libselinux, libsepol, pcre2 and libcap
They are used for SELinux support and systemd-udevd Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
- Loading branch information
Showing
11 changed files
with
176 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: libcap | ||
dependencies: | ||
- stage: base | ||
steps: | ||
- sources: | ||
- url: https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-{{ .libcap_version }}.tar.xz | ||
destination: libcap.tar.xz | ||
sha256: "{{ .libcap_sha256 }}" | ||
sha512: "{{ .libcap_sha512 }}" | ||
prepare: | ||
- | | ||
tar -xf libcap.tar.xz --strip-components=1 | ||
build: | ||
- | | ||
make prefix=/ lib=lib -j $(nproc) | ||
install: | ||
- | | ||
make DESTDIR=/rootfs prefix=/ lib=lib install | ||
rm -rf /rootfs/share | ||
finalize: | ||
- from: /rootfs | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Patch from https://bugs.gentoo.org/905711#c10 to build with musl | ||
|
||
diff --git a/src/selinux_restorecon.c b/src/selinux_restorecon.c | ||
index bc6ed935..3bc0d8dd 100644 | ||
--- a/src/selinux_restorecon.c | ||
+++ b/src/selinux_restorecon.c | ||
@@ -438,7 +438,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file, | ||
file_spec_t *prevfl, *fl; | ||
uint32_t h; | ||
int ret; | ||
- struct stat64 sb; | ||
+ struct stat sb; | ||
|
||
__pthread_mutex_lock(&fl_mutex); | ||
|
||
@@ -452,7 +452,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file, | ||
for (prevfl = &fl_head[h], fl = fl_head[h].next; fl; | ||
prevfl = fl, fl = fl->next) { | ||
if (ino == fl->ino) { | ||
- ret = lstat64(fl->file, &sb); | ||
+ ret = lstat(fl->file, &sb); | ||
if (ret < 0 || sb.st_ino != ino) { | ||
freecon(fl->con); | ||
free(fl->file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/utils/selabel_digest.c b/utils/selabel_digest.c | ||
index 47aad21f..c574d3fd 100644 | ||
--- a/utils/selabel_digest.c | ||
+++ b/utils/selabel_digest.c | ||
@@ -65,7 +65,7 @@ int main(int argc, char **argv) | ||
size_t digest_len, i, num_specfiles; | ||
|
||
char cmd_buf[4096]; | ||
- char *cmd_ptr; | ||
+ char *cmd_ptr = NULL; | ||
char *sha1_buf = NULL; | ||
|
||
struct selabel_handle *hnd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: libselinux | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
- stage: libsepol | ||
- stage: pcre2 | ||
steps: | ||
- sources: | ||
- url: https://github.com/SELinuxProject/selinux/releases/download/{{ .selinux_version }}/libselinux-{{ .selinux_version }}.tar.gz | ||
destination: libselinux.tar.gz | ||
sha256: "{{ .libselinux_sha256 }}" | ||
sha512: "{{ .libselinux_sha512 }}" | ||
prepare: | ||
- | | ||
tar -xzf libselinux.tar.gz --strip-components=1 | ||
patch -p1 < /pkg/patches/musl-lstat.patch | ||
patch -p1 < /pkg/patches/selabel-digest-uninit.patch | ||
build: | ||
- | | ||
make -j $(nproc) FTS_LDLIBS="-l:libfts.a -L/toolchain/lib" | ||
install: | ||
- | | ||
make install DESTDIR=/rootfs | ||
finalize: | ||
- from: /rootfs | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: libsepol | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
steps: | ||
- sources: | ||
- url: https://github.com/SELinuxProject/selinux/releases/download/{{ .selinux_version }}/libsepol-{{ .selinux_version }}.tar.gz | ||
destination: libsepol.tar.gz | ||
sha256: "{{ .libsepol_sha256 }}" | ||
sha512: "{{ .libsepol_sha512 }}" | ||
prepare: | ||
- | | ||
tar -xzf libsepol.tar.gz --strip-components=1 | ||
build: | ||
- | | ||
make -j $(nproc) | ||
install: | ||
- | | ||
make install DESTDIR=/rootfs | ||
finalize: | ||
- from: /rootfs | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: pcre2 | ||
dependencies: | ||
- stage: base | ||
steps: | ||
- sources: | ||
- url: https://github.com/PCRE2Project/pcre2/releases/download/pcre2-{{ .pcre2_version }}/pcre2-{{ .pcre2_version }}.tar.bz2 | ||
destination: pcre.tar.bz2 | ||
sha256: "{{ .pcre2_sha256 }}" | ||
sha512: "{{ .pcre2_sha512 }}" | ||
prepare: | ||
- | | ||
tar -xjf pcre.tar.bz2 --strip-components=1 | ||
mkdir build | ||
cd build | ||
../configure \ | ||
--prefix="/usr" \ | ||
--enable-unicode-properties \ | ||
--enable-pcre216 \ | ||
--enable-pcre232 \ | ||
--disable-static | ||
build: | ||
- | | ||
cd build | ||
make -j $(nproc) | ||
install: | ||
- | | ||
cd build | ||
make DESTDIR=/rootfs install | ||
rm -rf /rootfs/share | ||
finalize: | ||
- from: /rootfs | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters