Calculate automatic kernel building scripts

git-svn-id: http://svn.calculate.ru/overlay@277 c91db197-33c1-4113-bf15-f8a5c547ca64
atratsevskiy
atratsevskiy 16 years ago
parent 03c308a86e
commit 003e171e18

@ -0,0 +1,10 @@
AUX calckernel-3.4.9.patch 4137 RMD160 73e099cc517cf617c333dfa04650f57770d83457 SHA1 62874a37005017d3836ba134bb9bb4290261e575 SHA256 506d40e15d81c2e77232b28331297904bb60953547befe2c838d19ba4fb31ac5
AUX genkernel.bash 2438 RMD160 b3d8e4436d8768c07d18c5aaff9c14fc16641729 SHA1 e15a9c6ef506aa6872a6a97d26751246dedded04 SHA256 e7de9771ba79ef878e2c9a21a1c1720f092c6047d3cc7d4a49ff6b90e7e2c248
DIST LVM2.2.02.28.tgz 531905 RMD160 bf6f25db6e34bf362353ae9557691a7f01962502 SHA1 6eb2f6e1228b017ad23d0b7f2bb12fd113f96616 SHA256 2d8d7b123e427d0bfb7471d7c17dfd88890eb98257ca22ea3be5d7307e83aceb
DIST device-mapper.1.02.22.tgz 189726 RMD160 8bf9986536c49f53c398d6a2180e21e1235bea18 SHA1 a4533872c32951a1b549bb9207a13b7e4dae0701 SHA256 ff833a6cd6246686f5b3f5692fd6597f1ffbc60f08929e5fe68304cdafb61595
DIST dmraid-1.0.0.rc14.tar.bz2 164234 RMD160 9cd238a981cfef9c5c1f2f1d6466b70c95ec9c7c SHA1 2b3284db46a995967d88993ae5ae36b57c513bc4 SHA256 a777354d6d69a9b58d84966cc7b37bc3f5c89539f885ad25fd874ed1c388fbec
DIST e2fsprogs-1.39.tar.gz 3695111 RMD160 67e77a7cbf0e719fa8b5a8ac6285b334e1c3481b SHA1 c2dad0c9bd76701eafe3804e2a7d072aa198f046 SHA256 dc2033447e69a1612881151f6f163e8a3b80e51d16f5e8b3576f3f8ccb325ea3
DIST genkernel-3.4.9.tar.bz2 181731 RMD160 f26551a6013028fee23d7a1e6e2429fc7fa76d58 SHA1 ca6c482bb44133a04430fd0b5777294d5dd7cb8f SHA256 b3a09bb0135f052c13c0b3dac56d825b1f9c4068fbb9f81b2283f83301f559c7
DIST genkernel-pkg-3.4-r3.tar.bz2 1915282 RMD160 8424628e94c51d500f7b28532901ad0c5e53ee38 SHA1 a4fec14ca086098fbe3d62810bf7892f7c0da326 SHA256 0681579b34705de7fc7ec7a08154cea9dc21142b612f4b7d904a4b588e3de684
DIST unionfs-1.5pre-cvs200701042308.tar.gz 163418 RMD160 6d54be6db26a562dd943df2de9cf0e0138c45c6f SHA1 9559a0ae8e0552a9c3644c85a99c1be601c837fc SHA256 d1925eee22517df72828a7c75890c20a54335e135f6ed04ea43f8771c9b1c271
EBUILD calckernel-3.4.9.ebuild 3906 RMD160 dc8f206bcc043212b3e03801f78ba04c5aea8db5 SHA1 ad2d1f92b263f41bf4d6257b70082759fb328870 SHA256 4a690c50d81188147f39199768929708848333df24d151f2760f8742ffcf2e8c

