Permalink
Browse files

Merge branch 'git-fs'

  • Loading branch information...
2 parents fd2d664 + d6347dd commit 1a887b5293fb25b382471c5416243bb5e38de232 @kaihendry kaihendry committed Oct 2, 2012
Showing with 451 additions and 4,975 deletions.
  1. +1 −0 .gitignore
  2. BIN boot/initrd.img-3.2.0-3artax1-486
  3. BIN boot/initrd.img-3.2.0-3artax1-686-pae
  4. +2 −0 etc/dpkg/dpkg.cfg.d/{exclude-docs → exclude-files}
  5. +1 −0 etc/init.d/timezone
  6. +1 −0 etc/init.d/webconverger
  7. +0 −1 etc/inittab
  8. +1 −0 etc/network/if-up.d/after-network-up
  9. +1 −0 etc/rc.local
  10. +9 −0 etc/webc/boot-cmdline
  11. +200 −0 etc/webc/functions.sh
  12. +36 −42 etc/webc/install-to-disk.sh
  13. +151 −4 etc/webc/live-config.sh
  14. +15 −10 etc/webc/logbot.sh
  15. +1 −0 etc/webc/network-up.d/ntpdate
  16. +1 −0 etc/webc/network-up.d/ping
  17. +1 −0 etc/webc/network-up.d/resolvconf
  18. +1 −0 etc/webc/network-up.d/webc-id
  19. +1 −0 etc/webc/startx.sh
  20. +0 −62 etc/webc/updates.sh
  21. +0 −65 etc/webc/webc.conf
  22. +1 −0 home/webc/.xinitrc
  23. +1 −4 home/webc/webc.sh
  24. +1 −0 lib/lsb/init-functions
  25. +1 −0 usr/bin/kioskresetstation
  26. +0 −6 usr/include/X11/bitmaps/1x1
  27. +0 −6 usr/include/X11/bitmaps/2x2
  28. +0 −4 usr/include/X11/bitmaps/Dashes
  29. +0 −13 usr/include/X11/bitmaps/Down
  30. +0 −17 usr/include/X11/bitmaps/Excl
  31. +0 −13 usr/include/X11/bitmaps/FlipHoriz
  32. +0 −13 usr/include/X11/bitmaps/FlipVert
  33. +0 −13 usr/include/X11/bitmaps/Fold
  34. +0 −13 usr/include/X11/bitmaps/Left
  35. +0 −13 usr/include/X11/bitmaps/Right
  36. +0 −13 usr/include/X11/bitmaps/RotateLeft
  37. +0 −13 usr/include/X11/bitmaps/RotateRight
  38. +0 −4 usr/include/X11/bitmaps/Stipple
  39. +0 −14 usr/include/X11/bitmaps/Term
  40. +0 −13 usr/include/X11/bitmaps/Up
  41. +0 −6 usr/include/X11/bitmaps/black
  42. +0 −4 usr/include/X11/bitmaps/black6
  43. +0 −4 usr/include/X11/bitmaps/box6
  44. +0 −6 usr/include/X11/bitmaps/boxes
  45. +0 −19 usr/include/X11/bitmaps/calculator
  46. +0 −8 usr/include/X11/bitmaps/cntr_ptr
  47. +0 −6 usr/include/X11/bitmaps/cntr_ptrmsk
  48. +0 −6 usr/include/X11/bitmaps/cross_weave
  49. +0 −6 usr/include/X11/bitmaps/dimple1
  50. +0 −6 usr/include/X11/bitmaps/dimple3
  51. +0 −6 usr/include/X11/bitmaps/dot
  52. +0 −4 usr/include/X11/bitmaps/dropbar7
  53. +0 −4 usr/include/X11/bitmaps/dropbar8
  54. +0 −473 usr/include/X11/bitmaps/escherknot
  55. +0 −27 usr/include/X11/bitmaps/flagdown
  56. +0 −27 usr/include/X11/bitmaps/flagup
  57. +0 −4 usr/include/X11/bitmaps/flipped_gray
  58. +0 −4 usr/include/X11/bitmaps/gray
  59. +0 −4 usr/include/X11/bitmaps/gray1
  60. +0 −4 usr/include/X11/bitmaps/gray3
  61. +0 −6 usr/include/X11/bitmaps/grid16
  62. +0 −4 usr/include/X11/bitmaps/grid2
  63. +0 −4 usr/include/X11/bitmaps/grid4
  64. +0 −4 usr/include/X11/bitmaps/grid8
  65. +0 −4 usr/include/X11/bitmaps/hlines2
  66. +0 −4 usr/include/X11/bitmaps/hlines3
  67. +0 −6 usr/include/X11/bitmaps/icon
  68. +0 −6 usr/include/X11/bitmaps/keyboard16
  69. +0 −5 usr/include/X11/bitmaps/ldblarrow
  70. +0 −8 usr/include/X11/bitmaps/left_ptr
  71. +0 −6 usr/include/X11/bitmaps/left_ptrmsk
  72. +0 −27 usr/include/X11/bitmaps/letters
  73. +0 −4 usr/include/X11/bitmaps/light_gray
  74. +0 −27 usr/include/X11/bitmaps/mailempty
  75. +0 −27 usr/include/X11/bitmaps/mailemptymsk
  76. +0 −27 usr/include/X11/bitmaps/mailfull
  77. +0 −27 usr/include/X11/bitmaps/mailfullmsk
  78. +0 −258 usr/include/X11/bitmaps/mensetmanus
  79. +0 −5 usr/include/X11/bitmaps/menu10
  80. +0 −5 usr/include/X11/bitmaps/menu12
  81. +0 −6 usr/include/X11/bitmaps/menu16
  82. +0 −4 usr/include/X11/bitmaps/menu6
  83. +0 −4 usr/include/X11/bitmaps/menu8
  84. +0 −27 usr/include/X11/bitmaps/noletters
  85. +0 −8 usr/include/X11/bitmaps/opendot
  86. +0 −8 usr/include/X11/bitmaps/opendotMask
  87. +0 −11 usr/include/X11/bitmaps/plaid
  88. +0 −5 usr/include/X11/bitmaps/rdblarrow
  89. +0 −8 usr/include/X11/bitmaps/right_ptr
  90. +0 −6 usr/include/X11/bitmaps/right_ptrmsk
  91. +0 −4 usr/include/X11/bitmaps/root_weave
  92. +0 −6 usr/include/X11/bitmaps/scales
  93. +0 −16 usr/include/X11/bitmaps/sipb
  94. +0 −8 usr/include/X11/bitmaps/star
  95. +0 −8 usr/include/X11/bitmaps/starMask
  96. +0 −4 usr/include/X11/bitmaps/stipple
  97. +0 −6 usr/include/X11/bitmaps/target
  98. +0 −52 usr/include/X11/bitmaps/terminal
  99. +0 −6 usr/include/X11/bitmaps/tie_fighter
  100. +0 −4 usr/include/X11/bitmaps/vlines2
  101. +0 −4 usr/include/X11/bitmaps/vlines3
  102. +0 −5 usr/include/X11/bitmaps/weird_size
  103. +0 −6 usr/include/X11/bitmaps/wide_weave
  104. +0 −14 usr/include/X11/bitmaps/wingdogs
  105. +0 −66 usr/include/X11/bitmaps/woman
  106. +0 −27 usr/include/X11/bitmaps/xfd_icon
  107. +0 −6 usr/include/X11/bitmaps/xlogo11
  108. +0 −6 usr/include/X11/bitmaps/xlogo16
  109. +0 −14 usr/include/X11/bitmaps/xlogo32
  110. +0 −46 usr/include/X11/bitmaps/xlogo64
  111. +0 −1,112 usr/include/X11/bitmaps/xsnow
  112. +0 −121 usr/include/clif.h
  113. +0 −84 usr/include/initreq.h
  114. +0 −58 usr/include/oss-redir.h
  115. +22 −4 usr/share/initramfs-tools/scripts/live
  116. +0 −41 var/lib/dpkg/info/adduser.list
  117. +0 −7 var/lib/dpkg/info/alsa-utils.list
  118. +0 −63 var/lib/dpkg/info/apt.list
  119. +0 −47 var/lib/dpkg/info/bash.list
  120. +0 −69 var/lib/dpkg/info/console-common.list
  121. +0 −87 var/lib/dpkg/info/console-data.list
  122. +0 −65 var/lib/dpkg/info/coreutils.list
  123. +0 −41 var/lib/dpkg/info/cpio.list
  124. +0 −65 var/lib/dpkg/info/debconf-i18n.list
  125. +0 −59 var/lib/dpkg/info/diffutils.list
  126. +0 −59 var/lib/dpkg/info/dpkg.list
  127. +0 −27 var/lib/dpkg/info/e2fsprogs.list
  128. +0 −23 var/lib/dpkg/info/eject.list
  129. +0 −39 var/lib/dpkg/info/epdfview.list
  130. +0 −69 var/lib/dpkg/info/findutils.list
  131. +0 −9 var/lib/dpkg/info/git.list
  132. +0 −53 var/lib/dpkg/info/gnupg.list
  133. +0 −71 var/lib/dpkg/info/grep.list
  134. +0 −31 var/lib/dpkg/info/kbd.list
  135. +0 −47 var/lib/dpkg/info/libavahi-common-data.list
  136. +0 −19 var/lib/dpkg/info/libgnutls26.list
  137. +0 −13 var/lib/dpkg/info/libgpg-error0.list
  138. +0 −95 var/lib/dpkg/info/libgtk2.0-common.list
  139. +0 −87 var/lib/dpkg/info/libnewt0.52.list
  140. +0 −51 var/lib/dpkg/info/libpam-runtime.list
  141. +0 −61 var/lib/dpkg/info/libpopt0.list
  142. +0 −57 var/lib/dpkg/info/login.list
  143. +0 −59 var/lib/dpkg/info/nano.list
  144. +0 −11 var/lib/dpkg/info/net-tools.list
  145. +0 −63 var/lib/dpkg/info/sed.list
  146. +0 −71 var/lib/dpkg/info/shared-mime-info.list
  147. +0 −63 var/lib/dpkg/info/tar.list
  148. +0 −69 var/lib/dpkg/info/wget.list
  149. +0 −53 var/lib/dpkg/info/xkb-data.list
  150. +0 −7 var/lib/dpkg/info/xz-utils.list
  151. +1 −1 var/lib/initramfs-tools/3.2.0-3artax1-486
  152. +1 −1 var/lib/initramfs-tools/3.2.0-3artax1-686-pae
View
@@ -13,6 +13,7 @@ var/cache/dictionaries-common
var/cache/apt/
var/cache/debconf/*-old
var/tmp
+usr/share/locale
usr/share/lintian
usr/share/man
usr/share/doc
Binary file not shown.
Binary file not shown.
@@ -2,3 +2,5 @@ path-exclude=/usr/share/doc/*
path-exclude=/usr/share/doc-base/*
path-exclude=/usr/share/man/*
path-exclude=/usr/share/lintian/*
+path-exclude=/usr/share/locales/*
+path-exclude=/usr/include/*
View
@@ -1,5 +1,6 @@
#!/bin/bash
+. /etc/webc/functions.sh
. /etc/webc/webc.conf
Configure_tzdata ()
View
@@ -21,6 +21,7 @@ set Master 100% unmute
set Master Front 100% unmute
END
+. /etc/webc/functions.sh
. /etc/webc/webc.conf
for x in $(cmdline)
View
@@ -58,6 +58,5 @@ po::powerokwait:/etc/init.d/powerfail stop
6:23:respawn:/sbin/getty 38400 tty6
X1:2:respawn:/etc/webc/startx.sh
-X2:2:respawn:/etc/webc/logbot.sh /etc/webc/updates.sh
X3:3:respawn:/etc/webc/install-to-disk.sh
X4:2:respawn:/etc/webc/logbot.sh /etc/webc/live-config.sh
@@ -14,6 +14,7 @@ wait_until_network() {
return 0
}
+. "/etc/webc/functions.sh"
. "/etc/webc/webc.conf"
for i in /etc/webc/network-up.d/*; do
View
@@ -1,4 +1,5 @@
#!/bin/bash
+. "/etc/webc/functions.sh"
. "/etc/webc/webc.conf"
cmdline_has debug && {
View
@@ -0,0 +1,9 @@
+# This file lists the kernel cmdline options that should be passed to
+# the kernel by the bootloader when booting this particular git
+# revision. It is used by the image generation to pass onto lb config
+# --bootappend-live, as well as by the live-config.sh script when
+# generating new bootloader configs during an upgrade.
+#
+# This file should contain exactly one non-comment line, which is
+# inserted into the "append" line of the bootloader config.
+boot=live skipconfig vga=771 video=vesa nomodeset splash quiet
View
@@ -0,0 +1,200 @@
+# installed config trumps boot cmdline
+cmdline()
+{
+ test -e /proc/cmdline && cat /proc/cmdline
+ test -e /etc/webc/cmdline && cat /etc/webc/cmdline
+}
+
+logs ()
+{
+ logger -t $0 -p daemon.info "$@"
+}
+
+cmdline_has()
+{
+ for i in `cmdline`
+ do
+ test "$1" = "${i%%=*}" && return 0
+ done
+ return 1
+}
+
+cmdline_get()
+{
+ for i in `cmdline`
+ do
+ test ${i/=*} = $1 && { echo "${i#$1=}"; return 0; }
+ done
+ return 1
+}
+
+mac_address()
+{
+ for i in /sys/class/net/*/address
+ do
+ tr -d ":" < $i
+ return
+ done
+}
+
+# # http://stackoverflow.com/questions/11827252
+wait_for()
+{
+ np=$(mktemp -u)
+ mkfifo $np
+ inotifywait -m -e create "$(dirname $1)" > $np 2>&1 & ipid=$!
+ while read output
+ do
+ if test -p "$1"
+ then
+ kill $ipid
+ break
+ fi
+ done < $np
+ rm -f $np
+}
+
+has_network()
+{
+ netstat -rn | grep -qs '^0.0.0.0'
+}
+
+################################################################################
+# Functions related to installing and updating
+################################################################################
+
+# Extract a kernel and initrd from git.
+# dir - The directory to store the kernel and initrd in
+# flavour - The flavour of kernel to extract
+# postfix - A postfix to use as the name of the kernel and initrd (e.g.,
+# vmlinux${postfix} and initrd${postfix}.img
+# git_repo - The .git repository to look in
+# git_revision - The revision to look at
+extract_kernel() {
+ local dir="$1"
+ local flavour="$2"
+ local postfix="$3"
+ local git_repo="$4"
+ local git_revision="$5"
+
+ # Find out the filenames for the kernel and
+ # initrd for this flavour inside the new
+ # rootfs
+ local kernel=$(git --git-dir "${git_repo}" show "${git_revision}:boot" | grep ^vmlinuz-.*-${flavour}$ | head -n 1)
+ local initrd=$(git --git-dir "${git_repo}" show "${git_revision}:boot" | grep ^initrd.img-.*-${flavour}$ | head -n 1)
+
+ if [ -z "$kernel" -o -z "$initrd" ]; then
+ logs "No kernel or initrd found in revision ${git_revision} for flavour ${flavour}!"
+ fi
+
+ # Fetch the actual files
+ git --git-dir "${git_repo}" show "${git_revision}:boot/${kernel}" > ${dir}/vmlinuz${postfix}
+ git --git-dir "${git_repo}" show "${git_revision}:boot/${initrd}" > ${dir}/initrd${postfix}.img
+}
+
+# Generate the boot params needed to boot the given revision. Boot parameters
+# from the cmdline config are also included.
+# git_repo - The .git repository to look in
+# git_revision - The revision to look at
+get_bootparams()
+{
+ local git_repo="$1"
+ local git_revision="$2"
+
+ # Get bootparams from inside the new rootfs. This
+ # allows having bootparams that are specific to a
+ # given rootfs / revision.
+ local rootfs_bootparams=$(git --git-dir "${git_repo}" show "${git_revision}:etc/webc/boot-cmdline" | grep -v "^#" | head -n 1)
+
+ # The bootparams to pass
+ echo "${rootfs_bootparams} $(cmdline_get boot_append) git-revision=${git_revision}"
+}
+
+# Extract a kernel and generate a bootloader configuration for a live boot of
+# the given revision. This regenerates live.cfg (based on live.cfg.in), but
+# leaves the main bootloader config alone.
+# dir - The directory where the disk is mounted (e.g. which contains
+# the live and boot directories)
+# git_repo - The .git repository to look in
+# git_revision - The revision to look at
+generate_live_config()
+{
+ local dir="$1"
+ local git_repo="$2"
+ local git_revision="$3"
+
+ # The bootparams to pass
+ local bootparams=$(get_bootparams "$git_repo" "$git_revision")
+
+ # TODO: Unhardcode this list
+ local flavours="486 686-pae"
+
+ if ! [ -r "${dir}/boot/live.cfg.in" ]; then
+ logs "live.cfg.in not found, skipping bootloader update!"
+ return 1
+ fi
+
+ # The code below is based on lb_binary_syslinux from
+ # live-build and is intended to recreate the same live.cfg
+ rm -f "${dir}/boot/live.cfg"
+ local _NUMBER="0"
+ for _FLAVOUR in ${flavours}; do
+ _NUMBER="$((${_NUMBER} + 1))"
+
+ extract_kernel "${dir}/live" "${_FLAVOUR}" "${_NUMBER}" "${git_repo}" "${git_revision}" || continue
+
+ sed -e "s|@FLAVOUR@|${_FLAVOUR}|g" \
+ -e "s|@KERNEL@|/live/vmlinuz${_NUMBER}|g" \
+ -e "s|@INITRD@|/live/initrd${_NUMBER}.img|g" \
+ -e "s|@LB_BOOTAPPEND_LIVE@|${bootparams}|g" \
+ "${dir}/boot/live.cfg.in" >> "${dir}/boot/live.cfg"
+ done
+}
+
+# Extract a kernel and generate a bootloader configuration for a installed
+# boot of the given revision. This regenerates live.cfg (based on
+# live.cfg.in), but leaves the main bootloader config alone.
+# dir - The directory where the disk is mounted (e.g. which contains
+# the live and boot directories)
+# git_repo - The .git repository to look in
+# git_revision - The revision to look at
+generate_installed_config()
+{
+ local dir="$1"
+ local git_repo="$2"
+ local git_revision="$3"
+
+ # Install the same kernel flavour as we're currently running
+ local flavour=$(cmdline_get kernel-flavour)
+
+ # If no flavour was given, fall back to any available flavour
+ # (rather than blowing up...)
+ if [ -z "${flavour}" ]; then
+ logs "No kernel flavour found, skipping bootloader update!"
+ return 1
+ fi
+
+ # The bootparams to pass (we keep the kernel flavour used in the
+ # cmdline, so it can be used again on upgrades).
+ local bootparams="$(get_bootparams "$git_repo" "$git_revision") kernel-flavour=${flavour}"
+
+ # Extract the kernel and initrd from git
+ extract_kernel "${dir}/live" "${flavour}" "" "${git_repo}" "${git_revision}" || return 1
+
+ # Generate global extlinux config file
+ cat<<EOF > ${dir}/boot/extlinux/extlinux.conf
+default linux
+prompt 0
+
+include linux.cfg
+EOF
+
+ # Generate config entry to boot our selected flavour
+ cat<<EOF > ${dir}/boot/extlinux/linux.cfg
+label linux
+ linux /live/vmlinuz
+ append initrd=/live/initrd.img ${bootparams}
+EOF
+}
+
+# vim: set sw=8 sts=8 noexpandtab:
Oops, something went wrong.

0 comments on commit 1a887b5

Please sign in to comment.