]>
Raphaƫl G. Git Repositories - distgen/blob - lib/export.sh
4 cat /dev
/null
> root.conf
6 # Append every config parameters
7 for i
in `cat config/*.conf | perl -pne 'undef $_ if /^#/; s/=.*$//'`; do
8 echo "$i='$(eval echo \$$i)'" | tee -a root.conf
12 cat << EOF > root/virtualbox
13 # VirtualBox disk creation commands
14 VBoxManage internalcommands createrawvmdk -filename '$VBHDDIR/sda.vmdk' -rawdisk '${PWD}/${SDA}'
15 VBoxManage internalcommands createrawvmdk -filename '$VBHDDIR/sdb.vmdk' -rawdisk '${PWD}/${SDB}'
17 Fix ownership of '${PWD}/${SDA}', '${PWD}/${SDB}', '${VBHDDIR}/sda.vmdk' and '${VBHDDIR}/sdb.vmdk' if you to use these as user
19 # VirtualBox configuration
20 Go in file/preferences.../network/host-only networks" >> root.virtualbox
21 Add a new host-only networkd IPv4=${NETGATEWAY4}/IPv4 Mask=255.255.255.0/IPv6=${NETGATEWAY6}/IPv6 Mask=64/DHCP Server=disabled" >> root.virtualbox
23 # Virtual Machine Configuration
24 Create a new virtual machine : Type=Linux/Version=Mageia(${ARCH})/Do not add a virtual hard disk
25 Open the settings of the virtual machine
28 In controller SATA click on add hard disk, select choose existing disk, sda.vmdk, same with sdb.vmdk
31 Change 'Attached to' to 'Host-only adapter'
32 Under advanced change MAC Address to ${NETMAC}
36 cat << EOF > root/dhcpd.conf
38 ddns-update-style none;
41 option domain-name "${NETHOSTNAME#*.}";
44 option domain-name-servers ${NETDNS/ /, };
47 default-lease-time 600;
50 # ${NETADDRESS4%.*}.0/${NETADDRESS4#*/} subnet
51 subnet ${NETADDRESS4%.*}.0 netmask 255.255.255.0 {
53 option routers ${NETGATEWAY4};
57 hardware ethernet ${NETMAC};
58 fixed-address ${NETADDRESS4%/*};
63 cat << EOF > root/dhcpd6.conf
65 ddns-update-style none;
68 default-lease-time 600;
71 # Enable RFC 5007 support (same than for DHCPv4)
74 # vboxnet0 shared network
75 shared-network vboxnet0 {
77 option domain-name "${NETHOSTNAME#*.}";
80 # option dhcp6.name-servers ${NETGATEWAY6};
82 # private ${NETADDRESS6%::*}::/${NETADDRESS6#*/} subnet
83 subnet6 ${NETADDRESS6%::*}::/${NETADDRESS6#*/} {
85 range6 ${NETADDRESS6%::*}::2 ${NETADDRESS6%::*}::ffff:ffff;
88 # shared fe80::/64 subnet
95 #XXX: only work for ipv4 : hardware ethernet ${NETMAC};
96 #XXX: see journalctl -u dhcpd6.service to get virtualbox machine DUID
97 host-identifier option dhcp6.client-id 00:00:00:00:00:00:00:00:00:00:00:00:00:00;
99 fixed-address6 ${NETADDRESS6%/*};
104 cat << EOF > root/radvd.conf
105 # Radvd configuration
108 # Announce at regular interval
110 # Start service even if vboxnet0 is missing
112 # Force the configuration of client through dhcpv6
114 AdvOtherConfigFlag on;
116 prefix ${NETADDRESS6%::*}::/${NETADDRESS6#*/} {
117 # Announce that all address prefix are on-link
119 # Announce that the prefix can be used for autonomous address configuration
120 #XXX: off require a dhcpd6 configuration
122 # Announce that the interface address is sent instead of network prefix
126 prefix ${NETGATEWAY6}/128 {