Added dmraid, iniparser, mozjs, libatasmart, libblockdev, libbytesize,
libyaml, ndctl, polkit, udisks to base and updated base build list Fixed base/gcc-libs build file Removed old incomplete base/rust build file
This commit is contained in:
parent
b96d59e4bc
commit
887b96a3e3
28 changed files with 1102 additions and 102 deletions
|
@ -314,3 +314,13 @@ rust
|
|||
lld
|
||||
sccache
|
||||
nodejs
|
||||
iniparser
|
||||
ndctl
|
||||
dmraid
|
||||
libatasmart
|
||||
libyaml
|
||||
libbytesize
|
||||
libblockdev
|
||||
mozjs
|
||||
polkit
|
||||
udisks
|
||||
|
|
13
base/dmraid/001-do_not_use_p_for_partition.patch
Normal file
13
base/dmraid/001-do_not_use_p_for_partition.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
Author: Giuseppe Iuculano <giuseppe@iuculano.it>
|
||||
Description: Removed "p" from device name. A proper upgrade script is needed before using it.
|
||||
--- dmraid/lib/format/partition/dos.c
|
||||
+++ dmraid/lib/format/partition/dos.c
|
||||
@@ -31,7 +31,7 @@ _name(struct lib_context *lc, struct rai
|
||||
{
|
||||
const char *base = get_basename(lc, rd->di->path);
|
||||
|
||||
- return type ? snprintf(str, len, "%s%s%u", base, OPT_STR_PARTCHAR(lc),
|
||||
+ return type ? snprintf(str, len, "%s%u", base,
|
||||
partition) : snprintf(str, len, "%s", base);
|
||||
}
|
||||
|
13
base/dmraid/002-support_virtio_devices.patch
Normal file
13
base/dmraid/002-support_virtio_devices.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
Author: Luke Yelavich <themuso@ubuntu.com>
|
||||
Description: Support for checking virtio devices for dmraid metadata.
|
||||
--- dmraid/lib/device/scan.c
|
||||
+++ dmraid/lib/device/scan.c
|
||||
@@ -174,7 +174,7 @@ interested(struct lib_context *lc, char
|
||||
* Whole IDE and SCSI disks only.
|
||||
*/
|
||||
return (!isdigit(name[strlen(name) - 1]) &&
|
||||
- (*(name + 1) == 'd' && (*name == 'h' || *name == 's')))
|
||||
+ (*(name + 1) == 'd' && (*name == 'h' || *name == 's' || *name == 'v')))
|
||||
#ifdef DMRAID_TEST
|
||||
/*
|
||||
* Include dm devices for testing.
|
144
base/dmraid/003-isw-probe-hpa.patch
Normal file
144
base/dmraid/003-isw-probe-hpa.patch
Normal file
|
@ -0,0 +1,144 @@
|
|||
Probe isw disks with [some] HPA awareness, thanks to Robert Collins <robert@ubuntu.com>. (LP: #372170)
|
||||
--- dmraid/lib/format/ataraid/isw.c
|
||||
+++ dmraid/lib/format/ataraid/isw.c
|
||||
@@ -353,6 +353,7 @@ raiddev(struct isw *isw, unsigned i)
|
||||
enum convert { FULL, FIRST, LAST };
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
# define to_cpu(x, y)
|
||||
+# define CVT16(x)
|
||||
#else
|
||||
/*
|
||||
* We can differ from the read_raid_dev template here,
|
||||
@@ -547,15 +548,16 @@ disk_ok(struct lib_context *lc, struct d
|
||||
}
|
||||
|
||||
static void *
|
||||
-isw_read_metadata(struct lib_context *lc, struct dev_info *di,
|
||||
- size_t * sz, uint64_t * offset, union read_info *info)
|
||||
+isw_try_sboffset(struct lib_context *lc, struct dev_info *di,
|
||||
+ size_t * sz, uint64_t * offset, union read_info *info,
|
||||
+ uint64_t const isw_sboffset)
|
||||
{
|
||||
size_t size = ISW_DISK_BLOCK_SIZE;
|
||||
- uint64_t isw_sboffset = ISW_CONFIGOFFSET(di);
|
||||
struct isw *isw;
|
||||
+ uint64_t temp_isw_sboffset = isw_sboffset;
|
||||
|
||||
if (!(isw = alloc_private_and_read(lc, handler, size,
|
||||
- di->path, isw_sboffset)))
|
||||
+ di->path, temp_isw_sboffset)))
|
||||
goto out;
|
||||
|
||||
/*
|
||||
@@ -565,9 +567,15 @@ isw_read_metadata(struct lib_context *lc
|
||||
to_cpu(isw, FIRST);
|
||||
|
||||
/* Check Signature and read optional extended metadata. */
|
||||
- if (!is_isw(lc, di, isw) ||
|
||||
- !isw_read_extended(lc, di, &isw, &isw_sboffset, &size))
|
||||
+ if (!is_isw(lc, di, isw)) {
|
||||
+ log_dbg(lc, "not isw at %ld", isw_sboffset);
|
||||
goto bad;
|
||||
+ }
|
||||
+ if (!isw_read_extended(lc, di, &isw, &temp_isw_sboffset, &size)) {
|
||||
+ log_err(lc, "isw metadata, but extended read failed at %ld",
|
||||
+ isw_sboffset);
|
||||
+ goto bad;
|
||||
+ }
|
||||
|
||||
/*
|
||||
* Now that we made sure, that we've got all the
|
||||
@@ -578,6 +586,8 @@ isw_read_metadata(struct lib_context *lc
|
||||
if (disk_ok(lc, di, isw)) {
|
||||
*sz = size;
|
||||
*offset = info->u64 = isw_sboffset;
|
||||
+ log_dbg(lc, "isw metadata found at %ld from probe at %ld\n",
|
||||
+ *offset, isw_sboffset);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -589,6 +599,54 @@ out:
|
||||
return (void *) isw;
|
||||
}
|
||||
|
||||
+/* HPA on a disk shifts everything down. This is a 'works-enough' approach to
|
||||
+ * handling that. There is a better long term approach requiring kernel
|
||||
+ * patches - see the lkml patches for alt_size.
|
||||
+ */
|
||||
+static void *
|
||||
+isw_try_hpa(struct lib_context *lc, struct dev_info *di,
|
||||
+ size_t * sz, uint64_t * offset, union read_info *info)
|
||||
+{
|
||||
+ struct isw10 *isw10;
|
||||
+ void *result = NULL;
|
||||
+ uint64_t actual_offset;
|
||||
+ if (!(isw10 = alloc_private_and_read(lc, handler, ISW_DISK_BLOCK_SIZE,
|
||||
+ di->path, ISW_10_CONFIGOFFSET(di))))
|
||||
+ goto out;
|
||||
+ if (strncmp((const char *)isw10->sig, ISW10_SIGNATURE, ISW10_SIGNATURE_SIZE))
|
||||
+ goto out_free;
|
||||
+ log_dbg(lc, "Found isw 10 gafr signature.");
|
||||
+ CVT16(isw10->offset);
|
||||
+ actual_offset = isw10->offset + 2;
|
||||
+ log_dbg(lc, "isw 10 sector offset calculated at %hd.", actual_offset);
|
||||
+ if (actual_offset > di->sectors)
|
||||
+ goto out_free;
|
||||
+ result = isw_try_sboffset(lc, di, sz, offset, info,
|
||||
+ ISW_SECTOR_TO_OFFSET(di->sectors - actual_offset));
|
||||
+ out_free:
|
||||
+ dbg_free(isw10);
|
||||
+ out:
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void *
|
||||
+isw_read_metadata(struct lib_context *lc, struct dev_info *di,
|
||||
+ size_t * sz, uint64_t * offset, union read_info *info)
|
||||
+{
|
||||
+ void *result;
|
||||
+ if ((result = isw_try_sboffset(
|
||||
+ lc, di, sz, offset, info, ISW_CONFIGOFFSET(di))))
|
||||
+ return result;
|
||||
+ if ((result = isw_try_hpa(lc, di, sz, offset, info)))
|
||||
+ return result;
|
||||
+ log_dbg(lc, "isw trying hard coded -2115 offset.");
|
||||
+ if ((result = isw_try_sboffset(
|
||||
+ lc, di, sz, offset, info, (di->sectors - 2115)*512)))
|
||||
+ return result;
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
|
||||
struct dev_info *di, void *meta, union read_info *info);
|
||||
static struct raid_dev *
|
||||
--- dmraid/lib/format/ataraid/isw.h
|
||||
+++ dmraid/lib/format/ataraid/isw.h
|
||||
@@ -36,8 +36,11 @@
|
||||
|
||||
/* Intel metadata offset in bytes */
|
||||
#define ISW_CONFIGSECTOR(di) ((di)->sectors - 2)
|
||||
-#define ISW_CONFIGOFFSET(di) (ISW_CONFIGSECTOR(di) << 9)
|
||||
+#define ISW_SECTOR_TO_OFFSET(sector) ((sector) << 9)
|
||||
+#define ISW_CONFIGOFFSET(di) (ISW_SECTOR_TO_OFFSET(ISW_CONFIGSECTOR(di)))
|
||||
#define ISW_DATAOFFSET 0 /* Data offset in sectors */
|
||||
+#define ISW_10_CONFIGSECTOR(di) ((di)->sectors - 1)
|
||||
+#define ISW_10_CONFIGOFFSET(di) (ISW_SECTOR_TO_OFFSET(ISW_10_CONFIGSECTOR(di)))
|
||||
|
||||
#define MPB_SIGNATURE "Intel Raid ISM Cfg Sig. "
|
||||
#define MPB_SIGNATURE_SIZE (sizeof(MPB_SIGNATURE) - 1)
|
||||
@@ -222,6 +225,14 @@ struct isw {
|
||||
// here comes isw_dev[num_raid_devs]
|
||||
} __attribute__ ((packed));
|
||||
|
||||
+#define ISW10_SIGNATURE "$GAFR\x10"
|
||||
+#define ISW10_SIGNATURE_SIZE (sizeof(ISW10_SIGNATURE) - 1)
|
||||
+struct isw10 {
|
||||
+ int8_t sig[ISW10_SIGNATURE_SIZE];
|
||||
+ uint32_t offset; /* offset to real data, in sectors back */
|
||||
+} __attribute__ ((packed));
|
||||
+
|
||||
+
|
||||
#endif
|
||||
|
||||
int register_isw(struct lib_context *lc);
|
12
base/dmraid/004-activate_multiple_raid_sets.patch
Normal file
12
base/dmraid/004-activate_multiple_raid_sets.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
Continue onto all raid sets instead of returning after processing the first. (LP: #401713)
|
||||
--- dmraid/lib/metadata/metadata.c
|
||||
+++ dmraid/lib/metadata/metadata.c
|
||||
@@ -839,7 +839,7 @@ _discover_partitions(struct lib_context
|
||||
*/
|
||||
if (T_GROUP(rs)) {
|
||||
_discover_partitions(lc, &rs->sets);
|
||||
- return;
|
||||
+ continue;
|
||||
}
|
||||
|
||||
/*
|
14
base/dmraid/005-fix_isw_sectors_calculation.patch
Normal file
14
base/dmraid/005-fix_isw_sectors_calculation.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
Fix isw raid0 incorrect sectors calculation, thanks to Valentin Pavlyuchenko
|
||||
--- dmraid/lib/format/ataraid/isw.c
|
||||
+++ dmraid/lib/format/ataraid/isw.c
|
||||
@@ -776,7 +776,9 @@ _create_rd(struct lib_context *lc,
|
||||
r->di = rd->di;
|
||||
r->fmt = rd->fmt;
|
||||
r->offset = dev->vol.map[0].pba_of_lba0;
|
||||
- if ((r->sectors = dev->vol.map[0].blocks_per_member - RAID_DS_JOURNAL))
|
||||
+ //fix bugs on ICH10R
|
||||
+ //if ((r->sectors = dev->vol.map[0].blocks_per_member - RAID_DS_JOURNAL))
|
||||
+ if ((r->sectors = dev->vol.map[0].blocks_per_member))
|
||||
goto out;
|
||||
|
||||
log_zero_sectors(lc, rd->di->path, handler);
|
20
base/dmraid/006-musl-libc.patch
Normal file
20
base/dmraid/006-musl-libc.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
---dmraid/include/dmraid/misc.h.orig
|
||||
+++ dmraid/include/dmraid/misc.h
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#ifndef _MISC_H_
|
||||
#define _MISC_H_
|
||||
+#include <fcntl.h>
|
||||
|
||||
#define DM_ASSERT(__cond) do { if (!(__cond)) { printf("ASSERT file:%s line:%d fuction:%s cond: %s\n", __FILE__, __LINE__, __FUNCTION__, #__cond); } } while(0);
|
||||
|
||||
--- dmraid/lib/device/scan.c.orig
|
||||
+++ dmraid/lib/device/scan.c
|
||||
@@ -10,6 +10,7 @@
|
||||
# include <dirent.h>
|
||||
# include <paths.h>
|
||||
#else
|
||||
+# include <paths.h>
|
||||
# include <dirent.h>
|
||||
# include <mntent.h>
|
||||
#endif
|
14
base/dmraid/007-fix-loff_t-musl.patch
Normal file
14
base/dmraid/007-fix-loff_t-musl.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
Source: maxice8
|
||||
Upstream: no, it seems to be inactive.
|
||||
Reason: fixes usage of dmraid.h under musl libc.
|
||||
|
||||
--- dmraid/include/dmraid/misc.h
|
||||
+++ dmraid/include/dmraid/misc.h
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#ifndef _MISC_H_
|
||||
#define _MISC_H_
|
||||
+#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
|
||||
#define DM_ASSERT(__cond) do { if (!(__cond)) { printf("ASSERT file:%s line:%d fuction:%s cond: %s\n", __FILE__, __LINE__, __FUNCTION__, #__cond); } } while(0);
|
51
base/dmraid/dmraid.SMBuild
Executable file
51
base/dmraid/dmraid.SMBuild
Executable file
|
@ -0,0 +1,51 @@
|
|||
app=dmraid
|
||||
version=1.0.0
|
||||
build=1sml
|
||||
homepage="https://people.redhat.com/~heinzm/sw/dmraid/"
|
||||
download="https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-1.0.0.rc16-3.tar.bz2"
|
||||
desc="Tool and a library to discover, configure and activate ATA RAID devices"
|
||||
requires="lvm"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf $app
|
||||
|
||||
tar xf $srcdir/$app"-"$version".rc16-3".tar.?z*
|
||||
cd $app/$version".rc16-3"/dmraid
|
||||
fixbuilddirpermissions
|
||||
|
||||
applypatch $srcdir/001-do_not_use_p_for_partition.patch
|
||||
applypatch $srcdir/002-support_virtio_devices.patch
|
||||
applypatch $srcdir/003-isw-probe-hpa.patch
|
||||
applypatch $srcdir/004-activate_multiple_raid_sets.patch
|
||||
applypatch $srcdir/005-fix_isw_sectors_calculation.patch
|
||||
applypatch $srcdir/006-musl-libc.patch
|
||||
applypatch $srcdir/007-fix-loff_t-musl.patch
|
||||
|
||||
./configure \
|
||||
--prefix="" \
|
||||
--sysconfdir=/etc \
|
||||
--sbindir=/bin \
|
||||
--enable-led \
|
||||
--enable-intel_led \
|
||||
--enable-shared_lib \
|
||||
--disable-static_link \
|
||||
$builddist
|
||||
|
||||
unset MAKEFLAGS CFLAGS CXXFLAGS
|
||||
make -j1
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
7c45e5117adc52fc2094b1b2bad4f4c518a46317a2196611966d72085ba3587c4ac8d1080f9d934888c01788f2b2d3d621c6f0d3e2a023c0fb1f9f3fa7fc127e dmraid-1.0.0.rc16-3.tar.bz2
|
||||
df1e285f404da61f9d15c9be3fae905599fb5d03203d3cd0551421b89913361d36524f9d2ee899eac9088c35daad9e8d6280a621c6a5832eec1a9be21bd05b12 001-do_not_use_p_for_partition.patch
|
||||
1486aa76066e959d800506030f37392560e4953eb23fbcb65899ce76ef8e646639d5bd7abed8d9328e9a7f8dcc005fac4312528a8afcc806d228828a5d9b3fb9 002-support_virtio_devices.patch
|
||||
b679ef5ff2671a8c8aa1a12feb54cfdfa6a40cbb0aef23e49b1ea5a8f97563061f9b207eeaf06da9fbb33837d9d04a4972869adc87eb89eb459aeb1c1e7bc5ee 003-isw-probe-hpa.patch
|
||||
ce120d7313f7f1b563e95fd9b81e4eb5353edf416a521d2955b0bd7a0c08ec4c0a5da4402aa1690f65d2b4464d1f5fc534ec7819b07ee8791046b25f0209a21b 004-activate_multiple_raid_sets.patch
|
||||
702cb4cf0edf79dbde9185cada12462681b52bffd5f8c4eab1b594ef754c964fb6c7f711ce77e4074167d920755fe0466d284f94fb272d60ea2314f2a45ef366 005-fix_isw_sectors_calculation.patch
|
||||
1335297528df24faa292e4d80a57e23e3f910b669a92370e57a97bd4df443092323a91489c2cc1f17e3b280a3a7f0386bb7fed3a157cdab7ab55686e9d5e1ae4 006-musl-libc.patch
|
||||
3fe66677b7bb3a314cabcab32d35192ddd5ec70e50398a37916197eb2818debf919fe48337fe9befb3a7d7ab727cbeed976413db89585f66fed7375cf9b36ac8 007-fix-loff_t-musl.patch
|
||||
"
|
|
@ -11,8 +11,8 @@ build() {
|
|||
mkandenterbuilddir
|
||||
rm -rf $app-$version-$ARCH
|
||||
|
||||
tar xf $srcdir/$app-$version-$ARCH.tar.?z
|
||||
cd $app-$version-$ARCH
|
||||
tar xf $srcdir/$app-$version-$arch.tar.?z
|
||||
cd $app-$version-$arch
|
||||
|
||||
mkdir -p $pkg/lib
|
||||
cp -av * $pkg/lib/
|
||||
|
|
34
base/iniparser/iniparser.SMBuild
Executable file
34
base/iniparser/iniparser.SMBuild
Executable file
|
@ -0,0 +1,34 @@
|
|||
app=iniparser
|
||||
version=4.1
|
||||
build=1sml
|
||||
homepage="https://github.com/ndevilla/iniparser"
|
||||
download="https://github.com/ndevilla/iniparser/archive/refs/tags/v4.1.tar.gz"
|
||||
desc="Stand-alone ini file parsing library written in ANSI C"
|
||||
requires="musl"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf $app-$version
|
||||
|
||||
tar xf $srcdir/$app-$version.tar.?z*
|
||||
cd $app-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
make
|
||||
|
||||
install -Dm 644 src/iniparser.h $pkg/include/iniparser.h
|
||||
install -Dm 644 src/dictionary.h $pkg/include/dictionary.h
|
||||
install -Dm 644 libiniparser.so.1 $pkg/lib/libiniparser.so.1
|
||||
cp LICENSE $pkgdocs/
|
||||
|
||||
(
|
||||
cd $pkg/lib ; ln -s libiniparser.so.1 libiniparser.so
|
||||
chrpath $pkg/lib/libiniparser.so.1
|
||||
)
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a8125aaaead1f9dfde380fa1e45bae31ca2312be029f2c53b4072cb3b127d16578a95c7c0aee1e3dda5e7b8db7a865ba6dfe8a1d80eb673061b3babef744e968 iniparser-4.1.tar.gz
|
||||
"
|
31
base/libatasmart/libatasmart.SMBuild
Executable file
31
base/libatasmart/libatasmart.SMBuild
Executable file
|
@ -0,0 +1,31 @@
|
|||
app=libatasmart
|
||||
version=0.19
|
||||
build=1sml
|
||||
homepage="http://0pointer.de/blog/projects/being-smart.html"
|
||||
download="https://0pointer.de/public/libatasmart-0.19.tar.xz"
|
||||
desc="ATA S.M.A.R.T reading and parsing library"
|
||||
requires="musl"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf $app-$version
|
||||
|
||||
tar xf $srcdir/$app-$version.tar.?z**
|
||||
cd $app-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
./configure \
|
||||
--prefix="" \
|
||||
--sbindir=/bin \
|
||||
--disable-static \
|
||||
$builddist
|
||||
|
||||
make
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
ec9edb019c477873b01289ba365ad0ed0946505d651c1f6f83a63ef61b3976a5db6439c8a0c74d9a55325db9a3a587ad6f655f8d1af9387b0d08356eccabdb62 libatasmart-0.19.tar.xz
|
||||
"
|
36
base/libblockdev/libblockdev.SMBuild
Executable file
36
base/libblockdev/libblockdev.SMBuild
Executable file
|
@ -0,0 +1,36 @@
|
|||
app=libblockdev
|
||||
version=2.26
|
||||
build=1sml
|
||||
homepage="https://github.com/rhinstaller/libblockdev"
|
||||
download="http://github.com/storaged-project/libblockdev/archive/refs/tags/2.26-1.tar.gz"
|
||||
desc="library for manipulating block devices"
|
||||
requires="libbytesize libyaml dmraid"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf $app-$version
|
||||
|
||||
tar xf $srcdir/$app-$version.tar.?z*
|
||||
cd $app-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
./configure \
|
||||
--prefix="" \
|
||||
--sysconfdir=/etc \
|
||||
--disable-static \
|
||||
--without-gtk-doc \
|
||||
--without-bcache \
|
||||
--without-escrow \
|
||||
--without-btrfs \
|
||||
--disable-introspection \
|
||||
--without-kbd || true
|
||||
|
||||
make
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
d2f94481fbbf19876ff359d2f4c8a0ede12e77bc96eaf7af99f31a9d325dccf7cd7be7820e0747d3aef8c200fd85838ec1ab4796680728589ade226dc443822d libblockdev-2.26.tar.lz
|
||||
"
|
33
base/libbytesize/libbytesize.SMBuild
Executable file
33
base/libbytesize/libbytesize.SMBuild
Executable file
|
@ -0,0 +1,33 @@
|
|||
app=libbytesize
|
||||
version=2.6
|
||||
build=1sml
|
||||
homepage="https://github.com/rhinstaller/libbytesize"
|
||||
download="https://github.com/storaged-project/libbytesize/archive/refs/tags/2.6.tar.gz"
|
||||
desc="Library for working with big sizes in bytes"
|
||||
requires="musl"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf $app-$version
|
||||
|
||||
tar xf $srcdir/$app-$version.tar.?z*
|
||||
cd $app-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
NOCONFIGURE=1 ./autogen.sh
|
||||
|
||||
./configure \
|
||||
--prefix="" \
|
||||
--sysconfdir=/etc \
|
||||
--disable-static \
|
||||
--disable-nls
|
||||
|
||||
make
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
f4fe0f31ba1c919961450ac183cd65a4207db9e8b38338705f5f1c239179485bc639273e861db6b547bbe0356b3609bb65200040017a8cc88ef96931c7b6dc11 libbytesize-2.6.tar.lz
|
||||
"
|
29
base/libyaml/libyaml.SMBuild
Executable file
29
base/libyaml/libyaml.SMBuild
Executable file
|
@ -0,0 +1,29 @@
|
|||
app=libyaml
|
||||
version=0.2.5
|
||||
build=1sml
|
||||
homepage="http://pyyaml.org/wiki/LibYAML"
|
||||
download="http://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz"
|
||||
desc="YAML 1.1 library"
|
||||
requires="musl"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf yaml-$version
|
||||
|
||||
tar xf $srcdir/yaml-$version.tar.?z*
|
||||
cd yaml-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
./configure \
|
||||
--prefix="" \
|
||||
--disable-static
|
||||
|
||||
make
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
dadd7d8e0d88b5ebab005e5d521d56d541580198aa497370966b98c904586e642a1cd4f3881094eb57624f218d50db77417bbfd0ffdce50340f011e35e8c4c02 yaml-0.2.5.tar.gz
|
||||
"
|
26
base/mozjs/0001-silence-sandbox-violations.patch
Normal file
26
base/mozjs/0001-silence-sandbox-violations.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
Upstream: no
|
||||
From 9ad10569e11a2fb96377188f895bc66abcc9511d Mon Sep 17 00:00:00 2001
|
||||
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
Date: Wed, 5 Sep 2018 15:05:24 +0200
|
||||
Subject: [PATCH] silence sandbox violations
|
||||
|
||||
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
---
|
||||
python/mozbuild/mozbuild/frontend/emitter.py | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
--- a/python/mozbuild/mozbuild/frontend/emitter.py
|
||||
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
|
||||
@@ -1239,12 +1239,6 @@
|
||||
'is a filename, but a directory is required: %s '
|
||||
'(resolved to %s)' % (local_include, full_path),
|
||||
context)
|
||||
- if (full_path == context.config.topsrcdir or
|
||||
- full_path == context.config.topobjdir):
|
||||
- raise SandboxValidationError(
|
||||
- 'Path specified in LOCAL_INCLUDES '
|
||||
- '(%s) resolves to the topsrcdir or topobjdir (%s), which is '
|
||||
- 'not allowed' % (local_include, full_path), context)
|
||||
include_obj = LocalInclude(context, local_include)
|
||||
local_includes.append(include_obj.path.full_path)
|
||||
yield include_obj
|
17
base/mozjs/disable-jslint.patch
Normal file
17
base/mozjs/disable-jslint.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
--- a/js/src/build/moz.build
|
||||
+++ b/js/src/build/moz.build
|
||||
@@ -80,14 +80,3 @@
|
||||
NO_EXPAND_LIBS = True
|
||||
|
||||
DIST_INSTALL = True
|
||||
-
|
||||
-# Run SpiderMonkey style checker after linking the static library. This avoids
|
||||
-# running the script for no-op builds.
|
||||
-GeneratedFile(
|
||||
- 'spidermonkey_checks', script='/config/run_spidermonkey_checks.py',
|
||||
- inputs=[
|
||||
- '!%sjs_static.%s' % (CONFIG['LIB_PREFIX'], CONFIG['LIB_SUFFIX']),
|
||||
- '/config/check_spidermonkey_style.py',
|
||||
- '/config/check_macroassembler_style.py',
|
||||
- '/config/check_js_opcode.py'
|
||||
- ])
|
37
base/mozjs/fd6847c9416f9eebde636e21d794d25d1be8791d.patch
Normal file
37
base/mozjs/fd6847c9416f9eebde636e21d794d25d1be8791d.patch
Normal file
|
@ -0,0 +1,37 @@
|
|||
See https://bugzilla.mozilla.org/show_bug.cgi?id=1539739
|
||||
|
||||
From fd6847c9416f9eebde636e21d794d25d1be8791d Mon Sep 17 00:00:00 2001
|
||||
From: Mike Hommey <mh@glandium.org>
|
||||
Date: Sat, 1 Jun 2019 09:06:01 +0900
|
||||
Subject: [PATCH] Bug 1526653 - Include struct definitions for user_vfp and
|
||||
user_vfp_exc.
|
||||
|
||||
---
|
||||
js/src/wasm/WasmSignalHandlers.cpp | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
|
||||
index 636537f8478..383c380f04c 100644
|
||||
--- a/js/src/wasm/WasmSignalHandlers.cpp
|
||||
+++ b/js/src/wasm/WasmSignalHandlers.cpp
|
||||
@@ -248,7 +248,16 @@ using mozilla::DebugOnly;
|
||||
#endif
|
||||
|
||||
#ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
|
||||
-# include <sys/user.h>
|
||||
+struct user_vfp {
|
||||
+ unsigned long long fpregs[32];
|
||||
+ unsigned long fpscr;
|
||||
+};
|
||||
+
|
||||
+struct user_vfp_exc {
|
||||
+ unsigned long fpexc;
|
||||
+ unsigned long fpinst;
|
||||
+ unsigned long fpinst2;
|
||||
+};
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID)
|
||||
--
|
||||
2.20.1
|
||||
|
16
base/mozjs/fix-musl-build.patch
Normal file
16
base/mozjs/fix-musl-build.patch
Normal file
|
@ -0,0 +1,16 @@
|
|||
Upstream: No
|
||||
Reason: mozjs60 miscompiles on musl if built with HAVE_THREAD_TLS_KEYWORD:
|
||||
https://github.com/void-linux/void-packages/issues/2598
|
||||
diff --git a/js/src/old-configure.in b/js/src/old-configure.in
|
||||
--- a/js/src/old-configure.in
|
||||
+++ b/js/src/old-configure.in
|
||||
@@ -1272,6 +1272,9 @@
|
||||
*-android*|*-linuxandroid*)
|
||||
:
|
||||
;;
|
||||
+ *-musl*)
|
||||
+ :
|
||||
+ ;;
|
||||
*)
|
||||
AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
|
||||
;;
|
15
base/mozjs/fix-rust-target.patch
Normal file
15
base/mozjs/fix-rust-target.patch
Normal file
|
@ -0,0 +1,15 @@
|
|||
Allow us to just set RUST_TARGEt ourselves instead of hacking around in mozilla's
|
||||
weird custom build system...
|
||||
|
||||
diff -upr firefox-68.9.0.orig/build/moz.configure/rust.configure firefox-68.9.0/build/moz.configure/rust.configure
|
||||
--- firefox-68.9.0.orig/build/moz.configure/rust.configure 2020-06-02 22:54:39.982616128 +0200
|
||||
+++ firefox-68.9.0/build/moz.configure/rust.configure 2020-06-02 23:08:37.656332899 +0200
|
||||
@@ -345,7 +345,7 @@ def rust_triple_alias(host_or_target):
|
||||
|
||||
return None
|
||||
|
||||
- rustc_target = find_candidate(candidates)
|
||||
+ rustc_target = os.environ['RUST_TARGET']
|
||||
|
||||
if rustc_target is None:
|
||||
die("Don't know how to translate {} for rustc".format(
|
81
base/mozjs/mozjs.SMBuild
Executable file
81
base/mozjs/mozjs.SMBuild
Executable file
|
@ -0,0 +1,81 @@
|
|||
app=mozjs
|
||||
version=78.15.0
|
||||
build=1sml
|
||||
homepage="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
|
||||
download="https://ftp.mozilla.org/pub/firefox/releases/78.15.0esr/source/firefox-78.15.0esr.source.tar.xz"
|
||||
desc="Mozilla's JavaScript engine"
|
||||
requires="zip unzip yasm libevent zlib alsa-lib libpng libogg libvorbis icu libvpx hunspell python3 diffutils llvm imake libXt gtk2 dbus-glib ffmpeg"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf firefox-$version
|
||||
|
||||
tar xf $srcdir/firefox-"$version"esr.source.tar.?z
|
||||
cd firefox-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
mkdir -p AC213
|
||||
tar xf $srcdir/autoconf-2.13.tar.gz
|
||||
cd autoconf-2.13
|
||||
./configure --prefix="$PWD"/../AC213 --program-suffix=-2.13
|
||||
make && make install
|
||||
cd ..
|
||||
export PATH="$PWD"/AC213/bin:"$PATH"
|
||||
|
||||
applypatch $srcdir/0001-silence-sandbox-violations.patch
|
||||
applypatch $srcdir/disable-jslint.patch
|
||||
applypatch $srcdir/fd6847c9416f9eebde636e21d794d25d1be8791d.patch
|
||||
applypatch $srcdir/fix-musl-build.patch
|
||||
applypatch $srcdir/fix-rust-target.patch
|
||||
|
||||
cd js/src
|
||||
export SHELL=/bin/sh
|
||||
export PYTHON=/bin/python3
|
||||
export LDFLAGS="-Wl,-z,stack-size=1048576"
|
||||
export RUST_TARGET="$arch-unknown-linux-musl"
|
||||
|
||||
cd build
|
||||
../configure \
|
||||
--prefix="" \
|
||||
--disable-jemalloc \
|
||||
--with-system-zlib \
|
||||
--with-system-icu \
|
||||
--with-system-nspr \
|
||||
--disable-strip \
|
||||
--with-clang-path=/bin/clang \
|
||||
--with-libclang-path=/lib \
|
||||
--enable-ctypes \
|
||||
--enable-hardening \
|
||||
--enable-optimize="-O2" \
|
||||
--enable-release \
|
||||
--enable-shared-js \
|
||||
--enable-system-ffi \
|
||||
--with-intl-api \
|
||||
--enable-tests \
|
||||
--disable-debug \
|
||||
--disable-debug-symbols
|
||||
|
||||
# Go easy on the pi
|
||||
if [ "$arch" = "aarch64" ] ; then
|
||||
unset MAKEFLAGS
|
||||
MAKEFLAGS="-j2"
|
||||
fi
|
||||
|
||||
make $MAKEFLAGS
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
# Discard the static library in staging directory
|
||||
rm -v $pkg/lib/*.ajs
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
602584f4c77b7a554aaa068eda5409b68eb0b3229e9c224bffb91c83c4314d25de15bd560a323626ff78f6df339c79e1ef8938c54b78ecadf4dc75c5241290ad autoconf-2.13.tar.gz
|
||||
ac3de735b246ce4f0e1619cd2664321ffa374240ce6843e785d79a350dc30c967996bbcc5e3b301cb3d822ca981cbea116758fc4122f1738d75ddfd1165b6378 firefox-78.15.0esr.source.tar.xz
|
||||
f7e5bee97cfa495d491dac4b8b98e5d3081346d920700e8bb6d077543e18245e5c82201a9981036ec0bf16d9fbdd42fd76e8cf6d90bb811e7338261204020149 0001-silence-sandbox-violations.patch
|
||||
4f2cb93f91e798218d83cb3ac4c60b61a3658c5b269bfe250f4c4875aedaacbd77598d8d20e3a868626e49988b2073a2404e37d6918b11def774c25db68dd08d disable-jslint.patch
|
||||
60845dcb034b2c4459c30f7d5f25c8176cf42df794e2cc0e86c3e2abb6541c24b962f3a16ca70a288d4d6f377b68d00b2904b22463108559612053d835d9bff1 fd6847c9416f9eebde636e21d794d25d1be8791d.patch
|
||||
bc91c2fb15eb22acb8acc36d086fb18fbf6f202b4511d138769b5ecaaed4a673349c55f808270c762616fafa42e3b01e74dc0af1dcbeea1289e043926e2750c8 fix-musl-build.patch
|
||||
c397bd594428b009d1533922a3728a0ec74403714417f4b90c38c1b7751749b0585d48e77c79efa05c6c22a0d9a8ac04d535eb5bb8deb51684852c03c05d94cd fix-rust-target.patch
|
||||
"
|
33
base/ndctl/ndctl.SMBuild
Executable file
33
base/ndctl/ndctl.SMBuild
Executable file
|
@ -0,0 +1,33 @@
|
|||
app=ndctl
|
||||
version=72.1
|
||||
build=1sml
|
||||
homepage="https://github.com/pmem/ndctl"
|
||||
download="https://github.com/pmem/ndctl/archive/refs/tags/v72.1.tar.gz"
|
||||
desc="Library for managing the libnvdimm sub-system in the linux kernel"
|
||||
requires="util-linux json-c keyutils eudev kmod netbsd-curses"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf $app-$version
|
||||
|
||||
tar xf $srcdir/$app-$version.tar.?z*
|
||||
cd $app-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
NOCONFIGURE=1 ./autogen.sh
|
||||
|
||||
./configure \
|
||||
--prefix="" \
|
||||
--sysconfdir=/etc \
|
||||
--disable-docs \
|
||||
--without-systemd
|
||||
|
||||
make
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
7304e23121c99457fa6e22a399fb636f6a66d6d07b090463ec41e424687b06e7e8a1a18623ab9dd5783aaccfa09ff964e3477b63aaa4614ac60f6e6050452f12 ndctl-72.1.tar.gz
|
||||
"
|
8
base/polkit/doinst.sh
Normal file
8
base/polkit/doinst.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
if ! getent group polkitd ; then
|
||||
addgroup -S -g 115 polkitd
|
||||
fi
|
||||
|
||||
if ! getent passwd polkitd ; then
|
||||
adduser -D -S -u 115 -G polkitd -s "/bin/false" -g "Policykit Daemon Owner" -h "/etc/polkit-1" polkitd
|
||||
fi
|
||||
|
239
base/polkit/make-innetgr-optional.patch
Normal file
239
base/polkit/make-innetgr-optional.patch
Normal file
|
@ -0,0 +1,239 @@
|
|||
See https://gitlab.freedesktop.org/polkit/polkit/merge_requests/10
|
||||
|
||||
From 778bb45e0e0cbabe2b04adf67a500af1dab09768 Mon Sep 17 00:00:00 2001
|
||||
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
|
||||
Date: Wed, 11 Jul 2018 04:54:26 -0500
|
||||
Subject: [PATCH] make netgroup support optional
|
||||
|
||||
On at least Linux/musl and Linux/uclibc, netgroup support is not
|
||||
available. PolKit fails to compile on these systems for that reason.
|
||||
|
||||
This change makes netgroup support conditional on the presence of the
|
||||
setnetgrent(3) function which is required for the support to work. If
|
||||
that function is not available on the system, an error will be returned
|
||||
to the administrator if unix-netgroup: is specified in configuration.
|
||||
|
||||
Fixes bug 50145.
|
||||
|
||||
Closes polkit/polkit#14.
|
||||
|
||||
Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
|
||||
---
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 4ac2219..ca478df 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -100,7 +100,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
|
||||
[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
|
||||
AC_SUBST(EXPAT_LIBS)
|
||||
|
||||
-AC_CHECK_FUNCS(clearenv fdatasync)
|
||||
+AC_CHECK_FUNCS(clearenv fdatasync setnetgrent)
|
||||
|
||||
if test "x$GCC" = "xyes"; then
|
||||
LDFLAGS="-Wl,--as-needed $LDFLAGS"
|
||||
diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c
|
||||
index 3aa1f7f..10e9c17 100644
|
||||
--- a/src/polkit/polkitidentity.c
|
||||
+++ b/src/polkit/polkitidentity.c
|
||||
@@ -182,7 +182,15 @@ polkit_identity_from_string (const gchar *str,
|
||||
}
|
||||
else if (g_str_has_prefix (str, "unix-netgroup:"))
|
||||
{
|
||||
+#ifndef HAVE_SETNETGRENT
|
||||
+ g_set_error (error,
|
||||
+ POLKIT_ERROR,
|
||||
+ POLKIT_ERROR_FAILED,
|
||||
+ "Netgroups are not available on this machine ('%s')",
|
||||
+ str);
|
||||
+#else
|
||||
identity = polkit_unix_netgroup_new (str + sizeof "unix-netgroup:" - 1);
|
||||
+#endif
|
||||
}
|
||||
|
||||
if (identity == NULL && (error != NULL && *error == NULL))
|
||||
@@ -344,6 +352,13 @@ polkit_identity_new_for_gvariant (GVariant *variant,
|
||||
GVariant *v;
|
||||
const char *name;
|
||||
|
||||
+#ifndef HAVE_SETNETGRENT
|
||||
+ g_set_error (error,
|
||||
+ POLKIT_ERROR,
|
||||
+ POLKIT_ERROR_FAILED,
|
||||
+ "Netgroups are not available on this machine");
|
||||
+ goto out;
|
||||
+#else
|
||||
v = lookup_asv (details_gvariant, "name", G_VARIANT_TYPE_STRING, error);
|
||||
if (v == NULL)
|
||||
{
|
||||
@@ -353,6 +368,7 @@ polkit_identity_new_for_gvariant (GVariant *variant,
|
||||
name = g_variant_get_string (v, NULL);
|
||||
ret = polkit_unix_netgroup_new (name);
|
||||
g_variant_unref (v);
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
diff --git a/src/polkit/polkitunixnetgroup.c b/src/polkit/polkitunixnetgroup.c
|
||||
index 8a2b369..83f8d4a 100644
|
||||
--- a/src/polkit/polkitunixnetgroup.c
|
||||
+++ b/src/polkit/polkitunixnetgroup.c
|
||||
@@ -194,6 +194,9 @@ polkit_unix_netgroup_set_name (PolkitUnixNetgroup *group,
|
||||
PolkitIdentity *
|
||||
polkit_unix_netgroup_new (const gchar *name)
|
||||
{
|
||||
+#ifndef HAVE_SETNETGRENT
|
||||
+ g_assert_not_reached();
|
||||
+#endif
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_NETGROUP,
|
||||
"name", name,
|
||||
diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
|
||||
index 056d9a8..36c2f3d 100644
|
||||
--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
|
||||
+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
|
||||
@@ -2233,25 +2233,26 @@ get_users_in_net_group (PolkitIdentity *group,
|
||||
GList *ret;
|
||||
|
||||
ret = NULL;
|
||||
+#ifdef HAVE_SETNETGRENT
|
||||
name = polkit_unix_netgroup_get_name (POLKIT_UNIX_NETGROUP (group));
|
||||
|
||||
-#ifdef HAVE_SETNETGRENT_RETURN
|
||||
+# ifdef HAVE_SETNETGRENT_RETURN
|
||||
if (setnetgrent (name) == 0)
|
||||
{
|
||||
g_warning ("Error looking up net group with name %s: %s", name, g_strerror (errno));
|
||||
goto out;
|
||||
}
|
||||
-#else
|
||||
+# else
|
||||
setnetgrent (name);
|
||||
-#endif
|
||||
+# endif /* HAVE_SETNETGRENT_RETURN */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
-#if defined(HAVE_NETBSD) || defined(HAVE_OPENBSD)
|
||||
+# if defined(HAVE_NETBSD) || defined(HAVE_OPENBSD)
|
||||
const char *hostname, *username, *domainname;
|
||||
-#else
|
||||
+# else
|
||||
char *hostname, *username, *domainname;
|
||||
-#endif
|
||||
+# endif /* defined(HAVE_NETBSD) || defined(HAVE_OPENBSD) */
|
||||
PolkitIdentity *user;
|
||||
GError *error = NULL;
|
||||
|
||||
@@ -2282,6 +2283,7 @@ get_users_in_net_group (PolkitIdentity *group,
|
||||
|
||||
out:
|
||||
endnetgrent ();
|
||||
+#endif /* HAVE_SETNETGRENT */
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
|
||||
index ca17108..da95180 100644
|
||||
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
|
||||
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
|
||||
@@ -1520,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
|
||||
|
||||
JS::CallArgs args = JS::CallArgsFromVp (argc, vp);
|
||||
|
||||
+#ifdef HAVE_SETNETGRENT
|
||||
JS::RootedString usrstr (authority->priv->cx);
|
||||
usrstr = args[0].toString();
|
||||
user = JS_EncodeStringToUTF8 (cx, usrstr);
|
||||
@@ -1534,6 +1535,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
|
||||
{
|
||||
is_in_netgroup = true;
|
||||
}
|
||||
+ #endif
|
||||
|
||||
ret = true;
|
||||
|
||||
diff --git a/test/polkit/polkitidentitytest.c b/test/polkit/polkitidentitytest.c
|
||||
index e91967b..e829aaa 100644
|
||||
--- a/test/polkit/polkitidentitytest.c
|
||||
+++ b/test/polkit/polkitidentitytest.c
|
||||
@@ -19,6 +19,7 @@
|
||||
* Author: Nikki VonHollen <vonhollen@google.com>
|
||||
*/
|
||||
|
||||
+#include "config.h"
|
||||
#include "glib.h"
|
||||
#include <polkit/polkit.h>
|
||||
#include <polkit/polkitprivate.h>
|
||||
@@ -145,11 +146,15 @@ struct ComparisonTestData comparison_test_data [] = {
|
||||
{"unix-group:root", "unix-group:jane", FALSE},
|
||||
{"unix-group:jane", "unix-group:jane", TRUE},
|
||||
|
||||
+#ifdef HAVE_SETNETGRENT
|
||||
{"unix-netgroup:foo", "unix-netgroup:foo", TRUE},
|
||||
{"unix-netgroup:foo", "unix-netgroup:bar", FALSE},
|
||||
+#endif
|
||||
|
||||
{"unix-user:root", "unix-group:root", FALSE},
|
||||
+#ifdef HAVE_SETNETGRENT
|
||||
{"unix-user:jane", "unix-netgroup:foo", FALSE},
|
||||
+#endif
|
||||
|
||||
{NULL},
|
||||
};
|
||||
@@ -181,11 +186,13 @@ main (int argc, char *argv[])
|
||||
g_test_add_data_func ("/PolkitIdentity/group_string_2", "unix-group:jane", test_string);
|
||||
g_test_add_data_func ("/PolkitIdentity/group_string_3", "unix-group:users", test_string);
|
||||
|
||||
+#ifdef HAVE_SETNETGRENT
|
||||
g_test_add_data_func ("/PolkitIdentity/netgroup_string", "unix-netgroup:foo", test_string);
|
||||
+ g_test_add_data_func ("/PolkitIdentity/netgroup_gvariant", "unix-netgroup:foo", test_gvariant);
|
||||
+#endif
|
||||
|
||||
g_test_add_data_func ("/PolkitIdentity/user_gvariant", "unix-user:root", test_gvariant);
|
||||
g_test_add_data_func ("/PolkitIdentity/group_gvariant", "unix-group:root", test_gvariant);
|
||||
- g_test_add_data_func ("/PolkitIdentity/netgroup_gvariant", "unix-netgroup:foo", test_gvariant);
|
||||
|
||||
add_comparison_tests ();
|
||||
|
||||
diff --git a/test/polkit/polkitunixnetgrouptest.c b/test/polkit/polkitunixnetgrouptest.c
|
||||
index 3701ba1..e3352eb 100644
|
||||
--- a/test/polkit/polkitunixnetgrouptest.c
|
||||
+++ b/test/polkit/polkitunixnetgrouptest.c
|
||||
@@ -19,6 +19,7 @@
|
||||
* Author: Nikki VonHollen <vonhollen@google.com>
|
||||
*/
|
||||
|
||||
+#include "config.h"
|
||||
#include "glib.h"
|
||||
#include <polkit/polkit.h>
|
||||
#include <string.h>
|
||||
@@ -69,7 +70,9 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
+#ifdef HAVE_SETNETGRENT
|
||||
g_test_add_func ("/PolkitUnixNetgroup/new", test_new);
|
||||
g_test_add_func ("/PolkitUnixNetgroup/set_name", test_set_name);
|
||||
+#endif
|
||||
return g_test_run ();
|
||||
}
|
||||
diff --git a/test/polkitbackend/test-polkitbackendjsauthority.c b/test/polkitbackend/test-polkitbackendjsauthority.c
|
||||
index f97e0e0..fc52149 100644
|
||||
--- a/test/polkitbackend/test-polkitbackendjsauthority.c
|
||||
+++ b/test/polkitbackend/test-polkitbackendjsauthority.c
|
||||
@@ -137,12 +137,14 @@ test_get_admin_identities (void)
|
||||
"unix-group:users"
|
||||
}
|
||||
},
|
||||
+#ifdef HAVE_SETNETGRENT
|
||||
{
|
||||
"net.company.action3",
|
||||
{
|
||||
"unix-netgroup:foo"
|
||||
}
|
||||
},
|
||||
+#endif
|
||||
};
|
||||
guint n;
|
||||
|
87
base/polkit/polkit-0.120-security_fix-1.patch
Normal file
87
base/polkit/polkit-0.120-security_fix-1.patch
Normal file
|
@ -0,0 +1,87 @@
|
|||
Submitted By: Xi Ruoyao <xry111 at linuxfromscratch dot org>
|
||||
Date: 2021-01-27
|
||||
Initial Package Version: 0.120
|
||||
Upstream Status: Applied
|
||||
Origin: Upstream
|
||||
Description: Fix CVE-2021-4034, a trivially exploitable local
|
||||
privilege escalation, to polkit since 0.92.
|
||||
|
||||
From a2bf5c9c83b6ae46cbd5c779d3055bff81ded683 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Rybar <jrybar@redhat.com>
|
||||
Date: Tue, 25 Jan 2022 17:21:46 +0000
|
||||
Subject: [PATCH] pkexec: local privilege escalation (CVE-2021-4034)
|
||||
|
||||
---
|
||||
src/programs/pkcheck.c | 5 +++++
|
||||
src/programs/pkexec.c | 23 ++++++++++++++++++++---
|
||||
2 files changed, 25 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/programs/pkcheck.c b/src/programs/pkcheck.c
|
||||
index f1bb4e1..768525c 100644
|
||||
--- a/src/programs/pkcheck.c
|
||||
+++ b/src/programs/pkcheck.c
|
||||
@@ -363,6 +363,11 @@ main (int argc, char *argv[])
|
||||
local_agent_handle = NULL;
|
||||
ret = 126;
|
||||
|
||||
+ if (argc < 1)
|
||||
+ {
|
||||
+ exit(126);
|
||||
+ }
|
||||
+
|
||||
/* Disable remote file access from GIO. */
|
||||
setenv ("GIO_USE_VFS", "local", 1);
|
||||
|
||||
diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c
|
||||
index 7698c5c..84e5ef6 100644
|
||||
--- a/src/programs/pkexec.c
|
||||
+++ b/src/programs/pkexec.c
|
||||
@@ -488,6 +488,15 @@ main (int argc, char *argv[])
|
||||
pid_t pid_of_caller;
|
||||
gpointer local_agent_handle;
|
||||
|
||||
+
|
||||
+ /*
|
||||
+ * If 'pkexec' is called THIS wrong, someone's probably evil-doing. Don't be nice, just bail out.
|
||||
+ */
|
||||
+ if (argc<1)
|
||||
+ {
|
||||
+ exit(127);
|
||||
+ }
|
||||
+
|
||||
ret = 127;
|
||||
authority = NULL;
|
||||
subject = NULL;
|
||||
@@ -614,10 +623,10 @@ main (int argc, char *argv[])
|
||||
|
||||
path = g_strdup (pwstruct.pw_shell);
|
||||
if (!path)
|
||||
- {
|
||||
+ {
|
||||
g_printerr ("No shell configured or error retrieving pw_shell\n");
|
||||
goto out;
|
||||
- }
|
||||
+ }
|
||||
/* If you change this, be sure to change the if (!command_line)
|
||||
case below too */
|
||||
command_line = g_strdup (path);
|
||||
@@ -636,7 +645,15 @@ main (int argc, char *argv[])
|
||||
goto out;
|
||||
}
|
||||
g_free (path);
|
||||
- argv[n] = path = s;
|
||||
+ path = s;
|
||||
+
|
||||
+ /* argc<2 and pkexec runs just shell, argv is guaranteed to be null-terminated.
|
||||
+ * /-less shell shouldn't happen, but let's be defensive and don't write to null-termination
|
||||
+ */
|
||||
+ if (argv[n] != NULL)
|
||||
+ {
|
||||
+ argv[n] = path;
|
||||
+ }
|
||||
}
|
||||
if (access (path, F_OK) != 0)
|
||||
{
|
||||
--
|
||||
GitLab
|
||||
|
48
base/polkit/polkit.SMBuild
Executable file
48
base/polkit/polkit.SMBuild
Executable file
|
@ -0,0 +1,48 @@
|
|||
app=polkit
|
||||
version=0.120
|
||||
build=1sml
|
||||
homepage="http://www.freedesktop.org/wiki/Software/polkit"
|
||||
download="https://gitlab.freedesktop.org/polkit/polkit/-/archive/0.120/polkit-0.120.tar.bz2"
|
||||
desc="authentication framework to allow communication between unprivileged and privileged processes"
|
||||
requires="glib netbsd-curses expat libffi zlib dbus"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf $app-$version
|
||||
|
||||
tar xf $srcdir/$app-$version.tar.?z*
|
||||
cd $app-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
applypatch $srcdir/make-innetgr-optional.patch
|
||||
applypatch $srcdir/polkit-0.120-security_fix-1.patch
|
||||
|
||||
autoreconf -vif
|
||||
./configure \
|
||||
--prefix="" \
|
||||
--sysconfdir=/etc \
|
||||
--disable-man-pages \
|
||||
--disable-static \
|
||||
--disable-examples \
|
||||
--enable-libsystemd-login=no \
|
||||
--enable-libelogind=no \
|
||||
--with-authfw=shadow \
|
||||
--enable-verbose-mode \
|
||||
--with-os-type=Slackware \
|
||||
--disable-introspection
|
||||
|
||||
make
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
mkdir -p $pkg/var/lib/polkit
|
||||
|
||||
cp COPYING $pkgdocs/
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
db072769439d5e17d0eed681e7b94251b77828c1474b40fe40b94293903a64333e7fa17515a3270648691f04a1374d8b404405ead6abf292a8eb8483164adc46 polkit-0.120.tar.gz
|
||||
0c47751e928a91ce3a477a330ef38b8f6f003b515c94e7fb9842e6f2043be43d749ab7390cc1dbcf1fa6128b62cf0eab353d4f8855d68e595bc53777512f4562 make-innetgr-optional.patch
|
||||
2606d4ff8ae00be2416da965f6c00c9b2c30ff928b765d9a744f9470805329192949bbca43b42741709e6fb3672c8d6f0bf8b4c97603b4f022d16ca243ab99a2 polkit-0.120-security_fix-1.patch
|
||||
"
|
|
@ -1,100 +0,0 @@
|
|||
APP=rust
|
||||
VERSION=1.53.0
|
||||
BUILD=1sml
|
||||
HOMEPAGE='https://rust-lang.org'
|
||||
DOWNLOAD='https://static.rust-lang.org/dist/rustc-1.53.0-src.tar.xz'
|
||||
DESC="a safe, concurrent, practical language"
|
||||
REQUIRES="gcc-libs bash llvm clang gdb"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
#rm -rf rustc-$VERSION-src
|
||||
|
||||
#tar xf $SRCDIR/rustc-$VERSION-src.tar.?z*
|
||||
cd rustc-$VERSION-src
|
||||
#fixbuilddirpermissions
|
||||
|
||||
# Create a temporary directory that will house a prebuilt architecture-specific rust toolchain provided by rust developers for bootstrapping
|
||||
#mkdir temp-toolchain
|
||||
#cd temp-toolchain
|
||||
|
||||
# Extract the toolchain into it
|
||||
#tar xf $SRCDIR/$APP-$VERSION-$ARCH-unknown-linux-musl.tar.gz
|
||||
#cd $APP-$VERSION-$ARCH-unknown-linux-musl
|
||||
|
||||
# Now install the toolchain
|
||||
#./install.sh --prefix="/" || true
|
||||
|
||||
# Go back to the temporary build directory
|
||||
#cd ../../
|
||||
|
||||
#patch -p1 < $SRCDIR/0001-Fix-LLVM-build.patch
|
||||
#patch -p1 < $SRCDIR/00016-do-not-copy-libunwind.patch
|
||||
#patch -p1 < $SRCDIR/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
|
||||
#patch -p1 < $SRCDIR/0003-Require-static-native-libraries-when-linking-static-.patch
|
||||
#patch -p1 < $SRCDIR/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch
|
||||
#patch -p1 < $SRCDIR/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch
|
||||
#patch -p1 < $SRCDIR/0006-test-use-extern-for-plugins-Don-t-assume-multilib.patch
|
||||
#patch -p1 < $SRCDIR/0007-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch
|
||||
#patch -p1 < $SRCDIR/0008-Ignore-broken-and-non-applicable-tests.patch
|
||||
#patch -p1 < $SRCDIR/0009-Link-stage2-tools-dynamically-to-libstd.patch
|
||||
#patch -p1 < $SRCDIR/0010-Move-debugger-scripts-to-usr-share-rust.patch
|
||||
#patch -p1 < $SRCDIR/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch
|
||||
#patch -p1 < $SRCDIR/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
|
||||
#patch -p1 < $SRCDIR/disable_miri.patch
|
||||
|
||||
clear_vendor_checksums() {
|
||||
sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json
|
||||
}
|
||||
|
||||
export RUST_BACKTRACE=1
|
||||
export PKG_CONFIG_ALLOW_CROSS=1
|
||||
#sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py
|
||||
#clear_vendor_checksums libc
|
||||
|
||||
# We use our system's LLVM. Discard rust's own bundled LLVM directory
|
||||
#rm -Rf src/llvm-project/
|
||||
|
||||
#cp $SRCDIR/config.toml .
|
||||
|
||||
#if [ "$ARCH" = "aarch64" ] ; then
|
||||
# sed -i 's@ARCH@aarch64@g' config.toml
|
||||
#elif [ "$ARCH" = "x86_64" ] ; then
|
||||
# sed -i 's@ARCH@x86_64@g' config.toml
|
||||
#fi
|
||||
|
||||
# Go easy on the pi
|
||||
unset MAKEFLAGS
|
||||
python3 ./x.py dist -v -j2
|
||||
DESTDIR="$PKG" python3 ./x.py install
|
||||
|
||||
cp LICENSE* COPYRIGHT $PKGDOCS/
|
||||
|
||||
find $PKG/lib -name "*.so" -exec chmod 755 "{}" \+
|
||||
|
||||
# Remove the temporary toolchain
|
||||
cd temp-toolchain/$APP-$VERSION-$ARCH-unknown-linux-musl
|
||||
./install.sh --uninstall --prefix="/"
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
SHA512SUMS="
|
||||
ddd5fbd62242e7541245c0abd0ba76ac0197e8182ea425610da3e8be8700d6639763c4dadc699bfa29e1441e659de82fdfbe6e235efce29b9e28d0c8e9ad44f3 rust-1.53.0-aarch64-unknown-linux-musl.tar.gz
|
||||
97d1c3c43f02a378ae2fba0148b6ec37c4c69756bb518c3e1624fa6c5dee9383925312d69ff4bde45a2c3a04a3ef6bb10ed0d2939a932b12cfbb507550cc3c4f rust-1.53.0-x86_64-unknown-linux-musl.tar.gz
|
||||
e279491a6252b2a62a70c0352e4dd9603ffbb629231315572ef2eac4581ebad394076ff05da47ff71f488f1b84a783ac95b41665b3c85b524ecc8a4eccd7c4b0 rustc-1.53.0-src.tar.xz
|
||||
3a2961af1f90f19f06cd079c051566952f7e347bd29dcb5f2b6ffe85d59e00f9de1eda4a5ddad7a5abd0ef85d5f8e7c5b2a143923cb286bff9369291e562856e 0001-Fix-LLVM-build.patch
|
||||
165316d689dc664101a720af4baf5772159dc87459f3937488ceb1cfd4063b76bcb190046fe3927489b399f9815d24007845f4270d58fb06e4500d05cc39fa50 00016-do-not-copy-libunwind.patch
|
||||
966a3f898d516b9e327a6caa2dcecb189f1af2ad2b606a4254452b7525b992d160fbb5acc5e6747dd8f572d6f055dded4d07b0e5680184af3f58c86ef434e6c7 0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
|
||||
4fc9d7ced03f0effb3bcce385fa1663d37ae9f271b79c8270fa442a6e9a2de3694246f3a95eaa0fb5177558c0f312e8df38ce514b69c889642b6895197e0b15f 0003-Require-static-native-libraries-when-linking-static-.patch
|
||||
a9fd9de296f3c4a54534901d3b9912b1cafd0787ad2358e872a030393c7f9f6e57adf39f6a16699621389056edd8118dbb4e8071bce97906b1311b39ccec4098 0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch
|
||||
fa67468667903290b8e6d16d6777f80aac49d987e8e60c43f8302da77fa1e0e35c4d363d216867c79989c8c35d552c0d5dd6bce69734ed0ce75b4b67ca924953 0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch
|
||||
5798114c8eb1b914b7affe9925c477f5dcd135925ed925580b69811ca3249c40ca73731425b5e15322879817ad5cb17e19dc78748e993a6c56fa5570a44ce228 0006-test-use-extern-for-plugins-Don-t-assume-multilib.patch
|
||||
7a559ce8f92f015cc5173fdf378e7e3b52052b7a0ea2604e851121bcdab098220c6cdba59980a087560865b339e761afa0570fefb63b0def5e45f512bb0d1a9e 0007-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch
|
||||
1bd86522b04d95baa42aff5656cc12642f4772de021aa6b13fc809cca998ec2ac78b075f66c57c0a565804a14ad6f99f34fd9b3470198970c57b13b61e6bbcad 0008-Ignore-broken-and-non-applicable-tests.patch
|
||||
ab7cea491237894bfa77e2a74ca27a3ff20c38c6428e853fa384e5ba511afe496f7ec3210048f26b393224c47414440c5e7beea0e480a471128b301515750196 0009-Link-stage2-tools-dynamically-to-libstd.patch
|
||||
5ed3c48782f52e30180b0a012686a5dbea18bf69e053eefd4211fb077b2e5696b1e7031f6b37659cbdf78e9fa902abe36aeb384a3ff88f8ab2ba5ada7b32a3f9 0010-Move-debugger-scripts-to-usr-share-rust.patch
|
||||
63701e7d8c5606abe94cba6d157a60682b67f6eb585f16dd543061229e5cfff777a675d984541398a4c0bf4d8f7a873428b9849ebcaa9acdc685c269b40c6a57 0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch
|
||||
9d772f7d109becbae2fa007e350a4357b70afc13a6a2d9b64885cb0970742785cd4e770b28cdaa6a4314a7db0d44a91f0a95334c46b51591c89ad17cdc3e020b 0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
|
||||
70b12454888b80487b5819e03800c86ad978099f0b607e60b8e129f2388780068b11e79a0382a58af7a03f7c2e8bf28e1682edc1d55118ad4be8e72ddf011a59 disable_miri.patch
|
||||
"
|
39
base/udisks/udisks.SMBuild
Executable file
39
base/udisks/udisks.SMBuild
Executable file
|
@ -0,0 +1,39 @@
|
|||
app=udisks
|
||||
version=2.9.4
|
||||
build=1sml
|
||||
homepage="http://www.freedesktop.org/wiki/Software/udisks"
|
||||
download="https://github.com/storaged-project/udisks/releases/download/udisks-2.9.4/udisks-2.9.4.tar.bz2"
|
||||
desc="Daemon that implements D-Bus interfaces for interacting with storage devices"
|
||||
requires="libblockdev libatasmart polkit"
|
||||
|
||||
build() {
|
||||
mkandenterbuilddir
|
||||
rm -rf $app-$version
|
||||
|
||||
tar xf $srcdir/$app-$version.tar.?z*
|
||||
cd $app-$version
|
||||
fixbuilddirpermissions
|
||||
|
||||
./configure \
|
||||
--prefix="" \
|
||||
--sysconfdir=/etc \
|
||||
--sbindir=/bin \
|
||||
--enable-lvm2 \
|
||||
--enable-lvmcache \
|
||||
--disable-zram \
|
||||
--disable-man \
|
||||
--disable-nls \
|
||||
--disable-rpath \
|
||||
--disable-static \
|
||||
--disable-introspection \
|
||||
--disable-gtk-doc-html
|
||||
|
||||
make
|
||||
make install DESTDIR=$pkg
|
||||
|
||||
mkfinalpkg
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
35f5429bc2a7092aa659cba9296837d127e2b17c23ab23111d0d9b230d15ef5a6965e112b1f3829748a69a52fb5b09722153f86f1ef70977b3ad7b7a4ec40ec5 udisks-2.9.4.tar.bz2
|
||||
"
|
Loading…
Reference in a new issue