Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- SOURCE=net
- MIRROR=('http://mirrors.xmission.com/archlinux/${repo}/os/${arch}' 'http://locke.suu.edu/linux/dist/archlinux/${repo}/os/${arch}')
- SYNC_URL=${MIRROR}
- TARGET_REPOSITORIES=(core ${SYNC_URL} extra ${SYNC_URL} community ${SYNC_URL})
- HARDWARECLOCK=UTC
- TIMEZONE=MST
- KEYMAP=dvorak
- RUNTIME_REPOSITORIES=
- RUNTIME_PACKAGES=
- systemd='systemd systemd-arch-units systemd-sysvcompat'
- xorg='xorg-server xorg-xinit xorg-server-utils'
- python='python python2 pygtk'
- sysv='initscripts sysvinit'
- # add this in if you want to run in a vm
- virtualbox='virtualbox-archlinux-additions'
- # packages to install
- TARGET_GROUPS='base gnome'
- TARGET_PACKAGES_EXCLUDE="nano reiserfsprogs epiphany ${sysv}"
- TARGET_PACKAGES="${systemd} ${xorg} ${python} gdm vim networkmanager iproute2 sudo"
- grok_partitions () {
- local root_found=
- local partitions=
- for label in `ls /dev/disk/by-label | grep "Arch"`
- do
- if [ ${label} == "Arch" ]
- then
- mount_point="/"
- root_found=true
- else
- IFS="-" read base mount <<< "${label}"
- mount_point="/${mount}"
- fi
- local partition=$(readlink -f /dev/disk/by-label/${label})
- local fs=$(blkid -s TYPE -o value "${partition}")
- partitions+="${partition} raw ${label} ${fs};yes;${mount_point};target;no_opts;${label};no_params\n"
- done
- if [ ! ${root_found} ]
- then
- echo "No mount point specified for /. Refusing to continue."
- exit 1
- fi
- # do the swap
- if [ -e /dev/disk/by-label/swap ]
- then
- local partition=$(readlink -f /dev/disk/by-label/swap)
- partitions+="${partition} raw swap swap;yes;no_mountpoint;target;no_opts;swap;no_params"
- else
- # if there's no labeled swap, use the first one we find
- local partition=$(blkid -t TYPE="swap" -o device | head -1)
- if [ ! -e ${partition} ]
- then
- echo "No swap detected. Giving up."
- exit 1
- fi
- partitions+="${partition} raw no_label swap;yes;no_mountpoint;target;no_opts;no_label;no_params"
- fi
- echo -n ${partitions}
- }
- PART_ACCESS=
- # These variables are mandatory
- GRUB_DEVICE=/dev/sda
- # empty partition table (we've already set them up)
- # there has to be something here or aif will complain
- PARTITIONS="invalid"
- BLOCKDATA=$(grok_partitions)
- # you can optionally also override some functions...
- # This way you can change/extend/remove pretty much all functionality in AIF !
- worker_intro () {
- inform "The following partition setup will be used:"
- echo -e ${BLOCKDATA}
- inform "This is your last chance to abort. Install starting in 3 seconds."
- sleep 3
- }
- # don't partition, we already have our disks set up
- # this is basically the same as prepare_disks, but
- # it does not create the partitions
- worker_prepare_disks () {
- if ! process_filesystems
- then
- show_warning 'Disk processing' "Could not process_filesystems"
- txt='also failed to execute properly'
- rollback_filesystems && txt='ended successfully'
- die_error "Something failed while processing the filesystem. A rollback was executed, which $txt"
- fi
- }
- worker_configure_system () {
- preconfigure_target
- # store systemd-specific settings
- echo "archy" > "${var_TARGET_DIR}/etc/hostname"
- echo "KEYMAP=dvorak" > "${var_TARGET_DIR}/etc/vconsole.conf"
- echo "America/Boise" > "${var_TARGET_DIR}/etc/timezone"
- postconfigure_target
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement