Magellan Linux

Contents of /smage/branches/alx-0_6_0/core/mkinitrd/mkinitrd-6.3.5-r6.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3534 - (show annotations) (download)
Tue Apr 24 14:40:06 2012 UTC (12 years ago) by niro
File size: 3135 byte(s)
-fixed patchwork
1 # $Id$
2
3 PNAME="mkinitrd"
4 PVER="6.3.5"
5 PBUILD="r6"
6
7 PCATEGORIE="sys-apps"
8
9 DESCRIPTION="Mkinitrd creates filesystem images for use as initial ramdisk (initrd) images."
10 HOMEPAGE="http://magellan-linux.de/"
11
12 DEPEND=">= sys-apps/gawk-3
13 >= virtual/which
14 >= virtual/debianutils
15 >= sys-apps/module-init-tools-3.12
16 >= app-arch/cpio-2
17 >= virtual/gzip
18 >= sys-fs/e2fsprogs-1.41
19 >= dev-libs/popt-1.16
20 >= sys-apps/util-linux-2.19
21 >= sys-apps/v86d-0.1.10"
22
23 # nasm is needed to rebuild syslinux
24 SDEPEND=">= virtual/kernel-sources
25 >= sys-apps/findutils-4
26 >= virtual/sed
27 >= dev-lang/nasm-2"
28
29 SRCFILE="${PNAME}-${PVER}.tar.bz2"
30 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
31
32 REMOVE_DEPRECATED_MAGE_TARGETS=1
33 ALX_ONLY_KEEP="sbin usr/sbin usr/$(mlibdir)/mkinitrd etc/conf.d/mkinitrd"
34 sminclude mbuild alx-split
35
36 SRC_URI=(
37 mirror://${PNAME}/${SRCFILE}
38 mirror://${PNAME}/${PNAME}-${PVER}-no-glib2-dep.patch
39 mirror://${PNAME}/${PNAME}-${PVER}-respect-rootdelay-and-mount-devtmpfs-in-sysroot-if-supported.patch
40 mirror://${PNAME}/${PNAME}-${PVER}-fix-dev-handling.patch
41 mirror://${PNAME}/${PNAME}-${PVER}-klibc-1.5.22.patch
42 mirror://${PNAME}/${PNAME}-${PVER}-variable-sysroot-and-substition-fix.patch
43 )
44
45 src_prepare()
46 {
47 munpack ${SRCFILE} || die
48 cd ${SRCDIR}
49
50 # no need to link against glib2 - removed in later versions
51 mpatch ${PNAME}-${PVER}-no-glib2-dep.patch || die
52
53 # respect rootdelay given in cmdline and mount devtmpfs in sysroot before switch-root if supported
54 mpatch ${PNAME}-${PVER}-respect-rootdelay-and-mount-devtmpfs-in-sysroot-if-supported.patch || die
55
56 # fix broken devtmpfs handling of prior patch and only mount dev if really needed
57 # do not umount initrds dev,proc,sys but mount move it to real sysroot
58 mpatch ${PNAME}-${PVER}-fix-dev-handling.patch || die
59
60 # update klibc to 1.5.22
61 mpatch ${PNAME}-${PVER}-klibc-1.5.22.patch || die
62
63 # support variable sysroot and fixed variable substitution while linking cloop mount dirs
64 mpatch ${PNAME}-${PVER}-variable-sysroot-and-substition-fix.patch || die
65
66 # enable scsi,sata and pata checks for 2.6.29 as default
67 sed -i -e "s:^\(DOSCSI=\).*:\1yes:" \
68 -e "s:^\(DOSATA=\).*:\1yes:" \
69 -e "s:^\(DOPATA=\).*:\1yes:" \
70 livecd/linuxrc.sh || die
71
72 # fix version, we want ${PVER}-${PBUILD}
73 echo "${PVER}-${PBUILD}" > VERSION || die
74
75 # fix libdir on 64bit arches
76 sed -i "s:^\(LIBDIR =\).*:\1 /usr/$(mlibdir):" livecd/Makefile || die
77 sed -i "s:^\(LIBDIR.*=\).*:\1 /usr/$(mlibdir)/mkinitrd:" isolinux/Makefile || die
78
79 # only load supported fb-drivers with dofb
80 : > livecd/modules.framebuffer || die
81 local mod
82 for mod in i915 mga nouveau r128 radeon savage sis tdfx ttm via uvesafb
83 do
84 echo "${mod}" >> livecd/modules.framebuffer || die
85 done
86 }
87
88 src_compile()
89 {
90 cd ${SRCDIR}
91 mmake -j1 ARCH=${ARCH/i*86/i386} || die
92 }
93
94 preinstall()
95 {
96 add_conf_prot_ignore /etc/conf.d/mkinitrd
97 }
98
99 postinstall()
100 {
101 # re-create initrd
102 mount /boot &> /dev/null
103 kv="$(readlink /boot/initrd | sed -e 's:initrd-::' -e 's:.img::')"
104 if [ -d /lib/modules/${kv} ]
105 then
106 mkinitrd -f /boot/initrd-"${kv}".img "${kv}"
107 else
108 echo "Warning: modules dir /lib/modules/${kv} does not exist!"
109 fi
110 }