From 91e49037236e65fa567bc26ca501e2ed30857be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 30 Sep 2010 16:56:17 -0300 Subject: Parabola GNU/Linux-libre 2010-09-30 --- overlay/arch/setup | 3 ++ overlay/etc/arch-release | 1 + overlay/etc/archiso/functions | 12 ++++++ overlay/etc/archiso/getshell | 9 ++++ overlay/etc/fstab | 7 ++++ overlay/etc/hosts | 8 ++++ overlay/etc/issue | 5 +++ overlay/etc/motd | 13 ++++++ overlay/etc/pacman.conf | 84 +++++++++++++++++++++++++++++++++++++ overlay/etc/pam.d/su | 6 +++ overlay/etc/rc.conf | 25 +++++++++++ overlay/etc/rc.d/archiso | 96 +++++++++++++++++++++++++++++++++++++++++++ overlay/etc/sudoers | 2 + overlay/usr/bin/km | 2 + 14 files changed, 273 insertions(+) create mode 100755 overlay/arch/setup create mode 100644 overlay/etc/arch-release create mode 100644 overlay/etc/archiso/functions create mode 100644 overlay/etc/archiso/getshell create mode 100644 overlay/etc/fstab create mode 100644 overlay/etc/hosts create mode 100644 overlay/etc/issue create mode 100644 overlay/etc/motd create mode 100644 overlay/etc/pacman.conf create mode 100644 overlay/etc/pam.d/su create mode 100644 overlay/etc/rc.conf create mode 100755 overlay/etc/rc.d/archiso create mode 100644 overlay/etc/sudoers create mode 100755 overlay/usr/bin/km (limited to 'overlay') diff --git a/overlay/arch/setup b/overlay/arch/setup new file mode 100755 index 0000000..e9d1660 --- /dev/null +++ b/overlay/arch/setup @@ -0,0 +1,3 @@ +#!/bin/sh +# +aif -p interactive diff --git a/overlay/etc/arch-release b/overlay/etc/arch-release new file mode 100644 index 0000000..153f8b2 --- /dev/null +++ b/overlay/etc/arch-release @@ -0,0 +1 @@ +Arch Linux Live ISO diff --git a/overlay/etc/archiso/functions b/overlay/etc/archiso/functions new file mode 100644 index 0000000..fdd48f4 --- /dev/null +++ b/overlay/etc/archiso/functions @@ -0,0 +1,12 @@ +# vim: set ft=sh: + +cmdline_param () +{ + for param in ${CMDLINE}; do + case "${param}" in + $1=*) echo "${param##*=}"; return ;; + *) continue ;; + esac + done + [ -n "${2}" ] && echo "${2}" +} diff --git a/overlay/etc/archiso/getshell b/overlay/etc/archiso/getshell new file mode 100644 index 0000000..a6f8775 --- /dev/null +++ b/overlay/etc/archiso/getshell @@ -0,0 +1,9 @@ +#!/bin/sh + +. /etc/archiso/functions + +shell="$(cmdline_param shell)" +[ -n "${shell}" ] && shell="/bin/bash" +[ ! -e "${shell}" ] && shell="/bin/sh" + +exec ${shell} diff --git a/overlay/etc/fstab b/overlay/etc/fstab new file mode 100644 index 0000000..3c43a5e --- /dev/null +++ b/overlay/etc/fstab @@ -0,0 +1,7 @@ +# /etc/fstab: static file system information +# +aufs / aufs noauto 0 0 +none /dev/pts devpts defaults 0 0 +none /dev/shm tmpfs defaults 0 0 + +### Auto generated entries get added here: diff --git a/overlay/etc/hosts b/overlay/etc/hosts new file mode 100644 index 0000000..b6f25e3 --- /dev/null +++ b/overlay/etc/hosts @@ -0,0 +1,8 @@ +# +# /etc/hosts: static lookup table for host names +# + +# +127.0.0.1 localhost.localdomain localhost archiso + +# End of file diff --git a/overlay/etc/issue b/overlay/etc/issue new file mode 100644 index 0000000..ce82e88 --- /dev/null +++ b/overlay/etc/issue @@ -0,0 +1,5 @@ + +Arch Linux Live ISO (\l) +\s-\r \m. +Default logins "root" and "arch" have no password. +To begin installation, login as root. diff --git a/overlay/etc/motd b/overlay/etc/motd new file mode 100644 index 0000000..00e4775 --- /dev/null +++ b/overlay/etc/motd @@ -0,0 +1,13 @@ +************************************************************** +* To begin installation, run /arch/setup * +* You can find documentation at * +* /usr/share/aif/docs/official_installation_guide_en * +* * +* i18n: Use the 'km' utility to change your keyboard layout * +* and console font. * +* * +* If you are looking to install Arch on something more * +* exotic, such as your kerosene-powered cheese grater, * +* please consult http://wiki.archlinux.org. * +* * +************************************************************** diff --git a/overlay/etc/pacman.conf b/overlay/etc/pacman.conf new file mode 100644 index 0000000..911c23d --- /dev/null +++ b/overlay/etc/pacman.conf @@ -0,0 +1,84 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +HoldPkg = pacman glibc +# If upgrades are available for these packages they will be asked for first +SyncFirst = pacman +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#XferCommand = /usr/bin/curl -C - %u > %o +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options (all disabled by default) +#UseSyslog +#ShowSize +#UseDelta +#TotalDownload + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +#[testing] +## Add your preferred servers here, they will be used first +#Include = /etc/pacman.d/mirrorlist + +[core] +# Add your preferred servers here, they will be used first +Include = /etc/pacman.d/mirrorlist + +[extra] +# Add your preferred servers here, they will be used first +Include = /etc/pacman.d/mirrorlist + +#[community-testing] +## Add your preferred servers here, they will be used first +#Include = /etc/pacman.d/mirrorlist + +[community] +# Add your preferred servers here, they will be used first +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#Server = file:///home/custompkgs + diff --git a/overlay/etc/pam.d/su b/overlay/etc/pam.d/su new file mode 100644 index 0000000..a291042 --- /dev/null +++ b/overlay/etc/pam.d/su @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth sufficient pam_rootok.so +auth sufficient pam_wheel.so trust use_uid +auth required pam_unix.so +account required pam_unix.so +session required pam_unix.so diff --git a/overlay/etc/rc.conf b/overlay/etc/rc.conf new file mode 100644 index 0000000..ff18456 --- /dev/null +++ b/overlay/etc/rc.conf @@ -0,0 +1,25 @@ +# +# /etc/rc.conf - Main Configuration for Arch Linux + +. /etc/archiso/functions + +LOCALE_DEFAULT="en_US.UTF-8" +CLOCK_DEFAULT="" +TIMEZONE_DEFAULT="" +KEYMAP_DEFAULT="us" + +LOCALE="$(cmdline_param locale ${LOCALE_DEFAULT})" +HARDWARECLOCK="$(cmdline_param clock ${CLOCK_DEFAULT})" +TIMEZONE="$(cmdline_param timezone ${TIMEZONE_DEFAULT})" +KEYMAP="$(cmdline_param keymap ${KEYMAP_DEFAULT})" +CONSOLEFONT="$(cmdline_param consolefont)" +CONSOLEMAP="$(cmdline_param consolemap)" +USECOLOR="yes" + +MOD_AUTOLOAD="yes" + +HOSTNAME="archiso" + +#TODO add more auto-daemons here, especially the live-cd specific stuff +DAEMONS=(syslog-ng network archiso) +#TODO: auto-network find-disks find-user-home diff --git a/overlay/etc/rc.d/archiso b/overlay/etc/rc.d/archiso new file mode 100755 index 0000000..435152a --- /dev/null +++ b/overlay/etc/rc.d/archiso @@ -0,0 +1,96 @@ +# vim: set ft=sh: +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/archiso/functions + + +scan_network () +{ + netparam () { echo ${2} | sed "s|.*${1}\([^ ]*\).*|\1|gi"; } + # + netdevs=$(cat /proc/net/dev | grep ':' | cut -d':' -f1) + for net in ${netdev}; do + stats=$(ifconfig ${net} | tr -s "\n" " ") + done +} + +scan_mount_pts () +{ + #iterate over all block devices + stat_busy "Scanning local block devices" + for dev in $(echo /sys/block/*/dev /sys/block/*/*/dev); do + + devname="/dev/$(echo ${dev} | cut -d'/' -f3,4 | cut -d'/' -f1)" + mountpt="/mnt/$(basename '${devname}')" + mkdir -p "${mountpt}" 2>/dev/null + mount ${options} "${devname}" "${mountpt}" >/dev/null 2>&1 + + fstype=$(awk '{ if ($1=="${devname}") { print $3" "$4;q }}' /proc/mounts) + fstype="${fstype%%,*}" + case "${fstype%% *}" in + *fat*|ntfs|*dos) options="user,exec,uid=0,gid=100,umask=00070" ;; + *) options="users,defaults,exec" ;; + #TODO handle 'sync' on usb devices... + esac + + echo "${devname} ${mountpt} ${fstype} ${options} 0 0 #configured by archiso" >>/etc/fstab + done + stat_done +} + +scan_swap () +{ + #Archie finds a pagefile.sys for windows/dos machines... may add later + stat_busy "Finding existing swap partitions" + swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)" + if [ -e "${swapdev}" ]; then + swapon ${swapdev} + echo "${swapdev} swap swap defaults 0 0 #configured by archiso" >>/etc/fstab + fi + stat_done +} + +do_homedir () +{ + stat_busy "Scanning for existing HOME directory" + user="$(cmdline_param homeuser)" + for hdir in $(find /mnt -name "home/${user}" 2>/dev/null); do + mkdir -p "/home/arch/" + # break after the first success... + mount --bind "${hdir}" "/home/arch/" && break + done + stat_done +} + +do_makeuser () +{ + stat_busy "Making the default user arch" + addgroups="audio,disk,optical,wheel" + useradd -m -p "" -g users -G $addgroups arch + stat_done +} + +do_locale_gen () +{ + stat_busy "Generating locales..." + sed -i "s/#\(${LOCALE/[@.]*}\)/\1/" /etc/locale.gen + /usr/sbin/locale-gen > /dev/null + stat_done +} + +# GIT does not manage perms others thans 755 and 644, so fix here. +do_fix_perms () +{ + stat_busy "Fixing file permissions..." + chmod 440 /etc/sudoers + stat_done +} + +case "$1" in + start) + do_locale_gen + do_makeuser + do_fix_perms + ;; +esac +exit 0 diff --git a/overlay/etc/sudoers b/overlay/etc/sudoers new file mode 100644 index 0000000..67b20ba --- /dev/null +++ b/overlay/etc/sudoers @@ -0,0 +1,2 @@ +root ALL=(ALL) ALL +%wheel ALL=(ALL) NOPASSWD: ALL diff --git a/overlay/usr/bin/km b/overlay/usr/bin/km new file mode 100755 index 0000000..e24d780 --- /dev/null +++ b/overlay/usr/bin/km @@ -0,0 +1,2 @@ +#!/bin/bash +aif -p partial-keymap -- cgit v1.2.3