Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T5498: fsck during boot doesnt work, part 1 #435

Closed
wants to merge 2 commits into from

Conversation

Apachez-
Copy link
Contributor

@Apachez- Apachez- commented Oct 9, 2023

Change Summary

Included proper fsck versions and added initramfs.conf to modify level of compression of initrd.img.

This alone wont fix the issue of fsck not running during boot but will be a step in the direction of resolving this issue.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

build, initrd

Proposed changes

As a first fix for the issue of fsck not running on boot this commit includes all proper versions of fsck along with the logsave binary which was missing:

File data/live-build-config/includes.chroot/etc/initramfs-tools/hooks/10-vyos-addons:

# missing fsck in initramfs
copy_exec /sbin/dosfsck
copy_exec /sbin/e2fsck
copy_exec /sbin/fsck
copy_exec /sbin/fsck.exfat
copy_exec /sbin/fsck.ext2
copy_exec /sbin/fsck.ext3
copy_exec /sbin/fsck.ext4
copy_exec /sbin/fsck.fat
copy_exec /sbin/fsck.msdos
copy_exec /sbin/fsck.vfat
copy_exec /sbin/logsave

Also added file data/live-build-config/includes.chroot/etc/initramfs-tools/initramfs.conf to modify level of compression:

COMPRESS=zstd
COMPRESSLEVEL=19

Note! Current kernel config doesnt allow for other compressions than gzip (fallback) or zstd.

That have been filed as a separate task: https://vyos.dev/T5640

  • Smoketest results:
DEBUG - ERROR: One or more tests failed!
DEBUG - vyos@vyos:~$ echo EXITCODE:$?
DEBUG - echo EXITCODE:$?
ERROR - Smoketest failed :/
ERROR - Unknown error occured while VyOS!
Traceback (most recent call last):
  File "/vyos/T5498/vyos-build/scripts/check-qemu-install", line 521, in <module>
    raise Exception("Smoketest-failed, please look into debug output")
Exception: Smoketest-failed, please look into debug output

Turns out that the failure is NOT related to this commit:

DEBUG - Running Testcase: /usr/libexec/vyos/tests/smoke/cli/test_protocols_ospf.py
DEBUG - test_ospf_01_defaults (__main__.TestProtocolsOSPF.test_ospf_01_defaults) ... ok
DEBUG - test_ospf_02_simple (__main__.TestProtocolsOSPF.test_ospf_02_simple) ... ok
DEBUG - test_ospf_03_access_list (__main__.TestProtocolsOSPF.test_ospf_03_access_list) ... ok
DEBUG - test_ospf_04_default_originate (__main__.TestProtocolsOSPF.test_ospf_04_default_originate) ... ok
DEBUG - test_ospf_05_options (__main__.TestProtocolsOSPF.test_ospf_05_options) ... ok
DEBUG - test_ospf_06_neighbor (__main__.TestProtocolsOSPF.test_ospf_06_neighbor) ... ok
DEBUG - test_ospf_07_redistribute (__main__.TestProtocolsOSPF.test_ospf_07_redistribute) ... ok
DEBUG - test_ospf_08_virtual_link (__main__.TestProtocolsOSPF.test_ospf_08_virtual_link) ... ok
DEBUG - test_ospf_09_interface_configuration (__main__.TestProtocolsOSPF.test_ospf_09_interface_configuration) ... ok
DEBUG - test_ospf_11_interface_area (__main__.TestProtocolsOSPF.test_ospf_11_interface_area) ... ok
DEBUG - test_ospf_12_vrfs (__main__.TestProtocolsOSPF.test_ospf_12_vrfs) ... ok
DEBUG - test_ospf_13_export_list (__main__.TestProtocolsOSPF.test_ospf_13_export_list) ... FAIL
DEBUG - test_ospf_14_segment_routing_configuration (__main__.TestProtocolsOSPF.test_ospf_14_segment_routing_configuration) ... ok
DEBUG - test_ospf_15_ldp_sync (__main__.TestProtocolsOSPF.test_ospf_15_ldp_sync) ... ok
DEBUG - test_ospf_16_graceful_restart (__main__.TestProtocolsOSPF.test_ospf_16_graceful_restart) ... ok
DEBUG - 
DEBUG - ======================================================================
DEBUG - FAIL: test_ospf_13_export_list (__main__.TestProtocolsOSPF.test_ospf_13_export_list)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_protocols_ospf.py", line 428, in test_ospf_13_export_list
DEBUG -     self.assertIn(f'router ospf', frrconfig)
DEBUG - AssertionError: 'router ospf' not found in ''
DEBUG - 
DEBUG - ----------------------------------------------------------------------
DEBUG - Ran 15 tests in 126.221s
DEBUG - 
DEBUG - FAILED (failures=1)

How to test

Make sure that the image boots.

Once properly fixed (probably after step 2) adding "fsck.mode=force fsck.repair=yes" to the "/boot/grub/grub.cfg" file should make fsck to run and fix any issues with the storage that VyOS is installed at.

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team October 9, 2023 00:26
@Apachez-
Copy link
Contributor Author

Changes since previous commit:

  • Removed "initramfs.conf" in favour of "conf.d/10-vyos-compression".

  • Added prio in "vyos-dev.pref.chroot" to use live-boot* from Debian Bookworm rather than VyOS current (preparation to migrate the VyOS live-boot repo into the vyos-build repo).

Note: Do NOT merge this PR yet...

@c-po c-po marked this pull request as draft October 21, 2023 18:54
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@sever-sever
Copy link
Member

Update please a PR or close the task and create a new one. As I t has conflicts now.
Tranks.

@Apachez-
Copy link
Contributor Author

This needs some more work since VyOS seems to be using a custom broken initramfs compared to Debian12 which VyOS is currently based on.

@c-po
Copy link
Member

c-po commented Jan 14, 2024

Why "custom broken"? We use the one from Debian and extend it with custom scripts responsible to setup the squashfs/unionfs structure for the config https://github.com/vyos/live-boot/blob/current/components/9990-vyos.sh.

@Apachez-
Copy link
Contributor Author

Not really, its fairly empty when comparing to the one Debian provides.

For example capability of running fsck during boot etc is missing.

This pull request #435 was to have the proper support of fsck included in the initramfs that VyOS creates.

Whats missing for part 2 is to create the initramfs script needed for fsck to be recognised as an option during boot.

If the live-boot repo is still active (5 months since last update) then these files for sure is missing the fsck capabilities when you compare to the ones provided by Debian12 itself:

https://github.com/vyos/live-boot/blob/current/backend/initramfs-tools/live.hook

https://github.com/vyos/live-boot/blob/current/backend/initramfs-tools/live.script

vs the stuff in Debian12 (bookworm):

https://salsa.debian.org/kernel-team/initramfs-tools/-/blob/master/scripts/functions

@c-po
Copy link
Member

c-po commented Jan 14, 2024

Well forked live-boot package could be upgraded to the Debian 12 version. Could be done in this task

@zdc
Copy link
Contributor

zdc commented Mar 14, 2024

@Apachez- this PR should be split into individual PRs with compression and expanding filesystems supported by fsck. Feel free to do this.

@zdc zdc closed this Mar 14, 2024
@Apachez- Apachez- deleted the T5498 branch March 19, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants