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.
-- 
    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

Reply via email to