diff options
author | Dirk von Suchodoletz | 2009-03-05 15:06:08 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2009-03-05 15:06:08 +0100 |
commit | 474e19aacc78a4f9dec99f9f7cba71fd2f87ab81 (patch) | |
tree | 3cb3a9c3f3bc70b7756dab8636cfc640439c54ef /os-plugins/plugins/qemukvm/XX_qemukvm.sh | |
parent | Fix for transportation of init variables into hooks and back again. (diff) | |
download | core-474e19aacc78a4f9dec99f9f7cba71fd2f87ab81.tar.gz core-474e19aacc78a4f9dec99f9f7cba71fd2f87ab81.tar.xz core-474e19aacc78a4f9dec99f9f7cba71fd2f87ab81.zip |
Developing the qemukvm plugin (stage4 stuff) ...
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2668 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/qemukvm/XX_qemukvm.sh')
-rw-r--r-- | os-plugins/plugins/qemukvm/XX_qemukvm.sh | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/os-plugins/plugins/qemukvm/XX_qemukvm.sh b/os-plugins/plugins/qemukvm/XX_qemukvm.sh index 445405dc..54ee0d74 100644 --- a/os-plugins/plugins/qemukvm/XX_qemukvm.sh +++ b/os-plugins/plugins/qemukvm/XX_qemukvm.sh @@ -8,9 +8,61 @@ # # General information about OpenSLX can be found at http://openslx.org # -# script is included from init via the "." load function - thus it has all +# Script is included from init via the "." load function - thus it has all # variables and functions available +write_udhcpd_conf () +{ +local cfgfile=$1 +echo " +# udhcpd configuration file written by $0 during OpenSLX stage3 configuration + +# The start and end of the IP lease block +start 192.168.101.20 +end 192.168.101.100 + +# The interface that udhcpd will use +interface NWIF + +# How long an offered address is reserved (leased) in seconds +offer_time 6000 + +# The location of the leases file +lease_file /var/lib/misc/udhcpd.leases + +# The location of the pid file +pidfile /var/run/udhcpd.pid + +opt dns $domain_name_servers +option subnet 255.255.255.0 +opt router 192.168.10.2 +opt wins 192.168.10.10 +option domain $domain_name + +# Currently supported options, for more info, see options.c +#subnet +#timezone +#router +#timesvr +#namesvr +#dns +#logsvr +#cookiesvr +#lprsvr +#bootsize +#domain +#swapsvr +#rootpath +#ipttl +#mtu +#broadcast +#wins +#lease +#ntpsrv +#tftp +#bootfile +" >$file +} # check if the configuration file is available if [ -e /initramfs/plugin-conf/qemukvm.conf ]; then @@ -64,6 +116,20 @@ ${qemukvm_imagesrc}." nonfatal testmkd /mnt/etc/opt/openslx cp /mnt/opt/openslx/plugin-repo/qemukvm/run-virt.include \ /mnt/etc/opt/openslx/run-qemukvm.include + # create a template udhcpd configuration file + write_udhcpd_conf /mnt/etc/opt/openslx/udhcpd.qemukvm + + # for the busybox dhcp server + testmkd /mnt/var/lib/misc + touch /mnt/var/lib/misc/udhcpd.leases + + # copy the /etc/qemu-ifup script + cp /mnt/opt/openslx/plugin-repo/qemukvm/qemu-ifup /mnt/etc/qemu-ifup + cp /mnt/opt/openslx/plugin-repo/qemukvm/qemu-ifup.sudo \ + /mnt/etc/opt/openslx + chmod u+x /mnt/etc/opt/openslx/qemu-ifup.sudo + echo "%users ALL=NOPASSWD: /etc/opt/openslx/qemu-ifup.sudo" \ + >>/mnt/etc/sudoers fi else [ $DEBUGLEVEL -gt 0 ] && echo " * Configuration of qemukvm plugin failed" |