-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for booting without initramfs
Previously when initramfs-* was not found in a deployment's boot directory, it was assumed that rootfs is prepared for ostree booting by a kernel patch. With this patch, the behaviour changes to be - if initramfs-* is not found, assume that system is using a static ostree-prepare-root as init process. Booting without initramfs is a common use case on embedded systems. This approach is also more convenient, than having to patch the kernel. Closes: #1401 Approved by: cgwalters
- Loading branch information
1 parent
652d9dd
commit 4233b1d
Showing
4 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
. $(dirname $0)/libtest.sh | ||
|
||
echo "1..3" | ||
|
||
setup_os_repository "archive-z2" "uboot" | ||
|
||
cd ${test_tmpdir} | ||
|
||
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo | ||
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime | ||
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=rootfs --os=testos testos:testos/buildmaster/x86_64-runtime | ||
|
||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'root=LABEL=rootfs' | ||
assert_not_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'init=' | ||
|
||
echo "ok deployment with initramfs" | ||
|
||
cd ${test_tmpdir}/osdata/boot | ||
rm -f initramfs* vmlinuz* | ||
echo "the kernel only" > vmlinuz-3.6.0 | ||
bootcsum=$(cat vmlinuz-3.6.0 | sha256sum | cut -f 1 -d ' ') | ||
mv vmlinuz-3.6.0 vmlinuz-3.6.0-${bootcsum} | ||
cd - | ||
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --tree=dir=osdata/ -b testos/buildmaster/x86_64-runtime | ||
${CMD_PREFIX} ostree pull testos:testos/buildmaster/x86_64-runtime | ||
${CMD_PREFIX} ostree admin deploy --os=testos --karg=root=/dev/sda2 --karg=rootwait testos:testos/buildmaster/x86_64-runtime | ||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'rootwait' | ||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'init=' | ||
assert_not_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'initrd' | ||
|
||
echo "ok switching to bootdir with no initramfs" | ||
|
||
cd ${test_tmpdir}/osdata/boot | ||
rm -f initramfs* vmlinuz* | ||
echo "the kernel" > vmlinuz-3.6.0 | ||
echo "initramfs to assist the kernel" > initramfs-3.6.0 | ||
bootcsum=$(cat vmlinuz-3.6.0 initramfs-3.6.0 | sha256sum | cut -f 1 -d ' ') | ||
mv vmlinuz-3.6.0 vmlinuz-3.6.0-${bootcsum} | ||
mv initramfs-3.6.0 initramfs-3.6.0-${bootcsum} | ||
cd - | ||
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --tree=dir=osdata/ -b testos/buildmaster/x86_64-runtime | ||
${CMD_PREFIX} ostree pull testos:testos/buildmaster/x86_64-runtime | ||
${CMD_PREFIX} ostree admin deploy --os=testos --karg-none --karg=root=LABEL=rootfs testos:testos/buildmaster/x86_64-runtime | ||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'initrd' | ||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'root=LABEL=rootfs' | ||
assert_not_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'rootwait' | ||
assert_not_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'init=' | ||
|
||
echo "ok switching from no initramfs to initramfs enabled sysroot" | ||
|