Hello community, here is the log from the commit of package perl-Bootloader for openSUSE:Factory checked in at 2016-01-15 10:40:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Bootloader (Old) and /work/SRC/openSUSE:Factory/.perl-Bootloader.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Bootloader" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Bootloader/perl-Bootloader.changes 2015-12-18 21:50:28.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Bootloader.new/perl-Bootloader.changes 2016-01-15 10:40:16.000000000 +0100 @@ -1,0 +2,13 @@ +Fri Dec 18 15:32:13 UTC 2015 - snw...@suse.com + +- improve add/del-option scripts +- rename uboot to u-boot +- 0.903 + +------------------------------------------------------------------- +Fri Dec 18 13:42:13 UTC 2015 - snw...@suse.com + +- added support for modifying default boot options +- 0.902 + +------------------------------------------------------------------- Old: ---- perl-Bootloader-0.901.tar.xz New: ---- perl-Bootloader-0.903.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Bootloader.spec ++++++ --- /var/tmp/diff_new_pack.NFO7d2/_old 2016-01-15 10:40:17.000000000 +0100 +++ /var/tmp/diff_new_pack.NFO7d2/_new 2016-01-15 10:40:17.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Bootloader # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: perl-Bootloader -Version: 0.901 +Version: 0.903 Release: 0 Requires: coreutils Requires: perl-base = %{perl_version} @@ -104,6 +104,7 @@ /var/adm/perl-modules/perl-Bootloader %endif /sbin/update-bootloader +/sbin/pbl /usr/lib/bootloader /boot/boot.readme /etc/logrotate.d/pbl ++++++ perl-Bootloader-0.901.tar.xz -> perl-Bootloader-0.903.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/Makefile new/perl-Bootloader-0.903/Makefile --- old/perl-Bootloader-0.901/Makefile 2015-12-16 13:50:45.000000000 +0100 +++ new/perl-Bootloader-0.903/Makefile 2015-12-18 16:28:52.000000000 +0100 @@ -36,16 +36,26 @@ @install -d -m 755 $(DESTDIR)/usr/lib/bootloader @install -m 755 bootloader_entry $(DESTDIR)/usr/lib/bootloader/bootloader_entry.old @install -m 755 update-bootloader $(DESTDIR)/usr/lib/bootloader/update-bootloader.old + @install -d -m 755 $(DESTDIR)/usr/lib/bootloader/grub2 @install -m 755 grub2/install $(DESTDIR)/usr/lib/bootloader/grub2 @install -m 755 grub2/config $(DESTDIR)/usr/lib/bootloader/grub2 + @install -m 755 grub2/add-option $(DESTDIR)/usr/lib/bootloader/grub2 + @install -m 755 grub2/del-option $(DESTDIR)/usr/lib/bootloader/grub2 + @install -d -m 755 $(DESTDIR)/usr/lib/bootloader/grub2-efi @install -m 755 grub2-efi/install $(DESTDIR)/usr/lib/bootloader/grub2-efi @install -m 755 grub2/config $(DESTDIR)/usr/lib/bootloader/grub2-efi - @install -m 755 pbl $(DESTDIR)/usr/lib/bootloader/pbl - @perl -pi -e 's/0\.0/$(VERSION)/ if /VERSION = /' $(DESTDIR)/usr/lib/bootloader/pbl - @ln -snf ../usr/lib/bootloader/pbl $(DESTDIR)/sbin/update-bootloader - @ln -snf pbl $(DESTDIR)/usr/lib/bootloader/bootloader_entry + @install -m 755 grub2/add-option $(DESTDIR)/usr/lib/bootloader/grub2-efi + @install -m 755 grub2/del-option $(DESTDIR)/usr/lib/bootloader/grub2 + + @install -d -m 755 $(DESTDIR)/usr/lib/bootloader/u-boot + @install -m 755 u-boot/config $(DESTDIR)/usr/lib/bootloader/u-boot + + @install -m 755 pbl $(DESTDIR)/sbin/pbl + @perl -pi -e 's/0\.0/$(VERSION)/ if /VERSION = /' $(DESTDIR)/sbin/pbl + @ln -snf pbl $(DESTDIR)/sbin/update-bootloader + @ln -snf ../../../sbin/pbl $(DESTDIR)/usr/lib/bootloader/bootloader_entry @install -d -m 755 $(DESTDIR)/boot @install -m 644 boot.readme $(DESTDIR)/boot/ @install -d -m 755 $(DESTDIR)/usr/share/man/man8/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/VERSION new/perl-Bootloader-0.903/VERSION --- old/perl-Bootloader-0.901/VERSION 2015-12-16 13:50:45.000000000 +0100 +++ new/perl-Bootloader-0.903/VERSION 2015-12-18 16:28:52.000000000 +0100 @@ -1 +1 @@ -0.901 +0.903 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/changelog new/perl-Bootloader-0.903/changelog --- old/perl-Bootloader-0.901/changelog 2015-12-16 13:50:45.000000000 +0100 +++ new/perl-Bootloader-0.903/changelog 2015-12-18 16:28:52.000000000 +0100 @@ -1,3 +1,10 @@ +2015-12-18: 0.903 + - improve add/del-option scripts + - rename uboot to u-boot + +2015-12-17: 0.902 + - added support for modifying default boot options + 2015-11-28: 0.901 - Add initial implementation of uboot/config script diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/grub2/add-option new/perl-Bootloader-0.903/grub2/add-option --- old/perl-Bootloader-0.901/grub2/add-option 1970-01-01 01:00:00.000000000 +0100 +++ new/perl-Bootloader-0.903/grub2/add-option 2015-12-18 16:28:52.000000000 +0100 @@ -0,0 +1,54 @@ +#! /usr/bin/perl + +# usage: add-option OPTION +# +# Modify default boot option (resp. add it). +# +# OPTION is either of the form 'key=value' or 'key="value"' or just 'key'. + +use strict; + +my $file = "/etc/default/grub"; + +my $opt = shift; + +my $opt_name = $opt; + +if($opt_name =~ s/=("?).*//) { + $opt =~ s/"/\\"/g; +} + +exit 1 if $opt_name eq ""; + +open my $f, $file or die "$file: $!\n"; +my @lines = (<$f>); +close $f; + +my $changed = 0; + +for (@lines) { + if(/^(GRUB_CMDLINE_LINUX_DEFAULT)=(.*)/) { + $changed = 1; + my $key = $1; + my $val = $2; + + $val =~ s/(^"\s*|\s*"\s*$)//g; + + $val =~ s/(^|\s)$opt_name=(\\"[^"]*\\"\s*)/ $opt / or + $val =~ s/(^|\s)$opt_name((\s|$)|(=\S*\s*))/ $opt / or + $val .= " $opt"; + + $val =~ s/^\s+|\s+$//g; + + $_ = "$key=\"$val\"\n"; + } +} + +exit 0 unless $changed; + +open my $f, ">$file.pblnew" or die "$file.pblnew: $!\n"; +print $f @lines; +close $f; + +rename "$file.pblnew", $file; + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/grub2/del-option new/perl-Bootloader-0.903/grub2/del-option --- old/perl-Bootloader-0.901/grub2/del-option 1970-01-01 01:00:00.000000000 +0100 +++ new/perl-Bootloader-0.903/grub2/del-option 2015-12-18 16:28:52.000000000 +0100 @@ -0,0 +1,49 @@ +#! /usr/bin/perl + +# usage: del-option OPTION +# +# Delete default boot option. +# +# OPTION is either of the form 'key=value' or 'key="value"' or just 'key'. + +use strict; + +my $file = "/etc/default/grub"; + +my $opt = shift; + +$opt =~ s/=("?).*//; + +exit 1 if $opt eq ""; + +open my $f, $file or die "$file: $!\n"; +my @lines = (<$f>); +close $f; + +my $changed = 0; + +for (@lines) { + if(/^(GRUB_CMDLINE_LINUX_DEFAULT)=(.*)/) { + $changed = 1; + my $key = $1; + my $val = $2; + + $val =~ s/(^"\s*|\s*"\s*$)//g; + + $val =~ s/(^|\s)$opt=(\\"[^"]*\\"\s*)/ / or + $val =~ s/(^|\s)$opt((\s|$)|(=\S*\s*))/ /; + + $val =~ s/^\s+|\s+$//g; + + $_ = "$key=\"$val\"\n"; + } +} + +exit 0 unless $changed; + +open my $f, ">$file.pblnew" or die "$file.pblnew: $!\n"; +print $f @lines; +close $f; + +rename "$file.pblnew", $file; + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/grub2/install new/perl-Bootloader-0.903/grub2/install --- old/perl-Bootloader-0.901/grub2/install 2015-12-16 13:50:45.000000000 +0100 +++ new/perl-Bootloader-0.903/grub2/install 2015-12-18 16:28:52.000000000 +0100 @@ -18,7 +18,7 @@ err=0 if [ -x /usr/sbin/grub2-install ] ; then - if [ -f /etc/default/grub_installdevice ] ; then + if [ -r /etc/default/grub_installdevice ] ; then while read foo ; do # ignore everything that doesn't look like a path [ "${foo::1}" != "/" ] && continue @@ -30,7 +30,7 @@ fi done </etc/default/grub_installdevice else - echo "/etc/default/grub_installdevice: no such file" + echo "/etc/default/grub_installdevice: permission denied" err=1 fi else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/pbl new/perl-Bootloader-0.903/pbl --- old/perl-Bootloader-0.901/pbl 2015-12-16 13:50:45.000000000 +0100 +++ new/perl-Bootloader-0.903/pbl 2015-12-18 16:28:52.000000000 +0100 @@ -18,6 +18,7 @@ use strict; use POSIX qw ( strftime uname ); +use Getopt::Long; use Data::Dumper; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Terse = 1; @@ -27,8 +28,9 @@ my $pbl_dir = "/usr/lib/bootloader"; +sub pbl_usage; sub new; -sub info; +sub log_msg; sub get_bootloader; sub run_command; @@ -38,25 +40,51 @@ my $exit_code = 0; my @todo; +my $opt_logfile = "/var/log/pbl.log"; + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# pbl_usage($exit_code) +# +# Print help text and exit. +# +sub pbl_usage +{ + print <<"= = = = = = = ="; +Usage: pbl [OPTIONS] +Configure/install boot loader. + +Options: + --install Install boot loader. + --config Create boot loader config. + --show Print current boot loader name. + --default ENTRY Set default boot entry to ENTRY. + --add-option OPTION Add OPTION to default boot options. + --del-option OPTION Delete OPTION from default boot options. + --log LOGFILE Log messages to LOGFILE (default: /var/log/pbl.log) + --version Show pbl version. + --help Write this help text. + += = = = = = = = + + exit shift; +} + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sub new { $log->{session_id} = $program . sprintf("-%04d", int rand 10000); - # log to logfile if we can, else to STDERR + # log to logfile if we can - if(open my $f, ">>/var/log/pbl.log") { + if(open my $f, ">>$opt_logfile") { my $tmp = select $f; $| = 1; select $tmp; binmode $f, ':utf8'; $log->{log_fh} = $f; - } - elsif(open my $f, ">&STDERR") { - binmode $f, ':utf8'; - $log->{log_fh} = $f; - $log->{log_is_stderr} = 1; + $log->{log_is_tty} = 1 if $opt_logfile eq '-'; } # find root device & detect if we are chroot-ed @@ -73,14 +101,14 @@ } } - info(1, "$log->{session_id} = $0, version = $VERSION, root = $r"); + log_msg(1, "$log->{session_id} = $0, version = $VERSION, root = $r"); } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# info(level, message, var, depth) +# log_msg(level, message, var, depth) # -# level: 0 .. 3 (debug, info, warning, error) +# level: 0 .. 3 (debug, log_msg, warning, error) # message: log message (single line string) # var (optional): either a SCALAR or a REF # - SCALAR (may be multiline) will be logged in a block delimited @@ -88,7 +116,7 @@ # - REF will be logged using Data::Dumper # depth (optional): maximum depth when logging a REF # -sub info +sub log_msg { my $level = shift; my $message = shift; @@ -129,9 +157,9 @@ print { $log->{log_fh} } "$prefix $message\n"; } - # log error messages to STDERR unless we already did + # log error messages to console unless we already did - if(!$log->{log_is_stderr} && $level > 2) { + if(!$log->{log_is_tty} && $level > 2) { print STDERR "$program: $prefix $message\n"; } } @@ -158,31 +186,30 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sub run_command { - my $command = shift; - my $try = shift; - my $ret; my $output; - if(open my $f, "($command) 2>&1 |") { + my $command = join " ", @_; + + if(open my $f, "-|") { local $/; $output = <$f>; close $f; $ret = $? >> 8; - chomp $output; - $output .= "\n"; } else { - $ret = 127; - $output = "$command: " . ($! == 13 ? $! : "command not found") . " \n"; + open STDERR, ">&STDOUT"; + exec @_; + exit 127; } - if(!$ret || $try) { - info(1, "'$command' = $ret, output:", $output); - $ret = 0; + $output = "$command: " . ($! == 13 ? $! : "command not found") . " \n" if $ret == 127; + + if(!$ret) { + log_msg(1, "'$command' = $ret, output:", $output); } else { - info(3, "'$command' failed with exit code $ret, output:", $output); + log_msg(3, "'$command' failed with exit code $ret, output:", $output); } return $ret; @@ -192,31 +219,49 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ($program = $0) =~ s#^.*/##; -info(1, join(' ', ($0, @ARGV))); - $loader = get_bootloader; -info(1, "bootloader = $loader"); +if($program eq 'pbl') { + GetOptions( + 'log=s' => \$opt_logfile, + 'install' => sub { push @todo, [ 'install' ] }, + 'config' => sub { push @todo, [ 'config' ] }, + 'show' => sub { print "$loader\n"; exit 0 }, + 'default=s' => sub { push @todo, [ 'default', $_[1] ] }, + 'add-option=s' => sub { push @todo, [ 'add-option', $_[1] ] }, + 'del-option=s' => sub { push @todo, [ 'del-option', $_[1] ] }, + 'version' => sub { print "$VERSION\n"; exit 0 }, + 'help' => sub { pbl_usage 0 }, + ) || pbl_usage 1; +} -exit 0 if !$loader; +log_msg(1, join(' ', ($0, @ARGV))); -push @todo, 'config'; +log_msg(1, "bootloader = $loader"); -unshift @todo, 'install' if grep { /^--reinit$/ } @ARGV; +exit 0 if !$loader; + +if($program ne 'pbl') { + # compat: update-bootloader or bootloader_entry + push @todo, [ 'config' ]; + unshift @todo, [ 'install' ] if grep { /^--reinit$/ } @ARGV; +} if(-d "$pbl_dir/$loader") { for (@todo) { - if(-x "$pbl_dir/$loader/$_") { - $exit_code = run_command("$pbl_dir/$loader/$_") || $exit_code; + my @cmd = @{$_}; + $cmd[0] = "$pbl_dir/$loader/$cmd[0]"; + if(-x $cmd[0]) { + $exit_code = run_command(@cmd) || $exit_code; } else { - info(1, "$loader::$_ skipped"); + log_msg(1, "$cmd[0] skipped"); } } } else { exec "/usr/lib/bootloader/$program.old", @ARGV; - info(3, "/usr/lib/bootloader/$program.old: command not found"); + log_msg(3, "/usr/lib/bootloader/$program.old: command not found"); $exit_code = 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/u-boot/config new/perl-Bootloader-0.903/u-boot/config --- old/perl-Bootloader-0.901/u-boot/config 1970-01-01 01:00:00.000000000 +0100 +++ new/perl-Bootloader-0.903/u-boot/config 2015-12-18 16:28:52.000000000 +0100 @@ -0,0 +1,96 @@ +#!/bin/bash + +function print_entry { + local label=$1 + local zimage=$2 + local initrd=$3 + local append=$4 + local dtb=$5 + + echo "LABEL $label" + echo -e "\tLINUX $(readlink -m $zimage)" + echo -e "\tINITRD $(readlink -m $initrd)" + if [ -d $dtb ] ; then + echo -e "\tFDTDIR $(readlink -m $dtb)" + else + echo -e "\tFDT $(readlink -m $dtb)" + fi + echo -e "\tAPPEND $append" +} + +function print_header { + echo "# THIS FILE WILL BE OVERWRITTEN by perl-Bootloader" + echo -n "# Last modification on " + date + echo "# Please, use /boot/extlinux.d and /etc/default/uboot for configuration" + echo +} + +if [ ! -r /etc/default/u-boot ] ; then + echo "/etc/default/u-boot: no such file" + exit 1 +fi + +source /etc/default/u-boot + +# Find zImages +machine=`uname -m` +case "x$machine" in + xi?86 | xx86_64) + zimage=(`find /boot -maxdepth 1 -name vmlinuz-\*`) ;; + xaarch64) + zimage=(`find /boot -maxdepth 1 -name Image-\*`) ;; + *) + zimage=(`find /boot -maxdepth 1 -name zImage-\*`) ;; +esac +version=(${zimage[@]#*-}) + +# Generate filenames for initrd and dtbdir +initrd=(${version[@]/#/\/boot\/initrd-}) +dtb=(${version[@]/#/\/boot\/dtb-}) +dtb=(${dtb[@]%-*}) + +if [ ! -d /boot/extlinux.d ] ; then + echo "/boot/extlinux.d: no such directory" + exit 1 +fi +entry_file=/boot/extlinux.d/50_generated.conf +print_header > $entry_file + +echo "DEFAULT linux_0" >> $entry_file +echo "" >> $entry_file + +entry_id=0 +for ((i=0;i<${#zimage[@]};i++)) ; do + if [ -r ${initrd[$i]} -a -r ${zimage[$i]} -a -d ${dtb[$i]} ] ; then + for dtbfile in / $U_BOOT_DTB_LINUX_DEFAULT ; do + print_entry linux_$((entry_id++)) ${zimage[$i]} ${initrd[$i]} "$U_BOOT_CMDLINE_LINUX_DEFAULT" ${dtb[$i]}'/'${dtbfile} >> $entry_file + done + + if [ "x$U_BOOT_DISABLE_RECOVERY" == "x" ] ; then + for dtbfile in / $U_BOOT_DTB_LINUX_RECOVERY ; do + print_entry linux_$((entry_id++)) ${zimage[$i]} ${initrd[$i]} "$U_BOOT_CMDLINE_LINUX_RECOVERY" ${dtb[$i]}'/'${dtbfile} >> $entry_file + done + fi + fi +done + +tmp_file=$(mkdir -p /boot/extlinux && mktemp -p /boot/extlinux) +print_header > $tmp_file +configs=(`find /boot/extlinux.d -maxdepth 1 -name \*.conf | sort`) + +for ((i=0;i<${#configs[@]};i++)) ; do + echo "### ${configs[$i]}" >> $tmp_file + cat ${configs[$i]} >> $tmp_file +done + +sync + +if [ -e /boot/extlinux/extlinux.conf ] ; then + cp /boot/extlinux/extlinux.conf /boot/extlinux/extlinux.conf.old + sync +fi + +mv $tmp_file /boot/extlinux/extlinux.conf +sync +exit 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.901/uboot/config new/perl-Bootloader-0.903/uboot/config --- old/perl-Bootloader-0.901/uboot/config 2015-12-16 13:50:45.000000000 +0100 +++ new/perl-Bootloader-0.903/uboot/config 1970-01-01 01:00:00.000000000 +0100 @@ -1,96 +0,0 @@ -#!/bin/bash - -function print_entry { - local label=$1 - local zimage=$2 - local initrd=$3 - local append=$4 - local dtb=$5 - - echo "LABEL $label" - echo -e "\tLINUX $(readlink -m $zimage)" - echo -e "\tINITRD $(readlink -m $initrd)" - if [ -d $dtb ] ; then - echo -e "\tFDTDIR $(readlink -m $dtb)" - else - echo -e "\tFDT $(readlink -m $dtb)" - fi - echo -e "\tAPPEND $append" -} - -function print_header { - echo "# THIS FILE WILL BE OVERWRITTEN by perl-Bootloader" - echo -n "# Last modification on " - date - echo "# Please, use /boot/extlinux.d and /etc/default/uboot for configuration" - echo -} - -if [ ! -r /etc/default/u-boot ] ; then - echo "/etc/default/u-boot: no such file" - exit 1 -fi - -source /etc/default/u-boot - -# Find zImages -machine=`uname -m` -case "x$machine" in - xi?86 | xx86_64) - zimage=(`find /boot -maxdepth 1 -name vmlinuz-\*`) ;; - xaarch64) - zimage=(`find /boot -maxdepth 1 -name Image-\*`) ;; - *) - zimage=(`find /boot -maxdepth 1 -name zImage-\*`) ;; -esac -version=(${zimage[@]#*-}) - -# Generate filenames for initrd and dtbdir -initrd=(${version[@]/#/\/boot\/initrd-}) -dtb=(${version[@]/#/\/boot\/dtb-}) -dtb=(${dtb[@]%-*}) - -if [ ! -d /boot/extlinux.d ] ; then - echo "/boot/extlinux.d: no such directory" - exit 1 -fi -entry_file=/boot/extlinux.d/50_generated.conf -print_header > $entry_file - -echo "DEFAULT linux_0" >> $entry_file -echo "" >> $entry_file - -entry_id=0 -for ((i=0;i<${#zimage[@]};i++)) ; do - if [ -r ${initrd[$i]} -a -r ${zimage[$i]} -a -d ${dtb[$i]} ] ; then - for dtbfile in / $U_BOOT_DTB_LINUX_DEFAULT ; do - print_entry linux_$((entry_id++)) ${zimage[$i]} ${initrd[$i]} "$U_BOOT_CMDLINE_LINUX_DEFAULT" ${dtb[$i]}'/'${dtbfile} >> $entry_file - done - - if [ "x$U_BOOT_DISABLE_RECOVERY" == "x" ] ; then - for dtbfile in / $U_BOOT_DTB_LINUX_RECOVERY ; do - print_entry linux_$((entry_id++)) ${zimage[$i]} ${initrd[$i]} "$U_BOOT_CMDLINE_LINUX_RECOVERY" ${dtb[$i]}'/'${dtbfile} >> $entry_file - done - fi - fi -done - -tmp_file=$(mkdir -p /boot/extlinux && mktemp -p /boot/extlinux) -print_header > $tmp_file -configs=(`find /boot/extlinux.d -maxdepth 1 -name \*.conf | sort`) - -for ((i=0;i<${#configs[@]};i++)) ; do - echo "### ${configs[$i]}" >> $tmp_file - cat ${configs[$i]} >> $tmp_file -done - -sync - -if [ -e /boot/extlinux/extlinux.conf ] ; then - cp /boot/extlinux/extlinux.conf /boot/extlinux/extlinux.conf.old - sync -fi - -mv $tmp_file /boot/extlinux/extlinux.conf -sync -exit 0