The updated doc: The postinstall and cleanup files are processed respectively when bootstrapping an image and after image is built.
The file format is the same for both .bootstrap or .cleanup - empty lines (or with only spaces or tabs) are ignored - # character is for comments. everything after this char is ignored. (space or tabs before # are also ignored) - Commands: - bind <host mountpoint> => Mount the host mountpoint using -o bind in the image. Created the mountpoint in the image if needed. Example: "bind /dev" will mount /dev in the image - del <space separated file list with wildcards> => remove recursively the files or directories. - mkpath <absolute path in the image> => Creates the path in the image. Example: "mkpath /var/lib/yum" will create $imagepath/var/lib/yum Note: permission/owner canot be set here as passwd file does not exist yet in the image - pkgs <space separated list of pacakges to install> => Installs the packages and dependancies into the image. In case of multiple instance of pkg comands, multiple install instances will be done (in order) Note: on rpm system, packages can be also "capabilities" like 'perl(File::Path)'. In that case, simple quotes must be used around the "capabilities". - post <scriptname> => Runs the script after everything is processed. => Multiple post can be specified. They will be processed in the same order they've been decrared. => Path can be relative to this directory or absolute. - pre <scriptname> => Runs the script before doing everything else. => Multiple pre can be specified. They will be processed in the same order they've been decrared. => Path can be relative to this directory or absolute. - unbind <mount_point> => unmounts $imagepath/mount_point - Processing order: - pre - mkpath - del - bind - unbind - pkgs - post Regards, Olivier. Le jeudi 31 juillet 2014 11:32:21 Olivier LAHAYE a écrit : > Hi, > > I've just discovered that some package are not correctly installed in the > created image (mksiimage). > > For example, the screen package in rpm distro has it's postinstall not run > and thus the screen user and group is not created and thus, the systemd > service fails. > > When digging into the code of mksiimage that uses SystemInstaller::Package > and OSCAR::PackMan, I've discovered many problems. > > - For all distros: packages are installed one at a time which triggers full > dependancy computation each time and takes ages. > - For an rpm distro, packages are installed one by one twice! One during the > bootstrapping of the image (no bootstrapping on deb side as it's done in > rapt) and One for normal operation. > - Finally, some files or devices are missing in the image at early stage and > we get some bad installs. > > We need a clear image bootstrap for all distros (not a if condition for rpm > only in PackMan::smart_install) > > I'm planning to create a bootstrap config file for each distro so we can > tune for all different technologies. > The file would look like this for a rhel-7-x86_64 for example: > > # File centos-7-x86_64.bootstrap > pre prebootstrap.sh > post postbootstrap.sh > post post_rhel7.sh > bind /dev > bind /proc > path /var/lib/yum > pkg ldconfig > pkg yum > pkg passwd > pkg vim-minimal > pkg dhclient > pkg authconfig > # End > pre and post scripts would be ran with the image path as argument. > then the path commands would be honored (mkpath for all path lines) > then the bind lines (mkpath for the mount points if needed) and then: > mount -o bind $ARG $imagepath/$arg > then a smart_install of an array of all pkg lines > > Aside that, we also need a clean cleanup so we can unmount "binds" and > remove unncecessary files > > # File centos-7-x86_64.cleanup > pre precleanup.sh > post postcleanup.sh > post create_missing_files.sh > unbind /dev > unbind /proc > del /tmp/* > del /etc/fstab > # End > > As you can see, multiple pre and post for bootstrap and cleanup would be > allowed and would be run in declared order. > PATH to look for those files could be relative or absolute. > > Parser for both files would be the same of course. > > With that in place, the image creation would be more smart, more flexible > (easier to adapt to all distros) and far far faster. > > I'm experimenting on my side and see if at least, that solves the screen > group not created when building the rhel7 image. > > In the meantime, if you see some misconception or duplicate or any other > problem, don't hesitate to comment. > > Best regards, > > Olivier. Cordialement, Olivier. -- Olivier Lahaye DRT/LIST/DIR ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Oscar-devel mailing list Oscar-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oscar-devel