From 85d243ff5836fc17416c65dca8a9e8b4e9d915bc Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Sat, 18 Jun 2011 18:38:58 -0300 Subject: [archiso] Use dm-snapshot instead of aufs2 (A.K.A. "The Big Commit") * Use device mapper + snapshot module, instead union layer filesystem. * A block-level approach vs vfs-level. * No more unofficial (Linux) things. * More memory is needed. * Refactor mkarchiso. * Refactor hooks/archiso. * Fix install/archiso_pxe_nbd (due recent change in mkinitcpio-0.6.15 on checked_modules()/all_modules()) [Thanks Dave for the improved workaround] * New configs/releng to build official images. * Works with a Bash script instead of Makefile. (better control and easy to maintain) * Remove configs/syslinux-iso. * Remove archiso2dual script. Integrate functionality in configs/releng. * New configs/baseline to build the most basic live medium or use as template. * New README (draft). [Thanks Dieter for fixing english grammar] Signed-off-by: Gerardo Exequiel Pozzi --- configs/releng/root-image/arch/report-issues | 1 + configs/releng/root-image/arch/setup | 3 ++ configs/releng/root-image/etc/arch-release | 1 + configs/releng/root-image/etc/archiso/functions | 20 +++++++++ configs/releng/root-image/etc/fstab | 5 +++ configs/releng/root-image/etc/hosts | 9 ++++ configs/releng/root-image/etc/inittab | 48 ++++++++++++++++++++++ configs/releng/root-image/etc/issue | 5 +++ configs/releng/root-image/etc/motd | 16 ++++++++ configs/releng/root-image/etc/pam.d/su | 6 +++ configs/releng/root-image/etc/rc.conf | 35 ++++++++++++++++ configs/releng/root-image/etc/rc.d/archiso | 48 ++++++++++++++++++++++ .../etc/rc.d/functions.d/automated_script | 25 +++++++++++ configs/releng/root-image/etc/sudoers.d/g_wheel | 1 + configs/releng/root-image/usr/bin/autologin | 2 + configs/releng/root-image/usr/bin/km | 2 + 16 files changed, 227 insertions(+) create mode 100755 configs/releng/root-image/arch/report-issues create mode 100755 configs/releng/root-image/arch/setup create mode 100644 configs/releng/root-image/etc/arch-release create mode 100644 configs/releng/root-image/etc/archiso/functions create mode 100644 configs/releng/root-image/etc/fstab create mode 100644 configs/releng/root-image/etc/hosts create mode 100644 configs/releng/root-image/etc/inittab create mode 100644 configs/releng/root-image/etc/issue create mode 100644 configs/releng/root-image/etc/motd create mode 100644 configs/releng/root-image/etc/pam.d/su create mode 100644 configs/releng/root-image/etc/rc.conf create mode 100755 configs/releng/root-image/etc/rc.d/archiso create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/automated_script create mode 100644 configs/releng/root-image/etc/sudoers.d/g_wheel create mode 100755 configs/releng/root-image/usr/bin/autologin create mode 100755 configs/releng/root-image/usr/bin/km (limited to 'configs/releng/root-image') diff --git a/configs/releng/root-image/arch/report-issues b/configs/releng/root-image/arch/report-issues new file mode 100755 index 0000000..bf3b3a3 --- /dev/null +++ b/configs/releng/root-image/arch/report-issues @@ -0,0 +1 @@ +aif-report-issues.sh diff --git a/configs/releng/root-image/arch/setup b/configs/releng/root-image/arch/setup new file mode 100755 index 0000000..908d106 --- /dev/null +++ b/configs/releng/root-image/arch/setup @@ -0,0 +1,3 @@ +#!/bin/sh +# +aif -p interactive -d -l diff --git a/configs/releng/root-image/etc/arch-release b/configs/releng/root-image/etc/arch-release new file mode 100644 index 0000000..153f8b2 --- /dev/null +++ b/configs/releng/root-image/etc/arch-release @@ -0,0 +1 @@ +Arch Linux Live ISO diff --git a/configs/releng/root-image/etc/archiso/functions b/configs/releng/root-image/etc/archiso/functions new file mode 100644 index 0000000..9fffdcb --- /dev/null +++ b/configs/releng/root-image/etc/archiso/functions @@ -0,0 +1,20 @@ +# vim: set ft=sh: + +# kernel_cmdline +# Looks for a parameter on the kernel's boot-time command line. +# +# returns: 0 if param was found. Also prints its value if it was a K=V param. +# 1 if it was not. Also prints value passed as +# +kernel_cmdline () +{ + for param in $(/bin/cat /proc/cmdline); do + case "${param}" in + $1=*) echo "${param##*=}"; return 0 ;; + $1) return 0 ;; + *) continue ;; + esac + done + [ -n "${2}" ] && echo "${2}" + return 1 +} diff --git a/configs/releng/root-image/etc/fstab b/configs/releng/root-image/etc/fstab new file mode 100644 index 0000000..0df0cba --- /dev/null +++ b/configs/releng/root-image/etc/fstab @@ -0,0 +1,5 @@ +# +# /etc/fstab: static file system information +# +# +/dev/mapper/root-image / auto defaults 0 0 diff --git a/configs/releng/root-image/etc/hosts b/configs/releng/root-image/etc/hosts new file mode 100644 index 0000000..e474be0 --- /dev/null +++ b/configs/releng/root-image/etc/hosts @@ -0,0 +1,9 @@ +# +# /etc/hosts: static lookup table for host names +# + +# +127.0.0.1 localhost.localdomain localhost archiso +::1 localhost.localdomain localhost archiso + +# End of file diff --git a/configs/releng/root-image/etc/inittab b/configs/releng/root-image/etc/inittab new file mode 100644 index 0000000..2bbc494 --- /dev/null +++ b/configs/releng/root-image/etc/inittab @@ -0,0 +1,48 @@ +# +# /etc/inittab +# + +# Runlevels: +# 0 Halt +# 1(S) Single-user +# 2 Not used +# 3 Multi-user +# 4 Not used +# 5 X11 +# 6 Reboot + +## Only one of the following two lines can be uncommented! +# Boot to console +id:3:initdefault: +# Boot to X11 +#id:5:initdefault: + +rc::sysinit:/etc/rc.sysinit +rs:S1:wait:/etc/rc.single +rm:2345:wait:/etc/rc.multi +rh:06:wait:/etc/rc.shutdown +su:S:wait:/sbin/sulogin -p + +# -8 options fixes umlauts problem on login +c1:2345:respawn:/sbin/agetty -8 -s -n -l /usr/bin/autologin 38400 tty1 linux +c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux +c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux +c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux +c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux +c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux + +# Serial Virtual Console for KVM and others VMs +#s0:2345:respawn:/sbin/agetty -8 -s 9600 ttyS0 linux + +# Hypervisor Virtual Console for Xen and KVM +#h0:2345:respawn:/sbin/agetty -8 -s 38400 hvc0 linux + +ca::ctrlaltdel:/sbin/shutdown -t3 -r now + +# Example lines for starting a login manager +x:5:respawn:/usr/bin/xdm -nodaemon +#x:5:respawn:/usr/sbin/gdm -nodaemon +#x:5:respawn:/usr/bin/kdm -nodaemon +#x:5:respawn:/usr/bin/slim >/dev/null 2>&1 + +# End of file diff --git a/configs/releng/root-image/etc/issue b/configs/releng/root-image/etc/issue new file mode 100644 index 0000000..ce82e88 --- /dev/null +++ b/configs/releng/root-image/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/configs/releng/root-image/etc/motd b/configs/releng/root-image/etc/motd new file mode 100644 index 0000000..ddd9fbc --- /dev/null +++ b/configs/releng/root-image/etc/motd @@ -0,0 +1,16 @@ +************************************************************** +* 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 encounter issues and want to report them or * +* seek help, run /arch/report-issues * +* * +* 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/configs/releng/root-image/etc/pam.d/su b/configs/releng/root-image/etc/pam.d/su new file mode 100644 index 0000000..a291042 --- /dev/null +++ b/configs/releng/root-image/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/configs/releng/root-image/etc/rc.conf b/configs/releng/root-image/etc/rc.conf new file mode 100644 index 0000000..92236a2 --- /dev/null +++ b/configs/releng/root-image/etc/rc.conf @@ -0,0 +1,35 @@ +# +# /etc/rc.conf - Main Configuration for Arch Linux + +. /etc/archiso/functions + +LOCALE_DEFAULT="en_US.UTF-8" +DAEMON_LOCALE_DEFAULT="no" +CLOCK_DEFAULT="UTC" +TIMEZONE_DEFAULT="Canada/Pacific" +KEYMAP_DEFAULT="us" +CONSOLEFONT_DEFAULT= +CONSOLEMAP_DEFAULT= +USECOLOR_DEFAULT="yes" +VERBOSE_DEFAULT="3" + +LOCALE="$(kernel_cmdline locale ${LOCALE_DEFAULT})" +DAEMON_LOCALE="$(kernel_cmdline daemon_locale ${DAEMON_LOCALE_DEFAULT})" +HARDWARECLOCK="$(kernel_cmdline clock ${CLOCK_DEFAULT})" +TIMEZONE="$(kernel_cmdline timezone ${TIMEZONE_DEFAULT})" +KEYMAP="$(kernel_cmdline keymap ${KEYMAP_DEFAULT})" +CONSOLEFONT="$(kernel_cmdline consolefont ${CONSOLEFONT_DEFAULT})" +CONSOLEMAP="$(kernel_cmdline consolemap ${CONSOLEMAP_DEFAULT})" +USECOLOR="$(kernel_cmdline usecolor ${USECOLOR_DEFAULT})" +VERBOSE="$(kernel_cmdline verbose ${VERBOSE_DEFAULT})" + +MODULES=() + +UDEV_TIMEOUT=30 +USEDMRAID="no" +USEBTRFS="no" +USELVM="no" + +HOSTNAME="archiso" + +DAEMONS=(hwclock syslog-ng archiso) diff --git a/configs/releng/root-image/etc/rc.d/archiso b/configs/releng/root-image/etc/rc.d/archiso new file mode 100755 index 0000000..1429516 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/archiso @@ -0,0 +1,48 @@ +# vim: set ft=sh: +. /etc/rc.conf +. /etc/rc.d/functions + +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 +} + +# If an alternate console was specified on the kernel command line, +# start agetty on it too. +do_special_console() +{ + cmdline_console="$(kernel_cmdline console)" + [ $? -ne 0 ] && return + + dev="${cmdline_console%%,*}" + args="${cmdline_console##*,}" + baud="${args%%[neo]*}" && baud="${baud:-"9600"}" + [ "x${args}" != "x${args%%r}" ] && rts="-h" + + + stat_busy "Starting agetty on console: ${cmdline_console}" + echo "${dev}" >> /etc/securetty + echo "z0:2345:respawn:/sbin/agetty ${rts} ${baud} ${dev} linux" >> /etc/inittab + /sbin/telinit q + stat_done +} + +case "$1" in + start) + do_locale_gen + do_makeuser + do_special_console + ;; +esac +exit 0 diff --git a/configs/releng/root-image/etc/rc.d/functions.d/automated_script b/configs/releng/root-image/etc/rc.d/functions.d/automated_script new file mode 100644 index 0000000..edb8ea3 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/automated_script @@ -0,0 +1,25 @@ +. /etc/archiso/functions + +automated_script () +{ + script="$(kernel_cmdline script)" + if [[ -n "$script" ]]; then + stat_busy "Configuring $script" + if [[ "$script" =~ ^http:// || "$script" =~ ^ftp:// ]]; then + wget "$script" -q -O /tmp/startup_script >/dev/null + rt=$? + else + cp "$script" /tmp/startup_script + rt=$? + fi + if [ $rt -eq 0 ]; then + chmod +x /tmp/startup_script + echo -e '\nif [ $(tty) = "/dev/tty1" ]; then\n /tmp/startup_script\nfi\n' >> /root/.bash_profile + stat_done + else + stat_fail + fi + fi +} + +add_hook multi_end automated_script diff --git a/configs/releng/root-image/etc/sudoers.d/g_wheel b/configs/releng/root-image/etc/sudoers.d/g_wheel new file mode 100644 index 0000000..8c45359 --- /dev/null +++ b/configs/releng/root-image/etc/sudoers.d/g_wheel @@ -0,0 +1 @@ +%wheel ALL=(ALL) NOPASSWD: ALL diff --git a/configs/releng/root-image/usr/bin/autologin b/configs/releng/root-image/usr/bin/autologin new file mode 100755 index 0000000..c124f9e --- /dev/null +++ b/configs/releng/root-image/usr/bin/autologin @@ -0,0 +1,2 @@ +#!/bin/bash +/bin/login -f root diff --git a/configs/releng/root-image/usr/bin/km b/configs/releng/root-image/usr/bin/km new file mode 100755 index 0000000..e24d780 --- /dev/null +++ b/configs/releng/root-image/usr/bin/km @@ -0,0 +1,2 @@ +#!/bin/bash +aif -p partial-keymap -- cgit v1.2.3-54-g00ecf