mirror of
https://github.com/GNS3/gns3-registry.git
synced 2025-06-17 14:58:14 +00:00
TinyCore Linux appliance + packer
This commit is contained in:
37
packer/tinycore-linux/scripts/hd-install.sh
Normal file
37
packer/tinycore-linux/scripts/hd-install.sh
Normal file
@ -0,0 +1,37 @@
|
||||
# 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 30/' extlinux.conf
|
||||
cd
|
||||
|
||||
# make disk bootable
|
||||
tce-load -wi syslinux
|
||||
sudo sh -c 'cat /usr/local/share/syslinux/mbr.bin > /dev/sda'
|
||||
sudo /usr/local/sbin/extlinux --install /mnt/sda1/boot/extlinux
|
||||
|
||||
# create extensions directory
|
||||
sudo mkdir /mnt/sda1/tce
|
||||
sudo chgrp staff /mnt/sda1/tce
|
||||
sudo chmod 775 /mnt/sda1/tce
|
||||
|
||||
# base system modifications
|
||||
echo 'etc/issue' >> /opt/.filetool.lst
|
||||
echo 'etc/shadow' >> /opt/.filetool.lst
|
||||
echo -e "\nusername 'gns3', password 'gns3'\n" >> /etc/issue
|
18
packer/tinycore-linux/scripts/packages.sh
Normal file
18
packer/tinycore-linux/scripts/packages.sh
Normal file
@ -0,0 +1,18 @@
|
||||
# Add extensions
|
||||
|
||||
set -x
|
||||
|
||||
# change tcedir to harddisk
|
||||
mv /etc/sysconfig/tcedir /etc/sysconfig/tcedir.bak
|
||||
ln -s /mnt/sda1/tce /etc/sysconfig/tcedir
|
||||
rm -rf /usr/local/tce.installed/*
|
||||
|
||||
# openssh (optional)
|
||||
tce-load -wi openssh
|
||||
echo '/usr/local/etc/init.d/openssh start' >> /opt/bootlocal.sh
|
||||
echo 'usr/local/etc/ssh' >> /opt/.filetool.lst
|
||||
|
||||
tce-load -wi ipv6-`uname -r` iptables iproute2
|
||||
tce-load -wi tcpdump
|
||||
tce-load -wi iperf3
|
||||
|
9
packer/tinycore-linux/scripts/post_setup.sh
Normal file
9
packer/tinycore-linux/scripts/post_setup.sh
Normal file
@ -0,0 +1,9 @@
|
||||
# post-installation script
|
||||
set -x
|
||||
|
||||
# save changes
|
||||
rm -f .ash_history
|
||||
filetool.sh -b sda1
|
||||
|
||||
# write 0, not really necessary
|
||||
#sudo dd if=/dev/zero of=/mnt/sda1/zero ; sudo rm -f /mnt/sda1/zero
|
21
packer/tinycore-linux/scripts/serial.sh
Normal file
21
packer/tinycore-linux/scripts/serial.sh
Normal file
@ -0,0 +1,21 @@
|
||||
# Add serial console support
|
||||
|
||||
set -x
|
||||
|
||||
# Boot configuration
|
||||
# Serial interface is secondary console, the vga console remains main console
|
||||
# To change that, exchange the two 'console=' boot parameter
|
||||
sudo sed -i -e '1i serial 0 38400' -e '/append loglevel/ s/$/ console=ttyS0,38400 console=tty0/' /mnt/sda1/boot/extlinux/extlinux.conf
|
||||
|
||||
# /etc/inittab
|
||||
sudo sed -i -e '/tty6/attyS0::respawn:/sbin/getty 38400 ttyS0 xterm' /etc/inittab
|
||||
|
||||
# /etc/securetty
|
||||
sudo sed -i -e 's/^# *ttyS0/ttyS0/' /etc/securetty
|
||||
|
||||
# reload initab on startup
|
||||
sudo sed -i -e '/^\/opt\/bootlocal/ i' -e '/^\/opt\/bootlocal/ i# reload inittab' -e '/^\/opt\/bootlocal/ i kill -HUP 1' -e '/^\/opt\/bootlocal/ i' /opt/bootsync.sh
|
||||
|
||||
# add modified files to backup list
|
||||
echo 'etc/inittab' >> /opt/.filetool.lst
|
||||
echo 'etc/securetty' >> /opt/.filetool.lst
|
Reference in New Issue
Block a user