mirror of
https://github.com/GNS3/gns3-registry.git
synced 2025-06-01 15:30:44 +00:00
parent
41fb845c73
commit
a6daec2a45
@ -25,7 +25,7 @@
|
|||||||
"http_directory": "http",
|
"http_directory": "http",
|
||||||
"boot_wait": "5s",
|
"boot_wait": "5s",
|
||||||
"boot_command": [
|
"boot_command": [
|
||||||
"corepure64 user=gns3<enter><wait10><wait10><wait10><wait10><wait10><wait10>",
|
"corepure64 user=gns3<enter><wait10><wait10><wait10><wait10><wait10><wait10><wait10><wait10>",
|
||||||
"sudo passwd gns3<enter><wait>gns3<enter>gns3<enter>",
|
"sudo passwd gns3<enter><wait>gns3<enter>gns3<enter>",
|
||||||
"tce-load -wi openssh<enter><wait10>",
|
"tce-load -wi openssh<enter><wait10>",
|
||||||
"cd /usr/local/etc/ssh; [ -f sshd_config_example ] && sudo cp -a sshd_config_example sshd_config; cd<enter>",
|
"cd /usr/local/etc/ssh; [ -f sshd_config_example ] && sudo cp -a sshd_config_example sshd_config; cd<enter>",
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"provisioners": [
|
"provisioners": [
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"script": "scripts/hd-install.sh"
|
"script": "scripts/hd-install-64bits.sh"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
|
73
packer/tinycore-linux/scripts/hd-install-64bits.sh
Normal file
73
packer/tinycore-linux/scripts/hd-install-64bits.sh
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# Install tinycore on harddisk
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# format harddisk
|
||||||
|
echo -e 'n\np\n1\n\n\na\n1\nw' | sudo fdisk -H16 -S32 /dev/sda
|
||||||
|
sudo mkfs.ext2 /dev/sda1
|
||||||
|
|
||||||
|
# copy system to harddisk
|
||||||
|
sudo mkdir /mnt/sda1
|
||||||
|
sudo mount /dev/sda1 /mnt/sda1
|
||||||
|
sudo mount /mnt/sr0
|
||||||
|
sudo cp -a /mnt/sr0/boot /mnt/sda1/
|
||||||
|
sudo umount /mnt/sr0
|
||||||
|
|
||||||
|
# modify bootloader config
|
||||||
|
sudo mv /mnt/sda1/boot/isolinux /mnt/sda1/boot/extlinux
|
||||||
|
cd /mnt/sda1/boot/extlinux
|
||||||
|
sudo rm boot.cat isolinux.bin
|
||||||
|
sudo mv isolinux.cfg extlinux.conf
|
||||||
|
sudo sed -i -e '/append / s/$/ user=gns3/' -e 's/timeout .*/timeout 1/' extlinux.conf
|
||||||
|
cd
|
||||||
|
|
||||||
|
# make disk bootable
|
||||||
|
|
||||||
|
|
||||||
|
# create extensions directory
|
||||||
|
sudo mkdir /mnt/sda1/tce
|
||||||
|
sudo mkdir -p /mnt/sda1/tce/optional/
|
||||||
|
sudo chgrp -R staff /mnt/sda1/tce
|
||||||
|
sudo chmod -R 775 /mnt/sda1/tce
|
||||||
|
|
||||||
|
# Make lib32 extension
|
||||||
|
tce-load -wi squashfs-tools
|
||||||
|
mkdir /tmp/lib32
|
||||||
|
cd /tmp/lib32
|
||||||
|
wget http://tinycorelinux.net/6.x/x86/release/Core-current.iso
|
||||||
|
sudo mount -o loop Core-current.iso /mnt/fd0
|
||||||
|
mkdir lib32
|
||||||
|
cd lib32
|
||||||
|
zcat /mnt/fd0/boot/core.gz | cpio -id "lib/l*" "usr/lib/l*"
|
||||||
|
mkdir -p usr/local/lib
|
||||||
|
cd ..
|
||||||
|
sudo umount /mnt/fd0
|
||||||
|
rm Core-current.iso
|
||||||
|
mkdir lib
|
||||||
|
ln -s /lib32/lib/`readlink lib32/lib/ld-linux.so.2` lib/ld-linux.so.2
|
||||||
|
mkdir -p usr/local/tce.installed
|
||||||
|
cat > usr/local/tce.installed/lib32 << 'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
echo -e "/lib32/lib\n/lib32/usr/lib\n/lib32/usr/local/lib" >> /etc/ld.so.conf
|
||||||
|
ldconfig
|
||||||
|
sed 's/ld-linux.*\*/ld-linux.so\*/' /usr/bin/ldd > /usr/bin/ldd32
|
||||||
|
chmod +x /usr/bin/ldd32
|
||||||
|
sed 's/ld-linux/ld-linux-x86-64/' /usr/bin/ldd32 > /usr/bin/ldd
|
||||||
|
chmod +x /usr/bin/ldd
|
||||||
|
EOF
|
||||||
|
chmod +x usr/local/tce.installed/lib32
|
||||||
|
chgrp -R staff usr/local/tce.installed
|
||||||
|
chmod 775 usr/local/tce.installed
|
||||||
|
sudo mksquashfs /tmp/lib32 lib32.tcz
|
||||||
|
sudo mv lib32.tcz* /mnt/sda1/tce/optional/
|
||||||
|
echo lib32.tcz >> /mnt/sda1/tce/onboot.lst
|
||||||
|
tce-load -i /mnt/sda1/tce/optional/lib32
|
||||||
|
|
||||||
|
cd
|
||||||
|
|
||||||
|
wget http://repo.tinycorelinux.net/6.x/x86/tcz/syslinux.tcz
|
||||||
|
tce-load -i syslinux.tcz
|
||||||
|
|
||||||
|
sudo sh -c 'cat /usr/local/share/syslinux/mbr.bin > /dev/sda'
|
||||||
|
sudo /usr/local/sbin/extlinux --install /mnt/sda1/boot/extlinux
|
||||||
|
|
@ -31,7 +31,3 @@ sudo mkdir /mnt/sda1/tce
|
|||||||
sudo chgrp staff /mnt/sda1/tce
|
sudo chgrp staff /mnt/sda1/tce
|
||||||
sudo chmod 775 /mnt/sda1/tce
|
sudo chmod 775 /mnt/sda1/tce
|
||||||
|
|
||||||
# base system modifications
|
|
||||||
echo -e "\nusername 'gns3', password 'gns3'\n" >> /etc/issue
|
|
||||||
echo 'etc/issue' >> /opt/.filetool.lst
|
|
||||||
echo 'etc/shadow' >> /opt/.filetool.lst
|
|
||||||
|
@ -1 +1,35 @@
|
|||||||
|
# Original instructions: http://brezular.com/2011/09/03/openvswich-creating-and-submitting-openvswitch-extension-to-microcore-repository/
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
|
||||||
|
# We need gcc because it contain some dependencies of openvswitch
|
||||||
|
tce-load -wi gcc.tcz
|
||||||
|
|
||||||
tce-load -wi openvswitch-3.16.6-tinycore64
|
tce-load -wi openvswitch-3.16.6-tinycore64
|
||||||
|
|
||||||
|
|
||||||
|
sudo modprobe openvswitch
|
||||||
|
|
||||||
|
echo "modprobe openvswitch" >> /opt/bootlocal.sh
|
||||||
|
echo "modprobe 8021q" >> /opt/bootlocal.sh
|
||||||
|
|
||||||
|
sudo mkdir -p /usr/local/etc/openvswitch/
|
||||||
|
sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db /usr/local/etc/openvswitch/vswitchd/vswitch.ovsschema
|
||||||
|
|
||||||
|
echo "/usr/local/etc/openvswitch/" >> /opt/.filetool.lst
|
||||||
|
sudo chgrp -R staff /usr/local/etc/openvswitch/
|
||||||
|
|
||||||
|
echo "/usr/local/sbin/ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --private-key=db:Open_vSwitch,SSL,private_key --certificate=db:Open_vSwitch,SSL,certificate --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert --pidfile --detach" >> /opt/bootlocal.sh
|
||||||
|
|
||||||
|
echo "/usr/local/bin/ovs-vsctl --no-wait init" >> /opt/bootlocal.sh
|
||||||
|
|
||||||
|
echo "/usr/local/sbin/ovs-vswitchd --pidfile --detach" >> /opt/bootlocal.sh
|
||||||
|
|
||||||
|
sudo /opt/bootlocal.sh
|
||||||
|
|
||||||
|
sudo ovs-vsctl add-br br0
|
||||||
|
|
||||||
|
echo 'for interface in `ip link | cut -d " " -f2 | grep "eth" | sed "s/:$//"`;do ovs-vsctl add-port br0 $interface; done' >> /opt/bootlocal.sh
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
@ -9,3 +9,7 @@ rm -rf /usr/local/tce.installed/*
|
|||||||
|
|
||||||
tce-load -wi ipv6-`uname -r` iptables iproute2
|
tce-load -wi ipv6-`uname -r` iptables iproute2
|
||||||
|
|
||||||
|
|
||||||
|
echo "modprobe ipv6" >> /opt/bootlocal.sh
|
||||||
|
echo "sysctl -w net.ipv4.ip_forward=1" >> /opt/bootlocal.sh
|
||||||
|
echo "sysctl -w net.ipv6.conf.all.forwarding=1" >> /opt/bootlocal.sh
|
||||||
|
@ -1,9 +1,17 @@
|
|||||||
# post-installation script
|
# post-installation script
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
# base system modifications
|
||||||
|
sudo sed -i -e '/^\/opt\/bootlocal/ i' /opt/bootsync.sh
|
||||||
|
echo -e "\nusername 'gns3', password 'gns3'\nRun filetool.sh -b if you want to save your changes" >> /etc/issue
|
||||||
|
echo 'etc/issue' >> /opt/.filetool.lst
|
||||||
|
echo 'etc/shadow' >> /opt/.filetool.lst
|
||||||
|
|
||||||
# save changes
|
# save changes
|
||||||
rm -f .ash_history
|
rm -f .ash_history
|
||||||
filetool.sh -b sda1
|
filetool.sh -b sda1
|
||||||
|
|
||||||
# write 0, not really necessary
|
# write 0, not really necessary
|
||||||
#sudo dd if=/dev/zero of=/mnt/sda1/zero ; sudo rm -f /mnt/sda1/zero
|
#sudo dd if=/dev/zero of=/mnt/sda1/zero ; sudo rm -f /mnt/sda1/zero
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user