Closed syyhao1994 closed 4 years ago
kiwi boot images provides the linuxrc script, however the kernel also expects an init executable to be present. This method creates a hard link to the linuxrc file
It seems there are no linuxrc script in initrd.xz. There are no problems if i delete self.setup.create_init_link_from_linuxrc() in kiwi/boot/image/builtin_kiwi.py
You are creating <type image="cpio"
that is not a pxe suitable image type. May I ask what you would like to achieve ?
Also maybe the docs here are helpful:
and we prefer pxe images that are disk images deployed via pxe, see the docs for that here:
Hope that helps
You are creating
<type image="cpio"
that is not a pxe suitable image type. May I ask what you would like to achieve ?Also maybe the docs here are helpful:
and we prefer pxe images that are disk images deployed via pxe, see the docs for that here:
Hope that helps
I only need a linux and rootfs(initrd), and i do not need to install through pxe. As i creating <type image="cpio"
, i can get files that i needed(.kernel, initrd.xz, .md5, .packages, tar.xz) only if i commented the self.setup.create_init_link_from_linuxrc() in kiwi/boot/image/builtin_kiwi.py.I don not know if its suitable to do so.
Looking forward to hearing from you.
Thank you.
Not sure what you are after but if you use something like
<type image="pxe" filesystem="ext4" initrd_system="dracut">
The result will be:
You could eventually boot it with something similar to qemu-kvm --kernel <kernelfile> --initrd <initrdfile> -hda <imagefile> --append <kernelcmds>
Not sure what you are after but if you use something like
<type image="pxe" filesystem="ext4" initrd_system="dracut">
The result will be:
- An image with an ext4 filesystem containing the rootfs of the system without any bootloader installation
- An initrdfile created with dracut
- The kernel file
- An *.append text file containing the kernel command flags and options
- .md5, .packages metafiles
You could eventually boot it with something similar to
qemu-kvm --kernel <kernelfile> --initrd <initrdfile> -hda <imagefile> --append <kernelcmds>
You are right! I could boot it with the action below after change grub.cfg, $ cp .initrd.xz /boot/initrd $ cp .kernel /boot/linux.
Acturally my question is that there is a error: KiwiCommandError: ln: stderr: ln: failed to access '/home/mkiso/kiwi_boot_root.v8u7eh4n/linuxrc': No such file or directory It seems kiwi did not provides a linuxrc script, if i create a linurc script under root, everything will be ok. I can also solve the problem through commented the self.setup.create_init_link_from_linuxrc() in kiwi/boot/image/builtin_kiwi.py.
And i found another problem. The mod of my root filesystem (/) is 700. I think 555 or 755 maybe better.
[root@localhost /]# ls -l / -d drwx------ 15 root root 460 Apr 20 11:09 /
DEBUG: 19:44:35 | EXEC: [rsync -a /home/mkiso/kiwi_boot_root.3xwb3uzf/ /tmp/kiwi_boot_root_copy._48briaa] DEBUG: 19:44:36 | EXEC: [rm -r -f /tmp/kiwi_boot_root_copy._48briaa/boot] I think rsync -a change the mod of /home/mkiso/kiwi_boot_root.3xwb3uzf/, the mod of /home/mkiso/kiwi_boot_root.3xwb3uzf/ is 755, but the mod of /home/mkiso/kiwi_boot_root.3xwb3uzf/ is 700.
Hi, in our sprint meeting we came across this one and wondered if there is anything we can do to help you with or to identify if there is some bug in kiwi. To be honest we have no clue about your use case or why you are doing the things as you are doing them.
We don't see a problem in permissions or missing boot data. usually all that is handled via dracut but it seems you are using your own boot code ? Just a lot of guessing and we don't know how we could help you.
It would help to understand your use case or what you would like to achieve
Thanks
Hi, in our sprint meeting we came across this one and wondered if there is anything we can do to help you with or to identify if there is some bug in kiwi. To be honest we have no clue about your use case or why you are doing the things as you are doing them.
We don't see a problem in permissions or missing boot data. usually all that is handled via dracut but it seems you are using your own boot code ? Just a lot of guessing and we don't know how we could help you.
It would help to understand your use case or what you would like to achieve
Thanks
I am sorry for my unclearly description. I used the config.xml and the command kiwi-ng --type pxe system build --description /home/linuxiso/ --target-dir /home/mkiso/, and i got an initrdfile created with dracut and a kernel file. Then i can modify /boot/grub.cfg with a new option on my virtual machine as i do the action as below: $ cp .initrd.xz /boot/initrd $ cp .kernel /boot/linux
Then i can reboot my virtual machine to choose to login to the linux and initrdfile system. The problem is here, when i login to the system, i found the permission of / is 0700, rather than 0755 or 0555.
I take a look at image-root.log, and i found that the permission maybe change during the rsync action listed as below: DEBUG: 19:44:35 | EXEC: [rsync -a /home/mkiso/kiwi_boot_root.3xwb3uzf/ /tmp/kiwi_boot_root_copy._48briaa] The permission of /home/mkiso/kiwi_boot_root.3xwb3uzf/ is 0755, but the permission of /tmp/kiwi_boot_root_copy._48briaa is 0700. Maybe the mkdtemp funtion of /usr/lib/python3.7/site-packages/kiwi/boot/image/builtin_kiwi.py could not save the permisson of the original directory.
Sorry for the long delay. I finally understand what you were referring to with the permission bits. A pull request to fix this will follow
Problem description
when i use kiwi of pxe, i got the error as below: KiwiCommandError: ln: stderr: ln: failed to access '/home/mkiso/kiwi_boot_root.v8u7eh4n/linuxrc': No such file or directory
Expected behaviour
building success
Steps to reproduce the behaviour
I use the command kiwi-ng --type pxe system build --description /home/linuxiso/ --target-dir /home/mkiso/
and my config.xml is listed as below:
OS and Software information