A simple onesis_setup script is attached and here is updated process.
Note: NO patches necessary to cobbler and NO modify cobbler
# onesis_setup --rootfs=/var/lib/oneSIS/image/centos-5.1
--config=/tmp/sysimage.conf
this script includes onesis setup, nfs export, copy initrd and vmlinuz to
/tftpboot
# cobbler distro add --name=onesis --kernel=/tftpboot/vm...
--initrd=/tftpboot/initrd..
# cobbler profile add --name......
# cobbler system add --name.....
reasonable?
Thanks
-Ihara
Michael DeHaan wrote:
Shuichi Ihara wrote:
Hi Michael,
I appreciate your great comments. Please see below.
(B) I am not sure about adding "onesis" as a first class cobbler
object. This means that it needs to show up in the Web UI and command
lists, manpage, and so forth, and in general, I don't want users too
overburdened with too many first class objects. Perhaps it would be
possible to keep that code as "/usr/bin/onesys-setup" as a seperate
script/package? This seems reasonable as you only have to run that
command once and the other distros/profiles do not seem to reference the
"cobbler onesis" produced data again on the cobbler server. The rest of
the features seem like they can be used with mainstream Cobbler -- which
is of course excellent that it did not require further modifications.
Yes, agreed. I didn't think that adding to a first class was reasonable.
The reason was just easy implementation to me :)
Anyway, I'm looking for more good solutions and reasonable implementation.
As your suggestions, I can write down an bash script that is doing in
onesis.patch.
But, how can we use that bash script from the cobbler's command?
I do not think the command needs to be part of cobbler, really. All the
other steps can be used as part of cobbler,
but the main cobbler specific thing that patch seemed to do was to be
copying something into tftpboot. As long
as your script copies into /var/lib/tftpboot if it first exists, and
failing that, picks /tftpboot, you can do that without
needing any Cobbler API's.
This is not part
of a "post script" of the kickstart. It seems the behavior of "cobbler onesis"
is
similar to "cobbler import" that copy the ISO's data (in onesis case, copy the
rootFS
to any directory) to an any directory and automatically set up the profile and
distro
for the clients.
So, what do you think like "onesis import --onesis"?
From looking at your script, I think this could work without being
added to cobbler, and should
be a seperate script. If you want to implement that as a script using
the cobbler API's, that would be fine
too, though as I do not suspect a large fraction of users would be using
onesis, that we need to add it into
the core. I do not think support would be in any way limited by not
including it, as it is a pretty simple
script. Does this make sense?
I'm still very interested in the idea, though I just don't see why it
needs to be included in the cobbler codebase
to make it work.
We can still document how to get it all working with cobbler, and if you
would want to upload your setup
script to the Wiki page that would be fine too!
(C) I'd really LOVE to have docs on this on the Wiki. Can you add them
under "User Documentation"? You will need an account at
https://admin.fedoraproject.org/accounts (these are very easy to apply
for) and the Wiki is at http://fedorahosted.org/cobbler
Yes, I can. I have created my account.
Excellent.
Feel free to disagree with the above suggestions, just looking over
"onesis.patch" I did not see much in the script that referenced over
cobbler API's, so it seems a good candidate for a seperate bash/python
script that we could perhaps host on the Wiki. Perhaps I did not fully
understand it.
Neat stuff though, thanks for sharing and let me know what you think
about the above!
NP, thanks again for you comments. It's great start to me. I would like to try
to
improve this feature to be more reasonable and work well for the type of onesis
diskless clients as well as other current supported network installation on the
cobbler.
Thanks
-Ihara
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler
#!/bin/sh
# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
# set -x
KERNEL_VERSION=`uname -r`
usage()
{
printf "Usage: $0 [options]\n"
printf "\t --rootfs=rootfs_dir\n"
printf "\t --config=config_file\n"
exit 1;
}
if [ $# -lt 2 ] ; then
usage;
fi
eval set -- $(getopt -l rootfs:,config: "" "$@")
while [ -- != "$1" ]; do
case "$1" in
--rootfs)
ONESIS_IMAGE=$2
shift 2
;;
--config)
ONESIS_CONFIG=$2
shift 2
;;
*)
usage
;;
esac
done
run_copy_rootfs()
{
if [ ! -d ${ONESIS_IMAGE} ]; then
mkdir -p ${ONESIS_IMAGE}
/sbin/copy-rootfs -l ${ONESIS_IMAGE}
else
printf "${ONESIS_IMAGE} is existing, must be clean this direcotry as
first"
exit 1
fi
}
run_mk_initramfs()
{
mk-initramfs-oneSIS -f -s 8192 -w e1000 -w forcedeth
/tftpboot/initrd-${KERNEL_VERSION}.img ${KERNEL_VERSION}
cp /boot/vmlinuz-${KERNEL_VERSION} /tftpboot/
}
clear_pidfile()
{
find ${ONESIS_IMAGE}/var/run.default/ ! -type d -exec rm {} \;
}
init_onesis_config()
{
cp ${ONESIS_CONFIG} ${ONESIS_IMAGE}/etc/sysimage.conf
if [ -f /sbin/mk-sysimage ]; then
mk-sysimage ${ONESIS_IMAGE}
else
printf "no /sbin/mk-sysimage"
exit 1
fi
}
nfs_setup()
{
if ! grep "^${ONESIS_IMAGE}" /etc/exports > /dev/null; then
printf "${ONESIS_IMAGE} *(ro,no_root_squash,sync)" >> /etc/exports
fi
/etc/init.d/nfs restart
}
run_copy_rootfs
run_mk_initramfs
init_onesis_config
clear_pidfile
nfs_setup
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler