[Arch Linux][USB][Update 2013-05-17][Auto Script] Install arch linux 2013 on the USB stick
Following Script Download
#!/bin/sh
#
set -x # Show the message of each command
#MODULE FUNCTIONS{{{
arch_chroot () { #{{{
arch-chroot $ARCH_ROOT /bin/bash -c "${1}"
}
#}}}
#}}}
# ARCH Root
ARCH_ROOT=/mnt
# file system
mkfs -t ext4 /dev/sda1
# mount file system
mount /dev/sda1 $ARCH_ROOT
# pacman base
pacstrap -i $ARCH_ROOT base grub-bios
sleep 2
# fstab
genfstab -U -p $ARCH_ROOT >> $ARCH_ROOT/etc/fstab
sleep 2
# Set timezone and hwclock
arch_chroot 'hwclock --systohc --utc'
sleep 2
# Set hostname
arch_chroot 'echo "freeman-arch" > /etc/hostname'
sleep 2
# DHCP start
arch_chroot 'systemctl enable dhcpcd.service'
sleep 2
# locale
echo "LANG=zh_TW.UTF-8" > /etc/locale.conf
sleep 2
# locale-gen
arch_chroot 'sed -i \
-e "/^#en_US ISO-8859-1/s/#//" \
-e "/^#en_US.UTF-8 UTF-8/s/#//" \
-e "/^#zh_TW.UTF-8 UTF-8/s/#//" \
-e "/^#zh_TW BIG5/s/#//" \
/etc/locale.gen'
arch_chroot 'locale-gen'
sleep 2
# users and passwd
arch_chroot 'useradd -m -G users,wheel -s /bin/bash freeman'
arch_chroot 'echo "freeman:freeman" > passwd.txt'
arch_chroot 'echo "root:root" >> passwd.txt'
arch_chroot 'chpasswd < passwd.txt'
arch_chroot 'rm passwd.txt'
sleep 2
# mkinitcpio
arch_chroot 'mkinitcpio -p linux'
sleep 2
# grub
arch_chroot 'grub-mkconfig -o /boot/grub/grub.cfg'
arch_chroot 'grub-install /dev/sda'
sleep 2
#rm $ARCH_ROOT/vbox_arch_chroot.sh
umount $ARCH_ROOT/
shutdown -r now
# Reference:
[live]ArchLinux Install Script for Virtualbox
Archlinux Ultimate Install Script
Your great ideas will be born here
0 意見:
張貼留言