summaryrefslogtreecommitdiffstats
path: root/src/initramfs/distro-specs/ubuntu/functions-14.04
blob: 7cbfb96462928c5006beb9445ffeb2f425826fc2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Copyright (c) 2014 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your feedback to feedback@openslx.org
#
# General information about OpenSLX can be found under http://openslx.org
#
# Configuration script for Ubuntu 14.04 configure OpenSLX Linux stateless
# clients (merged in stage2 with ubuntu/functions-default - and loaded within
# initial ramfs - stage3) It may overwrite settings from the default config
# file (/etc/functions)

# configure hal, dbus, policykitd and services like that
config_dreshal () {
if [ "x$start_dreshal" = "xyes" ]; then
  testmkd /mnt/var/lib/dbus
  testmkd /mnt/var/lib/misc
  rm -rf /mnt/etc/dbus-1/system.d/*etwork*anager.conf \
         /mnt/etc/dbus-1/system.d/nm-*
  for dir in 10-vendor.d 20-org.d 30-site.d 50-local.d 90-mandatory.d ; do
    testmkd /mnt/var/lib/polkit-1/localauthority/${dir}
  done
fi
}

# distro specific function called from servconfig script
config_distro () {
  # runlevel system changed significantly compared to pre 9.10 sys-v-init
  # clean up nevertheless
  for dir in rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rcS.d ; do
    rm -rf /mnt/etc/${dir}/*
  done
  # remove unneeded init scripts (stuff handled in stage3 which would
  # interface with already existing setup)
  # copy all event scripts to a special directory
  testmkd /mnt/etc/init.inactive
  echo -e "# This directory was created in OpenSLX stage3 and contains all \
disabled\n# upstart scripts. They are moved by servconfig to init if this is \
required." >/mnt/etc/init.inactive/README
  mv /mnt/etc/init/* /mnt/etc/init.inactive
  # remove plymouth component from *dm.conf (not needed with splashy)
  sed "/# Check kernel c/,/done/d" -i /mnt/etc/init.inactive/*dm.conf
  # copy initial upstart scripts back
  for file in alsa-mixer-save control-alt-delete console-setup dbus \
              container-detect console-font \
              dmesg hwclock hwclock-save irqbalance module-init-tools \
              mountall mounted* networking procps rc* tty* udev* \
              upstart-socket-bridge upstart-udev-bridge ; do
    mv /mnt/etc/init.inactive/${file}.conf /mnt/etc/init >/dev/null 2>&1
  done

  # for screen sessions
  testmkd /mnt/var/run/screen root:utmp 0777

  # apt stuff
  testmkd /mnt/var/cache/apt/archives/partial

  # Gnome/Unity panel stuff
  echo -e "[D-BUS Service]\nName=com.canonical.Unity.Panel.Service\n\
Exec=/usr/lib/unity/unity-panel-service" >/mnt/usr/share/dbus-1/services/com.canonical.Unity.Panel.Service.service
  echo -e "[Desktop Entry]\nType=Application\nName=Unity Panel Service\n\
Exec=/usr/lib/unity/unity-panel-service\nOnlyShowIn=Unity;\n\
NoDisplay=true" >/mnt/etc/xdg/autostart/unity-panel-service.desktop

  # add the slx specific path (/var/opt/openslx/bin) to the PATH variable
  echo -e "# stuff generated by $0 (out of InitRamFS written $date)\n\
export PATH=\"\$PATH:/var/opt/openslx/bin\"" >>/mnt/etc/profile
}