Closed lesnake closed 7 years ago
A recent patch https://github.com/rhinstaller/lorax/commit/c91278a17d34b92d3bd549b5ff862e7375c21975 accomplishes this by modifying share/templates.d/99-generic/live/x86.tmpl . Here BCL is using this to copy a license file to iso /. You could add your own template using this method.
If I undestand correctely, I have to
Correct ?
No, i think, either append your file names to $f or add them to the end mkisofs after copying them to $outroot. Modify lorax x86.tmpl directly or copy all templates to new dir and modify x86 because --lorax-templates uses a directory
Ok. I get the workflow now.
I think I am going to stick to my actual workflow : a basic mount of the iso, then a copy in a writable location, do my patch/copy job then repack the iso.
For this workflow I think the best could be the calling of a script given by the user as a LMC parameter with the outroot, current path as arguments & environment.
You can do this with --add-arch-template
added in commit 67217f56425ce24e74f0a75010b22f5c462de239 which also added including content from iso-graft in the workdir.
I think it should be documented that %post --nochroot
is no more working.
I tried to create an iso-graft
directory inside the working directory the right way to add arbitrary content, but the content has not been included. Am I missing something?
Hello. I have similar question.
I am using lorax to build live image like this:
livemedia-creator --vcpus 4 --resultdir lorax-output --make-pxe-live --iso CentOS-7-x86_64-Minimal-1708.iso --ks ks2.cfg --vnc vnc=127.0.0.1:5
Is there a way to inject files to the resulting squashfs image using lorax?
@bcl Brian, could you please comment on this?
So you confirm that %post --nochroot
doesn't work?
You can do this with
--add-arch-template
added in commit 67217f5 which also added including content from iso-graft in the workdir.
I found a solution. In share/templates.d/99-generic/live/x86.tmpl
source code, it makes iso by xorrisofs
. And the key parameter is -graft-points
. With option -graft-points it is possible to put files and directories to arbitrary paths in the ISO image.
So you confirm that
%post --nochroot
doesn't work?
I tried, did not work.
Solution is here.. https://pagure.io/fedora-kickstarts/c/1c9fefa1865ced5b357b3ec5f3b7d5bd856809fc
"Adapt for livemedia-creator changes
Now that F24 images are made with livemedia-creator instead of
livecd-creator, the kickstart parser has changed; the new kickstart
parser doesn't understand the $INSTALL_ROOT variable we'd been using in
%post --nochroot scripts. This commit fixes this by replacing
$INSTALL_ROOT usage with hardcoded /mnt/sysimage as docs suggest.
While at this, this commit also fixes a case where resolv.conf would be
incorrectly copied if it is a symlink, thanks to dgilmore for pointing
this out."
When livemedia-creator exits, the result is an iso image contains squashfs, which contains ext3f, which is the rootfs. The kickstart allows installing packages, and do post processing in the rootfs. But not in the iso.
.ks files available in /usr/share/doc/lorax/fedora-livemedia.ks contains this %post section :
Which does not work :
Instead:
livecd-creator mechanism based on %post using $LIVE_ROOT has no equivalent, which is, for me, a lack in the said .ks file compatibility.
Having the possibility to interact with the iso file before its packing could be great to :