Revert "syslinux: Add /etc/kernel.d scripts."
This reverts commit e13236c8a8
.
This commit is contained in:
parent
39fb4ce5a7
commit
867e135456
4 changed files with 1 additions and 130 deletions
|
@ -4,16 +4,3 @@ Some optional packages must be installed for additional functionality:
|
||||||
- gptfdisk: GPT support
|
- gptfdisk: GPT support
|
||||||
- efibootmgr: EFI support
|
- efibootmgr: EFI support
|
||||||
- dosfstools: EFI support
|
- dosfstools: EFI support
|
||||||
|
|
||||||
Kernel.d scripts update the current and fallback kernel using these keywords:
|
|
||||||
|
|
||||||
- LABEL void
|
|
||||||
- LABEL voidfallback
|
|
||||||
- LINUX (or KERNEL)
|
|
||||||
- INITRD (or initrd)
|
|
||||||
|
|
||||||
Avoid using these keywords for the MENU LABEL entry.
|
|
||||||
|
|
||||||
For more information on how to setup syslinux.cfg, see:
|
|
||||||
|
|
||||||
https://www.syslinux.org/wiki/?title=SYSLINUX#How_do_I_Configure_SYSLINUX.3F
|
|
||||||
|
|
|
@ -1,57 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Kernel hook for SYSLINUX.
|
|
||||||
#
|
|
||||||
# Arguments passed to this script: $1 pkgname, $2 version.
|
|
||||||
#
|
|
||||||
PKGNAME="$1"
|
|
||||||
VERSION="$2"
|
|
||||||
CFGFILE="$ROOTDIR/boot/syslinux/syslinux.cfg"
|
|
||||||
|
|
||||||
LABELVOID_LINENUMBER=$(
|
|
||||||
grep -nwm 1 'LABEL void' "$CFGFILE" |
|
|
||||||
awk '{print ($0+0)}')
|
|
||||||
LABELVOIDFALLBACK_LINENUMBER=$(
|
|
||||||
grep -nwm 1 'LABEL voidfallback' "$CFGFILE" |
|
|
||||||
awk '{print ($0+0)}')
|
|
||||||
|
|
||||||
VOID_KERNEL_LINENUMBER=$(
|
|
||||||
tail -n +"$LABELVOID_LINENUMBER" "$CFGFILE" |
|
|
||||||
grep -Enwm 1 'LINUX|KERNEL' |
|
|
||||||
awk '{print ($0+offset)}' offset="$((LABELVOID_LINENUMBER-1))")
|
|
||||||
VOID_INITRD_LINENUMBER=$(
|
|
||||||
tail -n +"$LABELVOID_LINENUMBER" "$CFGFILE" |
|
|
||||||
grep -nwim 1 'INITRD' |
|
|
||||||
awk '{print ($0+offset)}' offset="$((LABELVOID_LINENUMBER-1))")
|
|
||||||
VOIDFALLBACK_KERNEL_LINENUMBER=$(
|
|
||||||
tail -n +"$LABELVOIDFALLBACK_LINENUMBER" "$CFGFILE" |
|
|
||||||
grep -Enwm 1 'LINUX|KERNEL' |
|
|
||||||
awk '{print ($0+offset)}' offset="$((LABELVOIDFALLBACK_LINENUMBER-1))")
|
|
||||||
VOIDFALLBACK_INITRD_LINENUMBER=$(
|
|
||||||
tail -n +"$LABELVOIDFALLBACK_LINENUMBER" "$CFGFILE" |
|
|
||||||
grep -nwim 1 'INITRD' |
|
|
||||||
awk '{print ($0+offset)}' offset="$((LABELVOIDFALLBACK_LINENUMBER-1))")
|
|
||||||
|
|
||||||
#only use LINUX|KERNEL line to parse old kernel version
|
|
||||||
OLD_VERSION=$(
|
|
||||||
sed -n "${VOID_KERNEL_LINENUMBER}p" "$CFGFILE" |
|
|
||||||
awk '{print $2}' |
|
|
||||||
awk 'BEGIN{FS="-"}{print $2}')
|
|
||||||
OLD_FALLBACKVERSION=$(
|
|
||||||
sed -n "${VOIDFALLBACK_KERNEL_LINENUMBER}p" "$CFGFILE" |
|
|
||||||
awk '{print $2}' |
|
|
||||||
awk 'BEGIN{FS="-"}{print $2}')
|
|
||||||
|
|
||||||
if [ -f "$CFGFILE" ]; then
|
|
||||||
sed -i "${VOID_KERNEL_LINENUMBER}s/$OLD_VERSION/$VERSION/" "$CFGFILE"
|
|
||||||
sed -i "${VOID_INITRD_LINENUMBER}s/$OLD_VERSION/$VERSION/" "$CFGFILE"
|
|
||||||
echo "Syslinux: Updated Kernel entry to $VERSION from $OLD_VERSION"
|
|
||||||
sed -i "${VOIDFALLBACK_KERNEL_LINENUMBER}s/$OLD_FALLBACKVERSION\
|
|
||||||
/$OLD_VERSION/" "$CFGFILE"
|
|
||||||
sed -i "${VOIDFALLBACK_INITRD_LINENUMBER}s/$OLD_FALLBACKVERSION\
|
|
||||||
/$OLD_VERSION/" "$CFGFILE"
|
|
||||||
echo "Syslinux: Updated Fallback Kernel entry to $OLD_VERSION from \
|
|
||||||
$OLD_FALLBACKVERSION"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,54 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Kernel hook for SYSLINUX.
|
|
||||||
#
|
|
||||||
# Arguments passed to this script: $1 pkgname, $2 version.
|
|
||||||
#
|
|
||||||
PKGNAME="$1"
|
|
||||||
VERSION="$2"
|
|
||||||
CFGFILE="$ROOTDIR/boot/syslinux/syslinux.cfg"
|
|
||||||
|
|
||||||
LABELVOID_LINENUMBER=$(
|
|
||||||
grep -nwm 1 'LABEL void' "$CFGFILE" |
|
|
||||||
awk '{print ($0+0)}')
|
|
||||||
LABELVOIDFALLBACK_LINENUMBER=$(
|
|
||||||
grep -nwm 1 'LABEL voidfallback' "$CFGFILE" |
|
|
||||||
awk '{print ($0+0)}')
|
|
||||||
|
|
||||||
VOID_KERNEL_LINENUMBER=$(
|
|
||||||
tail -n +"$LABELVOID_LINENUMBER" "$CFGFILE" |
|
|
||||||
grep -Enwm 1 'LINUX|KERNEL' |
|
|
||||||
awk '{print ($0+offset)}' offset="$((LABELVOID_LINENUMBER-1))")
|
|
||||||
VOID_INITRD_LINENUMBER=$(
|
|
||||||
tail -n +"$LABELVOID_LINENUMBER" "$CFGFILE" |
|
|
||||||
grep -nwim 1 'INITRD' |
|
|
||||||
awk '{print ($0+offset)}' offset="$((LABELVOID_LINENUMBER-1))")
|
|
||||||
VOIDFALLBACK_KERNEL_LINENUMBER=$(
|
|
||||||
tail -n +"$LABELVOIDFALLBACK_LINENUMBER" "$CFGFILE" |
|
|
||||||
grep -Enwm 1 'LINUX|KERNEL' |
|
|
||||||
awk '{print ($0+offset)}' offset="$((LABELVOIDFALLBACK_LINENUMBER-1))")
|
|
||||||
|
|
||||||
#only use LINUX|KERNEL line to parse old kernel version
|
|
||||||
OLD_VERSION=$(
|
|
||||||
sed -n "${VOID_KERNEL_LINENUMBER}p" "$CFGFILE" |
|
|
||||||
awk '{print $2}' |
|
|
||||||
awk 'BEGIN{FS="-"}{print $2}')
|
|
||||||
OLD_FALLBACKVERSION=$(
|
|
||||||
sed -n "${VOIDFALLBACK_KERNEL_LINENUMBER}p" "$CFGFILE" |
|
|
||||||
awk '{print $2}' |
|
|
||||||
awk 'BEGIN{FS="-"}{print $2}')
|
|
||||||
|
|
||||||
if [ -f "$CFGFILE" ]; then
|
|
||||||
if [ -f "$ROOTDIR/boot/vmlinuz-$OLD_VERSION" ]; then
|
|
||||||
#do nothing
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
sed -i "${VOID_KERNEL_LINENUMBER}s/$OLD_VERSION/$OLD_FALLBACKVERSION/" \
|
|
||||||
"$CFGFILE"
|
|
||||||
sed -i "${VOID_INITRD_LINENUMBER}s/$OLD_VERSION/$OLD_FALLBACKVERSION/" \
|
|
||||||
"$CFGFILE"
|
|
||||||
echo "Syslinux: Revert Kernel entry $OLD_VERSION to $OLD_FALLBACKVERSION"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'syslinux'
|
# Template file for 'syslinux'
|
||||||
pkgname=syslinux
|
pkgname=syslinux
|
||||||
version=6.03
|
version=6.03
|
||||||
revision=5
|
revision=4
|
||||||
hostmakedepends="perl python nasm"
|
hostmakedepends="perl python nasm"
|
||||||
makedepends="gnu-efi-libs libuuid-devel"
|
makedepends="gnu-efi-libs libuuid-devel"
|
||||||
short_desc="A boot loader for the Linux operating system"
|
short_desc="A boot loader for the Linux operating system"
|
||||||
|
@ -40,9 +40,4 @@ do_install() {
|
||||||
rm ${DESTDIR}/usr/share/syslinux/com32/*.a
|
rm ${DESTDIR}/usr/share/syslinux/com32/*.a
|
||||||
# Remove keytab-lilo to prevent conflict with LILO
|
# Remove keytab-lilo to prevent conflict with LILO
|
||||||
rm ${DESTDIR}/usr/bin/keytab-lilo
|
rm ${DESTDIR}/usr/bin/keytab-lilo
|
||||||
# Setup kernel hooks
|
|
||||||
vinstall ${FILESDIR}/kernel.d/syslinux.post-install 750 \
|
|
||||||
etc/kernel.d/post-install 50-syslinux
|
|
||||||
vinstall ${FILESDIR}/kernel.d/syslinux.post-remove 750 \
|
|
||||||
etc/kernel.d/post-remove 50-syslinux
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue