[PATCH] update simple example to support Ubuntu Precise 12.04 installations

Waldemar Brodkorb mail at waldemar-brodkorb.de
Thu Mar 14 11:25:21 CET 2013


Hi,

with the following small change it is possible to install a 
Ubuntu system via a Debian/wheezy FAI server, when hostname is
set to ubuntu.

Signed-off-by: Waldemar Brodkorb <wbx at openadk.org>
---
 examples/simple/basefiles/mk-basefile                |   17 ++++++++++++++++-
 examples/simple/class/50-host-classes                |    5 +++++
 examples/simple/class/UBUNTU.var                     |    9 +++++++++
 examples/simple/files/etc/apt/sources.list/LUCID32   |    1 +
 examples/simple/files/etc/apt/sources.list/PRECISE32 |    1 +
 examples/simple/package_config/UBUNTU                |    2 +-
 examples/simple/scripts/DEMO/10-misc                 |    6 ++++++
 7 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 examples/simple/class/UBUNTU.var
 create mode 100644 examples/simple/files/etc/apt/sources.list/LUCID32
 create mode 100644 examples/simple/files/etc/apt/sources.list/PRECISE32

diff --git a/examples/simple/basefiles/mk-basefile b/examples/simple/basefiles/mk-basefile
index f267a49..82f7b21 100755
--- a/examples/simple/basefiles/mk-basefile
+++ b/examples/simple/basefiles/mk-basefile
@@ -10,7 +10,7 @@
 
 # Supported distributions (each i386/amd64):
 # Debian GNU/Linux 6.0
-# Ubuntu 10.04
+# Ubuntu 10.04/12.04
 # CentOS 5/6
 # Scientific Linux Cern 5/6
 #
@@ -30,6 +30,8 @@ MIRROR_CENTOS=http://mirror.netcologne.de/
 EXCLUDE_SQUEEZE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
 EXCLUDE_WHEEZY=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data
 EXCLUDE_LUCID=dhcp3-client,dhcp3-common
+EXCLUDE_PRECISE=dhcp3-client,dhcp3-common
+INCLUDE_PRECISE=aptitude
 
 
 
@@ -185,6 +187,16 @@ lucid() {
     tarit
 }
 
+precise() {
+
+    local arch=$1
+
+    check
+    debootstrap --arch $arch --include=${INCLUDE_PRECISE} --exclude=${EXCLUDE_PRECISE} precise $xtmp ${MIRROR_UBUNTU}
+    cleanup-deb
+    tarit
+}
+
 
 unknown() {
 
@@ -196,6 +208,7 @@ unknown() {
     SLC5_32      SLC5_64
     SLC6_32      SLC6_64
     LUCID32      LUCID64
+    PRECISE32    PRECISE64
     SQUEEZE32    SQUEEZE64
     WHEEZY32     WHEEZY64
 "
@@ -237,6 +250,8 @@ case "$target" in
     SLC6_64) slc amd64 6 ;;
     LUCID32) lucid i386 ;;
     LUCID64) lucid amd64 ;;
+    PRECISE32) precise i386 ;;
+    PRECISE64) precise amd64 ;;
     SQUEEZE32) squeeze i386 ;;
     SQUEEZE64) squeeze amd64 ;;
     WHEEZY32) wheezy i386 ;;
diff --git a/examples/simple/class/50-host-classes b/examples/simple/class/50-host-classes
index f16a8fd..79bd77a 100755
--- a/examples/simple/class/50-host-classes
+++ b/examples/simple/class/50-host-classes
@@ -18,6 +18,11 @@ case $HOSTNAME in
         echo "FAIBASE DEBIAN DHCPC LVM_XEN_SERVER XEN" ;;
     puma)
         echo "FAIBASE DEBIAN DHCPC RAID_XEN_VIRTUAL" ;;
+    ubuntu)
+	echo "FAIBASE UBUNTU DHCPC DEMO"
+        ifclass I386 && echo LUCID32
+        ifclass AMD64 && echo LUCID64
+	;;
     centos)
         echo "FAIBASE CENTOS"   # you may want to add class XORG here
         ifclass I386 && echo CENTOS6_32
diff --git a/examples/simple/class/UBUNTU.var b/examples/simple/class/UBUNTU.var
new file mode 100644
index 0000000..a46a885
--- /dev/null
+++ b/examples/simple/class/UBUNTU.var
@@ -0,0 +1,9 @@
+CONSOLEFONT=
+KEYMAP=us-latin1
+
+# MODULESLIST contains modules that will be loaded by the new system,
+# not during installation these modules will be written to /etc/modules
+# If you need a module during installation, add it to $kernelmodules
+# in 20-hwdetect.source.
+MODULESLIST="usbkbd ehci-hcd ohci-hcd uhci-hcd usbhid psmouse"
+
diff --git a/examples/simple/files/etc/apt/sources.list/LUCID32 b/examples/simple/files/etc/apt/sources.list/LUCID32
new file mode 100644
index 0000000..8f61d4e
--- /dev/null
+++ b/examples/simple/files/etc/apt/sources.list/LUCID32
@@ -0,0 +1 @@
+deb http://ftp.halifax.rwth-aachen.de/ubuntu lucid main
diff --git a/examples/simple/files/etc/apt/sources.list/PRECISE32 b/examples/simple/files/etc/apt/sources.list/PRECISE32
new file mode 100644
index 0000000..1461ea6
--- /dev/null
+++ b/examples/simple/files/etc/apt/sources.list/PRECISE32
@@ -0,0 +1 @@
+deb http://ftp.halifax.rwth-aachen.de/ubuntu precise main
diff --git a/examples/simple/package_config/UBUNTU b/examples/simple/package_config/UBUNTU
index 52583e8..7a643bf 100644
--- a/examples/simple/package_config/UBUNTU
+++ b/examples/simple/package_config/UBUNTU
@@ -10,7 +10,7 @@ linux-image-generic initramfs-tools
 memtest86+
 
 PACKAGES aptitude DHCPC
-isc-dhcp-client
+dhcp3-client
 
 PACKAGES aptitude GRUB_PC
 grub-pc grub-legacy- lilo-
diff --git a/examples/simple/scripts/DEMO/10-misc b/examples/simple/scripts/DEMO/10-misc
index 46cfa9f..2e60fd2 100755
--- a/examples/simple/scripts/DEMO/10-misc
+++ b/examples/simple/scripts/DEMO/10-misc
@@ -12,5 +12,11 @@ if ! $ROOTCMD getent passwd demo ; then
     $ROOTCMD usermod -p "$ROOTPW" demo
 fi
 
+# allow demo user to get root access via sudo
+ifclass UBUNTU && {
+    $ROOTCMD groupadd admin
+    $ROOTCMD usermod -G admin demo
+}
+
 chmod -c 666 ${target}/dev/fd*
 chmod -c 444 ${target}/dev/sr*
-- 
1.7.10.4



More information about the linux-fai mailing list