sys-boot/refit: propperly use the mount-efi system
(Portage version: 2.2.0_alpha4/svn/Linux x86_64) git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@2742 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
@@ -75,11 +75,11 @@ src_install() {
|
||||
# at the moment the onyl really supported filesystem on
|
||||
# all efi bootloader in the efi partition is fat32
|
||||
# (elilo, refit, grub-efi, ...)
|
||||
insinto /boot/efi/EFI/${PN}
|
||||
insinto /usr/share/${PN}
|
||||
doins refit/refit.efi
|
||||
insinto /boot/efi/EFI/${PN}/tools
|
||||
insinto /usr/share/${PN}/tools
|
||||
doins gptsync/gptsync.efi
|
||||
insinto /boot/efi/EFI/${PN}/${PN}
|
||||
insinto /usr/share/${PN}/${PN}
|
||||
doins -r icons
|
||||
doins images/vollabel/refit.vollabel
|
||||
doins refit.conf
|
||||
@@ -87,3 +87,78 @@ src_install() {
|
||||
doman gptsync/gptsync.8
|
||||
doman "${WORKDIR}"/debian/showpart.8
|
||||
}
|
||||
|
||||
setup_efi_dir() {
|
||||
local boot_dir=$1
|
||||
local dir=${boot_dir}
|
||||
|
||||
mkdir -p "${dir}"
|
||||
dir="${dir}/refit"
|
||||
if [[ ! -e ${dir} ]] ; then
|
||||
mkdir -p "${dir}" || die "${dir} does not exist!"
|
||||
fi
|
||||
einfo "Copying files from /usr/share/refit to ${dir}"
|
||||
for x in \
|
||||
"${ROOT}"/usr/share/refit/* ; do
|
||||
[[ -f ${x} ]] && cp -p "${x}" "${dir}"/
|
||||
done
|
||||
|
||||
if [[ ! -e ${dir}/refit ]] ; then
|
||||
mkdir -p "${dir}/refit" || die "${dir}/refit does not exist!"
|
||||
fi
|
||||
einfo "Copying files from /usr/share/refit/refit to ${dir}/refit"
|
||||
for x in \
|
||||
"${ROOT}"/usr/share/refit/refit/* ; do
|
||||
[[ -f ${x} ]] && cp -p "${x}" "${dir}/refit/"
|
||||
done
|
||||
|
||||
if [[ ! -e ${dir}/refit/icons/ ]] ; then
|
||||
mkdir -p "${dir}/refit/icons/" || die "${dir}/refit/icons/ does not exist!"
|
||||
fi
|
||||
einfo "Copying files from /usr/share/refit/refit/icons to ${dir}/refit/icons"
|
||||
for x in \
|
||||
"${ROOT}"/usr/share/refit/refit/icons/* ; do
|
||||
[[ -f ${x} ]] && cp -p "${x}" "${dir}/refit/icons/"
|
||||
done
|
||||
|
||||
if [[ ! -e ${dir}/tools ]] ; then
|
||||
mkdir -p "${dir}/tools/" || die "${dir}/tools/ does not exist!"
|
||||
fi
|
||||
einfo "Copying files from /usr/share/refit/tools to ${dir}/tools"
|
||||
for x in \
|
||||
"${ROOT}"/usr/share/refit/tools/* ; do
|
||||
[[ -f ${x} ]] && cp -p "${x}" "${dir}/tools/"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ -n ${DONT_MOUNT_EFI} ]]; then
|
||||
elog "WARNING: you have DONT_MOUNT_EFI in effect, so you must apply"
|
||||
elog "the following instructions for your /boot/efi!"
|
||||
elog "Neglecting to do so may cause your system to fail to boot!"
|
||||
elog
|
||||
else
|
||||
setup_efi_dir "${ROOT}"/boot/efi/EFI
|
||||
# Trailing output because if this is run from pkg_postinst, it gets mixed into
|
||||
# the other output.
|
||||
einfo ""
|
||||
fi
|
||||
elog "To interactively install refit files to another device such as a USB"
|
||||
elog "stick, just run the following and specify the directory as prompted:"
|
||||
elog " emerge --config =${PF}"
|
||||
elog "Alternately, you can export REFIT_ALT_INSTALLDIR=/path/to/use to tell"
|
||||
elog "refit where to install in a non-interactive way."
|
||||
|
||||
}
|
||||
|
||||
pkg_config() {
|
||||
local dir
|
||||
if [ ! -d "${REFIT_ALT_INSTALLDIR}" ]; then
|
||||
einfo "Enter the directory where you want to setup refit:"
|
||||
read dir
|
||||
else
|
||||
dir="${REFIT_ALT_INSTALLDIR}"/EFI
|
||||
fi
|
||||
setup_efi_dir "${dir}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user