bootloop on beagle bone
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Snappy |
Critical
|
Sergio Schvezov | ||
| | 15.04 |
Critical
|
Sergio Schvezov | ||
Bug Description
I tried to reproduce a reported filesystem corruption error on the /boot partition when pulling the power I managed to get the snappy system into a boot loop. The error I get is:
"""
reading snappy-system.txt
1585 bytes read in 9 ms (171.9 KiB/s)
reading a/vmlinuz
6508992 bytes read in 377 ms (16.5 MiB/s)
reading a/initrd.img
13492457 bytes read in 774 ms (16.6 MiB/s)
reading a/dtbs/
30025 bytes read in 14 ms (2 MiB/s)
Kernel image @ 0x82000000 [ 0x000000 - 0x6351c0 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8f321000, end 8ffff0e9 ... OK
Loading Device Tree to 8f316000, end 8f320548 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
...
Loading, please wait...
starting version 219
[ 10.278969] random: systemd-udevd urandom read with 39 bits of entropy available
Begin: Loading essential drivers ... done.
Begin: Running /scripts/
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/
done.
ext4
[ 11.393868] initrd: mounting /dev/disk/
[ 11.406337] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 11.417123] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 11.440379] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 11.456766] initrd: mounting /run
[ 11.500665] initrd: checking filesystem for writable partition
[ 11.520088] EXT4-fs (mmcblk0p4): couldn't mount as ext3 due to feature incompatibilities
[ 11.531008] EXT4-fs (mmcblk0p4): couldn't mount as ext2 due to feature incompatibilities
[ 11.556151] EXT4-fs (mmcblk0p4): recovery complete
[ 11.561294] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: errors=remount-ro
[ 11.621327] initrd: mounting writable partition
[ 11.682302] EXT4-fs (mmcblk0p4): couldn't mount as ext3 due to feature incompatibilities
[ 11.695248] EXT4-fs (mmcblk0p4): couldn't mount as ext2 due to feature incompatibilities
[ 11.720508] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: discard
mkdir: can't create directory '/root/writable': Read-only file system
mount: mounting /tmpmnt_writable on /root/writable failed: No such file or directory
...
mount: mounting /root/writable/
Begin: Running /scripts/
done.
Begin: Running /scripts/
run-init: /lib/systemd/
[ 12.545627] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[ 12.545627]
[ 12.555211] CPU: 0 PID: 1 Comm: run-init Not tainted 3.19.0-15-generic #15-Ubuntu
[ 12.563038] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 12.569460] [<c0312074>] (unwind_backtrace) from [<c030bd3c>] (show_stack+
[ 12.577575] [<c030bd3c>] (show_stack) from [<c0b05514>] (dump_stack+
[ 12.585139] [<c0b05514>] (dump_stack) from [<c0b03500>] (panic+0xac/0x22c)
[ 12.592343] [<c0b03500>] (panic) from [<c0359470>] (complete_
[ 12.599996] [<c0359470>] (complete_and_exit) from [<c03594bc>] (do_group_
<REBOOT>
U-Boot SPL 2014.10-dirty (Dec 18 2014 - 22:07:26)
"""
and so on.
Related branches
- Michael Vogt: Approve on 2015-04-30
-
Diff: 65 lines (+16/-1)4 files modifiedpartition/bootloader_grub.go (+5/-0)
partition/bootloader_grub_test.go (+6/-1)
partition/bootloader_uboot.go (+3/-0)
partition/bootloader_uboot_test.go (+2/-0)
| Changed in snappy-ubuntu: | |
| importance: | Undecided → Critical |
| Michael Vogt (mvo) wrote : | #1 |
| Michael Vogt (mvo) wrote : | #2 |
It seems like the following code in the initrd is problematic:
"""
/sbin/e2fsck -va "$path" >> "$logfile" 2>&1 || true
"""
because it should display the logfile if the fsck fails. This makes diagnosing this harder as the logfile is not displayed when the kernel panics.
| Michael Vogt (mvo) wrote : | #3 |
The snappy-system.txt file looks like this:
"""
# boot logic
# either "a" or "b"; target partition we want to boot
snappy_ab=a
# stamp file indicating a new version is being tried; removed by s-i after boot
snappy_
# either "regular" (normal boot) or "try" when trying a new version
snappy_mode=regular
"""
however system-a looks incomplete and like it was what the last upgrade was applied to.
When I switch this to:
"snappy_ab=b"
it boots ok again.
Which is very confusing. But I was able to reproduce it, when I set it back to r31 with a half-done partition in system-a and do a snappy update I get:
"""
hardware spec requires dual root partitions
"""
and the update stop, *however* it does set my snappy-system.txt to:
"""
snappy_ab=a
snappy_mode=try
"""
which should not happen but it happens because the HandleAssets() calls is done *after* the "bootloader.
| Michael Vogt (mvo) wrote : | #4 |
The error: "hardware spec requires dual root partitions" is constantly showing for me, it seems like the reason is:
"""
if u.partition.
return fmt.Errorf(
}
"""
that hardware.
| Michael Vogt (mvo) wrote : | #5 |
I found the root cause why the hardware.
| Changed in snappy-ubuntu: | |
| status: | New → In Progress |
| status: | In Progress → Fix Committed |
| Michael Vogt (mvo) wrote : | #6 |
Sergio fixed this now, thanks a lot! The root cause of this problem is that on a good boot it would reset the "try" to "regular" but it would not set the partition to the good boot. So what happend is that it boots with "try" and "b", this fails, the bootloader notices, boots into "a" and "boot-ok" sets "try" to "regular" but did not switch "b" back to "a". So the next boot would boot into "b" and never switch because "try" was set to "regular".
| affects: | snappy-ubuntu → snappy |
| Changed in snappy: | |
| status: | Fix Committed → Fix Released |
| assignee: | nobody → Sergio Schvezov (sergiusens) |


I pushed the image to http:// people. canonical. com/~mvo/ tmp/broken- snappy- bbb-bug- 1449904. img for inspection.