@ -0,0 +1,110 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.9.ebuild,v 1.3 2008/02/14 04:33:25 wolf31o2 Exp $
inherit bash-completion eutils
MY_PN='genkernel'
MY_PV=${PV}
MY_P=${MY_PN}-${MY_PV}
VERSION_DMAP='1.02.22'
VERSION_DMRAID='1.0.0.rc14'
VERSION_E2FSPROGS='1.39'
VERSION_LVM='2.02.28'
VERSION_PKG='3.4-r3'
VERSION_UNIONFS='1.5pre-cvs200701042308'
DESCRIPTION="Calculate automatic kernel building scripts"
HOMEPAGE="http://www.calculate-linux.ru/Calckernel"
SRC_URI="mirror://gentoo/${MY_P}.tar.bz2
mirror://gentoo/${MY_PN}-pkg-${VERSION_PKG}.tar.bz2
http://dev.gentoo.org/~wolf31o2/sources/${MY_PN}/${MY_P}.tar.bz2
http://dev.gentoo.org/~wolf31o2/sources/${MY_PN}/${MY_PN}-pkg-${VERSION_PKG}.tar.bz2
http://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-${VERSION_DMRAID}.tar.bz2
http://people.redhat.com/~heinzm/sw/dmraid/src/old/dmraid-${VERSION_DMRAID}.tar.bz2
ftp://sources.redhat.com/pub/lvm2/LVM2.${VERSION_LVM}.tgz
ftp://sources.redhat.com/pub/lvm2/old/LVM2.${VERSION_LVM}.tgz
ftp://sources.redhat.com/pub/dm/device-mapper.${VERSION_DMAP}.tgz
ftp://sources.redhat.com/pub/dm/old/device-mapper.${VERSION_DMAP}.tgz
ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/unionfs-1.x/snapshots/unionfs-${VERSION_UNIONFS}.tar.gz
mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
RESTRICT=""
# Please don't touch individual KEYWORDS. Since this is maintained/tested by
# Release Engineering, it's easier for us to deal with all arches at once.
#KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sparc x86"
IUSE="ibm selinux"
DEPEND="sys-fs/e2fsprogs
selinux? ( sys-libs/libselinux )
!sys-kernel/genkernel*"
RDEPEND="${DEPEND} app-arch/cpio"
S=${WORKDIR}/${MY_P}
src_unpack() {
unpack ${MY_P}.tar.bz2
cd "${S}"
unpack ${MY_PN}-pkg-${VERSION_PKG}.tar.bz2
use selinux && sed -i 's/###//g' gen_compile.sh
epatch "${FILESDIR}"/${P}.patch
}
src_install() {
dodir /etc
cp "${S}"/genkernel.conf "${D}"/etc
# This block updates genkernel.conf
sed -i -e "s:VERSION_DMAP:$VERSION_DMAP:" \
-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
-e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \
-e "s:VERSION_LVM:$VERSION_LVM:" \
-e "s:VERSION_UNIONFS:$VERSION_UNIONFS:" \
"${D}"/etc/genkernel.conf || die "Could not adjust versions"
dodir /usr/share/genkernel
use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \
cp "${S}"/ppc64/kernel-2.6.g5 "${S}"/ppc64/kernel-2.6
cp -Rp "${S}"/* "${D}"/usr/share/genkernel
dodir /usr/bin
dosym /usr/share/genkernel/genkernel /usr/bin/genkernel
rm -f "${D}"/usr/share/genkernel/genkernel.conf
dodoc README
doman genkernel.8
rm genkernel.8
cp "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \
"${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \
"${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \
"${DISTDIR}"/unionfs-${VERSION_UNIONFS}.tar.gz \
"${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \
"${D}"/usr/share/genkernel/pkg
dobashcompletion "${FILESDIR}"/genkernel.bash
}
pkg_postinst() {
echo
elog 'Documentation is available in the genkernel manual page'
elog 'as well as the following URL:'
echo
elog 'http://www.gentoo.org/doc/en/genkernel.xml'
echo
ewarn "This package is known to not work with reiser4. If you are running"
ewarn "reiser4 and have a problem, do not file a bug. We know it does not"
ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
ewarn "broken in this regard. Try using a sane filesystem like ext3 or"
ewarn "even reiser3."
echo
ewarn "The LUKS support has changed from versions prior to 3.4.4. Now,"
ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
echo
bash-completion_pkg_postinst
}

@ -0,0 +1,90 @@
--- genkernel-3.4.9.orig/generic/initrd.defaults 2008-01-12 02:44:19.000000000 +0300
+++ genkernel-3.4.9/generic/initrd.defaults 2008-02-13 00:50:27.000000000 +0300
@@ -60,8 +60,12 @@
fi
QUIET=1
-ROOT_LINKS='bin sbin lib lib32 lib64 boot usr opt emul'
-ROOT_TREES='etc root home var'
+#-----------------------------------------------------------------------------
+# Calculate hack - перенесем копируемые директории из ROOT_TREES в ROOT_LINKS
+# плюс добавим media
+ROOT_LINKS='bin sbin lib lib32 lib64 boot usr opt emul etc root home var media'
+ROOT_TREES=''
+#-----------------------------------------------------------------------------
INSMOD='insmod'
if [ "${KMINOR}" -gt '4' ]
then
--- genkernel-3.4.9.orig/generic/initrd.scripts 2008-01-12 02:44:19.000000000 +0300
+++ genkernel-3.4.9/generic/initrd.scripts 2008-01-24 17:25:05.000000000 +0300
@@ -99,7 +99,12 @@
# else
# mount -r -t auto ${x} ${mntdir} &>/dev/null
# fi
- mount -r -t ${CDROOT_TYPE} ${x} ${mntdir} &>/dev/null
+
+#-----------------------------------------------------------------------------
+# Calculate hack - удалим вывод в null устройство приводящий к ошибке на экране
+# mount -r -t ${CDROOT_TYPE} ${x} ${mntdir} &>/dev/null
+ mount -r -t ${CDROOT_TYPE} ${x} ${mntdir}
+#-----------------------------------------------------------------------------
if [ "$?" = '0' ]
then
# Check for the media
--- genkernel-3.4.9.orig/generic/linuxrc 2008-01-12 02:44:19.000000000 +0300
+++ genkernel-3.4.9/generic/linuxrc 2008-01-24 17:22:47.000000000 +0300
@@ -634,9 +634,12 @@
if [ "${USE_UNIONFS_NORMAL}" != '1' ]
then
- good_msg "Copying read-write image contents to tmpfs"
+#-----------------------------------------------------------------------------
+# Calculate hack - закомментируем перенос директорий настроек на RAM-диск
+# good_msg "Copying read-write image contents to tmpfs"
# Copy over stuff that should be writable
- (cd ${NEW_ROOT}/${FS_LOCATION}; cp -a ${ROOT_TREES} ${NEW_ROOT})
+# (cd ${NEW_ROOT}/${FS_LOCATION}; cp -a ${ROOT_TREES} ${NEW_ROOT})
+#-----------------------------------------------------------------------------
# Now we do the links.
for x in ${ROOT_LINKS}
@@ -684,7 +687,14 @@
mkdir initrd proc tmp sys 2>/dev/null
chmod 1777 tmp
fi
-
+
+#-----------------------------------------------------------------------------
+# Calculate hack - подмонтируем образ через unionfs для возможности записи
+echo "mkdir unionfs && mount unionfs..."
+mkdir mnt/unionfs
+mount -t unionfs -o dirs=mnt/unionfs=rw:mnt/livecd=ro null mnt/livecd
+#-----------------------------------------------------------------------------
+
#UML=`cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||'`
#if [ "${UML}" = 'UML' ]
#then
--- genkernel-3.4.9.orig/x86/modules_load 2008-01-12 02:44:18.000000000 +0300
+++ genkernel-3.4.9/x86/modules_load 2008-01-24 17:23:17.000000000 +0300
@@ -39,4 +39,8 @@
ohci-hcd usbhid sl811-hcd"
# Filesystems
-MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs"
+#-----------------------------------------------------------------------------
+# Calculate hack - добавим unionfs в список импортируемых в initrd модулей
+MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs unionfs"
+#-----------------------------------------------------------------------------
+
--- genkernel-3.4.9.orig/x86_64/modules_load 2008-01-12 02:44:17.000000000 +0300
+++ genkernel-3.4.9/x86_64/modules_load 2008-01-24 17:23:28.000000000 +0300
@@ -39,4 +39,8 @@
ohci-hcd usbhid sl811-hcd"
# Filesystems
-MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs"
+#-----------------------------------------------------------------------------
+# Calculate hack - добавим unionfs в список импортируемых в initrd модулей
+MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs unionfs"
+#-----------------------------------------------------------------------------
+

@ -0,0 +1,73 @@
# genkernel (8) completion
# Copyright 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Written by Aron Griffis <agriffis@gentoo.org>
_genkernel()
{
declare cur prev genkernel_help actions params
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
# extract initial list of params/actions from genkernel --help
genkernel_help=$(command genkernel --help)
actions=( $(<<<"$genkernel_help" sed -n \
'/^Available Actions:/,/^$/s/^[[:space:]]\+\([^[:space:]]\+\).*/\1/p') )
params=( $(<<<"$genkernel_help" egrep -oe '--[^[:space:]]{2,}') )
# attempt to complete the current parameter based on the list
COMPREPLY=($(compgen -W "${params[*]/=*/=} ${actions[*]}" -- "$cur"))
# if we don't have a rhs to complete
if [[ ${#COMPREPLY[@]} -gt 1 ]]; then
return
elif [[ ${#COMPREPLY[@]} -eq 0 && $cur != --*=* ]]; then
return
elif [[ ${#COMPREPLY[@]} -eq 1 && $COMPREPLY != --*= ]]; then
# using nospace completion, add an explicit space
COMPREPLY="${COMPREPLY} "
return
fi
# we have a unique lhs and need to complete the rhs
declare args lhs rhs
if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
lhs=$COMPREPLY
else
lhs=${cur%%=*}=
rhs=${cur#*=}
fi
# genkernel's help gives clues as to what belongs on the rhs.
# extract the clue for the current parameter
args=" ${params[*]} "
args="${args##* $lhs}"
args="${args%% *}"
# generate a list of completions for the argument; this replaces args with
# an array of results
args=( $(case $args in
('<0-5>') compgen -W "$(echo {1..5})" -- "$rhs" ;;
('<outfile>'|'<file>') compgen -A file -o plusdirs -- "$rhs" ;;
('<dir>') compgen -A directory -S / -- "$rhs" ;;
('<tbz2>') compgen -G '*.tbz2' -G '*.tar.bz2' -o plusdirs -- "$rhs" ;;
(*) compgen -o bashdefault -- "$rhs" ;; # punt
esac) )
# we're using nospace completion to prevent spaces after paths that aren't
# "done" yet. So do some hacking to the args to add spaces after
# non-directories.
declare slash=/
args=( "${args[@]/%/ }" ) # add space to all
args=( "${args[@]/%$slash /$slash}" ) # remove space from dirs
# recreate COMPREPLY
if [[ $cur == "$lhs"* ]]; then
COMPREPLY=( "${args[@]}" )
elif [[ ${#args[@]} -gt 0 ]]; then
COMPREPLY=( "${args[@]/#/$lhs}" )
fi
}
complete -o nospace -F _genkernel genkernel
Loading…
Cancel
Save