Commit 89e0e9c7 authored by udeved's avatar udeved

initial commit portable efi settings

parent 9a4ac543
......@@ -32,7 +32,13 @@ RC = \
SD = $(wildcard data/sd/*)
all: $(BIN) $(RC) $(XBIN)
GRUB_DEFAULT = \
data/grub2-portable-efi
GRUB_D = \
data/99_zzz-portable-efi
all: $(BIN) $(RC) $(XBIN) ${GRUB_D}
edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/manjaro-tools|g" \
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/manjaro-tools|g" \
......@@ -46,7 +52,7 @@ edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/manjaro-tools|g" \
@chmod +x "$@"
clean:
rm -f $(BIN) $(RC) $(XBIN)
rm -f $(BIN) $(RC) $(XBIN) ${GRUB_D}
install_base:
install -dm0755 $(DESTDIR)$(PREFIX)/bin
......@@ -73,12 +79,22 @@ install_xdg:
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/skel/.config/autostart
install -m0755 ${XDG} $(DESTDIR)$(SYSCONFDIR)/skel/.config/autostart
install_portable_efi:
install -dm755 $(DESTDIR)$(SYSCONFDIR)/default
install -0755 $(GRUB_DEFAULT) $(DESTDIR)$(SYSCONFDIR)/default
install -dm755 $(DESTDIR)$(SYSCONFDIR)/grub.d
install -0755 $(GRUB_D) $(DESTDIR)$(SYSCONFDIR)/grub.d
uninstall:
for f in ${BIN}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${SHARED}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
for f in ${LIBS}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
uninstall_portable_efi:
for f in ${GRUB_DEFAULT}; do rm -f $(DESTDIR)$(SYSCONFDIR)/default/$$f; done
for f in ${GRUB_D}; do rm -f $(DESTDIR)$(SYSCONFDIR)/grub.d/$$f; done
uninstall_rc:
for f in ${RC}; do rm -f $(DESTDIR)$(SYSCONFDIR)/init.d/$$f; done
......@@ -89,9 +105,9 @@ uninstall_xdg:
for f in ${XBIN}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${XDG}; do rm -f $(DESTDIR)$(SYSCONFDIR)/skel/.config/autostart/$$f; done
install: install_base install_rc install_sd install_xdg
install: install_base install_rc install_sd install_xdg install_portable_efi
uninstall: uninstall_base uninstall_rc uninstall_sd uninstall_xdg
uninstall: uninstall_base uninstall_rc uninstall_sd uninstall_xdg uninstall_portable_efi
dist:
git archive --format=tar --prefix=manjaro-tools-livecd-$(Version)/ $(Version) | gzip -9 > manjaro-tools-livecd-$(Version).tar.gz
......
#!/bin/sh
# grub-mkconfig helper script.
#
# Copyright © 2014 Niall Walsh <niallwalsh@celtux.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
set -e
MT_EFI_STANDALONE=""
MT_EFI_PORTABLE_PATH="/boot/efi/EFI/BOOT"
# override tool behaviour through /etc/default/grub2-fll-standalone
if [ -r /etc/default/grub2-portable-efi ]; then
. /etc/default/grub2-portable-efi
fi
patt='[[:space:]]-o[[:space:]]\+/boot/grub/grub.cfg'
# do nothing if disabled or grub-mkconfig is generating /boot/grub/grub.cfg
( [ "${MT_EFI_STANDALONE}" != "disable" ] && \
ps x | grep 'grub-mkconfig[[:space:]]' | grep -q -e "${patt}[[:space:]]" -e "${patt}$" ) || exit
beeb="${MT_EFI_PORTABLE_PATH}"
if [ -e "${beeb}" ]; then
# do not do anything to a beeb we didn't create
[ ! -e "${beeb}/fullstory" ] && exit
else
# create beeb and mark it as ours
mkdir -p "${beeb}"
touch "${beeb}/fullstory"
fi
for platform in i386-efi x86_64-efi ; do
filename="bootx64"
[ "${platform}" = "i386-efi" ] && filename="bootia32"
[ -e /usr/lib/grub/${platform} ] && grub-mkstandalone \
-o ${beeb}/${filename}.efi --compress=xz -O ${platform} \
/boot/grub/grub.cfg=/boot/grub/grub.cfg.new 2>&1 > /dev/null
done
# Defaults for grub2-fll-portable-efi update-grub helper
# sourced by grub2's update-grub
# installed at /etc/default/grub2-fll-portable-efi by the maintainer scripts
#
# This is a POSIX shell fragment
#
# specify is this should be disabled (set to "disable")
# default:
#MT_EFI_STANDALONE=""
# specify where to install the portable efi
# default: /boot/efi/EFI/BOOT
#MT_EFI_PORTABLE_PATH="/boot/efi/EFI/BOOT"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment