[arch-releng] Fw: aif -p automatic

Dieter Plaetinck dieter at plaetinck.be
Tue Mar 31 15:25:43 EDT 2009


got this mail today and found it very interesting, so i'm forwarding it
(and my replies) here for your reading pleasure.


Begin forwarded message:

Date: Tue, 31 Mar 2009 18:03:44 +1000
From: Jud <jud at judfilm.net>
To: dieter at plaetinck.be
Subject: aif -p automatic


Hi Dieter,

How's it going?

Noticed you have started working on an automatic install feature for
Arch. IMHO this the most important feature Arch needs.

I took the liberty of editing your example file to how, from my
experience, I would like it to work. Are these ideas possible? There are
many questions inline, hope this helps and I am available to answer any
of your questions. If you need some help implementing any of the ideas,
I like to try and help out.

Regards

Jud


# AIF Automatic.example
# these variables are optional, here are the defaults (feel free to
omit them) #
# Goal: Setup a very workable machine(s) automatically
#

SOURCE=ftp usb # [rsync http webdav ftp usb disc] if can't get net
connection fallback to packages on boot usb stick
FILE_URL=/dev/sdb1 #
does the install script know the boot media and /dev address?
SYNC_URL=192.168.1.2  # The ftp:// and /${REPO}/os/${CARCH}/ should be
done automatically, fallback to pacman-mirrorlist
LOGGING_SERVER=  #
Address to connect to a remote logging server/service
EMAIL="Admin Guy
<admin_guy at example.com>" # send errors, finished log, etc # verify
address first?
EMAIL_SERVER="smtp.example.com:25"

# Do you want to have additional pacman repositories or packages
available at runtime (during installation)?
RUNTIME_REPOSITORIES=
RUNTIME_PACKAGES=openssh ntp ssmtp

# you can optionally also override some functions...
worker_intro () {
	infofy "Automatic procedure running the generic-install-on-sda
example config.  THIS WILL ERASE AND OVERWRITE YOUR /DEV/SDA.  IF YOU
DO NOT WANT THIS PRESS CTRL+C WITHIN 10 SECONDS" sleep 10 # countdown
onscreen? } # Could/Can this be run from GRUB menu on the boot media -
ie no user interaction at all?


PROFILES=TestMachine BuildMachine Laptop Server VirtualTest

# Profiles would be picked at start of script and/or grub menu?
# Detect by MAC address?

[TestMachine]
MAC=01:E5:17:1C:28:47

# Packages to Install
TARGET_REPOS=core extra community # Could add a list of repos to enable
eg: testing, kdemod TARGET_GROUPS=base xorg gnome #all packages in this
group will be installed (defaults to base if no group and no packages
are specified)
TARGET_PACKAGES=openssh openssl ntp di memtest86+
alsa-lib alsa-utils xf86-video-ati gdm gnupg firefox thunderbird
openoffice-base cups cups-pdf ghostscript gsfonts xsane mc-mp rsync
ssmtp ttf-liberation ttf-freefont # you can also specify separate
packages (this is empty by default) TARGET_PACKAGES_EXCLUDE=jfsutils
reiserfsprogs ppp rp-pppoe xterm epiphany gnome2-user-docs # These
packages will not be installed unless needed as a dependency for
TARGET_PACKAGES

# /etc/rc.conf Settings
HOSTNAME="TestMachine" # Could also be prompted as script starts? #
Also auto append to /etc/hosts
LOCALE="en_AU.utf8" # /etc/local.gen should be automatically set to
this option only
HARDWARECLOCK="UTC"
TIMEZONE="Australia/Brisbane" # Set TZ Environment Variable
KEYMAP="us"
eth0="dhcp"
MODULES=(powernow-k8 cpufreq-ondemand !ipv6)
DAEMONS=(@alsa @hal @fam @sshd @gdm) # Append to defaults or supply
whole line?


GROUPS='staff accounts' # groups to be created
USERS='root:[hashed_password]' # Not sure if this is a good idea - how
did you handle root?
'fred:Fred Nerk:staff,audio:[hashed_password]' #
Might be good to add other options like full name, UID, secondary
groups etc
'mary:Mary
Smith:staff,accounts,audio,optical,scanner:[hashed_password]' # user
would be prompted to change password on first login


# These variables are mandatory

GRUB_DEVICE='/dev/sda'
GRUB_OPTIONS='TIMEOUT=2
              0:vga=775 quiet # Add to the kernel= line for grub item 0
              1:vga=773'
PARTITIONS='/dev/sda 100:ext2:+ 512:swap 2048:ext4 4096:ext4 *:ext4'  #
The :+ makes it bootable? '/tmp tmpfs'
BLOCKDATA='/dev/sda1 raw boot
ext2;yes;/boot;target;no_opts;no_label;noatime,nodiratime /dev/sda2 raw
swap swap;yes;no_mountpoint;target;no_opts;no_label;no_params /dev/sda3
raw root ext4;yes;/;target;-m 1;no_label;relatime /dev/sda5 raw usr
ext4;yes;/usr;target;-m 1;no_label;relatime,nodev /dev/sda6 raw home
ext4;yes;/home;target;-m 0;no_label;relatime,nodev,nosuid' '/tmp tmpfs
relatime,nodev,nosuid,noexec,size=75% 0 0' # The '-m 0' is the tune2fs
command for setting the RESERVED_BLOCKS (default is 5%) # /dev/sda{5,6}
would be logical partitions # Could this be expaned to work with RAID?

# /etc conf files - from manual installation menu
MKINITCPIO=
MODPROBE="# Disable IPv6
alias net-pf-10 off
alias ipv6 off"
RESOLV=
HOSTS="192.168.0.1 Firewall"
HOSTS_ALLOW="sshd: 192.168.0.0/255.255.255.0"
RC_LOCAL="# Syncing Clock
if ifconfig | grep eth0 &> /dev/null ; then
    ntpd -s -d &> /dev/null
    #ntpdate 192.168.0.1 &> /dev/null
fi"

# These are user files added to the USB Stick/Disc and transferred
after installation but before reboot
UPDATE_CONFIG_FILES=.bashrc /root/.bashrc /etc/ssh/sshd_config /etc/X11/xorg.conf
# the .bashrc would be added to each created user

COPY_FILES=some_printer.ppd # $ cp
some_printer.ppd /usr/share/cups/model/ welcome.txt,
group_bookmarks.html # these would be copied to each user's home #
could be many files with target dir

AUTO_REBOOT=yes  # yes|no|wait xx

POST_INSTALLATON_SCRIPT= # This could be a .sh script run only on first
reboot of new system - ideas: alsa-config, pacman -Sy, db update, setup
printer, some tests, email admin, install more packages, etc

[End of TestMachine] # could be something else or nothing


[BuildMachine]
# Repeated from above; adjust options

[Laptop]
# Repeated from above; adjust options

[Server]
# Repeated from above; adjust options

[VirtualTest]
# Repeated from above; adjust options

# Another idea would be to have a [Default] profile then each following
profile would just list the specific alterations

# End of File


More information about the arch-releng mailing list