| Summary: | Banana Pro: Empty entries in /boot/extlinux/extlinux.conf crashes uboot. | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Jybz <j.biernacki+mga> |
| Component: | RPM Packages | Assignee: | Thierry Vignaud <thierry.vignaud> |
| Status: | RESOLVED OLD | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | tmb |
| Version: | 7 | ||
| Target Milestone: | --- | ||
| Hardware: | arm | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | drakxtools-18.21-1.mga7.src.rpm | CVE: | |
| Status comment: | |||
|
Description
Jybz
2019-12-14 22:40:50 CET
Ops... How is it possible ? The tool drakboot is NOT installed in the SBC. But the file mention "generated by drakboot", files that wasn't existing before the update. So, what generate that file actually ? (10 min later, I forget to post that comment, but ...) I found it ! The file was generated by : /usr/lib/libDrakX/bootloader.pm How to use that script ? > $ urpmf "/usr/lib/libDrakX/bootloader.pm" > drakxtools-backend:/usr/lib/libDrakX/bootloader.pm There is no drakxtools-backend in the maintdb.txt, but for drakxtools : > $ curl -s pkgsubmit.mageia.org/data/maintdb.txt | grep "drakxtools" > drakxtools tv -- Later, Ankh on #mageia-dev helped me, we found that the bootloader.pm was called by bootloader-config (installed) which is called by /sbin/installkernel . This file is executed by the RPM receipt http://svnweb.mageia.org/packages/updates/7/kernel/current/SPECS/kernel.spec?view=markup&sortby=date#l1399 line 1399, a post_install generated on the fly. I'm currently building an image to check if the first generated file contains, of not, empty entry in /boot/extlinux/extlinux.conf Well, I tried to build an image of Mageia for Banana Pro. I can read : > + echo -e '\nTrying to generate extlinux script\n' > > Trying to generate extlinux script > > ++ rpm -q kernel-desktop-latest > ++ sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/' > + K_INST_VERSION=5.4.2-desktop-1.mga7 > + bash -x /sbin/installkernel 5.4.2-desktop-1.mga7 > + NOLINK= > + NOENTRY= > + INITRDOPTS= > + NOLAUNCH= > + action=add-kernel > + no_initrd= > + '[' -f /etc/sysconfig/installkernel ']' > + source /etc/sysconfig/installkernel > ++ NOLINK= > ++ NOENTRY= > ++ INITRDOPTS= > + export PATH=/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/sbin:/usr/sbin > + PATH=/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/lib64/qt5/bin:/usr/lib64/qt4/bin:/sbin:/usr/sbin > + getopts algyNdnRsSCiLch opt > + shift 0 > + version=5.4.2-desktop-1.mga7 > + '[' 1 = 3 -o 1 = 4 ']' > + '[' 1 '!=' 1 ']' > + '[' '' = no ']' > + [[ 5.4.2-desktop-1.mga7 == *BOOT ]] > + '[' -z '' ']' > + '[' add-kernel = remove-kernel ']' > + options='--action add-kernel' > + '[' -z '' ']' > + '[' -z '' ']' > + '[' -z '' ']' > + '[' -z '' ']' > + '[' -x /usr/sbin/bootloader-config ']' > + bootloader-config --kernel-version 5.4.2-desktop-1.mga7 --initrd-options '' --action add-kernel > Unsupported ioctl: cmd=0x5331 > Running in chroot, ignoring request. > Unsupported ioctl: cmd=0x5331 > Running in chroot, ignoring request. > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > Unsupported ioctl: cmd=0xffffffff80604521 > ioctl EVIOCGBIT failed: Function not implemented > cannot find root partition in /etc/fstab > cannot find root partition > + echo -e '\nEnd trying to generate extlinux script with errcode 255\n' > > End trying to generate extlinux script with errcode 255 > I see that the errors are in the perl script bootloader-config. But I don't perl... Is someone able to debug the perl in a chroot ? Specialy that two lines : > my $root_part = fs::get::root_([ fs::get::fstab($all_hds) ]) or warn "cannot find root partition in /etc/fstab\n"; > $root_part ||= fs::get::root_from_mounted() or die "cannot find root partition\n"; What should I do in order to take the FSTAB from my chrooted directory in this PERL script ? (the FSTAB exists before the chroot). What can I do ? For info, script debuging mode, with the command "perl -d /usr/sbin/bootloader-config [args]"
>
> Loading DB routines from perl5db.pl version 1.53
> Editor support available.
>
> Enter h or 'h h' for help, or 'man perldebug' for more help.
>
> main::(/usr/sbin/bootloader-config:9):
> 9: $::isStandalone = 1; #- not using standalone which messes with @ARGV and usage
> DB<1> n
> main::(/usr/sbin/bootloader-config:10):
> 10: c::openlog('bootloader-config' . "[$$]");
> DB<1> n
> main::(/usr/sbin/bootloader-config:12):
> 12: $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
> DB<1> n
> main::(/usr/sbin/bootloader-config:14):
> 14: my %options = (
> 15: 'action=s' => \ (my $action),
> DB<1> n
> main::(/usr/sbin/bootloader-config:31):
> 31: GetOptions(%options) && $action or die <<'EOF';
> 32: usage: bootloader-config --action add-kernel (--image <vmlinuz> | --kernel-version <2.6.xxx>) [--label <...>] [--no-short-name] [--initrd-options <options>]
> 33: bootloader-config --action remove-kernel (--image <vmlinuz> | --kernel-version <2.6.xxx>)
> DB<1> n
> main::(/usr/sbin/bootloader-config:44):
> 44: my @known_actions = qw(add-kernel remove-kernel update-splash remove-splash rebuild-initrds migrate-to-uuids detectloader add-entry remove-entry add-resume2);
> DB<1> n
> main::(/usr/sbin/bootloader-config:45):
> 45: $action && member($action, @known_actions) or die "<action> must be one of " . join(' ', @known_actions) . "\n";
> DB<1> n
> main::(/usr/sbin/bootloader-config:47):
> 47: if ($image) {
> DB<1> n
> main::(/usr/sbin/bootloader-config:57):
> 57: $image = find { -e $_ } map { "/boot/$_-$kernel_version" } qw(vmlinux uImage vmlinuz);
> DB<1> n
> main::(/usr/sbin/bootloader-config:57):
> 57: $image = find { -e $_ } map { "/boot/$_-$kernel_version" } qw(vmlinux uImage vmlinuz);
> DB<1> n
> main::(/usr/sbin/bootloader-config:57):
> 57: $image = find { -e $_ } map { "/boot/$_-$kernel_version" } qw(vmlinux uImage vmlinuz);
> DB<1> n
> main::(/usr/sbin/bootloader-config:57):
> 57: $image = find { -e $_ } map { "/boot/$_-$kernel_version" } qw(vmlinux uImage vmlinuz);
> DB<1> n
> main::(/usr/sbin/bootloader-config:61):
> 61: my $all_hds = fsedit::get_hds();
> DB<1> n
> Unsupported ioctl: cmd=0x5331
> Running in chroot, ignoring request.
> Unsupported ioctl: cmd=0x5331
> Running in chroot, ignoring request.
> main::(/usr/sbin/bootloader-config:62):
> 62: fs::get_info_from_fstab($all_hds);
> DB<1> n
> main::(/usr/sbin/bootloader-config:64):
> 64: my $bootloader = bootloader::read($all_hds);
> DB<1> n
> main::(/usr/sbin/bootloader-config:65):
> 65: if (!$bootloader) {
> DB<1> n
> main::(/usr/sbin/bootloader-config:76):
> 76: $action =~ s/-/_/g;
> DB<1> n
> main::(/usr/sbin/bootloader-config:77):
> 77: $::{$action}->();
> DB<1> n
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> Unsupported ioctl: cmd=0xffffffff80604521
> ioctl EVIOCGBIT failed: Function not implemented
> cannot find root partition in /etc/fstab
> at /usr/sbin/bootloader-config line 159.
> main::add_kernel() called at /usr/sbin/bootloader-config line 77
> cannot find root partition
> at /usr/sbin/bootloader-config line 160.
> main::add_kernel() called at /usr/sbin/bootloader-config line 77
> Debugged program terminated. Use q to quit or R to restart,
> use o inhibit_exit to avoid stopping after program termination,
> h q, h R or h o to get additional info.
> DB<1> q
>
Sorry to be slow replying.
To start at the beginning... It seems you are trying to port Mageia to Banana Pro.
The Description summarises the bug: a kernel update introduced a faulty file:
/boot/extlinux/extlinux.conf [not on my system]
which contained two blank entries:
label
kernel
and you found that:
> When I commented the lines with empty entries :
> # label
> # kernel
> Uboot starts Mageia using that file.
Well done. *This* seems to be the bug. And thank you for reporting it, with the good initial evidence.
-----
What follows gets out of hand, and ends up with "cannot find root partition" errors far removed from the original error. It is more suited to a forum or IRC: you already used #mageia-dev. Are you are hoping to use a script out of context?
I could not pin down any Mageia fault in comments 2 onwards.
Assigning to tv for drakxtools; CC tmb for his wisdom, and having committed the SRPM relatively recently.Summary:
Empty entry in extlinux generated by drakboot crashes uboot. =>
Banana Pro: Empty entries in /boot/extlinux/extlinux.conf crashes uboot. (sorry I was busy, I will answer soon.
Just to let you know, the new kernel update modify well the /boot/extlinux/extlinux.conf file :
> [root@bananaPro ~]# cat /boot/extlinux/extlinux.conf
> # File generated by DrakX/drakboot
> default linux
> timeout 30
> menu title Boot Menu
>
> label linux
> kernel /boot/vmlinuz
> initrd /boot/initrd.img
> fdtdir /usr/lib/linux-5.4.6-desktop-2.mga7
> append root=UUID=03c0235b-ec27-4b41-ba5c-bd7a80999374 root=UUID=03c0235b-ec27-4b41-ba5c-bd7a80999374
>
> label desktop 5.4.2-1.mga7
> kernel /boot/vmlinuz-5.4.2-desktop-1.mga7
> initrd /boot/initrd-5.4.2-desktop-1.mga7.img
> fdtdir /usr/lib/linux-5.4.2-desktop-1.mga7
> append root=UUID=03c0235b-ec27-4b41-ba5c-bd7a80999374
>
> label desktop 5.4.6-2.mga7
> kernel /boot/vmlinuz-5.4.6-desktop-2.mga7
> initrd /boot/initrd-5.4.6-desktop-2.mga7.img
> fdtdir /usr/lib/linux-5.4.6-desktop-2.mga7
> append root=UUID=03c0235b-ec27-4b41-ba5c-bd7a80999374 root=UUID=03c0235b-ec27-4b41-ba5c-bd7a80999374
> [root@bananaPro ~]# reboot
And it reboots well also.
The problem is for the first kernel update
or the installation of the kernel in chroot.
The script /usr/sbin/installkernel which starts /usr/sbin/bootloader-config works with aarch64 in chroot on x86_64 (but not with armv7hl). Mageia 7 is EOL since July 1st 2021. There will not have any further bugfix for this release. You are encouraged to upgrade to Mageia 8 as soon as possible. @reporter, if this bug still apply with Mageia 8, please let us know it. @packager, if you work on the Mageia 7 version of your package, please check the Mageia 8 package if issue is also present. In this case, please fix the Mageia 8 version instead. This bug report will be closed OLD if there is no further notice within 1st September 2021. Hi bug reporter and hi assignee and others involved, Please reopen this bug report if it is still valid for Mageia 8 or 9(cauldron), and change "Version:" in the upper left of this report accordingly. This report is being closed as OLD because it was filed against Mageia 7, for which support ended on June 30th 2021. Thanks, Marja Status:
NEW =>
RESOLVED |