mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-27 16:02:55 +02:00
u-boot-menu: update to 0.3
This commit is contained in:
parent
1244ec58ad
commit
743f708c52
2 changed files with 18 additions and 12 deletions
|
@ -7,18 +7,19 @@ header() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_bootpath() {
|
get_bootpath() {
|
||||||
echo ${1} | sed "s#${BOOTPART}/#/#"
|
echo "${1}" | sed "s#${BOOTPART}/#/#"
|
||||||
}
|
}
|
||||||
|
|
||||||
add_kernel() {
|
add_kernel() {
|
||||||
ver=${1}
|
ver="${1}"
|
||||||
kernel=$(get_bootpath "/boot/vmlinux-${ver}")
|
suffix="${2}"
|
||||||
|
kernel=$(get_bootpath "/boot/vmlinu${suffix}-${ver}")
|
||||||
initrd=$(get_bootpath "/boot/initramfs-${ver}.img")
|
initrd=$(get_bootpath "/boot/initramfs-${ver}.img")
|
||||||
devicetreedir=$(get_bootpath "/boot/dtbs/dtbs-${ver}")
|
devicetreedir=$(get_bootpath "/boot/dtbs/dtbs-${ver}")
|
||||||
fdt=$(get_bootpath "/boot/dtbs/dtbs-${ver}/${DTBPATH}")
|
fdt=$(get_bootpath "/boot/dtbs/dtbs-${ver}/${DTBPATH}")
|
||||||
cmdline="${CMDLINE}"
|
cmdline="${CMDLINE}"
|
||||||
|
|
||||||
printf "LABEL entry%s\n" "${ENTRY}" >> "${OUTFILE}"
|
printf "\nLABEL entry%s\n" "${ENTRY}" >> "${OUTFILE}"
|
||||||
printf "\tMENU LABEL Void Linux Version %s\n" "${ver}" >> "${OUTFILE}"
|
printf "\tMENU LABEL Void Linux Version %s\n" "${ver}" >> "${OUTFILE}"
|
||||||
printf "\tLINUX %s\n" "${kernel}" >> "${OUTFILE}"
|
printf "\tLINUX %s\n" "${kernel}" >> "${OUTFILE}"
|
||||||
if [ -e "${BOOTPART}/${initrd}" ]; then
|
if [ -e "${BOOTPART}/${initrd}" ]; then
|
||||||
|
@ -27,17 +28,18 @@ add_kernel() {
|
||||||
if [ -n "${USE_DEVICETREEDIR}" ]; then
|
if [ -n "${USE_DEVICETREEDIR}" ]; then
|
||||||
printf "\tDEVICETREEDIR %s\n" "${devicetreedir}" >> "${OUTFILE}"
|
printf "\tDEVICETREEDIR %s\n" "${devicetreedir}" >> "${OUTFILE}"
|
||||||
elif [ -n "${DTBPATH}" ] && [ -e "${BOOTPART}/${fdt}" ]; then
|
elif [ -n "${DTBPATH}" ] && [ -e "${BOOTPART}/${fdt}" ]; then
|
||||||
printf "\tFDT %s\n" ${fdt} >> "${OUTFILE}"
|
printf "\tFDT %s\n" "${fdt}" >> "${OUTFILE}"
|
||||||
fi
|
fi
|
||||||
if [ -n "${cmdline}" ]; then
|
if [ -n "${cmdline}" ]; then
|
||||||
printf "\tAPPEND %s\n" "${cmdline}" >> "${OUTFILE}"
|
printf "\tAPPEND %s\n" "${cmdline}" >> "${OUTFILE}"
|
||||||
fi
|
fi
|
||||||
ENTRY=$(expr ${ENTRY} + 1)
|
|
||||||
|
ENTRY=$((ENTRY + 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [ ! -d /boot/extlinux ]; then
|
if [ ! -d /boot/extlinux ]; then
|
||||||
rm ${OUTFILE}
|
rm "${OUTFILE}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -52,15 +54,19 @@ main() {
|
||||||
header
|
header
|
||||||
|
|
||||||
for kernel in $(ls /boot/vmlinu[xz]-* | sort -rV); do
|
for kernel in $(ls /boot/vmlinu[xz]-* | sort -rV); do
|
||||||
ver=$(echo ${kernel} | sed "s#/boot/vmlinu[xz]-\(.*\)#\\1#")
|
ver=$(echo "${kernel}" | sed "s#/boot/vmlinu[xz]-\(.*\)#\\1#")
|
||||||
|
suffix=$(echo "${kernel}" | sed "s#/boot/vmlinu\([xz]\).*#\\1#")
|
||||||
echo "Add kernel ${ver}"
|
echo "Add kernel ${ver}"
|
||||||
add_kernel ${ver}
|
add_kernel "${ver}" "${suffix}"
|
||||||
done
|
done
|
||||||
mv ${OUTFILE} /boot/extlinux/extlinux.conf
|
|
||||||
|
mv "${OUTFILE}" /boot/extlinux/extlinux.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
CONF=/etc/default/extlinux
|
CONF=/etc/default/extlinux
|
||||||
OUTFILE=$(mktemp)
|
OUTFILE=$(mktemp)
|
||||||
BOOTPART=$(df -P /boot | tail -1 | awk '{ print $6 }')
|
BOOTPART=$(df -P /boot | tail -1 | awk '{ print $6 }')
|
||||||
ENTRY=0
|
ENTRY=0
|
||||||
|
TIMEOUT=10
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'u-boot-menu'
|
# Template file for 'u-boot-menu'
|
||||||
pkgname=u-boot-menu
|
pkgname=u-boot-menu
|
||||||
version=0.2
|
version=0.3
|
||||||
revision=3
|
revision=1
|
||||||
conf_files="/etc/default/extlinux"
|
conf_files="/etc/default/extlinux"
|
||||||
short_desc="Create an u-boot menu with currently available kernels"
|
short_desc="Create an u-boot menu with currently available kernels"
|
||||||
maintainer="Remi Pommarel <repk@triplefau.lt>"
|
maintainer="Remi Pommarel <repk@triplefau.lt>"
|
||||||
|
|
Loading…
Add table
Reference in a new issue