Magellan Linux

Contents of /branches/magellan-next/core/dracut/dracut-010-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7910 - (show annotations) (download)
Fri Jun 3 21:37:50 2011 UTC (12 years, 11 months ago) by niro
File size: 5637 byte(s)
-added missing grubby dependency
1 # $Id$
2
3 PNAME="dracut"
4 PVER="010"
5 PBUILD="r2"
6
7 SPLIT_PACKAGES="dracut dracut-network dracut-fips dracut-caps dracut-tools"
8
9 PCATEGORIE="sys-apps"
10 STATE="unstable"
11
12 HOMEPAGE="https://dracut.wiki.kernel.org/"
13
14 COMMON_DEPEND=">= app-shells/bash-4.2
15 >= app-shells/dash-0.5.6.1
16 >= app-arch/bzip2-1.0.6
17 >= app-arch/gzip-1.4
18 >= app-arch/cpio-2.11
19 >= sys-apps/tar-1.26
20 >= sys-apps/coreutils-8.12
21 >= sys-apps/findutils-4.4
22 >= sys-apps/grep-2.8
23 >= sys-apps/kbd-1.15
24 >= sys-apps/module-init-tools-3.12
25 >= sys-apps/sed-4.2
26 >= sys-apps/util-linux-2.19
27 >= sys-apps/v86d-0.1.9
28 >= sys-apps/plymouth-0.8.3
29 >= sys-apps/grubby-7.0.17.1
30 >= sys-fs/udev-171"
31
32 # todo nfs, icsci, rpcbind
33 NETWORK_DEPEND=">= sys-apps/iproute2-2.6.38
34 >= net-misc/dhcpcd-5.2
35 >= net-misc/bridge-utils-1.5"
36
37 CAPS_DEPEND=">= sys-libs/libcap-2.20"
38
39 SDEPEND="${COMMON_DEPEND}
40 ${NETWORK_DEPEND}
41 ${CAPS_DEPEND}"
42
43 SRCFILE="${PNAME}-${PVER}.tar.bz2"
44 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
45
46 sminclude mbuild mtools cleanutils
47
48 SRC_URI=(
49 http://www.kernel.org/pub/linux/utils/boot/${PNAME}/${SRCFILE}
50 mirror://${PNAME}/${SRCFILE}
51 )
52
53 UP2DATE="updatecmd http://www.kernel.org/pub/linux/utils/boot/${PNAME} | lasttarball"
54
55 split_info_dracut()
56 {
57 DESCRIPTION="Initramfs generator using udev which fully replaces mkinitrd."
58 DEPEND="${COMMON_DEPEND}"
59
60 PROVIDE="virtual/initramfs-tools"
61 }
62
63 split_info_dracut-network()
64 {
65 DESCRIPTION="Dracut modules to build a dracut initramfs with network support."
66 DEPEND="== sys-apps/dracut-${PVER}
67 ${NETWORK_DEPEND}"
68 }
69
70 split_info_dracut-fips()
71 {
72 DESCRIPTION="Dracut modules to build a dracut initramfs with an integrity check."
73 DEPEND="== sys-apps/dracut-${PVER}"
74 }
75
76 split_info_dracut-caps()
77 {
78 DESCRIPTION="Dracut modules to build a dracut initramfs which drops capabilities."
79 DEPEND="== sys-apps/dracut-${PVER}
80 ${CAPS_DEPEND}"
81 }
82
83 split_info_dracut-tools()
84 {
85 DESCRIPTION="Dracut tools to build the local initramfs."
86 DEPEND="== sys-apps/dracut-${PVER}"
87 }
88
89 src_compile()
90 {
91 cd ${SRCDIR}
92 mmake || die
93 }
94
95 src_install_dracut()
96 {
97 cd ${SRCDIR}
98 mmake DESTDIR=${BINDIR} sysconfdir=/etc sbindir=/sbin install || die
99
100 # remove gentoo specific modules
101 rm -rf ${BINDIR}/usr/share/dracut/modules.d/50gensplash || die
102 # remove rpm-bases specific modules
103 rm -rf ${BINDIR}/usr/share/dracut/modules.d/10rpmversion || die
104
105 # remove modules owned by other packages
106 rm -rf ${BINDIR}/etc/dracut.conf.d/40-fips || die
107 rm -rf ${BINDIR}/usr/share/dracut/modules.d/01fips || die
108 rm -rf ${BINDIR}/usr/share/dracut/modules.d/02caps || die
109 rm -rf ${BINDIR}/usr/share/dracut/modules.d/40network || die
110 rm -rf ${BINDIR}/usr/share/dracut/modules.d/95fcoe || die
111 rm -rf ${BINDIR}/usr/share/dracut/modules.d/95iscsi || die
112 rm -rf ${BINDIR}/usr/share/dracut/modules.d/95nbd || die
113 rm -rf ${BINDIR}/usr/share/dracut/modules.d/95nfs || die
114 rm -rf ${BINDIR}/usr/share/dracut/modules.d/45ifcfg || die
115 rm -rf ${BINDIR}/usr/share/dracut/modules.d/95znet || die
116 rm -rf ${BINDIR}/usr/share/dracut/modules.d/01fips || die
117 rm -rf ${BINDIR}/usr/share/man/man8/dracut-gencmdline.8* || die
118 rm -rf ${BINDIR}/usr/share/man/man8/dracut-catimages.8* || die
119 rm -rf ${BINDIR}/sbin/dracut-gencmdline || die
120 rm -rf ${BINDIR}/sbin/dracut-catimages || die
121
122 # needed directories
123 mkeepdir /var/initramfs || die
124 mkeepdir /var/log || die
125 memptyfile /var/log/dracut.log || die
126
127 # create a magellan specific config
128 minstalldir /etc/dracut.conf.d || die
129 cat > ${BINDIR}/etc/dracut.conf.d/01-magellan.conf << EOF
130 # /etc/dracut.conf.d/01-dist.conf
131 # Dracut config file customized for Magellan-Linux
132
133 #
134 # Modules
135 #
136
137 # i18n
138 i18n_vars="/etc/conf.d/keymap:KEYMAP /etc/conf.d/consolefont:CONSOLEFONT"
139 EOF
140
141 # logrotate
142 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/dracut
143 install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut
144
145 minstalldocs AUTHORS COPYING HACKING NEWS README* TODO || die
146 }
147
148 src_install_dracut-network()
149 {
150 cd ${SRCDIR}
151 mmake DESTDIR=${BINDIR} sysconfdir=/etc sbindir=/sbin install || die
152
153 # keep only related stuff
154 zapmost ${BINDIR} \
155 usr/share/dracut/modules.d/40network \
156 usr/share/dracut/modules.d/95fcoe \
157 usr/share/dracut/modules.d/95iscsi \
158 usr/share/dracut/modules.d/95nbd \
159 usr/share/dracut/modules.d/95nfs \
160 usr/share/dracut/modules.d/45ifcfg \
161 usr/share/dracut/modules.d/95znet \
162 || die
163 }
164
165 src_install_dracut-fips()
166 {
167 cd ${SRCDIR}
168 mmake DESTDIR=${BINDIR} sysconfdir=/etc sbindir=/sbin install || die
169 minstalldir /etc/dracut.conf.d || die
170 minstallfile dracut.conf.d/fips.conf.example /etc/dracut.conf.d/40-fips.conf || die
171
172 # keep only related stuff
173 zapmost ${BINDIR} etc/dracut.conf.d/40-fips usr/share/dracut/modules.d/01fips || die
174 }
175
176 src_install_dracut-caps()
177 {
178 cd ${SRCDIR}
179 mmake DESTDIR=${BINDIR} sysconfdir=/etc sbindir=/sbin install || die
180
181 # keep only related stuff
182 zapmost ${BINDIR} usr/share/dracut/modules.d/02caps || die
183 }
184
185 src_install_dracut-tools()
186 {
187 cd ${SRCDIR}
188 mmake DESTDIR=${BINDIR} sysconfdir=/etc sbindir=/sbin install || die
189
190 # keep only related stuff
191 zapmost ${BINDIR} \
192 usr/share/man/man8/dracut-gencmdline.8\* \
193 usr/share/man/man8/dracut-catimages.8\* \
194 sbin/dracut-gencmdline \
195 sbin/dracut-catimages \
196 || die
197
198 mkeepdir /boot/dracut || die
199 mkeepdir /var/lib/dracut || die
200 mkeepdir /var/lib/dracut/overlay || die
201 }
202
203 preinstall()
204 {
205 if [[ ! -z $(magequery -n mkinitrd) ]]
206 then
207 echo -e ${COLRED}
208 echo -e "Error: sys-apps/mkinitrd is installed!!"
209 echo -e "dracut will overwrite binaries from sys-apps/mkinitrd and fully replace it."
210 echo -e "Please uninstall sys-apps/mkinitrd first!"
211 echo -e ${COLDEFAULT}
212 die "sys-apps/mkinitrd found!"
213 fi
214 }