diff options
Diffstat (limited to 'target/linux/x86/base-files/lib')
-rw-r--r-- | target/linux/x86/base-files/lib/preinit/01_sysinfo | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/target/linux/x86/base-files/lib/preinit/01_sysinfo b/target/linux/x86/base-files/lib/preinit/01_sysinfo index cb63a04014..3c21c07615 100644 --- a/target/linux/x86/base-files/lib/preinit/01_sysinfo +++ b/target/linux/x86/base-files/lib/preinit/01_sysinfo @@ -1,3 +1,12 @@ +sanitize_name_x86() { + sed -e ' + y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/; + s/[^a-z0-9_-]\+/-/g; + s/^-//; + s/-$//; + ' "$@" +} + do_sysinfo_x86() { local vendor product file @@ -17,12 +26,7 @@ do_sysinfo_x86() { echo "$vendor $product" > /tmp/sysinfo/model - sed -e ' - y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/; - s/[^a-z0-9_-]\+/-/g; - s/^-//; - s/-$//; - ' /tmp/sysinfo/model > /tmp/sysinfo/board_name + sanitize_name_x86 /tmp/sysinfo/model > /tmp/sysinfo/board_name } boot_hook_add preinit_main do_sysinfo_x86 |