balbes150 Posted December 20, 2016 Posted December 20, 2016 Perhaps I badly searched, but except for the file makeboarddeb.sh not find the option how you can make changes to the initrd. Perhaps there is some primitive or correct functionality that may make changes in the collected initrd, which gets in the finished image. I need to add some utilities and modify init in the initrd. Возможно Ñ Ð¿Ð»Ð¾Ñ…Ð¾ иÑкал, но кроме файла makeboarddeb.sh не нахожу варианта, как можно внеÑти Ñвои Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² initrd. Возможно еÑÑ‚ÑŒ како-либо правильный функционал, который может вноÑить Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² Ñобираемый initrd, который попадает в готовый образ. Мне нужно добавить неÑколько утилит и изменить init в initrd.
zador.blood.stained Posted December 20, 2016 Posted December 20, 2016 Perhaps I badly searched, but except for the file makeboarddeb.sh not find the option how you can make changes to the initrd. Perhaps there is some primitive or correct functionality that may make changes in the collected initrd, which gets in the finished image. I need to add some utilities and modify init in the initrd. Depends on what you want to change. I wouldn't recommend changing any preinstalled script (changes may be lost at any time due to kernel or packages update), but it's relatively easy to add new scripts that will be packed to initrd, and you can try to implement any functionality there (i.e. mount external partition and copy DTB img file to /boot, resize rootfs, update filesystem UUID, ...) You can look in /usr/share/initramfs-tools/ for examples - hooks directory contains initramfs-update hook scripts that may copy additional binaries to the initrd, and scripts contains subdirectories with shell scripts that run at different stages (*-top, *-premount, *-bottom) So you can write a code in customize-image.sh that will copy files to /etc/initramfs-tools/hooks/ and /etc/initramfs-tools/scripts/<some subdirectory>/ and then run "update-initramfs -u -k all"
Recommended Posts