blob: 509c312a7c5054226c5a4e1cbb54ada74ed7bc3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
#spec file for busybox
%if "%{!?VERSION:1}"
%define VERSION 1.36.1
%endif
%if "%{!?RELEASE:1}"
%define RELEASE 3
%endif
Epoch: 1
Name: busybox
Version: %{VERSION}
Release: %{RELEASE}
Summary: The Swiss Army Knife of Embedded Linux
License: GPLv2
URL: http://www.busybox.net
Source: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2
Source1: busybox-static.config
Source2: busybox-petitboot.config
Source3: busybox-dynamic.config
Patch6000: backport-CVE-2022-28391.patch
Patch6001: backport-CVE-2022-48174.patch
BuildRoot: %_topdir/BUILDROOT
#Dependency
BuildRequires: gcc glibc-static
BuildRequires: libselinux-devel >= 1.27.7-2
BuildRequires: libsepol-devel libselinux-static libsepol-static
Provides: bundled(md5-drepper2)
%package petitboot
Summary: Configure the busybox version with petitboot
%package help
Summary: Documentation for busybox
%description
BusyBox combines tiny versions of many common UNIX utilities into a
single small executable. It provides replacements for most of the
utilities you usually find in GNU fileutils, shellutils, etc. It provides
a fairly complete environment for any small or embedded system.
%description petitboot
The Petitboot bootloader provides a boot menu and boots the chosen boot
option using the Linux kernel's kexec functionality. And for use with the
Petitboot bootloader used on PlayStation 3, the version of the contained
in this package is minimal configured.
%description help
This package contains help documentation for busybox
%prep
# auto apply all needed patch with git
%autosetup -n %{name}-%{version} -p1 -v
%build
export CFLAGS="$RPM_OPT_FLAGS -fPIE" LDFLAGS="-Wl,-z,now"
cp %{SOURCE3} .config
yes "" | make oldconfig && \
cat .config && \
make V=1 %{?_smp_mflags} CC="gcc $RPM_OPT_FLAGS"
cp busybox_unstripped busybox.dynamic
cp docs/busybox.1 docs/busybox.dynamic.1
make clean
cp %{SOURCE2} .config
yes "" | make oldconfig
cat .config && \
make V=1 %{?_smp_mflags} CC="%__cc $RPM_OPT_FLAGS"
cp busybox_unstripped busybox.petitboot
cp docs/busybox.1 docs/busybox.petitboot.1
%install
mkdir -p $RPM_BUILD_ROOT/sbin
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1
install -m 755 busybox.petitboot $RPM_BUILD_ROOT/sbin/busybox.petitboot
install -m 755 busybox.dynamic $RPM_BUILD_ROOT/sbin/busybox
install -m 644 docs/busybox.petitboot.1 $RPM_BUILD_ROOT/%{_mandir}/man1/busybox.petitboot.1
install -m 644 docs/busybox.dynamic.1 $RPM_BUILD_ROOT/%{_mandir}/man1/busybox.1
%files
%doc LICENSE README
/sbin/busybox
%files petitboot
%doc LICENSE README
/sbin/busybox.petitboot
%files help
%{_mandir}/man1/busybox.1.gz
%{_mandir}/man1/busybox.petitboot.1.gz
%changelog
* Thu Aug 31 2023 huangsong <huangsong14@huawei.com> - 1:1.36.1-3
- Type:CVE
- Id:NA
- SUG:NA
- DESC:re-fixed CVE-2022-48174
|