-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
150 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
#!/bin/bash | |||
|
|||
echo "we made it to autorun" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
Veewee::Session.declare( { | |||
:cpu_count => '1', :memory_size=> '256', | |||
:disk_size => '10140', :disk_format => 'VDI',:disk_size => '10240' , | |||
:os_type_id => 'Linux', | |||
:iso_file => "systemrescuecd-x86-2.0.0.iso", | |||
:iso_src => "http://downloads.sourceforge.net/project/systemrescuecd/sysresccd-x86/2.0.0/systemrescuecd-x86-2.0.0.iso?r=http%3A%2F%2Fwww.sysresccd.org%2FDownload&ts=1297107227&use_mirror=ignum", | |||
:iso_md5 => "51012e0bb943cff6367e5cea3a61cdbe", | |||
:iso_download_timeout => "1000", | |||
:boot_wait => "10",:boot_cmd_sequence => [ | |||
'<Tab> ', | |||
'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant', | |||
'<Enter>' | |||
], | |||
:kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "autorun0", | |||
:ssh_login_timeout => "10000",:ssh_user => "root", :ssh_password => "vagrant",:ssh_key => "", | |||
:ssh_host_port => "2222", :ssh_guest_port => "22", | |||
:sudo_cmd => "sh '%f'", | |||
:shutdown_cmd => "shutdown -H", | |||
:postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000" | |||
} | |||
) | |||
#'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,120 @@ | |||
#!/bin/bash | |||
|
|||
#https://wiki.archlinux.org/index.php/Install_from_Existing_Linux | |||
|
|||
ARCH=i686 | |||
mkdir /tmp/archlinux | |||
cd /tmp/archlinux | |||
|
|||
alias wget='wget --trust-server-names' | |||
|
|||
wget http://www.archlinux.org/packages/core/$ARCH/pacman/download/ | |||
wget http://www.archlinux.org/packages/core/any/pacman-mirrorlist/download/ | |||
|
|||
wget http://www.archlinux.org/packages/core/$ARCH/libfetch/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/libarchive/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/bzip2/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/openssl/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/xz/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/expat/download/ | |||
|
|||
for f in *.tar.xz ; do unxz -v $f ; done | |||
for f in *.tar ; do tar xvf $f ; done | |||
for f in *.tar.gz ; do tar xzvf $f ; done | |||
|
|||
|
|||
export PATH=/tmp/archlinux/usr/bin:$PATH | |||
export LD_LIBRARY_PATH=/tmp/archlinux/usr/lib:/tmp/archlinux/lib:$LD_LIBRARY_PATH | |||
alias pacman="pacman --config /tmp/archlinux/etc/pacman.conf" | |||
|
|||
cd / | |||
for f in /tmp/archlinux/pacman-*pkg.tar.gz ; do | |||
tar xzf $f | |||
done | |||
|
|||
#/etc/pacman.d/mirrorlist | |||
#enable a mirror | |||
|
|||
#Partition the disk | |||
sfdisk --force /dev/sda <<EOF | |||
# partition table of /dev/sda | |||
unit: sectors | |||
/dev/sda1 : start= 2048, size= 18874368, Id=83 | |||
/dev/sda2 : start= 18876416, size= 2095104, Id=82 | |||
/dev/sda3 : start= 0, size= 0, Id= 0 | |||
/dev/sda4 : start= 0, size= 0, Id= 0 | |||
EOF | |||
|
|||
sleep 2 | |||
|
|||
#Format the first disk | |||
mkfs.ext3 /dev/sda1 | |||
|
|||
#Format the swap and use it | |||
mkswap /dev/sda2 | |||
swapon /dev/sda2 | |||
|
|||
mkdir /newarch | |||
mount /dev/sda1 /newarch | |||
|
|||
mkdir -p /newarch/var/lib/pacman | |||
|
|||
#setting pacman - mirror - Belgium | |||
sed -i 's/^#\(.*kangaroot.*\)/\1/' /etc/pacman.d/mirrorlist | |||
|
|||
pacman -Sy -r /newarch | |||
|
|||
#pacman: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory | |||
#require bzip2 | |||
pacman --noconfirm --cachedir /newarch/var/cache/pacman/pkg -S base -r /newarch | |||
|
|||
#Create the devices | |||
cd /newarch/dev | |||
rm -f console ; mknod -m 600 console c 5 1 | |||
rm -f null ; mknod -m 666 null c 1 3 | |||
rm -f zero ; mknod -m 666 zero c 1 5 | |||
|
|||
#Copy the dns information (cp is aliased so we use the binary) | |||
/bin/cp -f /etc/resolv.conf /newarch/etc/ | |||
|
|||
#Mount the process architecture | |||
mount -t proc proc /newarch/proc | |||
mount -t sysfs sys /newarch/sys | |||
mount -o bind /dev /newarch/dev | |||
|
|||
chroot /newarch pacman --noconfirm -S kernel26 | |||
#chroot /newarch pacman --noconfir -S packagename | |||
|
|||
#set the mirror list within the machine | |||
chroot /newarch sed -i 's/^#\(.*kangaroot.*\)/\1/' /etc/pacman.d/mirrorlist | |||
#/etc/fstab | |||
#We need a partition! | |||
|
|||
echo "echo '/dev/sda1 / ext4 defaults,noatime 0 0' >> /etc/fstab"|chroot /newarch sh - | |||
echo "echo '/dev/sda2 swap swap defaults 0 0'>> /etc/fstab"|chroot /newarch sh - | |||
|
|||
#/etc/rc.conf | |||
|
|||
#hostname | |||
chroot /newarch sed -i 's/^HOSTNAME=\(.*\)/HOSTNAME=vagrant-arch/' /etc/rc.conf | |||
#gateway | |||
|
|||
#/etc/hosts | |||
#/etc/mkinitcpio.conf | |||
#/etc/local.gen | |||
|
|||
|
|||
#grub | |||
chroot /newarch grep -v rootfs /proc/mounts > /etc/mtab | |||
chroot /newarch grub-install /dev/sda | |||
chroot /newarch cp -a /usr/lib/grub/i386-pc/* /boot/grub | |||
|
|||
#create vagrant user | |||
|
|||
#chef | |||
cd / | |||
umount /newarch/{proc,sys,dev} | |||
umount /newarch | |||
|
|||
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,59 +1,3 @@ | |||
#!/bin/bash | #!/bin/bash | ||
|
|
||
#https://wiki.archlinux.org/index.php/Install_from_Existing_Linux | echo "we made it to autorun" | ||
|
|||
ARCH=i686 | |||
mkdir /tmp/archlinux | |||
cd /tmp/archlinux | |||
|
|||
alias wget='wget --trust-server-names' | |||
|
|||
wget http://www.archlinux.org/packages/core/$ARCH/pacman/download/ | |||
wget http://www.archlinux.org/packages/core/any/pacman-mirrorlist/download/ | |||
|
|||
wget http://www.archlinux.org/packages/core/$ARCH/libfetch/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/libarchive/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/openssl/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/xz/download/ | |||
wget http://www.archlinux.org/packages/core/$ARCH/expat/download/ | |||
|
|||
for f in *.tar.gz ; do tar xzvf $f ; done | |||
|
|||
export PATH=/tmp/archlinux/usr/bin:$PATH | |||
export LD_LIBRARY_PATH=/tmp/archlinux/usr/lib:$LD_LIBRARY_PATH | |||
alias pacman="pacman --config /tmp/archlinux/etc/pacman.conf" | |||
|
|||
cd / | |||
for f in /tmp/archlinux/pacman-*pkg.tar.gz ; do | |||
tar xzf $f | |||
done | |||
|
|||
#needs fdisk first | |||
mkfs.ext3 /dev/sda1 | |||
mkfs.ext3 -j -O dir_index /dev/sda1 | |||
|
|||
mkreiserfs /dev/sdxx | |||
|
|||
mkswap /dev/sda2 | |||
swapon /dev/sda2 | |||
|
|||
mkdir /newarch | |||
mount /dev/sda1 /newarch | |||
|
|||
mkdir -p /newarch/var/lib/pacman | |||
pacman -Sy -r /newarch | |||
|
|||
pacman --cachedir /newarch/var/cache/pacman/pkg -S base -r /newarch | |||
|
|||
cd /newarch/dev | |||
rm console ; mknod -m 600 console c 5 1 | |||
rm null ; mknod -m 666 null c 1 3 | |||
rm zero ; mknod -m 666 zero c 1 5 | |||
|
|||
cp /etc/resolv.conf /newarch/etc/ | |||
|
|||
mount -t proc proc /newarch/proc | |||
mount -t sysfs sys /newarch/sys | |||
mount -o bind /dev /newarch/dev | |||
|
|||
chroot /newroot pacman -S kernel26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters