Annotation of /smage/trunk/core/dracut/dracut-040-r2.smage2
Parent Directory | Revision Log
Revision 6245 -
(hide annotations)
(download)
Thu Mar 26 10:53:20 2015 UTC (9 years, 2 months ago) by niro
File size: 6148 byte(s)
Thu Mar 26 10:53:20 2015 UTC (9 years, 2 months ago) by niro
File size: 6148 byte(s)
-added
1 | niro | 6245 | # $Id$ |
2 | |||
3 | PNAME="dracut" | ||
4 | PVER="040" | ||
5 | PBUILD="r2" | ||
6 | |||
7 | PCAT="sys-apps" | ||
8 | |||
9 | DESCRIPTION="Initramfs generator using udev which fully replaces mkinitrd." | ||
10 | HOMEPAGE="https://dracut.wiki.kernel.org/" | ||
11 | |||
12 | DEPEND=">= app-shells/bash-4.2 | ||
13 | >= virtual/bzip2 | ||
14 | >= virtual/gzip | ||
15 | >= virtual/xz-utils | ||
16 | >= virtual/cpio | ||
17 | >= virtual/tar | ||
18 | >= sys-apps/coreutils-8.22 | ||
19 | >= sys-apps/findutils-4.4 | ||
20 | >= virtual/grep | ||
21 | >= virtual/kbd | ||
22 | >= virtual/procps | ||
23 | >= virtual/module-tools | ||
24 | >= virtual/sed | ||
25 | >= virtual/eject | ||
26 | >= sys-apps/util-linux-2.25 | ||
27 | >= sys-apps/v86d-0.1.9 | ||
28 | >= sys-apps/plymouth-0.8.8 | ||
29 | >= sys-apps/grubby-8.35 | ||
30 | >= sys-fs/device-mapper-2.02.111 | ||
31 | >= sys-fs/udev-216 | ||
32 | >= sys-apps/systemd-216" | ||
33 | |||
34 | PROVIDE="virtual/initramfs-tools" | ||
35 | |||
36 | SDEPEND=">= app-text/docbook-xml-dtd-9 | ||
37 | >= app-text/docbook-xml-dtd-9 | ||
38 | >= app-text/asciidoc-8.6 | ||
39 | >= sys-apps/util-linux-dev-2.25 | ||
40 | >= sys-fs/udev-dev-216 | ||
41 | >= sys-apps/systemd-dev-216" | ||
42 | |||
43 | SRCFILE="${PNAME}-${PVER}.tar.xz" | ||
44 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
45 | |||
46 | ALX_PKG_KEEP="etc/dracut.conf | ||
47 | etc/dracut.conf.d | ||
48 | usr/lib/dracut/dracut-install | ||
49 | usr/lib/dracut/dracut-logger.sh | ||
50 | usr/lib/dracut/dracut-functions | ||
51 | usr/lib/dracut/dracut-functions.sh | ||
52 | usr/lib/dracut/dracut-initramfs-restore | ||
53 | usr/lib/dracut/dracut-version.sh | ||
54 | usr/lib/dracut/modules.d/05busybox | ||
55 | usr/lib/dracut/modules.d/10i18n | ||
56 | usr/lib/dracut/modules.d/30convertfs | ||
57 | usr/lib/dracut/modules.d/40uvesafb | ||
58 | usr/lib/dracut/modules.d/40network | ||
59 | usr/lib/dracut/modules.d/45url-lib | ||
60 | usr/lib/dracut/modules.d/50drm | ||
61 | usr/lib/dracut/modules.d/50plymouth | ||
62 | usr/lib/dracut/modules.d/90dm | ||
63 | usr/lib/dracut/modules.d/90dmsquash-live | ||
64 | usr/lib/dracut/modules.d/90dmraid | ||
65 | usr/lib/dracut/modules.d/90kernel-modules | ||
66 | usr/lib/dracut/modules.d/90mdraid | ||
67 | usr/lib/dracut/modules.d/90multipath | ||
68 | usr/lib/dracut/modules.d/95dasd | ||
69 | usr/lib/dracut/modules.d/95dasd_mod | ||
70 | usr/lib/dracut/modules.d/95fstab-sys | ||
71 | usr/lib/dracut/modules.d/95resume | ||
72 | usr/lib/dracut/modules.d/95rootfs-block | ||
73 | usr/lib/dracut/modules.d/95terminfo | ||
74 | usr/lib/dracut/modules.d/95udev-rules | ||
75 | usr/lib/dracut/modules.d/97biosdevname | ||
76 | usr/lib/dracut/modules.d/98pollcdrom | ||
77 | usr/lib/dracut/modules.d/98syslog | ||
78 | usr/lib/dracut/modules.d/98systemd | ||
79 | usr/lib/dracut/modules.d/98usrmount | ||
80 | usr/lib/dracut/modules.d/99base | ||
81 | usr/lib/dracut/modules.d/99fs-lib | ||
82 | usr/lib/dracut/modules.d/99img-lib | ||
83 | usr/lib/dracut/modules.d/99shutdown | ||
84 | usr/lib/systemd | ||
85 | usr/bin/dracut | ||
86 | usr/bin/dracut-catimages | ||
87 | usr/bin/lsinitrd | ||
88 | usr/bin/mkinitrd | ||
89 | var/initramfs | ||
90 | var/log/dracut.log" | ||
91 | sminclude mbuild mtools systemd cleanutils alx-split | ||
92 | msetfeature "!check" | ||
93 | |||
94 | # += to add injection files (alx.sminc) | ||
95 | SRC_URI+=( | ||
96 | http://www.kernel.org/pub/linux/utils/boot/${PNAME}/${SRCFILE} | ||
97 | mirror://${PNAME}/${SRCFILE} | ||
98 | mirror://${PNAME}/${PNAME}-038-magellan.patch | ||
99 | mirror://${PNAME}/${PNAME}-024-add-uvesafb-module.patch | ||
100 | mirror://${PNAME}/${PNAME}-036-mkinitrd-ignore-allow-missing-switch.patch | ||
101 | mirror://${PNAME}/${PNAME}-019-convertfs-make-selinux-optional.patch | ||
102 | mirror://${PNAME}/${PNAME}-037-network-support-udhcpc-dhcpcd-2.patch | ||
103 | mirror://${PNAME}/${PNAME}-040-busybox.patch | ||
104 | mirror://${PNAME}/${PNAME}-040-busybox-grep.patch | ||
105 | mirror://${PNAME}/${PNAME}-037-alx-busybox-install-method.patch | ||
106 | ) | ||
107 | |||
108 | UP2DATE="updatecmd http://www.kernel.org/pub/linux/utils/boot/${PNAME} | highesttarball xz" | ||
109 | |||
110 | src_prepare() | ||
111 | { | ||
112 | munpack ${SRCFILE} || die | ||
113 | cd ${SRCDIR} | ||
114 | |||
115 | # magellan compat patch | ||
116 | mpatch ${PNAME}-038-magellan.patch || die | ||
117 | |||
118 | # add uvesafb module to run v86d inside the initrd (default off) | ||
119 | mpatch ${PNAME}-024-add-uvesafb-module.patch || die | ||
120 | |||
121 | # for better mkinitrd compat and to fully support new-kernel-pkg | ||
122 | # as drop-in replacement ignore the --allow-missing switch | ||
123 | mpatch ${PNAME}-036-mkinitrd-ignore-allow-missing-switch.patch || die | ||
124 | |||
125 | # make selinux optional, we do not use it yet | ||
126 | mpatch ${PNAME}-019-convertfs-make-selinux-optional.patch || die | ||
127 | |||
128 | # add support for dhcpcd and udhcpc in the network module | ||
129 | mpatch ${PNAME}-037-network-support-udhcpc-dhcpcd-2.patch || die | ||
130 | |||
131 | # be compatible with busybox cmds | ||
132 | mpatch ${PNAME}-040-busybox.patch || die | ||
133 | mpatch ${PNAME}-040-busybox-grep.patch || die | ||
134 | |||
135 | # install the busybox module with the alx method via busybox.links file | ||
136 | mpatch ${PNAME}-037-alx-busybox-install-method.patch || die | ||
137 | |||
138 | # remove gentoo specific modules | ||
139 | rm -rf modules.d/50gensplash || die | ||
140 | # remove rpm-bases specific modules | ||
141 | rm -rf modules.d/10rpmversion || die | ||
142 | # systemd-bootchart works better | ||
143 | rm -rf modules.d/00bootchart || die | ||
144 | # no dash support anymore | ||
145 | rm -rf modules.d/00dash || die | ||
146 | |||
147 | # fix plymouth libexecdir | ||
148 | sed -i "s:/usr/libexec:/usr/$(mlibdir)/plymouth:g" \ | ||
149 | modules.d/50plymouth/module-setup.sh || die | ||
150 | |||
151 | # fix plymouth logo | ||
152 | local plymouth_logo=/usr/share/plymouth/magellan-logo.png | ||
153 | sed -i "s:^\(PLYMOUTH_LOGO_FILE=\).*:\1\"${plymouth_logo}\":" \ | ||
154 | modules.d/50plymouth/plymouth-populate-initrd.sh || die | ||
155 | |||
156 | # fix qemu libexecdir | ||
157 | sed -i "s:/usr/libexec:/usr/$(mlibdir)/qemu:" test/run-qemu || die | ||
158 | } | ||
159 | |||
160 | src_compile() | ||
161 | { | ||
162 | cd ${SRCDIR} | ||
163 | |||
164 | # fix broken CFLAGS handling, which causes compile errors if custom CFLAGS are set | ||
165 | unset CFLAGS | ||
166 | |||
167 | mmake || die | ||
168 | } | ||
169 | |||
170 | alx_generic_src_install() | ||
171 | { | ||
172 | cd ${SRCDIR} | ||
173 | mmake DESTDIR=${BINDIR} sysconfdir=/etc sbindir=/usr/bin systemdsystemunitdir=$(mget-systemd-unit-dir) install || die | ||
174 | |||
175 | # needed directories | ||
176 | mkeepdir /var/initramfs || die | ||
177 | mkeepdir /var/log || die | ||
178 | memptyfile /var/log/dracut.log || die | ||
179 | |||
180 | # missing compat symlink | ||
181 | mlink dracut /usr/bin/mkinitrd || die | ||
182 | |||
183 | minstalldocs AUTHORS COPYING HACKING NEWS README* TODO || die | ||
184 | |||
185 | # install busybox-rc compatible config and remove upstream systemd one | ||
186 | echo -e ${COLGREEN}" injecting custom dracut-configs"${COLDEFAULT} | ||
187 | if [ -f ${BINDIR}/etc/dracut.conf.d/01-magellan.conf ] | ||
188 | then | ||
189 | mdelete /etc/dracut.conf.d/01-magellan.conf || die | ||
190 | fi | ||
191 | mcinjectfile 01-alx.conf /etc/dracut.conf.d || die | ||
192 | } | ||
193 | |||
194 | preinstall() | ||
195 | { | ||
196 | if [[ ! -z $(magequery -n mkinitrd) ]] | ||
197 | then | ||
198 | echo -e ${COLRED} | ||
199 | echo -e "Error: sys-apps/mkinitrd is installed!!" | ||
200 | echo -e "dracut will overwrite binaries from sys-apps/mkinitrd and fully replace it." | ||
201 | echo -e "Please uninstall sys-apps/mkinitrd first!" | ||
202 | echo -e ${COLDEFAULT} | ||
203 | die "sys-apps/mkinitrd found!" | ||
204 | fi | ||
205 | |||
206 | add_conf_prot_mask /etc/dracut.conf /etc/dracut.conf.d | ||
207 | } |