now in sabayon tree

This commit is contained in:
Mario Fetka 2012-10-25 22:31:17 +02:00
parent e566efbeb5
commit 902e8bf50e
6 changed files with 0 additions and 241 deletions

View File

@ -1,9 +0,0 @@
# ChangeLog for app-admin/eselect-uimage
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
25 Oct 2012; Mario Fetka <mario.fetka@gmail.com>
eselect-uimage-0.2-r1.ebuild, +files/uimage-0.2.default,
files/uimage-0.2.eselect, +metadata.xml:
add config file support to sabayons eselt mdoule

View File

@ -1,5 +0,0 @@
AUX uimage-0.2.default 301 SHA256 a5a13b1f1c76c4ad8938f1d681847ae6a652c086d428e87e69319260b553e6f4 SHA512 aa44463fc75591c5eccf3ad12cdf9710499a92aeb955e5286e863ab436b3dbe82374b9951855b7b3f8915582e63e9689e848cd5daf7c1be2aa7ba39cd96ba246 WHIRLPOOL 782c60c05c7de385098ea7c88dd5b87d5d931cc89d671c0677aa061bf7cb8dedf854024ea39aeb06f567ffe72a9b7c28bd880e675aa33b1b2b3643f1f28ea2ae
AUX uimage-0.2.eselect 4714 SHA256 1743c9d5060bfff19d4edc367b01e6d9d32a78808527e666108d324af7bf630e SHA512 4d4f18bfe2514852f88154f7c4888f4128e7c06d2f3750d200265ce56b93f0ddbad1f0cb0165b7015932f0bf90d321523d76fe6ef540a658282cd2e915b934ca WHIRLPOOL 77b5ba012bc847365d899e3a51f6a7d0a1ca3ae14b57dc648d240a1cf2b474729eb6b5c6f4140b1b729cd6f960915966d9abf246d0294fee3d9092474a49802f
EBUILD eselect-uimage-0.2-r1.ebuild 570 SHA256 ba3db0d6d918335e3c51096f7297ec5299fec9a29d753e4f8072a38c5c219f64 SHA512 9eeb6c240f06f22a92f86492c71aa574753640b556adfdf12e66084ad29409faa4aee14f08e59619bd5e6445b9ddfc98d5f66206a98f989a6ebebbc8f4167ce5 WHIRLPOOL d97ca44c9754ee54567a838333f4b9172724725696dce91f74db1bb8891796c6e6a6d4d926bf0404d8b4d1b101d55f415d5604a09a0f1f2b8b7f1a403e077341
MISC ChangeLog 330 SHA256 b7d91c024069fd21218c3840551e827fe0823f075e29508a273349c457e4ce51 SHA512 5cd16d6443c47513edc1134df955e1b6cf3fda0aaceb300ec0dea59678f8dd2e0ec1b3f6159b32ed0f4a0f60ad6d5c6510931c947034a3f828d7c3bef8021baa WHIRLPOOL 4cdd7ad2c560594563ac7b8e1b532e377ffd40dce26e3f1aa8a6a4c203b208ce470e537ff93df8611ec1162053c439f40f2a5b6ff5b9ccf9d917f85a0dfd66f9
MISC metadata.xml 273 SHA256 9538d9b03de39acce753f3b37c282c146e6de540b37588aee26b1a2b404dde1d SHA512 fc6f519c6b13824ab049e7f416cb4dd32146d9c52098a40b26c98e691781d1fff5ff0197456cef78ecc644da993ea6fcff1d370cd1fbb8c8365aba2f25dcf141 WHIRLPOOL e49afc5a4caac6f76ed53f026062f18608274aea56e1a86493043a21e9dcb293321acc94fc843666f8920c2d85e5d81b684007c9ce4201534b3c61a57697bc4e

View File

@ -1,27 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
SRC_URI=""
KEYWORDS="~arm"
DESCRIPTION="Eselect module for making easy to switch between u-boot Linux kernels"
HOMEPAGE="http://www.sabayon.org"
LICENSE="GPL-2"
SLOT="0"
IUSE=""
S="${WORKDIR}"
RDEPEND=">=app-admin/eselect-1.2.3
sys-apps/file"
src_install() {
insinto /usr/share/eselect/modules
newins "${FILESDIR}/uimage-${PV}.eselect" uimage.eselect
insinto /etc/eselect/uimage
newins "${FILESDIR}/uimage-${PV}.default" default
}

View File

@ -1,11 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 or later
# $Id: $
# Module variables
# BOOT_DIR="${EROOT}/boot"
# KERNEL_PREFIX="kernel-"
# INITRAMFS_PREFIX="initramfs-"
# UIMAGE_SYM="${BOOT_DIR}/uImage"
# UINITRD_SYM="${BOOT_DIR}/uInitrd"

View File

