#!/bin/sh
+# Filename: /etc/grml/fai/config/hooks/instsoft.GRML
+# Purpose: grml specific Debian installation in the chroot
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 22:53:02 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
-# make sure we have file-rc available before
-# package_config/GRML is being executed:
-
-# TODO: test whether adding file-rc to FAI_DEBOOTSTRAP_OPTS= would do the trick too
-
-# work around http://trac.lighttpd.net/trac/ticket/657:
+# work around http://trac.lighttpd.net/trac/ticket/657
+# should be removed later on:
echo "Acquire::http::Pipeline-Depth "0";" >> $target/etc/apt/apt.conf
# install grml keys:
gpg --export F61E2E7CECDEA787 > $target/etc/apt/grml.key
$ROOTCMD apt-key add /etc/apt/grml.key
-# finally install file-rc:
+# make sure we have file-rc available before
+# package_config/GRML is being executed:
$ROOTCMD apt-get update
-$ROOTCMD apt-get --download-only --assume-yes install file-rc
-$ROOTCMD /bin/sh -c "dpkg -i --force-all /var/cache/apt/archives/file-rc*.deb"
-$ROOTCMD apt-get -f install file-rc
+$ROOTCMD aptitude -f -y install file-rc
-# we don't need the invoke-rc.d and update-rc.d diversion
-# because otherwise use of file-rc with aptitude fails:
+# we don't need the invoke-rc.d.d diversion (we have grml-policyrcd :)):
if [ -L "$target"/usr/sbin/invoke-rc.d ] ; then
rm -f "$target"/usr/sbin/invoke-rc.d
$ROOTCMD dpkg-divert --package fai --rename --remove /usr/sbin/invoke-rc.d
fi
-if [ -L "$target"/usr/sbin/update-rc.d ] ; then
- dpkg --purge sysv-rc
- $ROOTCMD apt-get --assume-yes --reinstall install file-rc
-fi
-
-# debug:
-# $ROOTCMD /bin/bash
+## END OF FILE #################################################################
# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/05-hostname
+# Purpose: set hostname of live-system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 22:55:31 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
HOSTNAME=''
[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
[ -n "$HOSTNAME" ] || HOSTNAME=grml
-
echo "$HOSTNAME" > $target/etc/hostname
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/10-build-initramfs
+# Purpose: configure live-initramfs and build initramfs for booting
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 22:56:40 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
cp /etc/grml/fai/live-initramfs/live.conf $target/etc/live.conf
cp /etc/grml/fai/live-initramfs/grml-script.init-top "$target/usr/share/initramfs-tools/scripts/init-top/grml"
+
FILE=$(ls -1 $target/boot/vmlinuz-* | sort -r | head -1)
KERNELVERSION=$(echo "${FILE##$target/boot/vmlinuz-}")
+
$ROOTCMD update-initramfs -c -t -k $KERNELVERSION
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/15-initsetup
+# Purpose: configure init system for the live-system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 22:57:36 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
else
cp $target/etc/runlevel.conf.livecd $target/etc/runlevel.conf
fi
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/20-sudo
+# Purpose: configure sudo setup of the live-system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:12:25 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
[ -n "$USERNAME" ] || USERNAME=grml
-# FIXME: use /etc/grml/fai/... as base
-cat > $target/etc/sudoers << EOF
-# sudoers file.
-# This file MUST be edited with the "visudo" command as root.
-# See the man page for details on how to write a sudoers file.
-
-# Host alias specification
-
-# User alias specification
-
-# Cmnd alias specification
-
-# User privilege specification
-root ALL=(ALL) ALL
-
-# WARNING: This allows the unprivileged $USERNAME user to start commands as root
-# WARNING: This is totally insecure and (almost) makes $USERNAME a second root account.
-# WARNING: Never allow external access to the $USERNAME user!!!
-$USERNAME ALL=NOPASSWD: ALL
-
-# allow editing of files with editor:
-# $USERNAME ALL=NOPASSWD: sudoedit
-
-# usage examples:
-# $USERNAME ALL=NOPASSWD: /sbin/hdparm
-# $USERNAME ALL=NOPASSWD: /usr/sbin/hwinfo
-# Cmnd_Alias DEBIAN = /usr/bin/apt-get, /usr/bin/dpkg, /usr/bin/auto-apt, /usr/bin/apt-file
-# $USERNAME ALL=NOPASSWD: DEBIAN
-# chroot ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
-# chroot ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
+if [ -r /etc/grml/fai/files/etc/sudoers ] ; then
+ cp /etc/grml/fai/files/etc/sudoers $target/etc/sudoers
+ chmod 440 $target/etc/sudoers
+fi
-secvpn ALL=NOPASSWD: /usr/sbin/secvpn, /usr/sbin/pppd
-EOF
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/21-usersetup
+# Purpose: adjust user setup of the live-system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 22:58:45 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
$ROOTCMD chsh -s /bin/zsh root
$ROOTCMD chsh -s /bin/zsh $USERNAME
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/25-locales
+# Purpose: locales (language) configuration of the live system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 22:59:23 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
cp $target/etc/locale.gen.minimal $target/etc/locale.gen
$ROOTCMD locale-gen
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/30-fstab
+# Purpose: create initial /etc/fstab for use on live-system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:09:08 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
[ -n "$USERNAME" ] || USERNAME=grml
-# FIXME: use /etc/grml/fai/... as base
-cat > "$target"/etc/fstab << EOF
-# /etc/fstab - static file system information
-# <filesystem> <mountpoint> <type> <options> <dump> <pass>
-proc /proc proc rw,nosuid,nodev,noexec 0 0
-none /proc/bus/usb usbfs defaults,noauto 0 0
-sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0
-devpts /dev/pts devpts noauto,mode=0622 0 0
-/dev/fd0 /mnt/floppy auto users,noauto,exec 0 0
-/dev/external /mnt/external auto users,noauto,exec,rw,uid=$USERNAME,gid=$USERNAME 0 0
-/dev/external1 /mnt/external1 auto users,noauto,exec,rw,uid=$USERNAME,gid=$USERNAME 0 0
-/dev/cdrom /mnt/cdrom auto users,noauto,exec,ro 0 0
-/dev/dvd /mnt/dvd auto users,noauto,exec,ro 0 0
-# some other examples:
-# /dev/hda1 /Grml ext3 dev,suid,user,noauto 0 2
-# //1.2.3.4/pub /smb/pub smbfs defaults,user,noauto,uid=grml,gid=grml 0 0
-# linux:/pub /beer nfs defaults 0 0
-# tmpfs /tmp tmpfs size=300M 0 0
-# none /proc/bus/usb usbfs defaults,nodev,noexec,nosuid,noauto,devgid=1001,devmode=664 0 0
-# 192.168.1.101:/backups /mnt/nfs nfs defaults,users,wsize=8192,rsize=8192 0 0
-#
-# Warning! Please do *not* change any lines below because they are auto-generated by rebuildfstab!
-# If you want to disable rebuildfstab set CONFIG_FSTAB='no' in /etc/grml/autoconfig!
-# See 'man grml-rebuildfstab' for more details about the following entries.
-EOF
+if [ -r /etc/grml/fai/files/etc/fstab ] ; then
+ cp /etc/grml/fai/files/etc/fstab $target/etc/fstab
+ sed -i "s/uid=USERNAME,gid=USERNAME/uid=$USERNAME,gid=$USERNAME/" $target/etc/fstab
+fi
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/31-motd
+# Purpose: make sure the motd setup is correct
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:00:35 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
$ROOTCMD mv /etc/motd.dpkg-new /var/run/motd
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/33-aptsetup
+# Purpose: configure Debian package management of live-system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:10:06 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
$ROOTCMD ln -s /etc/apt/sources.list.grml /etc/apt/sources.list
-# FIXME: use /etc/grml/fai/... as base
-cat > $target/etc/apt/preferences << EOF
-// main grml-repository:
-Package: *
-Pin: origin deb.grml.org
-Pin-Priority: 996
-
-// fallback grml-repository:
-Package: *
-Pin: origin grml.org
-Pin-Priority: 995
-
-// debian unstable pool (default):
-Package: *
-Pin: release a=unstable,o=Debian
-Pin-Priority: 991
+if [ -r /etc/grml/fai/files/etc/apt/preferences ] ; then
+ cp /etc/grml/fai/files/etc/apt/preferences $target/etc/apt/preferences
+fi
-EOF
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/34-hosts
+# Purpose: configure /etc/hosts of live-system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:10:46 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
[ -n "$HOSTNAME" ] || HOSTNAME=grml
-# FIXME: use /etc/grml/fai/... as base
-cat > $target/etc/hosts << EOF
-127.0.0.1 $HOSTNAME localhost
-
-# The following lines are desirable for IPv6 capable hosts
-# (added automatically by netbase upgrade)
+if [ -r /etc/grml/fai/files/etc/hosts ] ; then
+ cp /etc/grml/fai/files/etc/hosts $target/etc/hosts
+fi
-::1 ip6-localhost ip6-loopback $HOSTNAME
-fe00::0 ip6-localnet
-ff00::0 ip6-mcastprefix
-ff02::1 ip6-allnodes
-ff02::2 ip6-allrouters
-ff02::3 ip6-allhosts
-EOF
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/35-network
+# Purpose: set up /etc/network/interfaces of live-system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:02:18 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
-# FIXME: use /etc/grml/fai/... as base
-cat >> $target/etc/network/interfaces << EOF
-# The loopback interface
-# automatically added when upgrading
-auto lo
-iface lo inet loopback
-EOF
+if [ -r /etc/grml/fai/files/etc/network/interfaces ] ; then
+ cp /etc/grml/fai/files/etc/network/interfaces $target/etc/network/interfaces
+fi
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/90-update-alternatives
+# Purpose: set up /etc/alternatives/* according to grml preferences
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:02:53 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
-# FIXME: use /etc/grml/fai/... as base
if [ -r $target/usr/bin/vim.basic ] ; then
$ROOTCMD update-alternatives --set editor /usr/bin/vim.basic
fi
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/98-clean-chroot
+# Purpose: clean up chroot system
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:03:50 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
+# TODO: provide customization of what should be cleaned up
+
cp /etc/grml/fai/grml/grml_cleanup_chroot $target/root/
$ROOTCMD /root/grml_cleanup_chroot
rm $target/root/grml_cleanup_chroot
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRML/99-finish-grml-build
+# Purpose: finalize grml chroot build
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+# Latest change: Sun Sep 16 23:04:36 CEST 2007 [mika]
+################################################################################
+
set -u
set -e
+# /etc/grml_cd makes the live system recognizable as a live system
touch $target/etc/grml_cd
+
+## END OF FILE #################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
--- /dev/null
+// main grml-repository:
+Package: *
+Pin: origin deb.grml.org
+Pin-Priority: 996
+
+// fallback grml-repository:
+Package: *
+Pin: origin grml.org
+Pin-Priority: 995
+
+// debian unstable pool (default):
+Package: *
+Pin: release a=unstable,o=Debian
+Pin-Priority: 991
+
--- /dev/null
+# /etc/fstab - static file system information
+# <filesystem> <mountpoint> <type> <options> <dump> <pass>
+proc /proc proc rw,nosuid,nodev,noexec 0 0
+none /proc/bus/usb usbfs defaults,noauto 0 0
+sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0
+devpts /dev/pts devpts noauto,mode=0622 0 0
+/dev/fd0 /mnt/floppy auto users,noauto,exec 0 0
+/dev/external /mnt/external auto users,noauto,exec,rw,uid=USERNAME,gid=USERNAME 0 0
+/dev/external1 /mnt/external1 auto users,noauto,exec,rw,uid=USERNAME,gid=USERNAME 0 0
+/dev/cdrom /mnt/cdrom auto users,noauto,exec,ro 0 0
+/dev/dvd /mnt/dvd auto users,noauto,exec,ro 0 0
+# some other examples:
+# /dev/hda1 /Grml ext3 dev,suid,user,noauto 0 2
+# //1.2.3.4/pub /smb/pub smbfs defaults,user,noauto,uid=grml,gid=grml 0 0
+# linux:/pub /beer nfs defaults 0 0
+# tmpfs /tmp tmpfs size=300M 0 0
+# none /proc/bus/usb usbfs defaults,nodev,noexec,nosuid,noauto,devgid=1001,devmode=664 0 0
+# 192.168.1.101:/backups /mnt/nfs nfs defaults,users,wsize=8192,rsize=8192 0 0
+#
+# Warning! Please do *not* change any lines below because they are auto-generated by rebuildfstab!
+# If you want to disable rebuildfstab set CONFIG_FSTAB='no' in /etc/grml/autoconfig!
+# See 'man grml-rebuildfstab' for more details about the following entries.
--- /dev/null
+127.0.0.1 $HOSTNAME localhost
+
+# The following lines are desirable for IPv6 capable hosts
+# (added automatically by netbase upgrade)
+
+::1 ip6-localhost ip6-loopback $HOSTNAME
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+ff02::3 ip6-allhosts
--- /dev/null
+# The loopback interface
+# automatically added when upgrading
+auto lo
+iface lo inet loopback
--- /dev/null
+# sudoers file.
+# This file MUST be edited with the "visudo" command as root.
+# See the man page for details on how to write a sudoers file.
+
+# Host alias specification
+
+# User alias specification
+
+# Cmnd alias specification
+
+# User privilege specification
+root ALL=(ALL) ALL
+
+# WARNING: This allows the unprivileged $USERNAME user to start commands as root
+# WARNING: This is totally insecure and (almost) makes $USERNAME a second root account.
+# WARNING: Never allow external access to the $USERNAME user!!!
+$USERNAME ALL=NOPASSWD: ALL
+
+# allow editing of files with editor:
+# $USERNAME ALL=NOPASSWD: sudoedit
+
+# usage examples:
+# $USERNAME ALL=NOPASSWD: /sbin/hdparm
+# $USERNAME ALL=NOPASSWD: /usr/sbin/hwinfo
+# Cmnd_Alias DEBIAN = /usr/bin/apt-get, /usr/bin/dpkg, /usr/bin/auto-apt, /usr/bin/apt-file
+# $USERNAME ALL=NOPASSWD: DEBIAN
+# chroot ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot
+# chroot ALL=NOPASSWD: /usr/sbin/chroot, /bin/su - chroot