Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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