diff options
author | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
commit | 48ca75555522716f0f686dcae3dd6cf3d8ad714d (patch) | |
tree | 00c0f58550ba4661e87376f2f02c8001c69bae44 /repo/system/syslinux/syslinux.post-upgrade | |
parent | 871b2b573f01c1b3176a0f65458b3d281b41c437 (diff) |
removed idea of repos
Diffstat (limited to 'repo/system/syslinux/syslinux.post-upgrade')
-rw-r--r-- | repo/system/syslinux/syslinux.post-upgrade | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/repo/system/syslinux/syslinux.post-upgrade b/repo/system/syslinux/syslinux.post-upgrade deleted file mode 100644 index 9038866..0000000 --- a/repo/system/syslinux/syslinux.post-upgrade +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -# find given append opt -get_append_opt() { - awk -v search="$1" ' - $1 == "append" || $1 == "APPEND" { - split($0, a); - for (i in a) { - if (index(a[i], search) == 1) { - print a[i]; - } - } - }' /boot/extlinux.conf | sort | uniq -} - -# print default kernel options -get_default_opts() { - awk ' - $1 == "append" || $1 == "APPEND" { - opts=""; - space=""; - split($0, a); - for (i in a) { - if (i != 1 \ - && (index(a[i], "root=") != 1) \ - && (index(a[i], "initrd=") != 1) \ - && (index(a[i], "modules=") != 1)) { - opts = opts space a[i]; - space = " "; - } - } - print opts; - } - ' /boot/extlinux.conf | sort | uniq -} - -if ! [ -f /boot/extlinux.conf ]; then - exit 0 -fi - -# check if we already have a generated extlinux.conf -if grep -q '^# Generated by update-extlinux' /boot/extlinux.conf; then - exit 0 -fi - -# try fish out the kernel opts from extlinuix.conf's append line -root=$(get_append_opt 'root=' | head -n 1) -modules=$(get_append_opt 'modules=' | head -n 1) -opts=$(get_default_opts | head -n 1) - -# populate update-extlinux.conf with the info we know -if [ -n "$root" ]; then - sed -i -e "/^root=/s|.*|$root|g" /etc/update-extlinux.conf -fi -if [ -n "$modules" ]; then - sed -i -e "/^modules=/s|.*|$modules|g" /etc/update-extlinux.conf -fi -if [ -n "$opts" ]; then - sed -i -e "/^default_kernel_opts=/s|.*|default_kernel_opts=\"$opts\"|g" /etc/update-extlinux.conf -fi - |