@ -1,181 +0,0 @@
# -*-eselect-*- vim: ft=eselect
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 or later
# $Id: $
DESCRIPTION="Switch u-boot default kernel by updating /boot/uImage symlink"
MAINTAINER="lxnay@sabayon.org"
VERSION="0.1"
# Module variables
BOOT_DIR="${EROOT}/boot"
KERNEL_PREFIX="kernel-"
INITRAMFS_PREFIX="initramfs-"
UIMAGE_SYM="${BOOT_DIR}/uImage"
UINITRD_SYM="${BOOT_DIR}/uInitrd"
if [ -e /etc/eselect/uimage/default ] && source /etc/eselect/uimage/default
_is_kernel() {
local f="${1}"
outcome=$(LC_ALL=C /usr/bin/file --brief "${f}" 2> /dev/null | \
grep "^u-boot" | grep -i "kernel image")
[[ -n "${outcome}" ]] && return 0
return 1
}
_get_initramfs() {
local kernel_bn="${1}"
echo "${kernel_bn/${KERNEL_PREFIX}/${INITRAMFS_PREFIX}}"
}
find_targets() {
local f
for f in "${BOOT_DIR}/"*; do
# skip dirs
[[ -d "${f}" ]] && continue
# skip broken syms etc
[[ ! -e "${f}" ]] && continue
# skip non reg files
[[ ! -f "${f}" ]] && continue
_is_kernel "${f}" || continue
basename "${f}"
done
}
remove_symlink() {
rm "${UIMAGE_SYM}"
}
set_symlink() {
local target="${1}"
if is_number "${target}"; then
local targets=( $(find_targets) )
target=${targets[target-1]}
fi
[[ -z "${target}" || ! -f "${BOOT_DIR}/${target}" ]] \
&& die -q "Target \"${target}\" doesn't appear to be valid!"
echo "Setting uImage to ${target}"
ln -sf "${target}" "${UIMAGE_SYM}" || die "Cannot create symlink"
local initramfs_target=$(_get_initramfs "${target}")
if [ -f "${BOOT_DIR}/${initramfs_target}" ]; then
echo "Setting uInitrd to ${initramfs_target}"
ln -sf "${initramfs_target}" "${UINITRD_SYM}" || \
die "Cannot create initrd symlink"
elif [ -L "${UINITRD_SYM}" ]; then
echo "No uInitrd found, removing ${UINITRD_SYM}"
rm "${UINITRD_SYM}"
fi
}
### show action ###
describe_show() {
echo "Show the current ${UIMAGE_SYM} kernel and ${UINITRD_SYM} initrd"
}
describe_show_options() {
echo "--quiet : only print the actual symlink value"
echo "--silent : same as --quiet"
}
do_show() {
local quiet=""
while [[ $# -gt 0 ]]; do
case ${1##--} in
quiet|silent)
quiet="1"
;;
esac
shift
done
[[ -z "${quiet}" ]] && write_list_start "Current kernel:"
if [[ -L "${UIMAGE_SYM}" ]] && [[ -e "${UIMAGE_SYM}" ]]; then
local kernel=$(canonicalise "${UIMAGE_SYM}")
local kernel_bn=$(basename "${kernel%/}")
if [[ -n "${quiet}" ]]; then
echo "${kernel_bn}"
else
write_kv_list_entry "${kernel_bn}" ""
fi
else
if [[ -z "${quiet}" ]]; then
write_kv_list_entry "(unset)" ""
fi
fi
}
### list action ###
describe_list() {
echo "List available kernel uImages"
}
describe_list_options() {
echo "--quiet : only print the actual symlink value"
echo "--silent : same as --quiet"
}
do_list() {
local quiet=""
while [[ $# -gt 0 ]]; do
case ${1##--} in
quiet|silent)
quiet="1"
;;
esac
shift
done
local i targets=( $(find_targets) )
[[ -z "${quiet}" ]] && write_list_start "Available kernel targets:"
for (( i = 0; i < ${#targets[@]}; i++ )); do
if [[ -z "${quiet}" ]]; then
# highlight the target where the symlink is pointing to
[[ ${targets[i]} = \
$(basename "$(canonicalise "${UIMAGE_SYM}")") ]] \
&& targets[i]=$(highlight_marker "${targets[i]}")
else
echo "${targets[i]}"
fi
done
[[ -z "${quiet}" ]] && \
write_numbered_list -m "(none found)" "${targets[@]}"
}
### set action ###
describe_set() {
echo "Set a new kernel uImage"
}
describe_set_parameters() {
echo "<target>"
}
describe_set_options() {
echo "target : Target name or number (from 'list' action)"
}
do_set() {
[[ -z "${1}" ]] && die -q "You didn't tell me what to set the symlink to"
[[ ${#} -gt 1 ]] && die -q "Too many parameters"
if [[ -L "${UIMAGE_SYM}" ]]; then
# existing symlink
remove_symlink || die -q "Couldn't remove existing symlink"
set_symlink "$1" || die -q "Couldn't set a new symlink"
elif [[ -e "${UIMAGE_SYM}" ]]; then
# we have something strange
die -q "${UIMAGE_SYM} exists but is not a symlink"
else
set_symlink "${1}" || die -q "Couldn't set a new symlink"
fi
}

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>mario.fetka@gmail.com</email>
<name>Mario Fetka</name>
</maintainer>
</pkgmetadata>