version1.0 limpiando boot-tools
git-svn-id: https://opengnsys.es/svn/branches/version1.0@1765 a21b9725-9963-47de-94b9-378ad31fedc9master
parent
d17950bd42
commit
7bf37b9cde
|
@ -1,77 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#/**
|
|
||||||
#@file Net.lib
|
|
||||||
#@brief Librería o clase Net
|
|
||||||
#@class Net
|
|
||||||
#@brief Funciones básicas de red.
|
|
||||||
#@version 1.0
|
|
||||||
#@warning License: GNU GPLv3+
|
|
||||||
#*/
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetHostname
|
|
||||||
#@brief Muestra el nombre del cliente.
|
|
||||||
#@return str_host - nombre de máquina
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetHostname ()
|
|
||||||
{
|
|
||||||
local HOST NETFILE
|
|
||||||
# Tomar nombre de la variable HOSTNAME
|
|
||||||
HOST="$HOSTNAME"
|
|
||||||
|
|
||||||
# Si no, tomar del DHCP, opción host-name /* (comentario para Doxygen)
|
|
||||||
[ -z "$HOST" ] && HOST=$(awk -F\" '/option host-name/ {gsub(/;/,""); host=$2}
|
|
||||||
END {print host}
|
|
||||||
' /var/lib/dhcp3/dhclient.leases)
|
|
||||||
# Si no, leer el parámetro del kernel hostname (comentario para Doxygen) */
|
|
||||||
[ -z "$HOST" ] && HOST=$(awk 'BEGIN {RS=""; FS="="}
|
|
||||||
$1~/hostname/ {print $2}' /proc/cmdline)
|
|
||||||
|
|
||||||
[ "$HOSTNAME" != "$HOST" ] && export HOSTNAME="$HOST"
|
|
||||||
echo $HOST
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetIpAddress
|
|
||||||
#@brief Muestra la dirección IP del sistema
|
|
||||||
#@return str_ip - Dirección IP
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetIpAddress ()
|
|
||||||
{
|
|
||||||
local IP
|
|
||||||
#Version og2ndFS
|
|
||||||
NETFILE="/tmp/net-eth0.conf"
|
|
||||||
[ -f "$NETFILE" ] && IP=$(cat $NETFILE | grep IPV4ADDR | cut -f2 -d=)
|
|
||||||
|
|
||||||
# Obtener direcciones IP. /* (comentario para Doxygen)
|
|
||||||
[ -z "$IP" ] && IP=$(ip address show | awk '$2!~/lo/ { readline; if ($1~/inet$/) {sub (/\/.*/, ""); printf ("%s ", $2)}}')
|
|
||||||
# Mostrar sólo la primera. (comentario para Doxygen) */
|
|
||||||
echo ${IP%% *}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetMacAddress
|
|
||||||
#@brief Muestra la dirección Ethernet del cliente.
|
|
||||||
#@return str_ether - Dirección Ethernet
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetMacAddress ()
|
|
||||||
{
|
|
||||||
local MAC
|
|
||||||
# Obtener direcciones Ethernet.
|
|
||||||
MAC=$(ip address show | awk '$2!~/lo/ {readline; if ($1~/ether/) printf ("%s ", toupper($2));}')
|
|
||||||
# Mostrar sólo la primera.
|
|
||||||
echo ${MAC%% *}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
Moverse al etc del cliente.
|
|
||||||
cd /opt/opengnsys/client/etc
|
|
||||||
|
|
||||||
preinit/default
|
|
||||||
modificamos el sha-bang a /bin/bash
|
|
||||||
eliminamos enlace del bash
|
|
||||||
Ejecute solo el loadmodules del for
|
|
||||||
|
|
||||||
preinit/loaenviron
|
|
||||||
comentamos el LD_PATH
|
|
||||||
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/opt/og2fs/opt/drbl/sbin
|
|
||||||
|
|
||||||
|
|
||||||
dejar en bin solo el browser y el ogadmcliente
|
|
||||||
|
|
||||||
/var/lib/tftboot/pxelinux.cfg/default
|
|
||||||
DEFAULT pxe2
|
|
||||||
LABEL pxe
|
|
||||||
KERNEL linux
|
|
||||||
APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on boot=admin
|
|
||||||
LABEL pxe2
|
|
||||||
KERNEL vmlinuz-2.6.32-21-generic-pae
|
|
||||||
APPEND initrd=initrd-2.6.32-21-generic-pae ip=dhcp rootdelay=0 boot=og engine=testing rootmnt=/opt/og2fs vga=788
|
|
||||||
|
|
||||||
|
|
||||||
parametro boot: reservado INCOMPATIBLE CON BOOT=ADMIN
|
|
||||||
temporalmente: init/default.sh => export boot=admin
|
|
77
old/Net.lib
77
old/Net.lib
|
@ -1,77 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#/**
|
|
||||||
#@file Net.lib
|
|
||||||
#@brief Librería o clase Net
|
|
||||||
#@class Net
|
|
||||||
#@brief Funciones básicas de red.
|
|
||||||
#@version 1.0
|
|
||||||
#@warning License: GNU GPLv3+
|
|
||||||
#*/
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetHostname
|
|
||||||
#@brief Muestra el nombre del cliente.
|
|
||||||
#@return str_host - nombre de máquina
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetHostname ()
|
|
||||||
{
|
|
||||||
local HOST NETFILE
|
|
||||||
# Tomar nombre de la variable HOSTNAME
|
|
||||||
HOST="$HOSTNAME"
|
|
||||||
|
|
||||||
# Si no, tomar del DHCP, opción host-name /* (comentario para Doxygen)
|
|
||||||
[ -z "$HOST" ] && HOST=$(awk -F\" '/option host-name/ {gsub(/;/,""); host=$2}
|
|
||||||
END {print host}
|
|
||||||
' /var/lib/dhcp3/dhclient.leases)
|
|
||||||
# Si no, leer el parámetro del kernel hostname (comentario para Doxygen) */
|
|
||||||
[ -z "$HOST" ] && HOST=$(awk 'BEGIN {RS=""; FS="="}
|
|
||||||
$1~/hostname/ {print $2}' /proc/cmdline)
|
|
||||||
|
|
||||||
[ "$HOSTNAME" != "$HOST" ] && export HOSTNAME="$HOST"
|
|
||||||
echo $HOST
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetIpAddress
|
|
||||||
#@brief Muestra la dirección IP del sistema
|
|
||||||
#@return str_ip - Dirección IP
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetIpAddress ()
|
|
||||||
{
|
|
||||||
local IP
|
|
||||||
#Version og2ndFS
|
|
||||||
NETFILE="/tmp/net-eth0.conf"
|
|
||||||
[ -f "$NETFILE" ] && IP=$(cat $NETFILE | grep IPV4ADDR | cut -f2 -d=)
|
|
||||||
|
|
||||||
# Obtener direcciones IP. /* (comentario para Doxygen)
|
|
||||||
[ -z "$IP" ] && IP=$(ip address show | awk '$2!~/lo/ { readline; if ($1~/inet$/) {sub (/\/.*/, ""); printf ("%s ", $2)}}')
|
|
||||||
# Mostrar sólo la primera. (comentario para Doxygen) */
|
|
||||||
echo ${IP%% *}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetMacAddress
|
|
||||||
#@brief Muestra la dirección Ethernet del cliente.
|
|
||||||
#@return str_ether - Dirección Ethernet
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetMacAddress ()
|
|
||||||
{
|
|
||||||
local MAC
|
|
||||||
# Obtener direcciones Ethernet.
|
|
||||||
MAC=$(ip address show | awk '$2!~/lo/ {readline; if ($1~/ether/) printf ("%s ", toupper($2));}')
|
|
||||||
# Mostrar sólo la primera.
|
|
||||||
echo ${MAC%% *}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/opt/opengnsys/bin/bash
|
|
||||||
|
|
||||||
set -a
|
|
||||||
|
|
||||||
OPENGNSYS=${OPENGNSYS:-/opt/opengnsys}
|
|
||||||
OGLOGFILE=${OGLOGFILE:-/var/log/opengnsys.log}
|
|
||||||
#### FIXME EN PRUEBAS
|
|
||||||
OGLOGFILE=/var/log/opengnsys.log
|
|
||||||
|
|
||||||
/opt/opengnsys/etc/init/load2fs.sh
|
|
||||||
source /opt/opengnsys/etc/preinit/loadenviron.sh
|
|
||||||
export PATH=/opt/og2fs/bin:$PATH
|
|
||||||
export PATH=/opt/og2fs/sbin:$PATH
|
|
||||||
export PATH=$PATH:/opt/og2fs/opt/drbl/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
||||||
|
|
||||||
if [ -x "$OPENGNSYS/bin/ogAdmClient" ]; then
|
|
||||||
echo "$MSG_LAUNCHCLIENT"
|
|
||||||
$OPENGNSYS/bin/ogAdmClient -f $OPENGNSYS/etc/ogAdmClient.cfg -l $OGLOGFILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
bash
|
|
||||||
# FIXME Arranque Browser
|
|
||||||
#browser -qws $OGSTARTPAGE
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#/**
|
|
||||||
#@file load2fs.sh
|
|
||||||
#@brief Script de carga del 2nd Sistema de Archivos para el cliente OpenGNSys.
|
|
||||||
#@warning License: GNU GPLv3+
|
|
||||||
#@version 0.9
|
|
||||||
#@author Antonio J. Doblas Viso, Unviersidad de Malaga.
|
|
||||||
#@date 2010-02-15
|
|
||||||
#*/
|
|
||||||
mkdir -p /opt/og2fs
|
|
||||||
mount /opt/opengnsys/og2ndFS /opt/og2fs -t ext3 -o loop -o ro
|
|
||||||
cp -R /opt/og2fs/etc/* /etc/ # */
|
|
||||||
mount /opt/og2fs/usr /usr
|
|
||||||
mount /opt/og2fs/lib /lib
|
|
||||||
export PATH=/opt/og2fs/sbin:$PATH
|
|
||||||
export PATH=/opt/og2fs/bin:$PATH
|
|
||||||
export PATH=$PATH:/opt/og2fs/opt/drbl/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
||||||
|
|
||||||
# meter aqui el reboot del Boot.lib
|
|
|
@ -1,34 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#/**
|
|
||||||
#@file conframfs.sh
|
|
||||||
#@brief Script de inicio para configurar el 2º FileSystem linkado.
|
|
||||||
#@version 1.0
|
|
||||||
#@author Antonio J. Doblas Viso. Universidad de Málaga
|
|
||||||
#@date 2010-06-02
|
|
||||||
#*/
|
|
||||||
#sustituido por la funcion ogPostConfigureFS
|
|
||||||
|
|
||||||
MSG_LOADMODULES=${MSG_CONFRAMFS:-"."}
|
|
||||||
echo "$MSG_CONFRAMFS"
|
|
||||||
|
|
||||||
# configuramos el /etc/hostname.
|
|
||||||
HOSTNAME=$(ogGetHostname)
|
|
||||||
echo $HOSTNAME > /etc/hostname
|
|
||||||
|
|
||||||
|
|
||||||
#configuramos el /etc/hosts
|
|
||||||
IP=$(ogGetIpAddress)
|
|
||||||
echo "127.0.0.1 localhost" > /etc/hosts
|
|
||||||
echo "$IP $HOSTNAME" >> /etc/hosts
|
|
||||||
|
|
||||||
### conft net
|
|
||||||
echo "auto lo " > /etc/network/interfaces
|
|
||||||
echo "iface lo inet loopback" >> /etc/network/interfaces
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /var/run/network
|
|
||||||
cd /var/run/network
|
|
||||||
touch ifstate
|
|
||||||
|
|
||||||
/etc/init.d/networking restart
|
|
||||||
ifup lo
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,461 +0,0 @@
|
||||||
# -*- shell-script -*-
|
|
||||||
|
|
||||||
catenate_cpiogz() {
|
|
||||||
# Sanity check
|
|
||||||
if [ ! -e "${1}" ]; then
|
|
||||||
echo "W:catenate_cpiogz: arg1='${1}' does not exist." >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat "${1}" >>"${__TMPCPIOGZ}"
|
|
||||||
}
|
|
||||||
|
|
||||||
force_load()
|
|
||||||
{
|
|
||||||
manual_add_modules ${@}
|
|
||||||
echo "${@}" >>"${DESTDIR}/conf/modules"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Takes a file containing a list of modules to be added as an
|
|
||||||
# argument, figures out dependancies, and adds them.
|
|
||||||
#
|
|
||||||
# Input file syntax:
|
|
||||||
#
|
|
||||||
# # comment
|
|
||||||
# modprobe_module_name [args ...]
|
|
||||||
# [...]
|
|
||||||
#
|
|
||||||
add_modules_from_file()
|
|
||||||
{
|
|
||||||
# Sanity check
|
|
||||||
if [ ! -e "${1}" ]; then
|
|
||||||
echo "W:add_modules_from_file: arg1='${1}' does not exist." >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
sed -e '/^#/d' ${1} | while read module rest; do
|
|
||||||
force_load "${module}" "${rest}"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Is this module available?
|
|
||||||
have_module()
|
|
||||||
{
|
|
||||||
modprobe --set-version="${version}" --ignore-install \
|
|
||||||
--show-depends "${1}" >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add dependent modules + eventual firmware
|
|
||||||
manual_add_modules()
|
|
||||||
{
|
|
||||||
local mam_x firmwares firmware
|
|
||||||
|
|
||||||
for mam_x in $(modprobe --set-version="${version}" --ignore-install \
|
|
||||||
--show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do
|
|
||||||
# Prune duplicates
|
|
||||||
if [ -e "${DESTDIR}/${mam_x}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "${DESTDIR}/$(dirname "${mam_x}")"
|
|
||||||
ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")"
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Adding module ${mam_x}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add firmware files if necessary
|
|
||||||
firmwares=$(modinfo -F firmware "${mam_x}")
|
|
||||||
if [ -z "${firmwares}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
for firmware in $firmwares; do
|
|
||||||
if [ -e "${DESTDIR}/lib/firmware/${firmware}" ] \
|
|
||||||
|| [ -e "${DESTDIR}/lib/firmware/${version}/${firmware}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Only print warning for missing fw of loaded module
|
|
||||||
# or forced loaded module
|
|
||||||
if [ ! -e "/lib/firmware/${firmware}" ] \
|
|
||||||
&& [ ! -e "/lib/firmware/${version}/${firmware}" ]; then
|
|
||||||
if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \
|
|
||||||
/proc/modules \
|
|
||||||
|| grep -q "^$(basename "${mam_x}" .ko)" \
|
|
||||||
"${CONFDIR}/modules"; then
|
|
||||||
echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${mam_x} .ko)" >&2
|
|
||||||
fi
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "/lib/firmware/${version}/${firmware}" ]; then
|
|
||||||
copy_exec "/lib/firmware/${version}/${firmware}"
|
|
||||||
else
|
|
||||||
copy_exec "/lib/firmware/${firmware}"
|
|
||||||
fi
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Adding firmware ${firmware}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# $1 is the source path (e.g. /usr/bin/time)
|
|
||||||
# $2 is the relative destination (e.g. /usr or /usr/time)
|
|
||||||
#
|
|
||||||
# The destination is interpreted in the same way "cp" would, meaning
|
|
||||||
# (assuming /bin is a directory):
|
|
||||||
#
|
|
||||||
# "copy_exec /usr/bin/time /bin" -> /bin/time
|
|
||||||
# "copy_exec /usr/bin/time /bin/mytime" -> /bin/mytime
|
|
||||||
#
|
|
||||||
# If $2 is left out, the same destination path as for the source arg will
|
|
||||||
# be used and directories will be created as needed, so:
|
|
||||||
#
|
|
||||||
# "copy_exec /usr/bin/time" -> /usr/bin/time
|
|
||||||
#
|
|
||||||
copy_exec() {
|
|
||||||
local source target destination final_destination x nonoptlib
|
|
||||||
local libname dirname
|
|
||||||
|
|
||||||
source="${1}"
|
|
||||||
if [ -n "${2}" ]; then
|
|
||||||
target="${2}"
|
|
||||||
else
|
|
||||||
if [ ! -e "${DESTDIR}/$(dirname "${1}")" ]; then
|
|
||||||
mkdir -p "${DESTDIR}/$(dirname "${1}")"
|
|
||||||
fi
|
|
||||||
target="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "${DESTDIR}/${target}" ]; then
|
|
||||||
destination="${target}/$(basename "${source}")"
|
|
||||||
else
|
|
||||||
destination="${target}"
|
|
||||||
fi
|
|
||||||
final_destination="${DESTDIR}/${destination}"
|
|
||||||
|
|
||||||
if [ -L "$final_destination" ]; then
|
|
||||||
if [ $(readlink "${final_destination}") != "${source}" ]; then
|
|
||||||
echo "W:copy_exec: Not copying ${source} to \$DESTDIR${destination}, which is already a copy of $(readlink ${final_destination})" >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
ln -s ${source} ${DESTDIR}/${destination}
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Adding binary ${source}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy the dependant libraries
|
|
||||||
for x in $(ldd ${source} 2>/dev/null | sed -e '
|
|
||||||
/\//!d;
|
|
||||||
/linux-gate/d;
|
|
||||||
/=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
|
|
||||||
s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do
|
|
||||||
|
|
||||||
# Try to use non-optimised libraries where possible.
|
|
||||||
# We assume that all HWCAP libraries will be in tls,
|
|
||||||
# sse2, vfp or neon
|
|
||||||
nonoptlib=$(echo "${x}" | sed -e 's#/lib/\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#/lib/\2#')
|
|
||||||
|
|
||||||
if [ -e "${nonoptlib}" ]; then
|
|
||||||
x="${nonoptlib}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
libname=$(basename "${x}")
|
|
||||||
dirname=$(dirname "${x}")
|
|
||||||
|
|
||||||
mkdir -p "${DESTDIR}/${dirname}"
|
|
||||||
if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then
|
|
||||||
ln -s "${x}" "${DESTDIR}/${dirname}"
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Adding library ${x}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Copy entire subtrees to the initramfs
|
|
||||||
copy_modules_dir()
|
|
||||||
{
|
|
||||||
local x_mod
|
|
||||||
|
|
||||||
if ! [ -d "${MODULESDIR}/${1}" ]; then
|
|
||||||
return;
|
|
||||||
fi
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Copying module directory ${1}"
|
|
||||||
fi
|
|
||||||
for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do
|
|
||||||
manual_add_modules $(basename ${x_mod} .ko)
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# walk /sys for relevant modules
|
|
||||||
sys_walk_mod_add()
|
|
||||||
{
|
|
||||||
local driver_path module
|
|
||||||
device_path="$1"
|
|
||||||
|
|
||||||
while [ "${device_path}" != "/sys" ]; do
|
|
||||||
driver_path="$(readlink -f ${device_path}/driver)"
|
|
||||||
if [ -e "$driver_path" ]; then
|
|
||||||
module="$(basename $(readlink -f $driver_path))"
|
|
||||||
if [ -n "${module}" ]; then
|
|
||||||
force_load "${module}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
device_path="$(dirname ${device_path})"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# walk /sys for relevant modalias
|
|
||||||
sys_walk_modalias()
|
|
||||||
{
|
|
||||||
local device_path modalias
|
|
||||||
|
|
||||||
device_path="$(dirname "${1}")"
|
|
||||||
device_path="$(dirname "${device_path}")"
|
|
||||||
if [ -e "${device_path}/modalias" ]; then
|
|
||||||
modalias=$(cat "${device_path}/modalias")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${modalias}" ]; then
|
|
||||||
force_load "${modalias}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# find and only copy root relevant modules
|
|
||||||
dep_add_modules()
|
|
||||||
{
|
|
||||||
local block minor root FSTYPE root_dev_path x
|
|
||||||
|
|
||||||
# findout root block device + fstype
|
|
||||||
eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')"
|
|
||||||
if [ "${root}" = "/dev/root" ] ; then
|
|
||||||
root="/dev/disk/by-uuid/"$(/sbin/blkid -s UUID -o value ${root}) 2>/dev/null
|
|
||||||
fi
|
|
||||||
root="$(readlink -f ${root})"
|
|
||||||
|
|
||||||
# find out real rootfs on auto type
|
|
||||||
if [ "${FSTYPE}" = "auto" ]; then
|
|
||||||
eval "$(/usr/lib/klibc/bin/fstype ${root})"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check that fstype rootfs recognition
|
|
||||||
if [ "${FSTYPE}" = "unknown" ]; then
|
|
||||||
echo "mkinitramfs: unknown fstype on root ${root}"
|
|
||||||
echo "mkinitramfs: workaround is MODULES=most"
|
|
||||||
echo "mkinitramfs: Error please report bug on initramfs-tools"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add rootfs
|
|
||||||
manual_add_modules "${FSTYPE}"
|
|
||||||
|
|
||||||
# lvm luks root
|
|
||||||
if [ "${root#/dev/mapper/}" != "${root}" ]; then
|
|
||||||
minor=$((0x$(stat --format "%T" ${root}) % 256))
|
|
||||||
block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1)
|
|
||||||
if [ "${block#dm-}" != "${block}" ]; then
|
|
||||||
block=$(ls -1 /sys/block/${block}/slaves | head -n 1)
|
|
||||||
fi
|
|
||||||
block=${block%%[0-9]*}
|
|
||||||
# md root new naming scheme /dev/md/X
|
|
||||||
elif [ "${root#/dev/md/}" != "${root}" ]; then
|
|
||||||
root=${root#/dev/md/}
|
|
||||||
block=$(awk "/^md${root}/{print substr(\$5, 1, 3); exit}" \
|
|
||||||
/proc/mdstat)
|
|
||||||
# md root /dev/mdX
|
|
||||||
elif [ "${root#/dev/md}" != "${root}" ]; then
|
|
||||||
root=${root#/dev/}
|
|
||||||
block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \
|
|
||||||
/proc/mdstat)
|
|
||||||
# mmc always uses numbering in the devicename (mmcblk[0-9])
|
|
||||||
elif [ "${root#/dev/mmc}" != "${root}" ]; then
|
|
||||||
block=${root#/dev/}
|
|
||||||
block=${block%%p[0-9]*}
|
|
||||||
# classical root device
|
|
||||||
else
|
|
||||||
block=${root#/dev/}
|
|
||||||
block=${block%%[0-9]*}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Error out if /sys lack block dev
|
|
||||||
if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then
|
|
||||||
echo "mkinitramfs: missing ${block} root ${root} /sys entry"
|
|
||||||
echo "mkinitramfs: workaround is MODULES=most"
|
|
||||||
echo "mkinitramfs: Error please report the bug"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# sys walk ATA
|
|
||||||
root_dev_path=$(readlink -f /sys/block/${block}/device)
|
|
||||||
sys_walk_mod_add ${root_dev_path}
|
|
||||||
|
|
||||||
# catch old-style IDE
|
|
||||||
if [ -e /sys/bus/ide/devices/ ]; then
|
|
||||||
sys_walk_modalias ${root_dev_path}
|
|
||||||
manual_add_modules ide-disk
|
|
||||||
manual_add_modules ide-cd
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /sys/bus/scsi/devices/ ]; then
|
|
||||||
manual_add_modules sd_mod
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /sys/bus/i2o/devices/ ]; then
|
|
||||||
force_load i2o_block
|
|
||||||
force_load i2o_config
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /sys/bus/ps3_system_bus/ ]; then
|
|
||||||
for x in ps3disk ps3rom ps3-gelic ps3_sys_manager; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /sys/bus/vio/ ]; then
|
|
||||||
for x in sunvnet sunvdc; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# The modules "most" classes added per default to the initramfs
|
|
||||||
auto_add_modules()
|
|
||||||
{
|
|
||||||
case "$1" in
|
|
||||||
base)
|
|
||||||
for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid_a4tech \
|
|
||||||
hid_apple hid_belkin hid_bright hid_cherry hid_chicony \
|
|
||||||
hid_cypress hid_dell hid_ezkey hid_gyration hid_logitech \
|
|
||||||
hid_microsoft hid_monterey hid_petalynx hid_pl hid_samsung \
|
|
||||||
hid_sony hid_sunplus hid_tmff hid_zpff usb-storage ext2 \
|
|
||||||
ext3 ext4 isofs jfs nfs reiserfs udf xfs af_packet atkbd i8042 \
|
|
||||||
virtio_pci vfat nls_cp437 nls_iso8859-1; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
net)
|
|
||||||
for x in 3c59x 8139cp 8139too 8390 atl1 atl1e b44 bmac \
|
|
||||||
cxgb3 defxx dl2k e100 e1000 e1000e ehea epic100 \
|
|
||||||
ep93xx_eth eql fealnx famachi forcedeth gelic_net \
|
|
||||||
hp100 igb ipg mace mv643xx_eth myri10ge \
|
|
||||||
natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \
|
|
||||||
r8169 s2io sis900 skge sky2 slhc smc911x starfire \
|
|
||||||
sundance sungem sungem_phy sunhme sunvnet tg3 tlan de2104x \
|
|
||||||
de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \
|
|
||||||
typhon via-rhine via-velocity virtio_net yellowfin; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
ide)
|
|
||||||
copy_modules_dir kernel/drivers/ide
|
|
||||||
;;
|
|
||||||
scsi)
|
|
||||||
copy_modules_dir kernel/drivers/scsi
|
|
||||||
for x in mptfc mptsas mptscsih mptspi; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
ata)
|
|
||||||
copy_modules_dir kernel/drivers/ata
|
|
||||||
;;
|
|
||||||
block)
|
|
||||||
copy_modules_dir kernel/drivers/block
|
|
||||||
copy_modules_dir kernel/drivers/usb/storage
|
|
||||||
;;
|
|
||||||
# FIXME: can be removed after Lenny release
|
|
||||||
ieee1394)
|
|
||||||
for x in ohci1394 sbp2; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
firewire)
|
|
||||||
for x in firewire-ohci firewire-sbp2; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
i2o)
|
|
||||||
for x in i2o_block; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
dasd)
|
|
||||||
for x in dasd_eckd_mod dasd_fba_mod; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
auto_add_modules base
|
|
||||||
auto_add_modules net
|
|
||||||
auto_add_modules ide
|
|
||||||
auto_add_modules scsi
|
|
||||||
auto_add_modules block
|
|
||||||
auto_add_modules ata
|
|
||||||
auto_add_modules i2o
|
|
||||||
auto_add_modules dasd
|
|
||||||
auto_add_modules ieee1394
|
|
||||||
auto_add_modules firewire
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
usage()
|
|
||||||
{
|
|
||||||
cat >&2 << EOF
|
|
||||||
|
|
||||||
Usage: ${0} [OPTION]... <-o outfile> [version]
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-d confdir Specify an alternative configuration directory.
|
|
||||||
-k Keep temporary directory used to make the image.
|
|
||||||
-o outfile Write to outfile.
|
|
||||||
-r root Override ROOT setting in mkinitrd.conf.
|
|
||||||
|
|
||||||
See mkinitramfs(8) for further details.
|
|
||||||
EOF
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# minimal supported kernel version
|
|
||||||
check_minkver()
|
|
||||||
{
|
|
||||||
local curversion initdir DPKG_ARCH minversion cm_x tmp
|
|
||||||
|
|
||||||
curversion="${1}"
|
|
||||||
initdir="${2}"
|
|
||||||
if [ -z "${initdir}" ]; then
|
|
||||||
DPKG_ARCH=$(dpkg --print-architecture)
|
|
||||||
case ${DPKG_ARCH} in
|
|
||||||
ia64|hppa)
|
|
||||||
minversion="2.6.15"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
minversion="2.6.12"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if dpkg --compare-versions "${curversion}" lt "${minversion}"; then
|
|
||||||
echo "W: kernel ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2
|
|
||||||
echo "W: not generating requested initramfs for kernel ${curversion}" >&2
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
set_initlist
|
|
||||||
for cm_x in ${initlist}; do
|
|
||||||
# sed: keep last line starting with MINKVER=,
|
|
||||||
# remove MINKVER= and trailing space
|
|
||||||
minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}")
|
|
||||||
if [ -z "${tmp}" ]; then
|
|
||||||
continue
|
|
||||||
elif dpkg --compare-versions "${curversion}" lt "${minver}"; then
|
|
||||||
echo "W: ${cm_x} hook script requires at least kernel version ${minver}" >&2
|
|
||||||
echo "W: not generating requested initramfs for kernel ${curversion}" >&2
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
|
@ -1,95 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ "$1" = prereqs ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
number=
|
|
||||||
suffix=
|
|
||||||
eval $(printf "%s" "$COMPCACHE_SIZE" | \
|
|
||||||
sed -nre 's/^ *([1-9][0-9]*) *([%KMGT]) *$/number="\1"; suffix="\2";/p')
|
|
||||||
|
|
||||||
if [ -z "$number" ] || [ -z "$suffix" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if have_module ramzswap; then
|
|
||||||
name=ramzswap
|
|
||||||
manual_add_modules ramzswap
|
|
||||||
elif have_module compcache; then
|
|
||||||
name=compcache
|
|
||||||
manual_add_modules compcache
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
copy_exec /sbin/swapon
|
|
||||||
|
|
||||||
mkdir -p "$DESTDIR"/etc/udev/rules.d
|
|
||||||
cat >"$DESTDIR"/etc/udev/rules.d/80-compcache.rules <<EOF
|
|
||||||
KERNEL=="ramzswap0", ACTION=="add", \\
|
|
||||||
RUN+="/sbin/swapon -p 100 /dev/ramzswap0 2>/dev/null"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
mem_total="\$(sed -nre 's/^MemTotal:\\s*([0-9]+) kB\$/\\1/p' /proc/meminfo)"
|
|
||||||
|
|
||||||
case "$suffix" in
|
|
||||||
%) kbytes="\$(($mem_total * $number / 100))" ;;
|
|
||||||
K) kbytes=$(($number)) ;;
|
|
||||||
M) kbytes=$(($number * 1024)) ;;
|
|
||||||
G) kbytes=$(($number * 1024 * 1024)) ;;
|
|
||||||
T) kbytes=$(($number * 1024 * 1024 * 1024)) ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cat >"$DESTDIR"/scripts/init-top/compcache <<EOF
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "\$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case \$1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# find total amount of available ram
|
|
||||||
TOTAL_RAM=\$( grep MemTotal /proc/meminfo |tr -d ': [A-Z][a-z]')
|
|
||||||
|
|
||||||
# Do not use compcache on the liveCD if we have more than 512M
|
|
||||||
if [ "\${BOOT}" = "casper" ]; then
|
|
||||||
if [ "\${TOTAL_RAM}" -gt 524288 ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
for x in \$(cat /proc/cmdline); do
|
|
||||||
case \${x} in
|
|
||||||
nocompcache)
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
if [ "$name" = ramzswap ]; then
|
|
||||||
cat >>"$DESTDIR"/scripts/init-top/compcache <<EOF
|
|
||||||
modprobe -q --ignore-install ramzswap disksize_kb="$kbytes"
|
|
||||||
EOF
|
|
||||||
else
|
|
||||||
cat >>"$DESTDIR"/scripts/init-top/compcache <<EOF
|
|
||||||
modprobe -q --ignore-install compcache compcache_size_kbytes="$kbytes"
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
chmod 0755 "$DESTDIR"/scripts/init-top/compcache
|
|
||||||
|
|
||||||
# vim:set et sw=2 sts=2:
|
|
|
@ -1,50 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
PREREQ="kbd|console_tools"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
. /etc/default/console-setup
|
|
||||||
|
|
||||||
# Copy console-setup configuration
|
|
||||||
mkdir -p "$DESTDIR/etc/default"
|
|
||||||
cp -p /etc/default/console-setup "$DESTDIR/etc/default"
|
|
||||||
|
|
||||||
# Assume setupcon --save has been run
|
|
||||||
if [ -f "$FONT" ]; then
|
|
||||||
FONT="/etc/console-setup/${FONT##*/}"
|
|
||||||
FONT="${FONT%.gz}"
|
|
||||||
else
|
|
||||||
FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
|
|
||||||
fi
|
|
||||||
if [ -f "$FONT" ]; then
|
|
||||||
mkdir -p "$DESTDIR${FONT%/*}"
|
|
||||||
cp -p "$FONT" "$DESTDIR$FONT"
|
|
||||||
fi
|
|
||||||
if [ -f "$ACM" ]; then
|
|
||||||
ACM="/etc/console-setup/${ACM##*/}"
|
|
||||||
ACM="${ACM%.gz}"
|
|
||||||
else
|
|
||||||
ACM="/etc/console-setup/$CHARMAP.acm"
|
|
||||||
fi
|
|
||||||
if [ -f "$ACM" ]; then
|
|
||||||
mkdir -p "$DESTDIR${ACM%/*}"
|
|
||||||
cp -p "$ACM" "$DESTDIR$ACM"
|
|
||||||
fi
|
|
||||||
if [ -f /etc/console-setup/cached.kmap.gz ]; then
|
|
||||||
mkdir -p "$DESTDIR/etc/console-setup"
|
|
||||||
cp -p /etc/console-setup/cached.kmap.gz \
|
|
||||||
"$DESTDIR/etc/console-setup/cached.kmap.gz"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
echo "udev"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
mkdir -p $DESTDIR/lib/udev/rules.d/
|
|
||||||
for rules in 55-dm.rules 60-persistent-storage-dm.rules; do
|
|
||||||
if [ -e /etc/udev/rules.d/$rules ]; then
|
|
||||||
cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
|
|
||||||
elif [ -e /lib/udev/rules.d/$rules ]; then
|
|
||||||
cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
copy_exec /sbin/dmsetup
|
|
||||||
|
|
||||||
manual_add_modules dm_mod
|
|
|
@ -1,26 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs hook for fixing broken rtc clock
|
|
||||||
# without battery
|
|
||||||
|
|
||||||
MINKVER="2.6.24"
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
# We use date, hwclock and dumpe2fs
|
|
||||||
copy_exec /bin/date /bin
|
|
||||||
copy_exec /sbin/hwclock /sbin
|
|
||||||
copy_exec /sbin/dumpe2fs /sbin
|
|
|
@ -1,41 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
copy_modules_dir kernel/drivers/char/agp
|
|
||||||
copy_modules_dir kernel/drivers/gpu
|
|
||||||
|
|
||||||
manual_add_modules fbcon
|
|
||||||
manual_add_modules vesafb
|
|
||||||
manual_add_modules vga16fb
|
|
||||||
|
|
||||||
for x in ${MODULESDIR}/initrd/*; do
|
|
||||||
x=${x##*/}
|
|
||||||
x=${x%.*}
|
|
||||||
case ${x} in
|
|
||||||
'*')
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*fb)
|
|
||||||
fbcon=y
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
manual_add_modules ${x}
|
|
||||||
done
|
|
|
@ -1,15 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
copy_exec /sbin/mount.fuse /sbin
|
|
||||||
|
|
||||||
manual_add_modules fuse
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,23 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
PREREQ="kernelextras"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
# Console utilities needed for console-setup
|
|
||||||
copy_exec /bin/setfont /bin
|
|
||||||
copy_exec /bin/kbd_mode /bin
|
|
||||||
copy_exec /bin/loadkeys /bin
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,43 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ="udev"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ ! -x /sbin/lvm ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
if [ -e /etc/lvm/lvm.conf ]; then
|
|
||||||
mkdir -p ${DESTDIR}/etc/lvm
|
|
||||||
cp /etc/lvm/lvm.conf ${DESTDIR}/etc/lvm/
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p $DESTDIR/lib/udev/rules.d/
|
|
||||||
for rules in 56-lvm.rules 60-persistent-storage-lvm.rules 85-lvm2.rules; do
|
|
||||||
if [ -e /etc/udev/rules.d/$rules ]; then
|
|
||||||
cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
|
|
||||||
elif [ -e /lib/udev/rules.d/$rules ]; then
|
|
||||||
cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
copy_exec /sbin/dmsetup
|
|
||||||
copy_exec /sbin/lvm
|
|
||||||
ln -s lvm ${DESTDIR}/sbin/vgchange
|
|
||||||
|
|
||||||
for x in dm_mod dm_snapshot dm_mirror; do
|
|
||||||
manual_add_modules ${x}
|
|
||||||
done
|
|
|
@ -1,22 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
PREREQ="fuse_utils"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
copy_exec /bin/ntfs-3g /bin
|
|
||||||
ln -s /bin/ntfs-3g "$DESTDIR/sbin/mount.ntfs-3g"
|
|
||||||
ln -s /bin/ntfs-3g "$DESTDIR/sbin/mount.ntfs"
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,69 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="framebuffer"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ -x /sbin/plymouthd ] || exit 0
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
mkdir -p ${DESTDIR}/lib/plymouth
|
|
||||||
mkdir -p ${DESTDIR}/lib/plymouth/renderers
|
|
||||||
mkdir -p ${DESTDIR}/lib/plymouth/themes
|
|
||||||
|
|
||||||
copy_exec /sbin/plymouthd /sbin
|
|
||||||
copy_exec /bin/plymouth /bin
|
|
||||||
|
|
||||||
# plugin that is always required
|
|
||||||
copy_exec /lib/plymouth/details.so /lib/plymouth/
|
|
||||||
|
|
||||||
# copy the default themes
|
|
||||||
cp -a /lib/plymouth/themes/details ${DESTDIR}/lib/plymouth/themes/
|
|
||||||
TEXT_THEME=$(readlink -f /lib/plymouth/themes/text.plymouth)
|
|
||||||
if [ -e "$TEXT_THEME" ]; then
|
|
||||||
ln -s $TEXT_THEME ${DESTDIR}/lib/plymouth/themes/text.plymouth
|
|
||||||
cp -a $(dirname $TEXT_THEME) ${DESTDIR}/lib/plymouth/themes/
|
|
||||||
MODULE=$(grep "ModuleName *= *" ${TEXT_THEME} | sed 's/ModuleName *= *//')
|
|
||||||
copy_exec /lib/plymouth/$MODULE.so /lib/plymouth/
|
|
||||||
fi
|
|
||||||
THEME=$(readlink -f /lib/plymouth/themes/default.plymouth)
|
|
||||||
if [ -e "$THEME" ]; then
|
|
||||||
ln -s $THEME ${DESTDIR}/lib/plymouth/themes/default.plymouth
|
|
||||||
cp -a $(dirname $THEME) ${DESTDIR}/lib/plymouth/themes/
|
|
||||||
MODULE=$(grep "ModuleName *= *" ${THEME} | sed 's/ModuleName *= *//')
|
|
||||||
copy_exec /lib/plymouth/$MODULE.so /lib/plymouth/
|
|
||||||
|
|
||||||
# if we have a non-text theme, make sure we copy all the support libs
|
|
||||||
copy_exec /lib/plymouth/label.so /lib/plymouth/
|
|
||||||
|
|
||||||
# output renderers
|
|
||||||
copy_exec /lib/plymouth/renderers/frame-buffer.so /lib/plymouth/renderers/
|
|
||||||
copy_exec /lib/plymouth/renderers/drm.so /lib/plymouth/renderers/
|
|
||||||
copy_exec /lib/plymouth/renderers/vga16fb.so /lib/plymouth/renderers/
|
|
||||||
|
|
||||||
cp /lib/plymouth/ubuntu-logo.png ${DESTDIR}/lib/plymouth
|
|
||||||
|
|
||||||
# and copy the font support files needed in order to actually display
|
|
||||||
# any text
|
|
||||||
mkdir -p ${DESTDIR}/usr/share/fonts/truetype/ttf-dejavu
|
|
||||||
mkdir -p ${DESTDIR}/etc/fonts/conf.d
|
|
||||||
mkdir -p ${DESTDIR}/usr/lib/pango/1.6.0/module-files.d
|
|
||||||
mkdir -p ${DESTDIR}/usr/lib/pango/1.6.0/modules
|
|
||||||
cp /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf ${DESTDIR}/usr/share/fonts/truetype/ttf-dejavu/
|
|
||||||
cp /etc/fonts/fonts.conf ${DESTDIR}/etc/fonts/fonts.conf
|
|
||||||
cp -L /etc/fonts/conf.d/60-latin.conf ${DESTDIR}/etc/fonts/conf.d
|
|
||||||
cp /usr/lib/pango/1.6.0/module-files.d/libpango1.0-0.modules ${DESTDIR}/usr/lib/pango/1.6.0/module-files.d/
|
|
||||||
cp /usr/lib/pango/1.6.0/modules/pango-basic-fc.so ${DESTDIR}/usr/lib/pango/1.6.0/modules/pango-basic-fc.so
|
|
||||||
fi
|
|
|
@ -1,46 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Hooks for loading thermal bits into the initramfs
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
case "$DPKG_ARCH" in
|
|
||||||
# copy the right modules
|
|
||||||
powerpc|ppc64)
|
|
||||||
# Add thermal control of Macintosh if the system is not a PS3
|
|
||||||
if [ ! -e /sys/bus/ps3_system_bus/ ]; then
|
|
||||||
force_load therm_pm72
|
|
||||||
force_load windfarm_core
|
|
||||||
force_load windfarm_cpufreq_clamp
|
|
||||||
force_load windfarm_lm75_sensor
|
|
||||||
force_load windfarm_max6690_sensor
|
|
||||||
force_load windfarm_pid
|
|
||||||
force_load windfarm_pm112
|
|
||||||
force_load windfarm_pm81
|
|
||||||
force_load windfarm_pm91
|
|
||||||
force_load windfarm_smu_controls
|
|
||||||
force_load windfarm_smu_sat
|
|
||||||
force_load windfarm_smu_sensors
|
|
||||||
force_load i2c-powermac
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
i386|amd64|ia64|lpia)
|
|
||||||
manual_add_modules fan
|
|
||||||
manual_add_modules thermal
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,52 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs hook for udev
|
|
||||||
|
|
||||||
MINKVER="2.6.24"
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
# We use pkill
|
|
||||||
copy_exec /usr/bin/pkill /sbin
|
|
||||||
|
|
||||||
# Copy across the udev binaries
|
|
||||||
copy_exec /sbin/udevd /sbin
|
|
||||||
copy_exec /sbin/udevadm /sbin
|
|
||||||
|
|
||||||
# Copy udev configuration
|
|
||||||
mkdir -p ${DESTDIR}/etc/udev
|
|
||||||
cp -p /etc/udev/udev.conf ${DESTDIR}/etc/udev
|
|
||||||
|
|
||||||
# Only copy across relevant rules
|
|
||||||
mkdir -p ${DESTDIR}/lib/udev/rules.d
|
|
||||||
for rules in 50-udev-default.rules 50-firmware.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 64-device-mapper.rules 80-drivers.rules 95-udev-late.rules; do
|
|
||||||
cp -p /lib/udev/rules.d/$rules ${DESTDIR}/lib/udev/rules.d
|
|
||||||
done
|
|
||||||
|
|
||||||
# Copy across helpers the rules need
|
|
||||||
mkdir -p ${DESTDIR}/lib/udev
|
|
||||||
# 50-udev-default.rules
|
|
||||||
# 50-firmware.rules
|
|
||||||
copy_exec /lib/udev/firmware /lib/udev
|
|
||||||
# 60-persistent-storage.rules
|
|
||||||
copy_exec /lib/udev/ata_id /lib/udev
|
|
||||||
copy_exec /lib/udev/usb_id /lib/udev
|
|
||||||
copy_exec /sbin/blkid /lib/udev
|
|
||||||
copy_exec /lib/udev/scsi_id /lib/udev
|
|
||||||
copy_exec /lib/udev/path_id /lib/udev
|
|
||||||
# 61-persistent-storage-edd.rules
|
|
||||||
copy_exec /lib/udev/edd_id /lib/udev
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs hook for watershed
|
|
||||||
|
|
||||||
PREREQ="udev"
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
# default statedir
|
|
||||||
mkdir -p ${DESTDIR}/var/run/watershed
|
|
||||||
|
|
||||||
copy_exec /lib/udev/watershed /lib/udev
|
|
|
@ -1,272 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
[ -d /dev ] || mkdir -m 0755 /dev
|
|
||||||
[ -d /root ] || mkdir -m 0700 /root
|
|
||||||
[ -d /sys ] || mkdir /sys
|
|
||||||
[ -d /proc ] || mkdir /proc
|
|
||||||
[ -d /tmp ] || mkdir /tmp
|
|
||||||
mkdir -p /var/lock
|
|
||||||
mount -t sysfs -o nodev,noexec,nosuid none /sys
|
|
||||||
mount -t proc -o nodev,noexec,nosuid none /proc
|
|
||||||
|
|
||||||
grep -q '\<quiet\>' /proc/cmdline || echo "Loading, please wait..."
|
|
||||||
|
|
||||||
# Note that this only becomes /dev on the real filesystem if udev's scripts
|
|
||||||
# are used; which they will be, but it's worth pointing out
|
|
||||||
if ! mount -t devtmpfs -o mode=0755 none /dev; then
|
|
||||||
mount -t tmpfs -o mode=0755 none /dev
|
|
||||||
mknod -m 0600 /dev/console c 5 1
|
|
||||||
mknod /dev/null c 1 3
|
|
||||||
fi
|
|
||||||
mkdir /dev/pts
|
|
||||||
mount -t devpts -o noexec,nosuid,gid=5,mode=0620 none /dev/pts || true
|
|
||||||
> /dev/.initramfs-tools
|
|
||||||
mkdir /dev/.initramfs
|
|
||||||
|
|
||||||
# Export the dpkg architecture
|
|
||||||
export DPKG_ARCH=
|
|
||||||
. /conf/arch.conf
|
|
||||||
|
|
||||||
# Set modprobe env
|
|
||||||
export MODPROBE_OPTIONS="-qb"
|
|
||||||
|
|
||||||
# Export relevant variables
|
|
||||||
export ROOT=
|
|
||||||
export ROOTDELAY=
|
|
||||||
export ROOTFLAGS=
|
|
||||||
export ROOTFSTYPE=
|
|
||||||
export IPOPTS=
|
|
||||||
export HWADDR=
|
|
||||||
export break=
|
|
||||||
export init=/sbin/init
|
|
||||||
export quiet=n
|
|
||||||
export readonly=y
|
|
||||||
export rootmnt=/root
|
|
||||||
export debug=
|
|
||||||
export panic=
|
|
||||||
export blacklist=
|
|
||||||
export resume_offset=
|
|
||||||
|
|
||||||
# Bring in the main config
|
|
||||||
. /conf/initramfs.conf
|
|
||||||
for conf in conf/conf.d/*; do
|
|
||||||
[ -f ${conf} ] && . ${conf}
|
|
||||||
done
|
|
||||||
. /scripts/functions
|
|
||||||
|
|
||||||
# Parse command line options
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case $x in
|
|
||||||
init=*)
|
|
||||||
init=${x#init=}
|
|
||||||
;;
|
|
||||||
root=*)
|
|
||||||
ROOT=${x#root=}
|
|
||||||
case $ROOT in
|
|
||||||
LABEL=*)
|
|
||||||
ROOT="${ROOT#LABEL=}"
|
|
||||||
|
|
||||||
# support / in LABEL= paths (escape to \x2f)
|
|
||||||
case "${ROOT}" in
|
|
||||||
*[/]*)
|
|
||||||
if [ -x "$(command -v sed)" ]; then
|
|
||||||
ROOT="$(echo ${ROOT} | sed 's,/,\\x2f,g')"
|
|
||||||
else
|
|
||||||
if [ "${ROOT}" != "${ROOT#/}" ]; then
|
|
||||||
ROOT="\x2f${ROOT#/}"
|
|
||||||
fi
|
|
||||||
if [ "${ROOT}" != "${ROOT%/}" ]; then
|
|
||||||
ROOT="${ROOT%/}\x2f"
|
|
||||||
fi
|
|
||||||
IFS='/'
|
|
||||||
newroot=
|
|
||||||
for s in $ROOT; do
|
|
||||||
if [ -z "${newroot}" ]; then
|
|
||||||
newroot="${s}"
|
|
||||||
else
|
|
||||||
newroot="${newroot}\\x2f${s}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
unset IFS
|
|
||||||
ROOT="${newroot}"
|
|
||||||
fi
|
|
||||||
esac
|
|
||||||
ROOT="/dev/disk/by-label/${ROOT}"
|
|
||||||
;;
|
|
||||||
UUID=*)
|
|
||||||
ROOT="/dev/disk/by-uuid/${ROOT#UUID=}"
|
|
||||||
;;
|
|
||||||
/dev/nfs)
|
|
||||||
[ -z "${BOOT}" ] && BOOT=nfs
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
rootflags=*)
|
|
||||||
ROOTFLAGS="-o ${x#rootflags=}"
|
|
||||||
;;
|
|
||||||
rootfstype=*)
|
|
||||||
ROOTFSTYPE="${x#rootfstype=}"
|
|
||||||
;;
|
|
||||||
rootdelay=*)
|
|
||||||
ROOTDELAY="${x#rootdelay=}"
|
|
||||||
case ${ROOTDELAY} in
|
|
||||||
*[![:digit:].]*)
|
|
||||||
ROOTDELAY=
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
resumedelay=*)
|
|
||||||
RESUMEDELAY="${x#resumedelay=}"
|
|
||||||
;;
|
|
||||||
loop=*)
|
|
||||||
LOOP="${x#loop=}"
|
|
||||||
;;
|
|
||||||
loopflags=*)
|
|
||||||
LOOPFLAGS="-o ${x#loopflags=}"
|
|
||||||
;;
|
|
||||||
loopfstype=*)
|
|
||||||
LOOPFSTYPE="${x#loopfstype=}"
|
|
||||||
;;
|
|
||||||
cryptopts=*)
|
|
||||||
cryptopts="${x#cryptopts=}"
|
|
||||||
;;
|
|
||||||
nfsroot=*)
|
|
||||||
NFSROOT="${x#nfsroot=}"
|
|
||||||
;;
|
|
||||||
netboot=*)
|
|
||||||
NETBOOT="${x#netboot=}"
|
|
||||||
;;
|
|
||||||
ip=*)
|
|
||||||
IPOPTS="${x#ip=}"
|
|
||||||
;;
|
|
||||||
hwaddr=*)
|
|
||||||
HWADDR="${x#hwaddr=}"
|
|
||||||
;;
|
|
||||||
boot=*)
|
|
||||||
BOOT=${x#boot=}
|
|
||||||
;;
|
|
||||||
resume=*)
|
|
||||||
RESUME="${x#resume=}"
|
|
||||||
;;
|
|
||||||
resume_offset=*)
|
|
||||||
resume_offset="${x#resume_offset=}"
|
|
||||||
;;
|
|
||||||
noresume)
|
|
||||||
noresume=y
|
|
||||||
;;
|
|
||||||
panic=*)
|
|
||||||
panic="${x#panic=}"
|
|
||||||
case ${panic} in
|
|
||||||
*[![:digit:].]*)
|
|
||||||
panic=
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
quiet)
|
|
||||||
quiet=y
|
|
||||||
;;
|
|
||||||
ro)
|
|
||||||
readonly=y
|
|
||||||
;;
|
|
||||||
rw)
|
|
||||||
readonly=n
|
|
||||||
;;
|
|
||||||
debug)
|
|
||||||
debug=y
|
|
||||||
quiet=n
|
|
||||||
exec >/dev/.initramfs/initramfs.debug 2>&1
|
|
||||||
set -x
|
|
||||||
;;
|
|
||||||
debug=*)
|
|
||||||
debug=y
|
|
||||||
quiet=n
|
|
||||||
set -x
|
|
||||||
;;
|
|
||||||
break=*)
|
|
||||||
break=${x#break=}
|
|
||||||
;;
|
|
||||||
break)
|
|
||||||
break=premount
|
|
||||||
;;
|
|
||||||
blacklist=*)
|
|
||||||
blacklist=${x#blacklist=}
|
|
||||||
;;
|
|
||||||
netconsole=*)
|
|
||||||
netconsole=${x#netconsole=}
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "${noresume}" ]; then
|
|
||||||
export resume=${RESUME}
|
|
||||||
else
|
|
||||||
export noresume
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -n "${netconsole}" ] && modprobe netconsole netconsole=${netconsole}
|
|
||||||
|
|
||||||
maybe_break top
|
|
||||||
|
|
||||||
# export BOOT variable value for compcache,
|
|
||||||
# so we know if we run from casper
|
|
||||||
export BOOT
|
|
||||||
|
|
||||||
# Don't do log messages here to avoid confusing usplash
|
|
||||||
run_scripts /scripts/init-top
|
|
||||||
|
|
||||||
maybe_break modules
|
|
||||||
log_begin_msg "Loading essential drivers..."
|
|
||||||
load_modules
|
|
||||||
log_end_msg
|
|
||||||
|
|
||||||
maybe_break premount
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount"
|
|
||||||
run_scripts /scripts/init-premount
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
maybe_break mount
|
|
||||||
log_begin_msg "Mounting root file system..."
|
|
||||||
. /scripts/${BOOT}
|
|
||||||
parse_numeric ${ROOT}
|
|
||||||
mountroot
|
|
||||||
log_end_msg
|
|
||||||
|
|
||||||
maybe_break bottom
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
|
|
||||||
run_scripts /scripts/init-bottom
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
# Move virtual filesystems over to the real filesystem
|
|
||||||
mount -n -o move /sys ${rootmnt}/sys
|
|
||||||
mount -n -o move /proc ${rootmnt}/proc
|
|
||||||
|
|
||||||
# Check init bootarg
|
|
||||||
if [ -n "${init}" ] && [ ! -x "${rootmnt}${init}" ]; then
|
|
||||||
echo "Target filesystem doesn't have ${init}."
|
|
||||||
init=
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Search for valid init
|
|
||||||
if [ -z "${init}" ] ; then
|
|
||||||
for init in /sbin/init /etc/init /bin/init /bin/sh; do
|
|
||||||
if [ ! -x "${rootmnt}${init}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
break
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# No init on rootmount
|
|
||||||
if [ ! -x "${rootmnt}${init}" ]; then
|
|
||||||
panic "No init found. Try passing init= bootarg."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Confuses /etc/init.d/rc
|
|
||||||
if [ -n ${debug} ]; then
|
|
||||||
unset debug
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Chain to real filesystem
|
|
||||||
maybe_break init
|
|
||||||
exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
|
|
||||||
panic "Could not execute run-init."
|
|
|
@ -1,10 +0,0 @@
|
||||||
# List of modules that you want to include in your initramfs.
|
|
||||||
#
|
|
||||||
# Syntax: module_name [args ...]
|
|
||||||
#
|
|
||||||
# You must run update-initramfs(8) to effect this change.
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
#
|
|
||||||
# raid1
|
|
||||||
# sd_mod
|
|
|
@ -1,420 +0,0 @@
|
||||||
# -*- shell-script -*-
|
|
||||||
|
|
||||||
_log_msg()
|
|
||||||
{
|
|
||||||
if [ "$quiet" = "y" ]; then return; fi
|
|
||||||
echo "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_success_msg()
|
|
||||||
{
|
|
||||||
_log_msg "Success: $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_failure_msg()
|
|
||||||
{
|
|
||||||
_log_msg "Failure: $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_warning_msg()
|
|
||||||
{
|
|
||||||
_log_msg "Warning: $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_begin_msg()
|
|
||||||
{
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "TEXT $@"
|
|
||||||
fi
|
|
||||||
_log_msg "Begin: $@ ..."
|
|
||||||
}
|
|
||||||
|
|
||||||
log_end_msg()
|
|
||||||
{
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "SUCCESS ok"
|
|
||||||
fi
|
|
||||||
_log_msg "Done."
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add failure hook
|
|
||||||
add_mountroot_fail_hook()
|
|
||||||
{
|
|
||||||
mkdir -p /tmp/mountroot-fail-hooks.d
|
|
||||||
ln -s "$0" /tmp/mountroot-fail-hooks.d/"$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Run failure hooks.
|
|
||||||
# When a failure hook exits "1", it has not done anything to correct the
|
|
||||||
# system. Exiting "0" means that something has been attempted to resolve
|
|
||||||
# the lack of a root filesystem.
|
|
||||||
# Hooks are run in lexigraphical order, and are responsible for removing
|
|
||||||
# themselves if they should not re-run in a later cycle. When one exits
|
|
||||||
# "0", the stack is stopped, so the caller can return to the main rootfs
|
|
||||||
# wait loop.
|
|
||||||
try_failure_hooks()
|
|
||||||
{
|
|
||||||
local hook
|
|
||||||
|
|
||||||
# Disable usplash so text from hooks can be seen
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "QUIT"
|
|
||||||
fi
|
|
||||||
chvt 1
|
|
||||||
|
|
||||||
for hook in /tmp/mountroot-fail-hooks.d/*; do
|
|
||||||
if [ -x ${hook} ] && ${hook} mountfail; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
panic()
|
|
||||||
{
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "QUIT"
|
|
||||||
fi
|
|
||||||
chvt 1
|
|
||||||
|
|
||||||
# Disallow console access
|
|
||||||
if [ -n "${panic}" ]; then
|
|
||||||
sleep ${panic}
|
|
||||||
reboot
|
|
||||||
fi
|
|
||||||
|
|
||||||
modprobe i8042
|
|
||||||
modprobe atkbd
|
|
||||||
|
|
||||||
run_scripts /scripts/panic
|
|
||||||
|
|
||||||
echo $@
|
|
||||||
PS1='(initramfs) ' /bin/sh -i </dev/console >/dev/console 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
maybe_break()
|
|
||||||
{
|
|
||||||
if echo "${break}" | egrep -q "(,|^)$1(,|$)"; then
|
|
||||||
panic "Spawning shell within the initramfs"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
render()
|
|
||||||
{
|
|
||||||
eval "echo -n \${$@}"
|
|
||||||
}
|
|
||||||
|
|
||||||
set_initlist()
|
|
||||||
{
|
|
||||||
unset initlist
|
|
||||||
for si_x in ${initdir}/*; do
|
|
||||||
# skip empty dirs without warning
|
|
||||||
[ "${si_x}" = "${initdir}/*" ] && return
|
|
||||||
|
|
||||||
# only allow variable name chars
|
|
||||||
case ${si_x#${initdir}/} in
|
|
||||||
*[![:alnum:]_]*)
|
|
||||||
[ "${verbose}" = "y" ] \
|
|
||||||
&& echo "$si_x ignored: not alphanumeric or '_' file"
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# skip non executable scripts
|
|
||||||
if [ ! -x ${si_x} ]; then
|
|
||||||
[ "${verbose}" = "y" ] \
|
|
||||||
&& echo "$si_x ignored: not executable"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# skip directories
|
|
||||||
if [ -d ${si_x} ]; then
|
|
||||||
[ "${verbose}" = "y" ] \
|
|
||||||
&& echo "$si_x ignored: a directory"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
initlist="${initlist} ${si_x#${initdir}/}"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce_satisfied()
|
|
||||||
{
|
|
||||||
deplist="$(render array_${1})"
|
|
||||||
unset tmpdeplist
|
|
||||||
for rs_y in ${deplist}; do
|
|
||||||
# check if there are alternatives
|
|
||||||
case ${rs_y} in
|
|
||||||
*\|*)
|
|
||||||
OLD_IFS="$IFS"
|
|
||||||
IFS="|"
|
|
||||||
for rs_z in ${rs_y}; do
|
|
||||||
IFS="$OLD_IFS"
|
|
||||||
# only allow variable name chars
|
|
||||||
case ${rs_z} in
|
|
||||||
*[![:alnum:]_]*)
|
|
||||||
IFS="|"
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
# skip non executable scripts
|
|
||||||
if [ ! -x ${initdir}/${rs_z} ]; then
|
|
||||||
IFS="|"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# skip directories
|
|
||||||
if [ -d ${initdir}/${rs_z} ]; then
|
|
||||||
IFS="|"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
tmpdeplist="${tmpdeplist} ${rs_z}"
|
|
||||||
break
|
|
||||||
done
|
|
||||||
IFS="$OLD_IFS"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
case ${rs_y} in
|
|
||||||
*[![:alnum:]_]*)
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if [ ! -x ${initdir}/${rs_y} ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
if [ -d ${initdir}/${rs_y} ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
tmpdeplist="${tmpdeplist} ${rs_y}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
deplist=${tmpdeplist}
|
|
||||||
for rs_x in ${runlist}; do
|
|
||||||
pop_list_item ${rs_x} ${deplist}
|
|
||||||
deplist=${tmppop}
|
|
||||||
done
|
|
||||||
eval array_${1}=\"${deplist}\"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_prereqs()
|
|
||||||
{
|
|
||||||
set_initlist
|
|
||||||
for gp_x in ${initlist}; do
|
|
||||||
tmp=$(${initdir}/${gp_x} prereqs)
|
|
||||||
eval array_${gp_x}=\"${tmp}\"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
count_unsatisfied()
|
|
||||||
{
|
|
||||||
set -- ${@}
|
|
||||||
return ${#}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Removes $1 from initlist
|
|
||||||
pop_list_item()
|
|
||||||
{
|
|
||||||
item=${1}
|
|
||||||
shift
|
|
||||||
set -- ${@}
|
|
||||||
unset tmppop
|
|
||||||
# Iterate
|
|
||||||
for pop in ${@}; do
|
|
||||||
if [ ${pop} = ${item} ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
tmppop="${tmppop} ${pop}"
|
|
||||||
done
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# This function generates the runlist, so we clear it first.
|
|
||||||
reduce_prereqs()
|
|
||||||
{
|
|
||||||
unset runlist
|
|
||||||
set -- ${initlist}
|
|
||||||
i=$#
|
|
||||||
# Loop until there's no more in the queue to loop through
|
|
||||||
while [ ${i} -ne 0 ]; do
|
|
||||||
oldi=${i}
|
|
||||||
for rp_x in ${initlist}; do
|
|
||||||
reduce_satisfied ${rp_x}
|
|
||||||
count_unsatisfied $(render array_${rp_x})
|
|
||||||
cnt=${?}
|
|
||||||
if [ ${cnt} -eq 0 ]; then
|
|
||||||
runlist="${runlist} ${rp_x}"
|
|
||||||
pop_list_item ${rp_x} ${initlist}
|
|
||||||
initlist=${tmppop}
|
|
||||||
i=$((${i} - 1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ ${i} -eq ${oldi} ]; then
|
|
||||||
panic "PANIC: Circular dependancy. Exiting."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
get_prereq_pairs()
|
|
||||||
{
|
|
||||||
set_initlist
|
|
||||||
for gp_x in ${initlist}; do
|
|
||||||
echo ${gp_x} ${gp_x}
|
|
||||||
prereqs=$(${initdir}/${gp_x} prereqs)
|
|
||||||
for prereq in ${prereqs}; do
|
|
||||||
echo ${prereq} ${gp_x}
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
call_scripts()
|
|
||||||
{
|
|
||||||
for cs_x in ${runlist}; do
|
|
||||||
[ -f ${initdir}/${cs_x} ] || continue
|
|
||||||
if [ x"$1" = "xoptional" ]; then
|
|
||||||
option=$(sed '/^OPTION=/!d;$d;s/^OPTION=//;s/[[:space:]]*$//' "${initdir}/${cs_x}")
|
|
||||||
[ -z "${option}" ] || eval test -n \"\${$option}\" -a \"\${$option}\" != \"n\" || continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# mkinitramfs verbose output
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Calling hook ${cs_x}"
|
|
||||||
fi
|
|
||||||
${initdir}/${cs_x}
|
|
||||||
# allow boot scripts to modify exported boot paramaters
|
|
||||||
if [ -e /conf/param.conf ]; then
|
|
||||||
. /conf/param.conf
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
run_scripts()
|
|
||||||
{
|
|
||||||
initdir=${1}
|
|
||||||
[ ! -d ${initdir} ] && return
|
|
||||||
|
|
||||||
if [ -f ${initdir}/ORDER ]; then
|
|
||||||
. ${initdir}/ORDER
|
|
||||||
elif [ -x /usr/bin/tsort ]; then
|
|
||||||
runlist=$(get_prereq_pairs | tsort)
|
|
||||||
call_scripts $2
|
|
||||||
else
|
|
||||||
get_prereqs
|
|
||||||
reduce_prereqs
|
|
||||||
call_scripts $2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
cache_run_scripts()
|
|
||||||
{
|
|
||||||
DESTDIR=${1}
|
|
||||||
scriptdir=${2}
|
|
||||||
initdir=${DESTDIR}${scriptdir}
|
|
||||||
[ ! -d ${initdir} ] && return
|
|
||||||
|
|
||||||
runlist=$(get_prereq_pairs | tsort)
|
|
||||||
for crs_x in ${runlist}; do
|
|
||||||
[ -f ${initdir}/${crs_x} ] || continue
|
|
||||||
echo "${scriptdir}/${crs_x}" >> ${initdir}/ORDER
|
|
||||||
echo "[ -e /conf/param.conf ] && . /conf/param.conf" >> ${initdir}/ORDER
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Load custom modules first
|
|
||||||
load_modules()
|
|
||||||
{
|
|
||||||
if [ -e /conf/modules ]; then
|
|
||||||
cat /conf/modules | while read m; do
|
|
||||||
# Skip empty lines
|
|
||||||
if [ -z "$m" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# Skip comments - d?ash removes whitespace prefix
|
|
||||||
com=$(printf "%.1s" "${m}")
|
|
||||||
if [ "$com" = "#" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
modprobe $m
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# lilo compatibility
|
|
||||||
parse_numeric() {
|
|
||||||
case $1 in
|
|
||||||
"")
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
/*)
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
*:*)
|
|
||||||
minor=${1#*:}
|
|
||||||
major=${1%:*}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
value=$(( 0x${1} ))
|
|
||||||
minor=$(( ${value} % 256 ))
|
|
||||||
major=$(( ${value} / 256 ))
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
mknod -m 600 /dev/root b ${major} ${minor}
|
|
||||||
ROOT=/dev/root
|
|
||||||
}
|
|
||||||
|
|
||||||
configure_networking()
|
|
||||||
{
|
|
||||||
# networking already configured thus bail out
|
|
||||||
[ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0
|
|
||||||
|
|
||||||
if [ "${HWADDR}" ]; then
|
|
||||||
# select interface by MAC address
|
|
||||||
HWADDR="$(echo "${HWADDR}" | tr A-Z- a-z:)"
|
|
||||||
local iface
|
|
||||||
for iface in /sys/class/net/*; do
|
|
||||||
[ -f "$iface/address" ] || continue
|
|
||||||
if [ "$(cat "$iface/address")" = "${HWADDR}" ]; then
|
|
||||||
DEVICE="${iface#/sys/class/net/}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# support ip options see linux sources
|
|
||||||
# Documentation/filesystems/nfsroot.txt
|
|
||||||
case ${IPOPTS} in
|
|
||||||
none|off)
|
|
||||||
# Do nothing
|
|
||||||
;;
|
|
||||||
""|on|any)
|
|
||||||
# Bring up device
|
|
||||||
ipconfig -t 60 ${DEVICE}
|
|
||||||
;;
|
|
||||||
dhcp|bootp|rarp|both)
|
|
||||||
ipconfig -t 60 -c ${IPOPTS} -d ${DEVICE}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
ipconfig -t 60 -d $IPOPTS
|
|
||||||
|
|
||||||
# grab device entry from ip option
|
|
||||||
NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
|
|
||||||
if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then
|
|
||||||
NEW_DEVICE=${NEW_DEVICE%:*}
|
|
||||||
else
|
|
||||||
# wrong parse, possibly only a partial string
|
|
||||||
NEW_DEVICE=
|
|
||||||
fi
|
|
||||||
if [ -n "${NEW_DEVICE}" ]; then
|
|
||||||
DEVICE="${NEW_DEVICE}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# source ipconfig output
|
|
||||||
if [ -n "${DEVICE}" ]; then
|
|
||||||
# source specific bootdevice
|
|
||||||
. /tmp/net-${DEVICE}.conf
|
|
||||||
else
|
|
||||||
# source any interface as not exaclty specified
|
|
||||||
. /tmp/net-*.conf
|
|
||||||
fi
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="udev"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -f ${rootmnt}/dev/.initramfs/plymouth.pid ]
|
|
||||||
then
|
|
||||||
/bin/plymouth update-root-fs --new-root-dir=${rootmnt}
|
|
||||||
fi
|
|
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs init-bottom script for udev
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# Stop udevd, we'll miss a few events while we run init, but we catch up
|
|
||||||
pkill udevd
|
|
||||||
|
|
||||||
# Move /dev to the real filesystem
|
|
||||||
mount -n -o move /dev ${rootmnt}/dev
|
|
|
@ -1,41 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# init-premount script for lvm2.
|
|
||||||
|
|
||||||
PREREQS="udev mdadm"
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo $PREREQS
|
|
||||||
}
|
|
||||||
|
|
||||||
mountroot_fail()
|
|
||||||
{
|
|
||||||
if ! /sbin/lvm vgscan >/dev/null 2>&1 ; then
|
|
||||||
cat <<EOF
|
|
||||||
There appears to be one or more degraded LVM volumes, and your root device may
|
|
||||||
depend on the LVM volumes being online. One or more of the following LVM volumes
|
|
||||||
are degraded:
|
|
||||||
EOF
|
|
||||||
/sbin/lvm vgscan
|
|
||||||
fi
|
|
||||||
# Nothing has been fixed on the system, so "fail" our recovery attempt.
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
mountfail)
|
|
||||||
mountroot_fail
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /scripts/functions
|
|
||||||
|
|
||||||
add_mountroot_fail_hook "20-lvm2"
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if grep all_generic_ide /proc/cmdline 2>/dev/null; then
|
|
||||||
modprobe ata_generic all_generic_ide=1
|
|
||||||
fi
|
|
|
@ -1,34 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# blacklist vga16fb when vga= or video= given
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case ${x} in
|
|
||||||
vga=*|video=*)
|
|
||||||
echo "blacklist vga16fb" >> /etc/modprobe.d/initramfs
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# sanity check
|
|
||||||
[ -z "${blacklist}" ] && exit 0
|
|
||||||
|
|
||||||
# write blacklist to modprobe.d
|
|
||||||
IFS=','
|
|
||||||
for b in ${blacklist}; do
|
|
||||||
echo "blacklist $b" >> /etc/modprobe.d/initramfs
|
|
||||||
done
|
|
|
@ -1,83 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
# A crude much-simplified clone of setupcon for use in the initramfs.
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="framebuffer"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /etc/default/console-setup
|
|
||||||
|
|
||||||
[ "$ACTIVE_CONSOLES" ] || exit 0
|
|
||||||
|
|
||||||
if [ "$VERBOSE_OUTPUT" = yes ]; then
|
|
||||||
verbose=
|
|
||||||
else
|
|
||||||
verbose='>/dev/null 2>&1'
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in 1 2 3 4 5 6; do
|
|
||||||
[ -c /dev/tty$i ] || mknod /dev/tty$i c 4 $i
|
|
||||||
done
|
|
||||||
|
|
||||||
for console in $ACTIVE_CONSOLES; do
|
|
||||||
[ -w $console ] || continue
|
|
||||||
|
|
||||||
if [ "$CHARMAP" = UTF-8 ] || [ -z "$ACM$CHARMAP" ]; then
|
|
||||||
printf '\033%%G' >$console
|
|
||||||
else
|
|
||||||
printf '\033%%@' >$console
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$FONT" ]; then
|
|
||||||
FONT="/etc/console-setup/${FONT##*/}"
|
|
||||||
FONT="${FONT%.gz}"
|
|
||||||
else
|
|
||||||
FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
|
|
||||||
fi
|
|
||||||
if [ -f "$FONT" ]; then
|
|
||||||
if type consolechars >/dev/null 2>&1; then
|
|
||||||
eval consolechars -v --tty=$console -f "$FONT" $verbose
|
|
||||||
elif type setfont >/dev/null 2>&1; then
|
|
||||||
eval setfont -v -C $console "$FONT" $verbose
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ACM" ]; then
|
|
||||||
ACM="/etc/console-setup/${ACM##*/}"
|
|
||||||
ACM="${ACM%.gz}"
|
|
||||||
else
|
|
||||||
ACM="/etc/console-setup/$CHARMAP.acm"
|
|
||||||
fi
|
|
||||||
if [ -f "$ACM" ]; then
|
|
||||||
if type consolechars >/dev/null 2>&1; then
|
|
||||||
eval consolechars -v --tty=$console --acm "$ACM" \
|
|
||||||
$verbose
|
|
||||||
elif type setfont >/dev/null 2>&1; then
|
|
||||||
eval setfont -v -C "$console" -m "$ACM" $verbose
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if type kbd_mode >/dev/null 2>&1; then
|
|
||||||
if [ "$CHARMAP" = UTF-8 ] || [ -z "$ACM" ]; then
|
|
||||||
kbd_mode -u <$console
|
|
||||||
else
|
|
||||||
kbd_mode -a <$console
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -f /etc/console-setup/cached.kmap.gz ] && type loadkeys >/dev/null; then
|
|
||||||
eval loadkeys /etc/console-setup/cached.kmap.gz $verbose
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,104 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="udev"
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# The options part of the kernel "video=" argument (i.e. everyting
|
|
||||||
# after "video=<fbdriver>:") has very inconsistent rules.
|
|
||||||
#
|
|
||||||
# Generally the following applies:
|
|
||||||
# 1) options are comma-separated
|
|
||||||
# 2) options can be in either of these three forms:
|
|
||||||
# <arg>=<value>, <arg>:<value>, <boolean-arg>.
|
|
||||||
# 3) the "mode" option has the form <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m]
|
|
||||||
# and may or may not start with "mode="
|
|
||||||
#
|
|
||||||
# When the options are used with modules, they need to be space-separated
|
|
||||||
# and the following conversions are needed:
|
|
||||||
# <arg>:<value> -> <arg>=<value>
|
|
||||||
# <boolean-arg> -> <boolean-arg>=1
|
|
||||||
# <modevalue> -> mode=<modevalue>
|
|
||||||
parse_video_opts()
|
|
||||||
{
|
|
||||||
local OPTS="$1"
|
|
||||||
local IFS=","
|
|
||||||
|
|
||||||
# Must be a line like video=<fbdriver>:<opt1>,[opt2]...
|
|
||||||
if [ "${OPTS}" = "${OPTS%%:*}" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
OPTS="${OPTS#*:}"
|
|
||||||
for opt in ${OPTS}; do
|
|
||||||
# Already in the "<arg>=<value>" form
|
|
||||||
if [ "${opt}" != "${opt#*=}" ]; then
|
|
||||||
echo -n "$opt "
|
|
||||||
# In the "<arg>:<value>" form
|
|
||||||
elif [ "${opt}" != "${opt#*:}" ]; then
|
|
||||||
echo -n "${opt%:*}=${opt#*:} "
|
|
||||||
# Presumably a modevalue without the "mode=" prefix
|
|
||||||
elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then
|
|
||||||
echo -n "mode=$opt "
|
|
||||||
# Presumably a boolean
|
|
||||||
else
|
|
||||||
echo -n "${opt}=1 "
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
FB=""
|
|
||||||
OPTS=""
|
|
||||||
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case ${x} in
|
|
||||||
vga=*)
|
|
||||||
FB="vesafb";
|
|
||||||
OPTS="";
|
|
||||||
;;
|
|
||||||
video=*)
|
|
||||||
FB=${x#*=}
|
|
||||||
FB="${FB%%:*}"
|
|
||||||
OPTS="$(parse_video_opts "${x}")"
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Map command line name to module name
|
|
||||||
case ${FB} in
|
|
||||||
matroxfb)
|
|
||||||
FB=matroxfb_base
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -n "${FB}" ]; then
|
|
||||||
# Some framebuffer devices need character devices :-/
|
|
||||||
udevadm settle
|
|
||||||
MODPROBE_OPTIONS=-q modprobe ${FB} ${OPTS}
|
|
||||||
# Wait for the framebuffer devices to be ready
|
|
||||||
udevadm settle
|
|
||||||
else
|
|
||||||
# If we have no graphics devices yet, wait for udev to settle
|
|
||||||
[ -d /sys/class/graphics/fbcon ] || udevadm settle
|
|
||||||
[ -d /sys/class/graphics/fb0 ] || udevadm settle
|
|
||||||
[ -d /sys/class/drm/card0 ] || udevadm settle
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Force fb mode via /sys interface
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case ${x} in
|
|
||||||
fbmode=*)
|
|
||||||
MODE=${x#*=}
|
|
||||||
echo "$MODE" > /sys/class/graphics/fb0/mode
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ=""
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
OPTS="-q"
|
|
||||||
|
|
||||||
# Should terminal be in UTF8 mode?
|
|
||||||
if [ -x /bin/kbd_mode ]; then
|
|
||||||
/bin/kbd_mode -u
|
|
||||||
OPTS="${OPTS} -u"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Load custom keymap
|
|
||||||
if [ -x /bin/loadkeys -a -r /etc/boottime.kmap.gz ]; then
|
|
||||||
loadkeys ${OPTS} /etc/boottime.kmap.gz
|
|
||||||
fi
|
|
|
@ -1,20 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="framebuffer console_setup brltty"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
printf '\033[?25l' > /dev/tty7
|
|
||||||
/sbin/plymouthd --mode=boot --attach-to-session --pid-file=/dev/.initramfs/plymouth.pid
|
|
||||||
/bin/plymouth show-splash
|
|
|
@ -1,30 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs init-top script for udev
|
|
||||||
|
|
||||||
PREREQ="all_generic_ide blacklist"
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# It's all over netlink now
|
|
||||||
echo "" > /proc/sys/kernel/hotplug
|
|
||||||
|
|
||||||
# Start the udev daemon to process events
|
|
||||||
/sbin/udevd --daemon --resolve-names=never
|
|
||||||
|
|
||||||
# Iterate sysfs and fire off everything; if we include a rule for it then
|
|
||||||
# it'll get handled; otherwise it'll get handled later when we do this again
|
|
||||||
# in the main boot sequence.
|
|
||||||
( /sbin/udevadm trigger --subsystem-match=block; \
|
|
||||||
/sbin/udevadm trigger --subsystem-nomatch=block; ) &
|
|
|
@ -1,131 +0,0 @@
|
||||||
# Local filesystem mounting -*- shell-script -*-
|
|
||||||
|
|
||||||
# Parameter: Where to mount the filesystem
|
|
||||||
mountroot ()
|
|
||||||
{
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top"
|
|
||||||
run_scripts /scripts/local-top
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
while [ -z "${FSTYPE}" ]; do
|
|
||||||
FSTYPE=$(wait-for-root "${ROOT}" ${ROOTDELAY:-30})
|
|
||||||
|
|
||||||
# Run failure hooks, hoping one of them can fix up the system
|
|
||||||
# and we can restart the wait loop. If they all fail, abort
|
|
||||||
# and move on to the panic handler and shell.
|
|
||||||
if [ -z "${FSTYPE}" ] && ! try_failure_hooks; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# We've given up, but we'll let the user fix matters if they can
|
|
||||||
while [ -z "${FSTYPE}" -a ! -e "${ROOT}" ]; do
|
|
||||||
# give hint about renamed root
|
|
||||||
case "${ROOT}" in
|
|
||||||
/dev/hd*)
|
|
||||||
suffix="${ROOT#/dev/hd}"
|
|
||||||
major="${suffix%[[:digit:]]}"
|
|
||||||
major="${major%[[:digit:]]}"
|
|
||||||
if [ -d "/sys/block/sd${major}" ]; then
|
|
||||||
echo "WARNING bootdevice may be renamed. Try root=/dev/sd${suffix}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
/dev/sd*)
|
|
||||||
suffix="${ROOT#/dev/sd}"
|
|
||||||
major="${suffix%[[:digit:]]}"
|
|
||||||
major="${major%[[:digit:]]}"
|
|
||||||
if [ -d "/sys/block/hd${major}" ]; then
|
|
||||||
echo "WARNING bootdevice may be renamed. Try root=/dev/hd${suffix}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo "Gave up waiting for root device. Common problems:"
|
|
||||||
echo " - Boot args (cat /proc/cmdline)"
|
|
||||||
echo " - Check rootdelay= (did the system wait long enough?)"
|
|
||||||
echo " - Check root= (did the system wait for the right device?)"
|
|
||||||
echo " - Missing modules (cat /proc/modules; ls /dev)"
|
|
||||||
panic "ALERT! ${ROOT} does not exist. Dropping to a shell!"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Get the root filesystem type if not set
|
|
||||||
if [ -z "${ROOTFSTYPE}" ]; then
|
|
||||||
[ -n "${FSTYPE}" ] || FSTYPE=$(/sbin/blkid -s TYPE -o value "${ROOT}")
|
|
||||||
ROOTFSTYPE="${FSTYPE}"
|
|
||||||
else
|
|
||||||
FSTYPE="${ROOTFSTYPE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount"
|
|
||||||
run_scripts /scripts/local-premount
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
if [ ${readonly} = y ] && \
|
|
||||||
[ -z "$LOOP" ]; then
|
|
||||||
roflag=-r
|
|
||||||
else
|
|
||||||
roflag=-w
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXME This has no error checking
|
|
||||||
[ -n "${FSTYPE}" ] && modprobe ${FSTYPE}
|
|
||||||
|
|
||||||
# FIXME This has no error checking
|
|
||||||
# Mount root
|
|
||||||
mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
|
|
||||||
mountroot_status="$?"
|
|
||||||
if [ "$LOOP" ]; then
|
|
||||||
if [ "$mountroot_status" != 0 ]; then
|
|
||||||
if [ ${FSTYPE} = ntfs ] || [ ${FSTYPE} = vfat ]; then
|
|
||||||
panic "
|
|
||||||
Could not mount the partition ${ROOT}.
|
|
||||||
This could also happen if the file system is not clean because of an operating
|
|
||||||
system crash, an interrupted boot process, an improper shutdown, or unplugging
|
|
||||||
of a removable device without first unmounting or ejecting it. To fix this,
|
|
||||||
simply reboot into Windows, let it fully start, log in, run 'chkdsk /r', then
|
|
||||||
gracefully shut down and reboot back into Windows. After this you should be
|
|
||||||
able to reboot again and resume the installation.
|
|
||||||
(filesystem = ${FSTYPE}, error code = $mountroot_status)
|
|
||||||
"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p /host
|
|
||||||
mount -o move ${rootmnt} /host
|
|
||||||
|
|
||||||
while [ ! -e "/host/${LOOP#/}" ]; do
|
|
||||||
panic "ALERT! /host/${LOOP#/} does not exist. Dropping to a shell!"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Get the loop filesystem type if not set
|
|
||||||
if [ -z "${LOOPFSTYPE}" ]; then
|
|
||||||
eval $(fstype < "/host/${LOOP#/}")
|
|
||||||
else
|
|
||||||
FSTYPE="${LOOPFSTYPE}"
|
|
||||||
fi
|
|
||||||
if [ "$FSTYPE" = "unknown" ] && [ -x /sbin/blkid ]; then
|
|
||||||
FSTYPE=$(/sbin/blkid -s TYPE -o value "/host/${LOOP#/}")
|
|
||||||
[ -z "$FSTYPE" ] && FSTYPE="unknown"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ${readonly} = y ]; then
|
|
||||||
roflag=-r
|
|
||||||
else
|
|
||||||
roflag=-w
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXME This has no error checking
|
|
||||||
modprobe loop
|
|
||||||
modprobe ${FSTYPE}
|
|
||||||
|
|
||||||
# FIXME This has no error checking
|
|
||||||
mount ${roflag} -o loop -t ${FSTYPE} ${LOOPFLAGS} "/host/${LOOP#/}" ${rootmnt}
|
|
||||||
|
|
||||||
if [ -d ${rootmnt}/host ]; then
|
|
||||||
mount -o move /host ${rootmnt}/host
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-bottom"
|
|
||||||
run_scripts /scripts/local-bottom
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ "$ROOTFSTYPE" = ntfs ] || [ "$ROOTFSTYPE" = ntfs-3g ] || \
|
|
||||||
[ "$LOOPFSTYPE" = ntfs ] || [ "$LOOPFSTYPE" = ntfs-3g ]; then
|
|
||||||
mkdir -p /dev/.initramfs/varrun
|
|
||||||
pidof mount.ntfs >> /dev/.initramfs/varrun/sendsigs.omit
|
|
||||||
pidof mount.ntfs-3g >> /dev/.initramfs/varrun/sendsigs.omit
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,64 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs local-premount script for fixrtc
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# use the fixrtc cmdline option in your bootloader to
|
|
||||||
# automatically set the hardware clock to the date of
|
|
||||||
# the last mount of your root filesystem to avoid fsck
|
|
||||||
# to get confused by the superblock being in the future
|
|
||||||
|
|
||||||
BROKEN_CLOCK=""
|
|
||||||
ROOTDEV=""
|
|
||||||
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case ${x} in
|
|
||||||
root=*)
|
|
||||||
value=${x#*=}
|
|
||||||
|
|
||||||
# Find the device node path depending on the form of root= :
|
|
||||||
|
|
||||||
case ${value} in
|
|
||||||
UUID=*)
|
|
||||||
ROOTDEV=/dev/disk/by-uuid/${value#UUID=}
|
|
||||||
;;
|
|
||||||
LABEL=*)
|
|
||||||
ROOTDEV=/dev/disk/by-label/${value#LABEL=}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
ROOTDEV=${value}
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
fixrtc)
|
|
||||||
BROKEN_CLOCK=1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -n "$BROKEN_CLOCK" -a -n "$ROOTDEV" ];then
|
|
||||||
ROOTDISK=$(readlink -f "$ROOTDEV") &&
|
|
||||||
|
|
||||||
TIMESTR=$(dumpe2fs -h "$ROOTDISK" 2>/dev/null|grep "Last mount time") &&
|
|
||||||
TIME=${TIMESTR#*:} &&
|
|
||||||
|
|
||||||
date --set="${TIME} 1 minute" >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# This script is best-effort. If we couldn't fudge the clock as desired,
|
|
||||||
# just try to carry on boot anyway:
|
|
||||||
# It will probably fail, but we won't have made the situation any worse.
|
|
||||||
exit 0
|
|
|
@ -1,14 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ "$ROOTFSTYPE" = ntfs ] || [ "$ROOTFSTYPE" = ntfs-3g ] || \
|
|
||||||
[ "$LOOPFSTYPE" = ntfs ] || [ "$LOOPFSTYPE" = ntfs-3g ]; then
|
|
||||||
modprobe fuse
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,75 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. ./scripts/functions
|
|
||||||
|
|
||||||
if [ -z "${resume}" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $resume in
|
|
||||||
LABEL=*)
|
|
||||||
resume="${resume#LABEL=}"
|
|
||||||
|
|
||||||
# support any / in LABEL= path (escape to \x2f)
|
|
||||||
case "${resume}" in
|
|
||||||
*[/]*)
|
|
||||||
if [ -x "$(command -v sed)" ]; then
|
|
||||||
resume="$(echo ${resume} | sed 's,/,\\x2f,g')"
|
|
||||||
else
|
|
||||||
if [ "${resume}" != "${resume#/}" ]; then
|
|
||||||
resume="\x2f${resume#/}"
|
|
||||||
fi
|
|
||||||
if [ "${resume}" != "${resume%/}" ]; then
|
|
||||||
resume="${resume%/}\x2f"
|
|
||||||
fi
|
|
||||||
IFS='/'
|
|
||||||
newresume=
|
|
||||||
for s in $resume; do
|
|
||||||
if [ -z "${newresume}" ]; then
|
|
||||||
newresume="${s}"
|
|
||||||
else
|
|
||||||
newresume="${newresume}\\x2f${s}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
unset IFS
|
|
||||||
resume="${newresume}"
|
|
||||||
fi
|
|
||||||
esac
|
|
||||||
resume="/dev/disk/by-label/${resume}"
|
|
||||||
;;
|
|
||||||
UUID=*)
|
|
||||||
resume="/dev/disk/by-uuid/${resume#UUID=}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
SWAPTYPE=$(wait-for-root "${resume}" ${RESUMEDELAY:-5})
|
|
||||||
|
|
||||||
case "${SWAPTYPE}" in
|
|
||||||
swsuspend|s1suspend|s2suspend|ulsuspend|tuxonice)
|
|
||||||
if [ -x /bin/plymouth ] && plymouth --ping; then
|
|
||||||
plymouth message --text="Resuming from $resume"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# hardcode path, uswsusp ships an resume binary too
|
|
||||||
if [ -n "${resume_offset}" ]; then
|
|
||||||
/bin/resume ${resume} ${resume_offset} >/dev/null 2>&1
|
|
||||||
else
|
|
||||||
/bin/resume ${resume} >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,83 +0,0 @@
|
||||||
# NFS filesystem mounting -*- shell-script -*-
|
|
||||||
|
|
||||||
# FIXME This needs error checking
|
|
||||||
|
|
||||||
retry_nr=0
|
|
||||||
|
|
||||||
# parse nfs bootargs and mount nfs
|
|
||||||
do_nfsmount()
|
|
||||||
{
|
|
||||||
|
|
||||||
configure_networking
|
|
||||||
|
|
||||||
# get nfs root from dhcp
|
|
||||||
if [ "x${NFSROOT}" = "xauto" ]; then
|
|
||||||
# check if server ip is part of dhcp root-path
|
|
||||||
if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then
|
|
||||||
NFSROOT=${ROOTSERVER}:${ROOTPATH}
|
|
||||||
else
|
|
||||||
NFSROOT=${ROOTPATH}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
|
|
||||||
elif [ -n "${NFSROOT}" ]; then
|
|
||||||
# nfs options are an optional arg
|
|
||||||
if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then
|
|
||||||
NFSOPTS="-o ${NFSROOT#*,}"
|
|
||||||
fi
|
|
||||||
NFSROOT=${NFSROOT%%,*}
|
|
||||||
if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then
|
|
||||||
NFSROOT=${ROOTSERVER}:${NFSROOT}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "${NFSOPTS}" ]; then
|
|
||||||
NFSOPTS="-o retrans=10"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-premount"
|
|
||||||
run_scripts /scripts/nfs-premount
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
if [ ${readonly} = y ]; then
|
|
||||||
roflag="-o ro"
|
|
||||||
else
|
|
||||||
roflag="-o rw"
|
|
||||||
fi
|
|
||||||
|
|
||||||
nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt}
|
|
||||||
}
|
|
||||||
|
|
||||||
# NFS root mounting
|
|
||||||
mountroot()
|
|
||||||
{
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top"
|
|
||||||
run_scripts /scripts/nfs-top
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
modprobe nfs
|
|
||||||
# For DHCP
|
|
||||||
modprobe af_packet
|
|
||||||
|
|
||||||
# Default delay is around 180s
|
|
||||||
# FIXME: add usplash_write info
|
|
||||||
if [ -z "${ROOTDELAY}" ]; then
|
|
||||||
delay=180
|
|
||||||
else
|
|
||||||
delay=${ROOTDELAY}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# loop until nfsmount succeds
|
|
||||||
while [ ${retry_nr} -lt ${delay} ] && [ ! -e ${rootmnt}${init} ]; do
|
|
||||||
[ ${retry_nr} -gt 0 ] && \
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount"
|
|
||||||
do_nfsmount
|
|
||||||
retry_nr=$(( ${retry_nr} + 1 ))
|
|
||||||
[ ! -e ${rootmnt}${init} ] && /bin/sleep 1
|
|
||||||
[ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg
|
|
||||||
done
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
|
|
||||||
run_scripts /scripts/nfs-bottom
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs nfs-top script for udev
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# Each call to udevsettle can take up to three minutes
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "TIMEOUT 360"
|
|
||||||
trap "/sbin/usplash_write 'TIMEOUT 15'" 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# We need to wait for the network card drivers to be loaded
|
|
||||||
/sbin/udevadm settle
|
|
|
@ -1,82 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
# A crude much-simplified clone of setupcon for use in the initramfs.
|
|
||||||
|
|
||||||
PREREQ="framebuffer"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /etc/default/console-setup
|
|
||||||
|
|
||||||
[ "$ACTIVE_CONSOLES" ] || exit 0
|
|
||||||
|
|
||||||
if [ "$VERBOSE_OUTPUT" = yes ]; then
|
|
||||||
verbose=
|
|
||||||
else
|
|
||||||
verbose='>/dev/null 2>&1'
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in 1 2 3 4 5 6; do
|
|
||||||
[ -c /dev/tty$i ] || mknod /dev/tty$i c 4 $i
|
|
||||||
done
|
|
||||||
|
|
||||||
for console in $ACTIVE_CONSOLES; do
|
|
||||||
[ -w $console ] || continue
|
|
||||||
|
|
||||||
if [ "$CHARMAP" = UTF-8 ] || [ -z "$ACM$CHARMAP" ]; then
|
|
||||||
printf '\033%%G' >$console
|
|
||||||
else
|
|
||||||
printf '\033%%@' >$console
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$FONT" ]; then
|
|
||||||
FONT="/etc/console-setup/${FONT##*/}"
|
|
||||||
FONT="${FONT%.gz}"
|
|
||||||
else
|
|
||||||
FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
|
|
||||||
fi
|
|
||||||
if [ -f "$FONT" ]; then
|
|
||||||
if type consolechars >/dev/null 2>&1; then
|
|
||||||
eval consolechars -v --tty=$console -f "$FONT" $verbose
|
|
||||||
elif type setfont >/dev/null 2>&1; then
|
|
||||||
eval setfont -v -C $console "$FONT" $verbose
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ACM" ]; then
|
|
||||||
ACM="/etc/console-setup/${ACM##*/}"
|
|
||||||
ACM="${ACM%.gz}"
|
|
||||||
else
|
|
||||||
ACM="/etc/console-setup/$CHARMAP.acm"
|
|
||||||
fi
|
|
||||||
if [ -f "$ACM" ]; then
|
|
||||||
if type consolechars >/dev/null 2>&1; then
|
|
||||||
eval consolechars -v --tty=$console --acm "$ACM" \
|
|
||||||
$verbose
|
|
||||||
elif type setfont >/dev/null 2>&1; then
|
|
||||||
eval setfont -v -C "$console" -m "$ACM" $verbose
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if type kbd_mode >/dev/null 2>&1; then
|
|
||||||
if [ "$CHARMAP" = UTF-8 ] || [ -z "$ACM" ]; then
|
|
||||||
kbd_mode -u <$console
|
|
||||||
else
|
|
||||||
kbd_mode -a <$console
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -f /etc/console-setup/cached.kmap.gz ] && type loadkeys >/dev/null; then
|
|
||||||
eval loadkeys /etc/console-setup/cached.kmap.gz $verbose
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
OPTS="-q"
|
|
||||||
|
|
||||||
# Should terminal be in UTF8 mode?
|
|
||||||
if [ -x /bin/kbd_mode ]; then
|
|
||||||
/bin/kbd_mode -u
|
|
||||||
OPTS="${OPTS} -u"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Load custom keymap
|
|
||||||
if [ -x /bin/loadkeys -a -r /etc/boottime.kmap.gz ]; then
|
|
||||||
loadkeys ${OPTS} /etc/boottime.kmap.gz
|
|
||||||
fi
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="udev"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
/bin/plymouth quit
|
|
|
@ -1,18 +0,0 @@
|
||||||
# mdadm boot_degraded configuration
|
|
||||||
#
|
|
||||||
# You can run 'dpkg-reconfigure mdadm' to modify the values in this file, if
|
|
||||||
# you want. You can also change the values here and changes will be preserved.
|
|
||||||
# Do note that only the values are preserved; the rest of the file is
|
|
||||||
# rewritten.
|
|
||||||
#
|
|
||||||
# BOOT_DEGRADED:
|
|
||||||
# Do you want to boot your system if a RAID providing your root filesystem
|
|
||||||
# becomes degraded?
|
|
||||||
#
|
|
||||||
# Running a system with a degraded RAID could result in permanent data loss
|
|
||||||
# if it suffers another hardware fault.
|
|
||||||
#
|
|
||||||
# However, you might answer "yes" if this system is a server, expected to
|
|
||||||
# tolerate hardware faults and boot unattended.
|
|
||||||
|
|
||||||
BOOT_DEGRADED=false
|
|
|
@ -1 +0,0 @@
|
||||||
RESUME=UUID=99eb2782-3766-452a-8e1e-0bc26b426b12
|
|
|
@ -1,40 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs hook for OpenGnsys
|
|
||||||
|
|
||||||
|
|
||||||
PREREQ="og"
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
mkdir -p ${DESTDIR}/scripts/og-top
|
|
||||||
mkdir -p ${DESTDIR}/scripts/og-premount
|
|
||||||
mkdir -p ${DESTDIR}/scripts/og-bottom
|
|
||||||
mkdir -p ${DESTDIR}/mnt/
|
|
||||||
mkdir -p ${DESTDIR}/net/
|
|
||||||
mkdir -p ${DESTDIR}/usr
|
|
||||||
mkdir -p ${DESTDIR}/var/lock
|
|
||||||
mkdir -p ${DESTDIR}/var/log
|
|
||||||
mkdir -p ${DESTDIR}/opt/opengnsys;
|
|
||||||
|
|
||||||
# Insert basic binaries
|
|
||||||
copy_exec /bin/bash-static /bin/bash
|
|
||||||
|
|
||||||
|
|
||||||
# Insert OpenGnsys Engine
|
|
||||||
mkdir -p ${DESTDIR}/opt/opengnsys/lib/engine
|
|
||||||
cp -prv /opt/opengnsys/client/lib/engine ${DESTDIR}/opt/opengnsys/lib/engine
|
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
#
|
|
||||||
# initramfs.conf
|
|
||||||
# Configuration file for mkinitramfs(8). See initramfs.conf(5).
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# MODULES: [ most | netboot | dep | list ]
|
|
||||||
#
|
|
||||||
# most - Add all framebuffer, acpi, filesystem, and harddrive drivers.
|
|
||||||
#
|
|
||||||
# dep - Try and guess which modules to load.
|
|
||||||
#
|
|
||||||
# netboot - Add the base modules, network modules, but skip block devices.
|
|
||||||
#
|
|
||||||
# list - Only include modules from the 'additional modules' list
|
|
||||||
#
|
|
||||||
|
|
||||||
MODULES=most
|
|
||||||
|
|
||||||
#
|
|
||||||
# BUSYBOX: [ y | n ]
|
|
||||||
#
|
|
||||||
# Use busybox if available.
|
|
||||||
#
|
|
||||||
|
|
||||||
BUSYBOX=y
|
|
||||||
|
|
||||||
#
|
|
||||||
# COMPCACHE_SIZE: [ "x K" | "x M" | "x G" | "x %" ]
|
|
||||||
#
|
|
||||||
# Amount of RAM to use for RAM-based compressed swap space.
|
|
||||||
#
|
|
||||||
# An empty value - compcache isn't used, or added to the initramfs at all.
|
|
||||||
# An integer and K (e.g. 65536 K) - use a number of kilobytes.
|
|
||||||
# An integer and M (e.g. 256 M) - use a number of megabytes.
|
|
||||||
# An integer and G (e.g. 1 G) - use a number of gigabytes.
|
|
||||||
# An integer and % (e.g. 50 %) - use a percentage of the amount of RAM.
|
|
||||||
#
|
|
||||||
# You can optionally install the compcache package to configure this setting
|
|
||||||
# via debconf and have userspace scripts to load and unload compcache.
|
|
||||||
#
|
|
||||||
|
|
||||||
COMPCACHE_SIZE=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# NFS Section of the config.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# BOOT: [ local | nfs ]
|
|
||||||
#
|
|
||||||
# local - Boot off of local media (harddrive, USB stick).
|
|
||||||
#
|
|
||||||
# nfs - Boot using an NFS drive as the root of the drive.
|
|
||||||
#
|
|
||||||
|
|
||||||
BOOT=local
|
|
||||||
|
|
||||||
#
|
|
||||||
# DEVICE: ...
|
|
||||||
#
|
|
||||||
# Specify the network interface, like eth0
|
|
||||||
#
|
|
||||||
|
|
||||||
DEVICE=eth0
|
|
||||||
|
|
||||||
#
|
|
||||||
# NFSROOT: [ auto | HOST:MOUNT ]
|
|
||||||
#
|
|
||||||
|
|
||||||
NFSROOT=auto
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
# List of modules that you want to include in your initramfs.
|
|
||||||
#
|
|
||||||
# Syntax: module_name [args ...]
|
|
||||||
#
|
|
||||||
# You must run update-initramfs(8) to effect this change.
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
#
|
|
||||||
# raid1
|
|
||||||
# sd_mod
|
|
||||||
fbcon
|
|
||||||
vesafb
|
|
||||||
vga16b
|
|
|
@ -1,140 +0,0 @@
|
||||||
# OpenGnsys Local filesystem mounting -*- shell-script -*-
|
|
||||||
|
|
||||||
ogLinkBusybox ()
|
|
||||||
{
|
|
||||||
for n in `busybox | tail -19 | tr "," "\\n" | sed -e "s/ \|\t//"|grep .` ; do
|
|
||||||
ln -f /bin/busybox /bin/$n
|
|
||||||
done
|
|
||||||
ln -f /bin/busybox /bin/sh
|
|
||||||
}
|
|
||||||
|
|
||||||
ogConfigureRamfs ()
|
|
||||||
{
|
|
||||||
mkdir -p /tmp/og2ndFStmp/
|
|
||||||
touch /tmp/og2ndFStmp/modules.dep.temp
|
|
||||||
touch /tmp/og2ndFStmp/modules.dep
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ogExportKernelParameters ()
|
|
||||||
{
|
|
||||||
GLOBAL="cat /proc/cmdline"
|
|
||||||
for i in `${GLOBAL}`
|
|
||||||
do
|
|
||||||
echo $i | grep "=" > /dev/null && export $i
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
ogCheckPointBreak ()
|
|
||||||
{
|
|
||||||
# firstshell=0 SH para Arranque en modo depuracion para el cliente intrd
|
|
||||||
if [ "$firstshell" = "0" ]
|
|
||||||
then
|
|
||||||
echo "entrando en sh antes de configurar la red"
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$firstshell" = "1" ]
|
|
||||||
then
|
|
||||||
echo "entrando en sh despues de configurar la red"
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
# firstrunt=sh Arranque en modo depuracion para el cliente intrd
|
|
||||||
if [ "$firstrun" = "9" ]
|
|
||||||
then
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ogLoadNetModule ()
|
|
||||||
{
|
|
||||||
#cargando netmodule
|
|
||||||
if [ -n "$netmodule" ]
|
|
||||||
then
|
|
||||||
echo "Cargando modulo de red $netmodule"
|
|
||||||
insmod `find /lib/modules/ -name ${netmodule}*`
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ogGetROOTSERVER ()
|
|
||||||
{
|
|
||||||
# get nfs root from dhcp
|
|
||||||
if [ "x${NFSROOT}" = "xauto" ]; then
|
|
||||||
# check if server ip is part of dhcp root-path
|
|
||||||
if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then
|
|
||||||
NFSROOT=${ROOTSERVER}:${ROOTPATH}
|
|
||||||
else
|
|
||||||
NFSROOT=${ROOTPATH}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
|
|
||||||
elif [ -n "${NFSROOT}" ]; then
|
|
||||||
# nfs options are an optional arg
|
|
||||||
if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then
|
|
||||||
NFSOPTS="-o ${NFSROOT#*,}"
|
|
||||||
fi
|
|
||||||
NFSROOT=${NFSROOT%%,*}
|
|
||||||
if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then
|
|
||||||
NFSROOT=${ROOTSERVER}:${NFSROOT}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
export ROOTSERVER
|
|
||||||
}
|
|
||||||
|
|
||||||
ogConectROOTSERVER ()
|
|
||||||
{
|
|
||||||
echo Preparando conexión con el Repositorio \$ROOTSERVER \$BOOTMODE \$MOUNTOPTS
|
|
||||||
## Montamos el resto de cosas necesarias
|
|
||||||
#printf "$MSG_MOUNTREPO\n" $BOOTMODE;
|
|
||||||
|
|
||||||
mount -t nfs -onolock,ro $ROOTSERVER:/opt/opengnsys/client /opt/opengnsys;
|
|
||||||
mount -t nfs -o nolock $ROOTSERVER:/opt/opengnsys/log/clients /opt/opengnsys/log;
|
|
||||||
#mount -t nfs -o "\$MOUNTOPTS" \$SERVERNFS:/opt/opengnsys/images /opt/opengnsys/images;
|
|
||||||
#mount -t tmpfs none /opt/opengnsys/images -o size=5m
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Parameter: Where to mount the filesystem
|
|
||||||
mountroot ()
|
|
||||||
{
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running OpenGnsys /scripts/og-top"
|
|
||||||
run_scripts /scripts/og-top
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
# If the root device hasn't shown up yet, give it a little while
|
|
||||||
# to deal with removable devices
|
|
||||||
|
|
||||||
|
|
||||||
ogConfigureRamfs
|
|
||||||
ogExportKernelParameters
|
|
||||||
ogCheckPointBreak
|
|
||||||
ogLoadNetModule
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount"
|
|
||||||
run_scripts /scripts/og-premount
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
configure_networking
|
|
||||||
ogGetROOTSERVER
|
|
||||||
ogCheckPointBreak
|
|
||||||
|
|
||||||
ogConectROOTSERVER
|
|
||||||
# ogConectROOTMEDIA
|
|
||||||
ogCheckPointBreak
|
|
||||||
|
|
||||||
set -a
|
|
||||||
trap "mount | grep loop && /opt/og2fs/bin/bash" 1 2 3 9 15
|
|
||||||
/opt/opengnsys/etc/preinit/default.sh
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-bottom"
|
|
||||||
run_scripts /scripts/og-bottom
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
#
|
|
||||||
# Configuration file for update-initramfs(8)
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# update_initramfs [ yes | all | no ]
|
|
||||||
#
|
|
||||||
# Default is yes
|
|
||||||
# If set to all update-initramfs will update all initramfs
|
|
||||||
# If set to no disables any update to initramfs beside kernel upgrade
|
|
||||||
|
|
||||||
update_initramfs=yes
|
|
||||||
|
|
||||||
#
|
|
||||||
# backup_initramfs [ yes | no ]
|
|
||||||
#
|
|
||||||
# Default is no
|
|
||||||
# If set to no leaves no .bak backup files.
|
|
||||||
|
|
||||||
backup_initramfs=no
|
|
|
@ -1,255 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#Definicion de variables
|
|
||||||
# TODO: Pendiente Definir directorio base del 2FS
|
|
||||||
OGBASEDIR=/var/lib/tftpboot/ogclient/
|
|
||||||
OGFSFILE=${OGBASEDIR}ogclient.img
|
|
||||||
OGFSMOUNT=${OGBASEDIR}ogclientmount
|
|
||||||
OGLIB=/opt/opengnsys/client/lib
|
|
||||||
FSCLIENTSIZEMB=1000
|
|
||||||
PASSROOT=og
|
|
||||||
SCRIPT=/root/configure.sh
|
|
||||||
RUNME=$OGFSMOUNT$SCRIPT
|
|
||||||
LASTDEBOOTSTRAP=http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.20_all.deb
|
|
||||||
OGMUSTCOMPILE="http://www.informatica.us.es:8080/opengnsys/browser/trunk/client/engine/ToolsGNU.c?format=txt -O /root/ToolsGNU.c"
|
|
||||||
OGFSLABEL=ogClient
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogClientMount [str_program]
|
|
||||||
#@brief Acceso al 2nd FS del cliente desde el Servidor Opengnsys
|
|
||||||
#@param 1 Opciona: scripts o programa a ejecutar para automatizaciones
|
|
||||||
#@return Si no hay parametros: login de acceso.
|
|
||||||
#@return con un parametro: La salida del programa ejecutado
|
|
||||||
#@exception
|
|
||||||
#@note
|
|
||||||
#@todo
|
|
||||||
#@version 0.9 - Primera versión para OpenGnSys
|
|
||||||
#@author Antonio J. Doblas Viso, Universidad de Málaga
|
|
||||||
#@date 2010/02/15
|
|
||||||
#*/ ##
|
|
||||||
function ogClientMount ()
|
|
||||||
{
|
|
||||||
#TODO comprobar que OGFILE y OGFILEMOUNT existe.
|
|
||||||
mount $OGFSFILE $OGFSMOUNT -o loop
|
|
||||||
mount --bind /proc $OGFSMOUNT/proc
|
|
||||||
mount --bind /sys $OGFSMOUNT/sys
|
|
||||||
mount --bind /tmp $OGFSMOUNT/tmp
|
|
||||||
mount --bind /dev $OGFSMOUNT/dev
|
|
||||||
mount --bind /dev/pts $OGFSMOUNT/dev/pts
|
|
||||||
[ $# = 0 ] && $(chroot $OGFSMOUNT /sbin/getty 38400 `tty`)
|
|
||||||
[ $# = 1 ] && chroot $OGFSMOUNT $1
|
|
||||||
}
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogClientUnmount
|
|
||||||
#@brief Desmonta el 2nd FS del cliente desde el Servidor Opengnsys
|
|
||||||
#@param
|
|
||||||
#@return
|
|
||||||
#@exception
|
|
||||||
#@note
|
|
||||||
#@todo
|
|
||||||
#@version 0.9 - Primera versión para OpenGnSys
|
|
||||||
#@author Antonio J. Doblas Viso, Universidad de Málaga
|
|
||||||
#@date 2010/02/15
|
|
||||||
#*/ ##
|
|
||||||
|
|
||||||
function ogClientUnmount ()
|
|
||||||
{
|
|
||||||
cd /tmp
|
|
||||||
umount -d -f -l $OGFSMOUNT/proc
|
|
||||||
umount -d -f -l $OGFSMOUNT/sys
|
|
||||||
umount -d -f -l $OGFSMOUNT/tmp
|
|
||||||
umount -d -f -l $OGFSMOUNT/dev
|
|
||||||
umount -d -f -l $OGFSMOUNT/dev/pts
|
|
||||||
umount -d -f -l $OGFSMOUNT
|
|
||||||
}
|
|
||||||
|
|
||||||
function ogClientCheckVersion ()
|
|
||||||
{
|
|
||||||
#TODO: configurar la version lucid
|
|
||||||
#TODO: introducir un nuevo case para la vesion
|
|
||||||
case $1 in
|
|
||||||
jaunty|JAUNTY)
|
|
||||||
export OGVERSION=jaunty
|
|
||||||
exort OGRELEASE=2.6.28-11-generic
|
|
||||||
;;
|
|
||||||
karmic|KARMIC)
|
|
||||||
export OGVERSION=karmic
|
|
||||||
export OGRELEASE=2.6.31-14-generic
|
|
||||||
;;
|
|
||||||
lucid|LUCID)
|
|
||||||
export OGVERSION=lucid
|
|
||||||
export OGRELEASE=2.6.32-21-generic-pae
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo $OGVERSION $OGRELEASE
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogClientGenerator str_versionUbuntu str_release
|
|
||||||
#@brief Crea el 2nd FS del cliente desde el Servidor Opengnsys
|
|
||||||
#@param 1 Versión de ubuntu a generar, jaunty karmic
|
|
||||||
#@return
|
|
||||||
#@exception
|
|
||||||
#@note
|
|
||||||
#@todo
|
|
||||||
#@version 0.9 - Primera versión para OpenGnSys
|
|
||||||
#@author Antonio J. Doblas Viso, Universidad de Málaga
|
|
||||||
#@date 2010/02/15
|
|
||||||
#*/ ##
|
|
||||||
|
|
||||||
function ogClientGeneratorDebootstrap ()
|
|
||||||
{
|
|
||||||
|
|
||||||
if [ $# != 2 ]
|
|
||||||
then
|
|
||||||
echo Debes introducir como argumento1: jaunty karmic lucid
|
|
||||||
echo Debes introducir como argumento2: la release
|
|
||||||
echo utiliza como entrada ogClientCheckVersion
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
OGVERSION=`echo $1`
|
|
||||||
OGRELEASE=`echo $2`
|
|
||||||
echo $OGVERSION $OGRELEASE
|
|
||||||
pause
|
|
||||||
|
|
||||||
# instalamos el ultimo debotstrap para permitir instalar versiones superiores a nuestro sistema
|
|
||||||
apt-get install gdebi-core
|
|
||||||
wget $LASTDEBOOTSTRAP
|
|
||||||
gdebi -n debootstrap_1.0.20_all.deb
|
|
||||||
|
|
||||||
|
|
||||||
#Creamos el directorio donde montaremos el disco virtual
|
|
||||||
mkdir -p $OGFSMOUNT
|
|
||||||
|
|
||||||
#Creamos el disco virtual con el filesystem del cliente.
|
|
||||||
dd if=/dev/zero of=$OGFSFILE bs=1048576 count=$FSCLIENTSIZEMB
|
|
||||||
mkfs.ext3 -b 4096 -L $OGFSLABEL $OGFSFILE -F
|
|
||||||
|
|
||||||
#Montamos el dispositivo virtual en su punto de montaje.
|
|
||||||
mount $OGFSFILE $OGFSMOUNT -o loop
|
|
||||||
|
|
||||||
#TODO Comprobar arquitectura
|
|
||||||
#Iniciamos la creación del sistema en el directorio de clientes.
|
|
||||||
echo debootstrap --include=linux-image-$OGRELEASE --arch=i386 --components=main,universe $OGVERSION $OGFSMOUNT http://es.archive.ubuntu.com/ubuntu/
|
|
||||||
debootstrap --include=linux-image-$OGRELEASE --arch=i386 --components=main,universe $OGVERSION $OGFSMOUNT http://es.archive.ubuntu.com/ubuntu/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
###### Funciones para los clientes offline
|
|
||||||
function agregarOG {
|
|
||||||
cd $NEWROOT
|
|
||||||
mkdir -p opt/opengnsys
|
|
||||||
cp -prv /opt/opengnsys/client/* $NEWROOT/opt/opengnsys
|
|
||||||
echo "agregando OG al newinitrd"
|
|
||||||
}
|
|
||||||
|
|
||||||
function finalizarISO
|
|
||||||
{
|
|
||||||
cd $ANTERIORPWD
|
|
||||||
mv $TMPINITRD/new-initrd.gz $DEST/initrdISO.gz
|
|
||||||
if [ $LINUX ] ; then
|
|
||||||
mv $TMPINITRD/linux $DEST/linuxISO
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function CrearISO {
|
|
||||||
mkdir -p tmp/iso/isolinux
|
|
||||||
#cd tmp/iso/
|
|
||||||
cp -prv /usr/lib/syslinux/* tmp/iso/isolinux/
|
|
||||||
cp -prv /usr/share/gpxe/* tmp/iso/isolinux/
|
|
||||||
cp -prv /tmp/linux tmp/iso/isolinux/linuxISO
|
|
||||||
cp -prv /tmp/initrd.gz tmp/iso/isolinux/
|
|
||||||
cp -prv /opt/opengnsys/client/og2ndFS tmp/iso/isolinux/
|
|
||||||
|
|
||||||
|
|
||||||
cat << FIN > tmp/iso/isolinux/isolinux.cfg
|
|
||||||
DEFAULT menu.c32
|
|
||||||
PROMPT 0
|
|
||||||
ALLOWOPTIONS 1
|
|
||||||
|
|
||||||
MENU TITLE FuTuR3 Live Collection
|
|
||||||
|
|
||||||
LABEL gpxe
|
|
||||||
MENU LABEL gpxe
|
|
||||||
KERNEL /clonezilla/live/vmlinuz1
|
|
||||||
APPEND initrd=/clonezilla/live/initrd1.img boot=live union=aufs noswap vga=788 ip=frommedia
|
|
||||||
|
|
||||||
|
|
||||||
#default 0
|
|
||||||
#prompt 1
|
|
||||||
#timeout 100
|
|
||||||
|
|
||||||
#display mensaje.txt
|
|
||||||
|
|
||||||
LABEL 0
|
|
||||||
MENU LABEL ogClient
|
|
||||||
KERNEL linuxISO
|
|
||||||
APPEND initrd=initrd.gz ro vga=788 irqpoll acpi=on boot=admin status=offline
|
|
||||||
|
|
||||||
LABEL 1
|
|
||||||
MENU LABEL ogClient1 sin vga
|
|
||||||
KERNEL linuxISO
|
|
||||||
APPEND initrd=initrd.gz ro irqpoll acpi=on boot=admin status=offline
|
|
||||||
|
|
||||||
LABEL 2
|
|
||||||
MENU LABEL ogClient2 sin irqpoll
|
|
||||||
KERNEL linuxISO
|
|
||||||
APPEND initrd=initrd.gz ro acpi=on boot=admin status=offline
|
|
||||||
|
|
||||||
LABEL 3
|
|
||||||
MENU LABEL ogClient3 acpi=off
|
|
||||||
KERNEL linuxISO
|
|
||||||
APPEND initrd=initrd.gz ro acpi=off boot=admin status=offline
|
|
||||||
|
|
||||||
|
|
||||||
#LABEL ogclient
|
|
||||||
#KERNEL /ogclient/linuxISO
|
|
||||||
#APPEND initrd=/ogclient/initrdISO.img
|
|
||||||
|
|
||||||
#KERNEL linuxISO
|
|
||||||
#APPEND initrd=initrdISO.img
|
|
||||||
|
|
||||||
LABEL 4
|
|
||||||
MENU LABEL local
|
|
||||||
localboot 0x80
|
|
||||||
append -
|
|
||||||
|
|
||||||
|
|
||||||
label 5
|
|
||||||
MENU LABEL Network boot via gPXE lkrn
|
|
||||||
KERNEL gpxe.lkrn
|
|
||||||
|
|
||||||
label 5
|
|
||||||
MENU LABEL Network boot via gPXE usb
|
|
||||||
KERNEL gpxe.usb
|
|
||||||
|
|
||||||
label 5
|
|
||||||
MENU LABEL Network boot via gPXE pxe
|
|
||||||
KERNEL gpxe.pxe
|
|
||||||
|
|
||||||
label 5
|
|
||||||
MENU LABEL Network boot via gPXE iso
|
|
||||||
KERNEL gpxe.iso
|
|
||||||
FIN
|
|
||||||
#### /tmp/iso#
|
|
||||||
mkisofs -V ogClient -o ogClient.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -J -no-emul-boot -boot-load-size 4 -boot-info-table tmp/iso
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function probarISO {
|
|
||||||
#/tmp/iso
|
|
||||||
qemu -m 256 -boot d -cdrom ogClient.iso
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,306 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#@file ogClientGenerator.sh
|
|
||||||
#@brief Script generación del cliente OpenGnSys
|
|
||||||
#@warning
|
|
||||||
#@version 0.9 -
|
|
||||||
#@author Antonio J. Doblas Viso.
|
|
||||||
#@date 2010/05/24
|
|
||||||
#*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
echo ": invalid number of parameters"
|
|
||||||
echo " host | lucid | karmic | jaunty | lenny | squeeze "
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Soo ejecutable por usuario root
|
|
||||||
if [ "$(whoami)" != 'root' ]
|
|
||||||
then
|
|
||||||
echo "ERROR: this program must run under root privileges!!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1).
|
|
||||||
PROGRAMDIR=$(readlink -e $(dirname "$0"))
|
|
||||||
if [ -d "$PROGRAMDIR/../installer" ]; then
|
|
||||||
USESVN=0
|
|
||||||
else
|
|
||||||
USESVN=1
|
|
||||||
SVN_URL=svn://www.informatica.us.es:3690/opengnsys/branches/ogClient
|
|
||||||
#directorio donde se almacenará el codigo temporalmente.
|
|
||||||
SVN_DIR="./opengnsys/installer/ogClient"
|
|
||||||
fi
|
|
||||||
|
|
||||||
WORKDIR=/tmp/opengnsys_installer
|
|
||||||
mkdir -p $WORKDIR
|
|
||||||
INSTALL_TARGET=/opt/opengnsys
|
|
||||||
LOG_FILE=/tmp/opengnsys_installation.log
|
|
||||||
|
|
||||||
###############################################
|
|
||||||
pushd $WORKDIR
|
|
||||||
|
|
||||||
|
|
||||||
source `dirname $0`/ogInstaller.lib
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$1" == "host" ]
|
|
||||||
then
|
|
||||||
OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null
|
|
||||||
#OSCODENAME=$(lsb_release -c | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null
|
|
||||||
OSCODENAME=$(cat /etc/lsb-release | grep CODENAME | awk -F= '{print $NF}')
|
|
||||||
OGRELEASE=$(uname -a | awk '{print $3}')
|
|
||||||
else
|
|
||||||
OSCODENAME=`echo $1`
|
|
||||||
OGRELEASE=`ogClientGetRelease $OSCODENAME`
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OGCLIENTBASEDIR=/var/lib/tftpboot/ogclient/
|
|
||||||
OGCLIENTFILE=${OGCLIENTBASEDIR}ogclient.img
|
|
||||||
OGCLIENTMOUNT=${OGCLIENTBASEDIR}ogclientmount
|
|
||||||
|
|
||||||
OGLIB=/opt/opengnsys/client/lib
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echoAndLog "OpenGnSys CLIENT installation begins at $(date)"
|
|
||||||
|
|
||||||
|
|
||||||
# Datos para la generación del cliente.
|
|
||||||
DEPENDENCIES=( debootstrap subversion schroot)
|
|
||||||
|
|
||||||
## Actualizar repositorios
|
|
||||||
apt-get update
|
|
||||||
# Instalación de dependencias (paquetes de sistema operativo).
|
|
||||||
declare -a notinstalled
|
|
||||||
checkDependencies DEPENDENCIES notinstalled
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
installDependencies notinstalled
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echoAndLog "Error while installing some dependeces, please verify your server installation before continue"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Si es necesario, descarga el repositorio especifico de la instalación del cliente
|
|
||||||
if [ $USESVN -eq 1 ]; then
|
|
||||||
#svnExportCode $SVN_URL
|
|
||||||
echo svn export "$SVN_URL" $SVN_DIR
|
|
||||||
#svn export "$SVN_URL" $SVN_DIR
|
|
||||||
#####debug boorrar el cp
|
|
||||||
#mkdir -p $SVN_DIR
|
|
||||||
#cp -prv /home/administrador/workspace/opengnsys/branches/ogClient/* $SVN_DIR
|
|
||||||
find $SVN_DIR/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null
|
|
||||||
###TODO si ya esta descargado da error ???
|
|
||||||
###if [ $? -ne 0 ]; then
|
|
||||||
### errorAndLog "Error while getting code from svn"
|
|
||||||
### exit 1
|
|
||||||
###fi
|
|
||||||
else
|
|
||||||
ln -fs "$(dirname $PROGRAMDIR)" opengnsys
|
|
||||||
fi
|
|
||||||
|
|
||||||
#### Parseo de ficheros descargados del svn.
|
|
||||||
# parseamos del apt.source
|
|
||||||
if [ "$1" == host ]
|
|
||||||
then
|
|
||||||
cp /etc/apt/sources.list ${SVN_DIR}/clientstructure/etc/apt/sources.list
|
|
||||||
else
|
|
||||||
sed -e "s/OGVERSION/$OGVERSION/g" ${SVN_DIR}/clientstructure/etc/apt/sources.list.generic > ${SVN_DIR}/clientstructure/etc/apt/sources.list
|
|
||||||
#rm ${SVN_DIR}/clientstructure/etc/apt/sources.list.generic
|
|
||||||
fi
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "parseando el fichero apt.source: ERROR"
|
|
||||||
else
|
|
||||||
echoAndLog "parseando el fichero apt.source: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#parseamos el scripts de generación del initrd.
|
|
||||||
sed -e "s/OGRELEASE/$OGRELEASE/g" ${SVN_DIR}/clientstructure/root/GenerateInitrd.generic.sh > ${SVN_DIR}/clientstructure/root/GenerateInitrd.sh
|
|
||||||
#rm ${SVN_DIR}/clientstructure/root/GenerateInitrd.generic.sh
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "parseando el fichero de cliente GenerateInitrd: ERROR"
|
|
||||||
else
|
|
||||||
echoAndLog "parseando el fichero de cliente GenerateInitrd: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#damos permiso al directorio de scripts
|
|
||||||
chmod 775 ${SVN_DIR}/clientstructure/root/*
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "Dando permisos de escritura al directorio de scrips para el cliente: ERROR"
|
|
||||||
else
|
|
||||||
echoAndLog "Dando permisos de escritura al directorio de scrips para el cliente: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#####PASO 1. Generamos el 2º sistema de archivos.
|
|
||||||
echo "generamos el sistema base con debootstrap"
|
|
||||||
if [ "$1" == host ]
|
|
||||||
then
|
|
||||||
echo ogClientGeneratorDebootstrap $OSCODENAME $OGRELEASE 2>&1 | tee -a $LOG_FILE
|
|
||||||
# ogClientGeneratorDebootstrap $OSCODENAME $OGRELEASE 2>&1 | tee -a $LOG_FILE
|
|
||||||
else
|
|
||||||
echo ogClientGeneratorDebootstrap $OSCODENAME $(ogClientGetRelease $OGVERSION) 2>&1 | tee -a $LOG_FILE
|
|
||||||
ogClientGeneratorDebootstrap $OSCODENAME $(ogClientGetRelease $OGVERSION) 2>&1 | tee -a $LOG_FILE
|
|
||||||
fi
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "Generando 2nd FileSystem: ERROR"
|
|
||||||
else
|
|
||||||
echoAndLog "Generando 2nd FileSystem: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.`getDateTime`
|
|
||||||
cat << EOF > /etc/schroot/schroot.conf
|
|
||||||
[IMGogclient]
|
|
||||||
type=loopback
|
|
||||||
file=/var/lib/tftpboot/ogclient/ogclient.img
|
|
||||||
description=ogclient ubuntu luc IMGi
|
|
||||||
priority=1
|
|
||||||
users=root
|
|
||||||
groups=root
|
|
||||||
root-groups=root
|
|
||||||
mount-options=-o offset=32256
|
|
||||||
root-users=root
|
|
||||||
[DIRogclient]
|
|
||||||
type=directory
|
|
||||||
directory=/var/lib/tftpboot/ogclient/ogclientmount
|
|
||||||
description=ogclient ubuntu lucid DIR
|
|
||||||
priority=2
|
|
||||||
users=root
|
|
||||||
groups=root
|
|
||||||
root-groups=root
|
|
||||||
root-users=root
|
|
||||||
EOF
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
####PASO 2 Insertamos datos en el 2º sistema de archivos
|
|
||||||
#2.1 montamos para insertar los ficheros necesarios.
|
|
||||||
mount | grep $OGCLIENTMOUNT || mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "Montando 2nd FileSystem Para Añadir elementos OG: ERROR"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echoAndLog "Montando 2nd FileSystem Para Añadir elementos OG: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#2.2 copiamos la estrucutra descargada al fichero imagen.
|
|
||||||
echo "cp -prv ${SVN_DIR}/clientstructure/* $OGCLIENTMOUNT "
|
|
||||||
cp -prv ${SVN_DIR}/clientstructure/* $OGCLIENTMOUNT
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "Copiando los elementos del cliente svn: ERROR"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echoAndLog "Copiando los elementos del cliente svn: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#2.3 Copiamos algunas cosas del actual sistema - ver de que manera integrar los lib
|
|
||||||
# copiamos algunas cosas del nfsexport
|
|
||||||
echo "Linking fonts for browser1 $OGLIB"
|
|
||||||
mkdir -p $OGCLIENTMOUNT/usr/local/Trolltech/QtEmbedded-4.5.1/lib/
|
|
||||||
cp -pr $OGLIB/fonts $OGCLIENTMOUNT/usr/local/Trolltech/QtEmbedded-4.5.1/lib/fonts
|
|
||||||
echo "Linking fonts for browser2 $OGLIB"
|
|
||||||
mkdir -p $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.2/lib/
|
|
||||||
cp -pr $OGLIB/fonts $OGCLIENTMOUNT/usr/local/QtEmbedded-4.6.2/lib/fonts
|
|
||||||
echo "Coping pci.ids"
|
|
||||||
cp -pr $OGLIB/pci.ids $OGCLIENTMOUNT/etc
|
|
||||||
#copiamos el browser y el ogADMcline al bin
|
|
||||||
cp /opt/opengnsys/client/bin/browser $OGCLIENTMOUNT/bin
|
|
||||||
cp /opt/opengnsys/client/bin/ogAdmClient $OGCLIENTMOUNT/bin
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "Copiando qt pci.ids fonts: ERROR"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echoAndLog "Copiando qt pci.ids fonts: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
## final desmontamos.
|
|
||||||
mount | grep $OGCLIENTMOUNT && umount $OGCLIENTMOUNT
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "Desmontando cliente : ERROR"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echoAndLog "desmontando cliente: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
################## Fin paso 2
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
######## instalamos software adicional.
|
|
||||||
#ogClientMount /root/InstallSoftware.sh 2>&1 | tee -a `echo $LOG_FILE`
|
|
||||||
cd /
|
|
||||||
schroot -c IMGogclient -- /root/InstallSoftware.sh 2>&1 | tee -a `echo $LOG_FILE`
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
errorAndLog "Instalando sofware adicional OG : ERROR"
|
|
||||||
#exit 1
|
|
||||||
else
|
|
||||||
echoAndLog "Instalando sofware adicional OG: OK"
|
|
||||||
fi
|
|
||||||
cd -
|
|
||||||
|
|
||||||
#cd /
|
|
||||||
#schroot -c IMGogclient -- /root/CompileSoftware.sh
|
|
||||||
#cd -
|
|
||||||
|
|
||||||
### configuracion hostname passroot securety
|
|
||||||
cd /
|
|
||||||
schroot -c IMGogclient -- /root/ConfFS.sh
|
|
||||||
cd -
|
|
||||||
|
|
||||||
##2.4 claves ssh
|
|
||||||
sshkeys()
|
|
||||||
{
|
|
||||||
##montamos
|
|
||||||
mount $OGCLIENTFILE $OGCLIENTMOUNT -o loop,offset=32256
|
|
||||||
##comprobamos clave rsa en el host,.
|
|
||||||
if [ ! -f /root/.ssh/id_rsa.pub ]
|
|
||||||
then
|
|
||||||
ssh-keygen -q -f /root/.ssh/id_rsa -N ""
|
|
||||||
fi
|
|
||||||
## copiamos ssh rsa del host al guest como authorized-key2
|
|
||||||
rm ${OGCLIENTMOUNT}/root/.ssh/authorized-key2
|
|
||||||
cat /root/.ssh/id_rsa.pub >> ${OGCLIENTMOUNT}/root/.ssh/authorized-key2
|
|
||||||
#cat ${OGCLIENTMOUNT}/root/.ssh/id_rsa.pub >> ${OGCLIENTMOUNT}/root/.ssh/authorized-key2
|
|
||||||
mount | grep $OGCLIENTMOUNT || umount $OGCLIENTMOUNT
|
|
||||||
}
|
|
||||||
|
|
||||||
### Generamos el 1er sistema de archivos.
|
|
||||||
cd /
|
|
||||||
schroot -c IMGogclient -- /root/GenerateInitrd.sh
|
|
||||||
cp /tmp/*-${OGRELEASE} $OGCLIENTBASEDIR
|
|
||||||
cd -
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################## DEJAMOS FICHERO DE EJEMPLOS PARA:
|
|
||||||
#default
|
|
||||||
cat << FIN >> /var/lib/tftpboot/pxelinux.cfg/defaultNEWClient
|
|
||||||
LABEL pxe-${OGRELEASE}
|
|
||||||
KERNEL ogclient/vmlinuz-$OGRELEASE
|
|
||||||
APPEND initrd=ogclient/initrd.img-$OGRELEASE ip=dhcp ro boot=og vga=788 irqpoll acpi=on reposerver=
|
|
||||||
FIN
|
|
||||||
#/etc/hosts
|
|
||||||
echo "/var/lib/tftpboot *(ro,no_subtree_check,no_root_squash,sync)" > /etc/exportsNEWClient
|
|
||||||
/etc/init.d/nfs-kernel-server restart
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
# Mostrar sumario de la instalación e instrucciones de post-instalación.
|
|
||||||
installationSummary
|
|
||||||
|
|
||||||
#rm -rf $WORKDIR
|
|
||||||
echoAndLog "OpenGnSys installation finished at $(date)"
|
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#/**
|
|
||||||
#@file Net.lib
|
|
||||||
#@brief Librería o clase Net
|
|
||||||
#@class Net
|
|
||||||
#@brief Funciones básicas de red.
|
|
||||||
#@version 1.0
|
|
||||||
#@warning License: GNU GPLv3+
|
|
||||||
#*/
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetHostname
|
|
||||||
#@brief Muestra el nombre del cliente.
|
|
||||||
#@return str_host - nombre de máquina
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetHostname ()
|
|
||||||
{
|
|
||||||
local HOST NETFILE
|
|
||||||
# Tomar nombre de la variable HOSTNAME
|
|
||||||
HOST="$HOSTNAME"
|
|
||||||
|
|
||||||
# Si no, tomar del DHCP, opción host-name /* (comentario para Doxygen)
|
|
||||||
[ -z "$HOST" ] && HOST=$(awk -F\" '/option host-name/ {gsub(/;/,""); host=$2}
|
|
||||||
END {print host}
|
|
||||||
' /var/lib/dhcp3/dhclient.leases)
|
|
||||||
# Si no, leer el parámetro del kernel hostname (comentario para Doxygen) */
|
|
||||||
[ -z "$HOST" ] && HOST=$(awk 'BEGIN {RS=""; FS="="}
|
|
||||||
$1~/hostname/ {print $2}' /proc/cmdline)
|
|
||||||
|
|
||||||
[ "$HOSTNAME" != "$HOST" ] && export HOSTNAME="$HOST"
|
|
||||||
echo $HOST
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetIpAddress
|
|
||||||
#@brief Muestra la dirección IP del sistema
|
|
||||||
#@return str_ip - Dirección IP
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetIpAddress ()
|
|
||||||
{
|
|
||||||
local IP
|
|
||||||
#Version og2ndFS
|
|
||||||
NETFILE="/tmp/net-eth0.conf"
|
|
||||||
[ -f "$NETFILE" ] && IP=$(cat $NETFILE | grep IPV4ADDR | cut -f2 -d=)
|
|
||||||
|
|
||||||
# Obtener direcciones IP. /* (comentario para Doxygen)
|
|
||||||
[ -z "$IP" ] && IP=$(ip address show | awk '$2!~/lo/ { readline; if ($1~/inet$/) {sub (/\/.*/, ""); printf ("%s ", $2)}}')
|
|
||||||
# Mostrar sólo la primera. (comentario para Doxygen) */
|
|
||||||
echo ${IP%% *}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogGetMacAddress
|
|
||||||
#@brief Muestra la dirección Ethernet del cliente.
|
|
||||||
#@return str_ether - Dirección Ethernet
|
|
||||||
#@version 1.0 - Integración en OpenGnSys 1.0
|
|
||||||
#@author Ramon Gomez, ETSII Universidad de Sevilla
|
|
||||||
#@date 2010-02-11
|
|
||||||
#*/ ##
|
|
||||||
function ogGetMacAddress ()
|
|
||||||
{
|
|
||||||
local MAC
|
|
||||||
# Obtener direcciones Ethernet.
|
|
||||||
MAC=$(ip address show | awk '$2!~/lo/ {readline; if ($1~/ether/) printf ("%s ", toupper($2));}')
|
|
||||||
# Mostrar sólo la primera.
|
|
||||||
echo ${MAC%% *}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
preinit/default
|
|
||||||
eliminamos enlace del bash
|
|
||||||
Ejecute solo el loadmodules del for
|
|
||||||
|
|
||||||
preinit/loaenviron
|
|
||||||
comentamos el LD_PATH
|
|
||||||
|
|
||||||
|
|
||||||
/var/lib/tftboot/pxelinux.cfg/default
|
|
||||||
DEFAULT pxe2
|
|
||||||
LABEL pxe
|
|
||||||
KERNEL linux
|
|
||||||
APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on boot=admin
|
|
||||||
LABEL pxe2
|
|
||||||
KERNEL vmlinuz-2.6.32-21-generic-pae
|
|
||||||
APPEND initrd=initrd-2.6.32-21-generic-pae ip=dhcp rootdelay=0 boot=og engine=testing rootmnt=/opt/og2fs vga=788
|
|
||||||
|
|
||||||
|
|
||||||
parametro boot: reservado INCOMPATIBLE CON BOOT=ADMIN
|
|
||||||
temporalmente: init/default.sh => export boot=admin
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/opt/opengnsys/bin/bash
|
|
||||||
|
|
||||||
set -a
|
|
||||||
|
|
||||||
OPENGNSYS=${OPENGNSYS:-/opt/opengnsys}
|
|
||||||
OGLOGFILE=${OGLOGFILE:-/var/log/opengnsys.log}
|
|
||||||
#### FIXME EN PRUEBAS
|
|
||||||
OGLOGFILE=/var/log/opengnsys.log
|
|
||||||
|
|
||||||
/opt/opengnsys/etc/init/load2fs.sh
|
|
||||||
source /opt/opengnsys/etc/preinit/loadenviron.sh
|
|
||||||
export PATH=/opt/og2fs/bin:$PATH
|
|
||||||
export PATH=/opt/og2fs/sbin:$PATH
|
|
||||||
export PATH=$PATH:/opt/og2fs/opt/drbl/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
||||||
|
|
||||||
if [ -x "$OPENGNSYS/bin/ogAdmClient" ]; then
|
|
||||||
echo "$MSG_LAUNCHCLIENT"
|
|
||||||
$OPENGNSYS/bin/ogAdmClient -f $OPENGNSYS/etc/ogAdmClient.cfg -l $OGLOGFILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
bash
|
|
||||||
# FIXME Arranque Browser
|
|
||||||
#browser -qws $OGSTARTPAGE
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#/**
|
|
||||||
#@file load2fs.sh
|
|
||||||
#@brief Script de carga del 2nd Sistema de Archivos para el cliente OpenGNSys.
|
|
||||||
#@warning License: GNU GPLv3+
|
|
||||||
#@version 0.9
|
|
||||||
#@author Antonio J. Doblas Viso, Unviersidad de Malaga.
|
|
||||||
#@date 2010-02-15
|
|
||||||
#*/
|
|
||||||
mkdir -p /opt/og2fs
|
|
||||||
mount /opt/opengnsys/og2ndFS /opt/og2fs -t ext3 -o loop -o ro
|
|
||||||
cp -R /opt/og2fs/etc/* /etc/ # */
|
|
||||||
mount /opt/og2fs/usr /usr
|
|
||||||
mount /opt/og2fs/lib /lib
|
|
||||||
export PATH=/opt/og2fs/sbin:$PATH
|
|
||||||
export PATH=/opt/og2fs/bin:$PATH
|
|
||||||
export PATH=$PATH:/opt/og2fs/opt/drbl/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
||||||
|
|
||||||
# meter aqui el reboot del Boot.lib
|
|
|
@ -1,395 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#Definicion de variables
|
|
||||||
# TODO: Pendiente Definir directorio base del 2FS
|
|
||||||
OGBASEDIR=/opt/opengnsys/client/
|
|
||||||
OGFSFILE=${OGBASEDIR}og2ndFS
|
|
||||||
OGFSMOUNT=${OGBASEDIR}ogfsmount
|
|
||||||
OGLIB=/opt/opengnsys/client/lib
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogFSHMount [str_program]
|
|
||||||
#@brief Acceso al 2nd FS del cliente desde el Servidor Opengnsys
|
|
||||||
#@param 1 Opciona: scripts o programa a ejecutar para automatizaciones
|
|
||||||
#@return Si no hay parametros: login de acceso.
|
|
||||||
#@return con un parametro: La salida del programa ejecutado
|
|
||||||
#@exception
|
|
||||||
#@note
|
|
||||||
#@todo
|
|
||||||
#@version 0.9 - Primera versión para OpenGnSys
|
|
||||||
#@author Antonio J. Doblas Viso, Universidad de Málaga
|
|
||||||
#@date 2010/02/15
|
|
||||||
#*/ ##
|
|
||||||
function ogFSHMount ()
|
|
||||||
{
|
|
||||||
mount $OGFSFILE $OGFSMOUNT -t ext3 -o loop
|
|
||||||
mount --bind /proc $OGFSMOUNT/proc
|
|
||||||
mount --bind /sys $OGFSMOUNT/sys
|
|
||||||
mount --bind /tmp $OGFSMOUNT/tmp
|
|
||||||
mount --bind /dev $OGFSMOUNT/dev
|
|
||||||
mount --bind /dev/pts $OGFSMOUNT/dev/pts
|
|
||||||
[ $# = 0 ] && $(chroot $OGFSMOUNT /sbin/getty 38400 `tty`)
|
|
||||||
[ $# = 1 ] && chroot $OGFSMOUNT $1
|
|
||||||
}
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogFSHUnmount
|
|
||||||
#@brief Desmonta el 2nd FS del cliente desde el Servidor Opengnsys
|
|
||||||
#@param
|
|
||||||
#@return
|
|
||||||
#@exception
|
|
||||||
#@note
|
|
||||||
#@todo
|
|
||||||
#@version 0.9 - Primera versión para OpenGnSys
|
|
||||||
#@author Antonio J. Doblas Viso, Universidad de Málaga
|
|
||||||
#@date 2010/02/15
|
|
||||||
#*/ ##
|
|
||||||
|
|
||||||
function ogFSHUnmount ()
|
|
||||||
{
|
|
||||||
cd /tmp
|
|
||||||
umount -d -f -l $OGFSMOUNT/proc
|
|
||||||
umount -d -f -l $OGFSMOUNT/sys
|
|
||||||
umount -d -f -l $OGFSMOUNT/tmp
|
|
||||||
umount -d -f -l $OGFSMOUNT/dev
|
|
||||||
umount -d -f -l $OGFSMOUNT/dev/pts
|
|
||||||
umount -d -f -l $OGFSMOUNT
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
|
||||||
# ogFSHCreate str_versionUbuntu
|
|
||||||
#@brief Crea el 2nd FS del cliente desde el Servidor Opengnsys
|
|
||||||
#@param 1 Versión de ubuntu a generar, jaunty karmic
|
|
||||||
#@return
|
|
||||||
#@exception
|
|
||||||
#@note
|
|
||||||
#@todo
|
|
||||||
#@version 0.9 - Primera versión para OpenGnSys
|
|
||||||
#@author Antonio J. Doblas Viso, Universidad de Málaga
|
|
||||||
#@date 2010/02/15
|
|
||||||
#*/ ##
|
|
||||||
|
|
||||||
function ogFSHCreate ()
|
|
||||||
{
|
|
||||||
#Definicion de variables.
|
|
||||||
local SCRIPT RUNME FSCLIENTSIZEMB PASSROOT LASTDEBOOTSTRAP OGMUSTCOMPILE OGFSLABEL
|
|
||||||
FSCLIENTSIZEMB=1000
|
|
||||||
PASSROOT=og
|
|
||||||
SCRIPT=/root/configure.sh
|
|
||||||
RUNME=$OGFSMOUNT$SCRIPT
|
|
||||||
LASTDEBOOTSTRAP=http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.20_all.deb
|
|
||||||
OGMUSTCOMPILE="http://www.informatica.us.es:8080/opengnsys/browser/trunk/client/engine/ToolsGNU.c?format=txt -O /root/ToolsGNU.c"
|
|
||||||
OGFSLABEL=og2FS
|
|
||||||
#TODO comprobar la compatibilidad del SO host
|
|
||||||
|
|
||||||
if [ $# != 1 ]
|
|
||||||
then
|
|
||||||
echo Debes introducir como argumento: jaunty karmic lucid
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
#TODO: configurar la version lucid
|
|
||||||
#TODO: introducir un nuevo case para la vesion
|
|
||||||
case $1 in
|
|
||||||
jaunty|JAUNTY)
|
|
||||||
VERSION=jaunty
|
|
||||||
RELEASE=2.6.28-11-generic
|
|
||||||
;;
|
|
||||||
karmic|KARMIC)
|
|
||||||
VERSION=karmic
|
|
||||||
RELEASE=2.6.31-14-generic
|
|
||||||
;;
|
|
||||||
lucid|LUCID)
|
|
||||||
VERSION=lucid
|
|
||||||
#RELEASE=2.6.32-19-generic
|
|
||||||
RELEASE=2.6.32-21-generic-pae
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# instalamos el ultimo debotstrap para permitir instalar versiones superiores a nuestro sistema
|
|
||||||
apt-get install gdebi-core
|
|
||||||
wget $LASTDEBOOTSTRAP
|
|
||||||
gdebi -n debootstrap_1.0.20_all.deb
|
|
||||||
|
|
||||||
#Creamos el disco virtual con el filesystem del cliente.
|
|
||||||
dd if=/dev/zero of=$OGFSFILE bs=1048576 count=$FSCLIENTSIZEMB
|
|
||||||
mkfs.ext3 -b 4096 -L $OGFSLABEL $OGFSFILE -F
|
|
||||||
#Creamos el directorio donde montaremos el disco virtual
|
|
||||||
mkdir -p $OGFSMOUNT
|
|
||||||
#Montamos el dispositivo virtual en su punto de montaje.
|
|
||||||
mount $OGFSFILE $OGFSMOUNT -t ext3 -o loop
|
|
||||||
|
|
||||||
#TODO Comprobar arquitectura
|
|
||||||
#Iniciamos la creación del sistema en el directorio de clientes.
|
|
||||||
echo debootstrap --include=linux-image-$RELEASE --arch=i386 --components=main,universe $VERSION $OGFSMOUNT http://es.archive.ubuntu.com/ubuntu/
|
|
||||||
debootstrap --include=linux-image-$RELEASE --arch=i386 --components=main,universe $VERSION $OGFSMOUNT http://es.archive.ubuntu.com/ubuntu/
|
|
||||||
|
|
||||||
# preparamos el etc.sources.
|
|
||||||
cat << FIN > ${OGFSMOUNT}/etc/apt/sources.list
|
|
||||||
deb http://es.archive.ubuntu.com/ubuntu/ $VERSION main restricted
|
|
||||||
deb-src http://es.archive.ubuntu.com/ubuntu/ $VERSION main restricted
|
|
||||||
## Major bug fix updates produced after the final release of the
|
|
||||||
## distribution.
|
|
||||||
deb http://es.archive.ubuntu.com/ubuntu/ $VERSION-updates main restricted
|
|
||||||
deb-src http://es.archive.ubuntu.com/ubuntu/ $VERSION-updates main restricted
|
|
||||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
|
||||||
## team. Also, please note that software in universe WILL NOT receive any
|
|
||||||
## review or updates from the Ubuntu security team.
|
|
||||||
deb http://es.archive.ubuntu.com/ubuntu/ $VERSION universe
|
|
||||||
deb-src http://es.archive.ubuntu.com/ubuntu/ $VERSION universe
|
|
||||||
deb http://es.archive.ubuntu.com/ubuntu/ $VERSION-updates universe
|
|
||||||
deb-src http://es.archive.ubuntu.com/ubuntu/ $VERSION-updates universe
|
|
||||||
|
|
||||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
|
||||||
## team, and may not be under a free licence. Please satisfy yourself as to
|
|
||||||
## your rights to use the software. Also, please note that software in
|
|
||||||
## multiverse WILL NOT receive any review or updates from the Ubuntu
|
|
||||||
## security team.
|
|
||||||
deb http://es.archive.ubuntu.com/ubuntu/ $VERSION multiverse
|
|
||||||
deb-src http://es.archive.ubuntu.com/ubuntu/ $VERSION multiverse
|
|
||||||
deb http://es.archive.ubuntu.com/ubuntu/ $VERSION-updates multiverse
|
|
||||||
deb-src http://es.archive.ubuntu.com/ubuntu/ $VERSION-updates multiverse
|
|
||||||
|
|
||||||
## Uncomment the following two lines to add software from the 'backports'
|
|
||||||
## repository.
|
|
||||||
## N.B. software from this repository may not have been tested as
|
|
||||||
## extensively as that contained in the main release, although it includes
|
|
||||||
## newer versions of some applications which may provide useful features.
|
|
||||||
## Also, please note that software in backports WILL NOT receive any review
|
|
||||||
## or updates from the Ubuntu security team.
|
|
||||||
# deb http://es.archive.ubuntu.com/ubuntu/ $VERSION-backports main restricted universe multiverse
|
|
||||||
# deb-src http://es.archive.ubuntu.com/ubuntu/ $VERSION-backports main restricted universe multiverse
|
|
||||||
|
|
||||||
## Uncomment the following two lines to add software from Canonical's
|
|
||||||
## 'partner' repository.
|
|
||||||
## This software is not part of Ubuntu, but is offered by Canonical and the
|
|
||||||
## respective vendors as a service to Ubuntu users.
|
|
||||||
# deb http://archive.canonical.com/ubuntu $VERSION partner
|
|
||||||
# deb-src http://archive.canonical.com/ubuntu $VERSION partner
|
|
||||||
|
|
||||||
|
|
||||||
deb http://security.ubuntu.com/ubuntu $VERSION-security main restricted
|
|
||||||
deb-src http://security.ubuntu.com/ubuntu $VERSION-security main restricted
|
|
||||||
deb http://security.ubuntu.com/ubuntu $VERSION-security universe
|
|
||||||
deb-src http://security.ubuntu.com/ubuntu $VERSION-security universe
|
|
||||||
deb http://security.ubuntu.com/ubuntu $VERSION-security multiverse
|
|
||||||
deb-src http://security.ubuntu.com/ubuntu $VERSION-security multiverse
|
|
||||||
|
|
||||||
|
|
||||||
deb http://archive.ubuntu.com/ubuntu $VERSION main
|
|
||||||
deb http://free.nchc.org.tw/drbl-core drbl stable
|
|
||||||
deb http://free.nchc.org.tw/ubuntu $VERSION-security main restricted universe multiverse
|
|
||||||
deb http://ppa.launchpad.net/freenx-team/ubuntu/ $VERSION main
|
|
||||||
deb http://ppa.launchpad.net/randomaction/ppa/ubuntu $VERSION main
|
|
||||||
deb-src http://ppa.launchpad.net/randomaction/ppa/ubuntu $VERSION main
|
|
||||||
FIN
|
|
||||||
|
|
||||||
#TODO: fichero etc/hosts
|
|
||||||
#TODO: fichero etc/resolv.conf
|
|
||||||
echo "2ndFSHclient" > ${OGFSMOUNT}/etc/hostname
|
|
||||||
#TODO: introducir mas consoluas para el acceso como root.
|
|
||||||
echo "pts/0" >> ${OGFSMOUNT}/etc/securetty
|
|
||||||
echo "pts/1" >> ${OGFSMOUNT}/etc/securetty
|
|
||||||
echo "pts/2" >> ${OGFSMOUNT}/etc/securetty
|
|
||||||
echo "pts/3" >> ${OGFSMOUNT}/etc/securetty
|
|
||||||
|
|
||||||
# copiamos algunas cosas del nfsexport
|
|
||||||
echo "Linking fonts for browser1 $OGLIB"
|
|
||||||
mkdir -p $OGFSMOUNT/usr/local/Trolltech/QtEmbedded-4.5.1/lib/
|
|
||||||
cp -pr $OGLIB/fonts $OGFSMOUNT/usr/local/Trolltech/QtEmbedded-4.5.1/lib/fonts
|
|
||||||
|
|
||||||
echo "Linking fonts for browser2 $OGLIB"
|
|
||||||
mkdir -p $OGFSMOUNT/usr/local/QtEmbedded-4.6.2/lib/
|
|
||||||
cp -pr $OGLIB/fonts $OGFSMOUNT/usr/local/QtEmbedded-4.6.2/lib/fonts
|
|
||||||
|
|
||||||
echo "Coping pci.ids"
|
|
||||||
cp -pr $OGLIB/pci.ids $OGFSMOUNT/etc
|
|
||||||
|
|
||||||
# Guión de ejecución y personalización final.
|
|
||||||
cat << FIN > $RUNME
|
|
||||||
#!/bin/bash
|
|
||||||
################################################################
|
|
||||||
##################### SOFTWARE #####################
|
|
||||||
################################################################
|
|
||||||
export LANGUAGE=C
|
|
||||||
export LC_ALL=C
|
|
||||||
export LANG=C
|
|
||||||
|
|
||||||
dpkg-divert --local --rename --add /sbin/initctl
|
|
||||||
ln -s /bin/true /sbin/initctl
|
|
||||||
|
|
||||||
|
|
||||||
apt-get -y update
|
|
||||||
|
|
||||||
# software system
|
|
||||||
apt-get -y --force-yes install linux-image-$RELEASE wget dialog man-db htop
|
|
||||||
#
|
|
||||||
# software to compile code
|
|
||||||
apt-get -y --force-yes install build-essential libattr* attr make m4 gettext libmhash-dev gdebi-core gawk
|
|
||||||
wget $OGMUSTCOMPILE
|
|
||||||
source /root/ToolsGNU.c
|
|
||||||
#
|
|
||||||
# sofware networking
|
|
||||||
apt-get -y --force-yes install netpipes nfs-common sshfs smbfs smbclient davfs2
|
|
||||||
ctorrent install
|
|
||||||
udpcast install
|
|
||||||
#
|
|
||||||
# software services
|
|
||||||
apt-get -y --force-yes install openssh-server bittornado trickle
|
|
||||||
#
|
|
||||||
# software disk and filesystem
|
|
||||||
apt-get -y --force-yes install drbl-ntfsprogs ntfsprogs parted
|
|
||||||
apt-get -y --force-yes install dmraid dmsetup mdadm lvm2 e2fsprogs jfsutils reiserfsprogs xfsprogs unionfs-fuse mhddfs squashfs-tools
|
|
||||||
ntfs-3g install
|
|
||||||
#
|
|
||||||
# software cloning
|
|
||||||
apt-get -y --force-yes install drbl-partimage fsarchiver pv kexec-tools
|
|
||||||
wget -O partclone_0.2.8_i386.deb http://downloads.sourceforge.net/project/partclone/stable/0.2.8/partclone_0.2.8_i386.deb?use_mirror=ovh
|
|
||||||
gdebi -n partclone_0.2.8_i386.deb
|
|
||||||
mbuffer install
|
|
||||||
#
|
|
||||||
## software postconf
|
|
||||||
apt-get -y --force-yes install drbl-chntpw chntpw ethtool lshw gawk
|
|
||||||
ms-sys install
|
|
||||||
#
|
|
||||||
# software compressor
|
|
||||||
apt-get -y --force-yes install lzma zip unzip gzip lzop drbl-lzop
|
|
||||||
|
|
||||||
apt-get -y --force-yes remove busybox
|
|
||||||
apt-get -y --force-yes install busybox-static bash-static
|
|
||||||
#
|
|
||||||
####################################################################
|
|
||||||
###################### Preparando el entorno ######################
|
|
||||||
###################################################################
|
|
||||||
mkdir -p /var/lock
|
|
||||||
dpkg-reconfigure passwd
|
|
||||||
echo "root:$PASSROOT" | chpasswd
|
|
||||||
mv /etc/fstab /etc/fstab.original 2>/dev/null
|
|
||||||
mv /etc/mtab /etc/mtab.original 2>/dev/null
|
|
||||||
FIN
|
|
||||||
|
|
||||||
chmod +x $RUNME
|
|
||||||
|
|
||||||
#chroot hacia el punto de montaje.
|
|
||||||
ogFSHMount $SCRIPT
|
|
||||||
### Desmontamos y salimos.
|
|
||||||
ogFSHUnmount 2>/dev/null
|
|
||||||
ogFSHUnmount 2>/dev/null
|
|
||||||
ogFSHUnmount 2>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
###### Funciones para los clientes offline
|
|
||||||
function agregarOG {
|
|
||||||
cd $NEWROOT
|
|
||||||
mkdir -p opt/opengnsys
|
|
||||||
cp -prv /opt/opengnsys/client/* $NEWROOT/opt/opengnsys
|
|
||||||
echo "agregando OG al newinitrd"
|
|
||||||
}
|
|
||||||
|
|
||||||
function finalizarISO
|
|
||||||
{
|
|
||||||
cd $ANTERIORPWD
|
|
||||||
mv $TMPINITRD/new-initrd.gz $DEST/initrdISO.gz
|
|
||||||
if [ $LINUX ] ; then
|
|
||||||
mv $TMPINITRD/linux $DEST/linuxISO
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function CrearISO {
|
|
||||||
mkdir -p tmp/iso/isolinux
|
|
||||||
#cd tmp/iso/
|
|
||||||
cp -prv /usr/lib/syslinux/* tmp/iso/isolinux/
|
|
||||||
cp -prv /usr/share/gpxe/* tmp/iso/isolinux/
|
|
||||||
cp -prv /tmp/linux tmp/iso/isolinux/linuxISO
|
|
||||||
cp -prv /tmp/initrd.gz tmp/iso/isolinux/
|
|
||||||
cp -prv /opt/opengnsys/client/og2ndFS tmp/iso/isolinux/
|
|
||||||
|
|
||||||
|
|
||||||
cat << FIN > tmp/iso/isolinux/isolinux.cfg
|
|
||||||
DEFAULT menu.c32
|
|
||||||
PROMPT 0
|
|
||||||
ALLOWOPTIONS 1
|
|
||||||
|
|
||||||
MENU TITLE FuTuR3 Live Collection
|
|
||||||
|
|
||||||
LABEL gpxe
|
|
||||||
MENU LABEL gpxe
|
|
||||||
KERNEL /clonezilla/live/vmlinuz1
|
|
||||||
APPEND initrd=/clonezilla/live/initrd1.img boot=live union=aufs noswap vga=788 ip=frommedia
|
|
||||||
|
|
||||||
|
|
||||||
#default 0
|
|
||||||
#prompt 1
|
|
||||||
#timeout 100
|
|
||||||
|
|
||||||
#display mensaje.txt
|
|
||||||
|
|
||||||
LABEL 0
|
|
||||||
MENU LABEL ogClient
|
|
||||||
KERNEL linuxISO
|
|
||||||
APPEND initrd=initrd.gz ro vga=788 irqpoll acpi=on boot=admin status=offline
|
|
||||||
|
|
||||||
LABEL 1
|
|
||||||
MENU LABEL ogClient1 sin vga
|
|
||||||
KERNEL linuxISO
|
|
||||||
APPEND initrd=initrd.gz ro irqpoll acpi=on boot=admin status=offline
|
|
||||||
|
|
||||||
LABEL 2
|
|
||||||
MENU LABEL ogClient2 sin irqpoll
|
|
||||||
KERNEL linuxISO
|
|
||||||
APPEND initrd=initrd.gz ro acpi=on boot=admin status=offline
|
|
||||||
|
|
||||||
LABEL 3
|
|
||||||
MENU LABEL ogClient3 acpi=off
|
|
||||||
KERNEL linuxISO
|
|
||||||
APPEND initrd=initrd.gz ro acpi=off boot=admin status=offline
|
|
||||||
|
|
||||||
|
|
||||||
#LABEL ogclient
|
|
||||||
#KERNEL /ogclient/linuxISO
|
|
||||||
#APPEND initrd=/ogclient/initrdISO.img
|
|
||||||
|
|
||||||
#KERNEL linuxISO
|
|
||||||
#APPEND initrd=initrdISO.img
|
|
||||||
|
|
||||||
LABEL 4
|
|
||||||
MENU LABEL local
|
|
||||||
localboot 0x80
|
|
||||||
append -
|
|
||||||
|
|
||||||
|
|
||||||
label 5
|
|
||||||
MENU LABEL Network boot via gPXE lkrn
|
|
||||||
KERNEL gpxe.lkrn
|
|
||||||
|
|
||||||
label 5
|
|
||||||
MENU LABEL Network boot via gPXE usb
|
|
||||||
KERNEL gpxe.usb
|
|
||||||
|
|
||||||
label 5
|
|
||||||
MENU LABEL Network boot via gPXE pxe
|
|
||||||
KERNEL gpxe.pxe
|
|
||||||
|
|
||||||
label 5
|
|
||||||
MENU LABEL Network boot via gPXE iso
|
|
||||||
KERNEL gpxe.iso
|
|
||||||
FIN
|
|
||||||
#### /tmp/iso#
|
|
||||||
mkisofs -V ogClient -o ogClient.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table tmp/iso
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function probarISO {
|
|
||||||
#/tmp/iso
|
|
||||||
qemu -m 256 -boot d -cdrom ogClient.iso
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,137 +0,0 @@
|
||||||
#/bin/sh
|
|
||||||
|
|
||||||
ogConfigureRamfs ()
|
|
||||||
{
|
|
||||||
mkdir -p /tmp/og2ndFStmp/
|
|
||||||
touch /tmp/og2ndFStmp/modules.dep.temp
|
|
||||||
touch /tmp/og2ndFStmp/modules.dep
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ogExportKernelParameters ()
|
|
||||||
{
|
|
||||||
GLOBAL="cat /proc/cmdline"
|
|
||||||
for i in `${GLOBAL}`
|
|
||||||
do
|
|
||||||
echo $i | grep "=" > /dev/null && export $i
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
ogCheckPointBreak ()
|
|
||||||
{
|
|
||||||
# firstshell=0 SH para Arranque en modo depuracion para el cliente intrd
|
|
||||||
if [ "$firstshell" = "0" ]
|
|
||||||
then
|
|
||||||
echo "entrando en sh antes de configurar la red"
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$firstshell" = "1" ]
|
|
||||||
then
|
|
||||||
echo "entrando en sh despues de configurar la red"
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
# firstrunt=sh Arranque en modo depuracion para el cliente intrd
|
|
||||||
if [ "$firstrun" = "9" ]
|
|
||||||
then
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ogLoadNetModule ()
|
|
||||||
{
|
|
||||||
#cargando netmodule
|
|
||||||
if [ -n "$netmodule" ]
|
|
||||||
then
|
|
||||||
echo "Cargando modulo de red $netmodule"
|
|
||||||
insmod `find /lib/modules/ -name ${netmodule}*`
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ogGetROOTSERVER ()
|
|
||||||
{
|
|
||||||
# get nfs root from dhcp
|
|
||||||
if [ "x${NFSROOT}" = "xauto" ]; then
|
|
||||||
# check if server ip is part of dhcp root-path
|
|
||||||
if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then
|
|
||||||
NFSROOT=${ROOTSERVER}:${ROOTPATH}
|
|
||||||
else
|
|
||||||
NFSROOT=${ROOTPATH}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
|
|
||||||
elif [ -n "${NFSROOT}" ]; then
|
|
||||||
# nfs options are an optional arg
|
|
||||||
if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then
|
|
||||||
NFSOPTS="-o ${NFSROOT#*,}"
|
|
||||||
fi
|
|
||||||
NFSROOT=${NFSROOT%%,*}
|
|
||||||
if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then
|
|
||||||
NFSROOT=${ROOTSERVER}:${NFSROOT}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
export ROOTSERVER
|
|
||||||
}
|
|
||||||
|
|
||||||
ogConectROOTSERVER ()
|
|
||||||
{
|
|
||||||
echo Preparando conexión con el Repositorio \$ROOTSERVER \$BOOTMODE \$MOUNTOPTS
|
|
||||||
## Montamos el resto de cosas necesarias
|
|
||||||
#printf "$MSG_MOUNTREPO\n" $BOOTMODE;
|
|
||||||
|
|
||||||
#mount -t nfs -onolock,ro
|
|
||||||
nfsmount -o nolock,ro $ROOTSERVER:/opt/opengnsys/client /opt/opengnsys;
|
|
||||||
#mount -t nfs -o nolock
|
|
||||||
nfsmount -o nolock $ROOTSERVER:/opt/opengnsys/log/clients /opt/opengnsys/log;
|
|
||||||
#mount -t nfs -o "\$MOUNTOPTS" \$SERVERNFS:/opt/opengnsys/images /opt/opengnsys/images;
|
|
||||||
#mount -t tmpfs none /opt/opengnsys/images -o size=5m
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Parameter: Where to mount the filesystem
|
|
||||||
mountroot ()
|
|
||||||
{
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running OpenGnsys /scripts/og-top"
|
|
||||||
run_scripts /scripts/og-top
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
# If the root device hasn't shown up yet, give it a little while
|
|
||||||
# to deal with removable devices
|
|
||||||
|
|
||||||
|
|
||||||
ogConfigureRamfs
|
|
||||||
ogExportKernelParameters
|
|
||||||
ogCheckPointBreak
|
|
||||||
ogLoadNetModule
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount"
|
|
||||||
run_scripts /scripts/og-premount
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
. /scripts/functions
|
|
||||||
configure_networking
|
|
||||||
ogGetROOTSERVER
|
|
||||||
ogCheckPointBreak
|
|
||||||
|
|
||||||
ogConectROOTSERVER
|
|
||||||
# ogConectROOTMEDIA
|
|
||||||
ogCheckPointBreak
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /opt/og2fs
|
|
||||||
mount /opt/opengnsys/og2ndFS /opt/og2fs -o loop -o ro
|
|
||||||
cp -R /opt/og2fs/etc/* /etc/ # */
|
|
||||||
mount /opt/og2fs/usr /usr
|
|
||||||
mount /opt/og2fs/lib /lib
|
|
||||||
mount /opt/og2fs/bin /bin
|
|
||||||
mount /opt/og2fs/sbin /sbin
|
|
||||||
unset PATH
|
|
||||||
export PATH=/opt/og2fs/sbin
|
|
||||||
export PATH=/opt/og2fs/bin:$PATH
|
|
||||||
export PATH=/opt/og2fs/sbin:$PATH
|
|
||||||
export PATH=$PATH:/opt/og2fs/opt/drbl/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
||||||
}
|
|
||||||
mountroot
|
|
|
@ -1 +0,0 @@
|
||||||
RESUME=UUID=e8ea296e-815a-44d5-be24-b51d6b6fce4d
|
|
|
@ -1,43 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs hook for OpenGnsys
|
|
||||||
|
|
||||||
|
|
||||||
PREREQ="og"
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
mkdir -p ${DESTDIR}/scripts/og-top
|
|
||||||
mkdir -p ${DESTDIR}/scripts/og-premount
|
|
||||||
mkdir -p ${DESTDIR}/scripts/og-bottom
|
|
||||||
mkdir -p ${DESTDIR}/mnt/
|
|
||||||
mkdir -p ${DESTDIR}/net/
|
|
||||||
mkdir -p ${DESTDIR}/usr
|
|
||||||
mkdir -p ${DESTDIR}/var/lock
|
|
||||||
mkdir -p ${DESTDIR}/var/log
|
|
||||||
mkdir -p ${DESTDIR}/opt/opengnsys;
|
|
||||||
|
|
||||||
# Insert basic binaries
|
|
||||||
copy_exec /bin/bash-static /bin/bash
|
|
||||||
copy_exec /usr/bin/unionfs-fuse
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Insert OpenGnsys Engine
|
|
||||||
#mkdir -p ${DESTDIR}/opt/opengnsys/lib/engine
|
|
||||||
#cp -prv /opt/opengnsys/client/lib/engine ${DESTDIR}/opt/opengnsys/lib/engine
|
|
||||||
|
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
#
|
|
||||||
# initramfs.conf
|
|
||||||
# Configuration file for mkinitramfs(8). See initramfs.conf(5).
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# MODULES: [ most | netboot | dep | list ]
|
|
||||||
#
|
|
||||||
# most - Add all framebuffer, acpi, filesystem, and harddrive drivers.
|
|
||||||
#
|
|
||||||
# dep - Try and guess which modules to load.
|
|
||||||
#
|
|
||||||
# netboot - Add the base modules, network modules, but skip block devices.
|
|
||||||
#
|
|
||||||
# list - Only include modules from the 'additional modules' list
|
|
||||||
#
|
|
||||||
|
|
||||||
MODULES=most
|
|
||||||
|
|
||||||
#
|
|
||||||
# BUSYBOX: [ y | n ]
|
|
||||||
#
|
|
||||||
# Use busybox if available.
|
|
||||||
#
|
|
||||||
|
|
||||||
BUSYBOX=y
|
|
||||||
|
|
||||||
#
|
|
||||||
# COMPCACHE_SIZE: [ "x K" | "x M" | "x G" | "x %" ]
|
|
||||||
#
|
|
||||||
# Amount of RAM to use for RAM-based compressed swap space.
|
|
||||||
#
|
|
||||||
# An empty value - compcache isn't used, or added to the initramfs at all.
|
|
||||||
# An integer and K (e.g. 65536 K) - use a number of kilobytes.
|
|
||||||
# An integer and M (e.g. 256 M) - use a number of megabytes.
|
|
||||||
# An integer and G (e.g. 1 G) - use a number of gigabytes.
|
|
||||||
# An integer and % (e.g. 50 %) - use a percentage of the amount of RAM.
|
|
||||||
#
|
|
||||||
# You can optionally install the compcache package to configure this setting
|
|
||||||
# via debconf and have userspace scripts to load and unload compcache.
|
|
||||||
#
|
|
||||||
|
|
||||||
COMPCACHE_SIZE=""
|
|
||||||
|
|
||||||
#
|
|
||||||
# NFS Section of the config.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# BOOT: [ local | nfs ]
|
|
||||||
#
|
|
||||||
# local - Boot off of local media (harddrive, USB stick).
|
|
||||||
#
|
|
||||||
# nfs - Boot using an NFS drive as the root of the drive.
|
|
||||||
#
|
|
||||||
|
|
||||||
BOOT=local
|
|
||||||
|
|
||||||
#
|
|
||||||
# DEVICE: ...
|
|
||||||
#
|
|
||||||
# Specify the network interface, like eth0
|
|
||||||
#
|
|
||||||
|
|
||||||
DEVICE=eth0
|
|
||||||
|
|
||||||
#
|
|
||||||
# NFSROOT: [ auto | HOST:MOUNT ]
|
|
||||||
#
|
|
||||||
|
|
||||||
NFSROOT=auto
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
# List of modules that you want to include in your initramfs.
|
|
||||||
#
|
|
||||||
# Syntax: module_name [args ...]
|
|
||||||
#
|
|
||||||
# You must run update-initramfs(8) to effect this change.
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
#
|
|
||||||
# raid1
|
|
||||||
# sd_mod
|
|
||||||
vga16b
|
|
||||||
vesafb
|
|
||||||
fbcon
|
|
||||||
|
|
|
@ -1,194 +0,0 @@
|
||||||
# OpenGnsys Local filesystem mounting -*- shell-script -*-
|
|
||||||
|
|
||||||
|
|
||||||
ogLinkBusybox ()
|
|
||||||
{
|
|
||||||
for n in `busybox | tail -19 | tr "," "\\n" | sed -e "s/ \|\t//"|grep .` ; do
|
|
||||||
ln -f /bin/busybox /bin/$n
|
|
||||||
done
|
|
||||||
ln -f /bin/busybox /bin/sh
|
|
||||||
}
|
|
||||||
|
|
||||||
ogConfigureRamfs ()
|
|
||||||
{
|
|
||||||
mkdir -p /tmp/og2ndFStmp/
|
|
||||||
touch /tmp/og2ndFStmp/modules.dep.temp
|
|
||||||
touch /tmp/og2ndFStmp/modules.dep
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ogExportKernelParameters ()
|
|
||||||
{
|
|
||||||
GLOBAL="cat /proc/cmdline"
|
|
||||||
for i in `${GLOBAL}`
|
|
||||||
do
|
|
||||||
echo $i | grep "=" > /dev/null && export $i
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
ogCheckPointBreak ()
|
|
||||||
{
|
|
||||||
# firstshell=0 SH para Arranque en modo depuracion para el cliente intrd
|
|
||||||
if [ "$firstshell" = "0" ]
|
|
||||||
then
|
|
||||||
echo "entrando en sh antes de configurar la red"
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$firstshell" = "1" ]
|
|
||||||
then
|
|
||||||
echo "entrando en sh despues de configurar la red"
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
# firstrunt=sh Arranque en modo depuracion para el cliente intrd
|
|
||||||
if [ "$firstrun" = "9" ]
|
|
||||||
then
|
|
||||||
sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ogLoadNetModule ()
|
|
||||||
{
|
|
||||||
#cargando netmodule
|
|
||||||
if [ -n "$netmodule" ]
|
|
||||||
then
|
|
||||||
echo "Cargando modulo de red $netmodule"
|
|
||||||
insmod `find /lib/modules/ -name ${netmodule}*`
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ogGetROOTSERVER ()
|
|
||||||
{
|
|
||||||
# get nfs root from dhcp
|
|
||||||
if [ "x${NFSROOT}" = "xauto" ]; then
|
|
||||||
# check if server ip is part of dhcp root-path
|
|
||||||
if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then
|
|
||||||
NFSROOT=${ROOTSERVER}:${ROOTPATH}
|
|
||||||
else
|
|
||||||
NFSROOT=${ROOTPATH}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
|
|
||||||
elif [ -n "${NFSROOT}" ]; then
|
|
||||||
# nfs options are an optional arg
|
|
||||||
if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then
|
|
||||||
NFSOPTS="-o ${NFSROOT#*,}"
|
|
||||||
fi
|
|
||||||
NFSROOT=${NFSROOT%%,*}
|
|
||||||
if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then
|
|
||||||
NFSROOT=${ROOTSERVER}:${NFSROOT}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
export ROOTSERVER
|
|
||||||
}
|
|
||||||
|
|
||||||
ogConectROOTSERVER ()
|
|
||||||
{
|
|
||||||
echo Preparando conexión con el Repositorio \$ROOTSERVER \$BOOTMODE \$MOUNTOPTS
|
|
||||||
## Montamos el resto de cosas necesarias
|
|
||||||
#printf "$MSG_MOUNTREPO\n" $BOOTMODE;
|
|
||||||
nfsmount -o nolock,ro $ROOTSERVER:/opt/opengnsys/client /opt/opengnsys;
|
|
||||||
#mount -t nfs -onolock,ro $ROOTSERVER:/opt/opengnsys/client /opt/opengnsys;
|
|
||||||
nfsmount -o nolock $ROOTSERVER:/opt/opengnsys/log/clients /opt/opengnsys/log;
|
|
||||||
#mount -t nfs -o nolock $ROOTSERVER:/opt/opengnsys/log/clients /opt/opengnsys/log;
|
|
||||||
#mount -t nfs -o "\$MOUNTOPTS" \$SERVERNFS:/opt/opengnsys/images /opt/opengnsys/images;
|
|
||||||
#mount -t tmpfs none /opt/opengnsys/images -o size=5m
|
|
||||||
}
|
|
||||||
|
|
||||||
unionmount()
|
|
||||||
{
|
|
||||||
FUSE_OPT="-o default_permissions -o allow_other -o use_ino -o nonempty -o suid"
|
|
||||||
UNION_OPT="-o cow -o noinitgroups"
|
|
||||||
UPATH="/unionfs"
|
|
||||||
UBIN="unionfs-fuse"
|
|
||||||
mkdir -p /unionfs/host
|
|
||||||
mkdir -p /unionfs/union
|
|
||||||
dir=$1
|
|
||||||
#echo "creando mkdir -p /unionfs/host/$dir"
|
|
||||||
mkdir -p /unionfs/host/$dir
|
|
||||||
#echo "montando mount --bind /$dir /unionfs/host/$dir "
|
|
||||||
mount --bind /$dir /unionfs/host/$dir
|
|
||||||
##########echo "creando mkdir -p /unionfs/union/$dir"
|
|
||||||
mkdir -p /unionfs/union/$dir
|
|
||||||
host="/unionfs/host/${dir}=RW"
|
|
||||||
common="/opt/og2fs/${dir}=RO"
|
|
||||||
#####echo " ejecuantdo $UBIN $FUSE_OPT $UNION_OPT ${host}:${common} /unionfs/union/$dir "
|
|
||||||
$UBIN $FUSE_OPT $UNION_OPT ${host}:${common} /unionfs/union/$dir
|
|
||||||
|
|
||||||
mount --bind /unionfs/union/$dir /$dir
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Parameter: Where to mount the filesystem
|
|
||||||
mountroot ()
|
|
||||||
{
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running OpenGnsys /scripts/og-top"
|
|
||||||
run_scripts /scripts/og-top
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
# If the root device hasn't shown up yet, give it a little while
|
|
||||||
# to deal with removable devices
|
|
||||||
|
|
||||||
|
|
||||||
ogConfigureRamfs
|
|
||||||
ogExportKernelParameters
|
|
||||||
ogCheckPointBreak
|
|
||||||
ogLoadNetModule
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-premount"
|
|
||||||
run_scripts /scripts/og-premount
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
. /scripts/functions
|
|
||||||
configure_networking
|
|
||||||
|
|
||||||
# for the portmapper we need localhost
|
|
||||||
ifconfig lo 127.0.0.1
|
|
||||||
/etc/init.d/portmap start
|
|
||||||
|
|
||||||
ogGetROOTSERVER
|
|
||||||
ogCheckPointBreak
|
|
||||||
|
|
||||||
ogConectROOTSERVER
|
|
||||||
# ogConectROOTMEDIA
|
|
||||||
ogCheckPointBreak
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /opt/og2fs
|
|
||||||
mount /opt/opengnsys/og2ndFS /opt/og2fs -o loop -o ro
|
|
||||||
|
|
||||||
#mount -t tmpfs -o size=8192 tmpfs /unionfs
|
|
||||||
for i in etc; do
|
|
||||||
unionmount $i
|
|
||||||
done
|
|
||||||
# root var lib bin sbin usr
|
|
||||||
cat /proc/mounts > /etc/mtab
|
|
||||||
|
|
||||||
#cp -R /opt/og2fs/etc/* /etc/ # */
|
|
||||||
mount /opt/og2fs/usr /usr
|
|
||||||
mount /opt/og2fs/lib /lib
|
|
||||||
mount /opt/og2fs/bin /bin
|
|
||||||
mount /opt/og2fs/sbin /sbin
|
|
||||||
#export PATH=$PATH:/opt/og2fs/opt/drbl/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
||||||
#chmod 777 /etc/rcog
|
|
||||||
##unset PATH
|
|
||||||
##export PATH=$PATH:/opt/og2fs/sbin
|
|
||||||
##export PATH=/opt/og2fs/bin:$PATH
|
|
||||||
##export PATH=/opt/og2fs/sbin:$PATH
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-bottom"
|
|
||||||
run_scripts /scripts/og-bottom
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
|
|
||||||
#set -a
|
|
||||||
#trap "mount | grep loop && /opt/og2fs/bin/bash" 1 2 3 9 15
|
|
||||||
|
|
||||||
#/opt/opengnsys/etc/preinit/default.sh
|
|
||||||
echo "llamando a init desde scritps og"
|
|
||||||
exec init
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
#
|
|
||||||
# Configuration file for update-initramfs(8)
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# update_initramfs [ yes | all | no ]
|
|
||||||
#
|
|
||||||
# Default is yes
|
|
||||||
# If set to all update-initramfs will update all initramfs
|
|
||||||
# If set to no disables any update to initramfs beside kernel upgrade
|
|
||||||
|
|
||||||
update_initramfs=yes
|
|
||||||
|
|
||||||
#
|
|
||||||
# backup_initramfs [ yes | no ]
|
|
||||||
#
|
|
||||||
# Default is no
|
|
||||||
# If set to no leaves no .bak backup files.
|
|
||||||
|
|
||||||
backup_initramfs=no
|
|
|
@ -1,14 +0,0 @@
|
||||||
# This is run first except when booting in single-user mode
|
|
||||||
#
|
|
||||||
#::sysinit:/opt/opengnsys/etc/preinit/default.sh
|
|
||||||
# /bin/sh invocations on selected ttys
|
|
||||||
#
|
|
||||||
# Start an "askfirst" shell on the console (whatever that may be)
|
|
||||||
#::askfirst:/bin/sh
|
|
||||||
# Start an "askfirst" shell on /dev/tty2-4
|
|
||||||
#tty1::respawn:/sbin/getty 38400 tty1
|
|
||||||
tty1::respawn:/opt/opengnsys/etc/preinit/default.sh
|
|
||||||
tty2::respawn:/sbin/getty 38400 tty2
|
|
||||||
tty3::respawn:/sbin/getty 38400 tty3
|
|
||||||
tty4::respawn:/sbin/getty 38400 tty4
|
|
||||||
tty5::respawn:/sbin/getty 38400 tty5
|
|
|
@ -1,30 +0,0 @@
|
||||||
# Framebuffer drivers are generally buggy and poorly-supported, and cause
|
|
||||||
# suspend failures, kernel panics and general mayhem. For this reason we
|
|
||||||
# never load them automatically.
|
|
||||||
blacklist aty128fb
|
|
||||||
blacklist atyfb
|
|
||||||
#blacklist radeonfb
|
|
||||||
blacklist cirrusfb
|
|
||||||
blacklist cyber2000fb
|
|
||||||
blacklist cyblafb
|
|
||||||
blacklist gx1fb
|
|
||||||
blacklist hgafb
|
|
||||||
blacklist i810fb
|
|
||||||
blacklist intelfb
|
|
||||||
blacklist kyrofb
|
|
||||||
blacklist lxfb
|
|
||||||
blacklist matroxfb_base
|
|
||||||
blacklist neofb
|
|
||||||
blacklist nvidiafb
|
|
||||||
blacklist pm2fb
|
|
||||||
blacklist rivafb
|
|
||||||
blacklist s1d13xxxfb
|
|
||||||
blacklist savagefb
|
|
||||||
blacklist sisfb
|
|
||||||
blacklist sstfb
|
|
||||||
blacklist tdfxfb
|
|
||||||
blacklist tridentfb
|
|
||||||
#blacklist vesafb
|
|
||||||
blacklist vfb
|
|
||||||
blacklist viafb
|
|
||||||
blacklist vt8623fb
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,461 +0,0 @@
|
||||||
# -*- shell-script -*-
|
|
||||||
|
|
||||||
catenate_cpiogz() {
|
|
||||||
# Sanity check
|
|
||||||
if [ ! -e "${1}" ]; then
|
|
||||||
echo "W:catenate_cpiogz: arg1='${1}' does not exist." >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat "${1}" >>"${__TMPCPIOGZ}"
|
|
||||||
}
|
|
||||||
|
|
||||||
force_load()
|
|
||||||
{
|
|
||||||
manual_add_modules ${@}
|
|
||||||
echo "${@}" >>"${DESTDIR}/conf/modules"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Takes a file containing a list of modules to be added as an
|
|
||||||
# argument, figures out dependancies, and adds them.
|
|
||||||
#
|
|
||||||
# Input file syntax:
|
|
||||||
#
|
|
||||||
# # comment
|
|
||||||
# modprobe_module_name [args ...]
|
|
||||||
# [...]
|
|
||||||
#
|
|
||||||
add_modules_from_file()
|
|
||||||
{
|
|
||||||
# Sanity check
|
|
||||||
if [ ! -e "${1}" ]; then
|
|
||||||
echo "W:add_modules_from_file: arg1='${1}' does not exist." >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
sed -e '/^#/d' ${1} | while read module rest; do
|
|
||||||
force_load "${module}" "${rest}"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Is this module available?
|
|
||||||
have_module()
|
|
||||||
{
|
|
||||||
modprobe --set-version="${version}" --ignore-install \
|
|
||||||
--show-depends "${1}" >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add dependent modules + eventual firmware
|
|
||||||
manual_add_modules()
|
|
||||||
{
|
|
||||||
local mam_x firmwares firmware
|
|
||||||
|
|
||||||
for mam_x in $(modprobe --set-version="${version}" --ignore-install \
|
|
||||||
--show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do
|
|
||||||
# Prune duplicates
|
|
||||||
if [ -e "${DESTDIR}/${mam_x}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "${DESTDIR}/$(dirname "${mam_x}")"
|
|
||||||
ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")"
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Adding module ${mam_x}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add firmware files if necessary
|
|
||||||
firmwares=$(modinfo -F firmware "${mam_x}")
|
|
||||||
if [ -z "${firmwares}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
for firmware in $firmwares; do
|
|
||||||
if [ -e "${DESTDIR}/lib/firmware/${firmware}" ] \
|
|
||||||
|| [ -e "${DESTDIR}/lib/firmware/${version}/${firmware}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Only print warning for missing fw of loaded module
|
|
||||||
# or forced loaded module
|
|
||||||
if [ ! -e "/lib/firmware/${firmware}" ] \
|
|
||||||
&& [ ! -e "/lib/firmware/${version}/${firmware}" ]; then
|
|
||||||
if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \
|
|
||||||
/proc/modules \
|
|
||||||
|| grep -q "^$(basename "${mam_x}" .ko)" \
|
|
||||||
"${CONFDIR}/modules"; then
|
|
||||||
echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${mam_x} .ko)" >&2
|
|
||||||
fi
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "/lib/firmware/${version}/${firmware}" ]; then
|
|
||||||
copy_exec "/lib/firmware/${version}/${firmware}"
|
|
||||||
else
|
|
||||||
copy_exec "/lib/firmware/${firmware}"
|
|
||||||
fi
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Adding firmware ${firmware}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# $1 is the source path (e.g. /usr/bin/time)
|
|
||||||
# $2 is the relative destination (e.g. /usr or /usr/time)
|
|
||||||
#
|
|
||||||
# The destination is interpreted in the same way "cp" would, meaning
|
|
||||||
# (assuming /bin is a directory):
|
|
||||||
#
|
|
||||||
# "copy_exec /usr/bin/time /bin" -> /bin/time
|
|
||||||
# "copy_exec /usr/bin/time /bin/mytime" -> /bin/mytime
|
|
||||||
#
|
|
||||||
# If $2 is left out, the same destination path as for the source arg will
|
|
||||||
# be used and directories will be created as needed, so:
|
|
||||||
#
|
|
||||||
# "copy_exec /usr/bin/time" -> /usr/bin/time
|
|
||||||
#
|
|
||||||
copy_exec() {
|
|
||||||
local source target destination final_destination x nonoptlib
|
|
||||||
local libname dirname
|
|
||||||
|
|
||||||
source="${1}"
|
|
||||||
if [ -n "${2}" ]; then
|
|
||||||
target="${2}"
|
|
||||||
else
|
|
||||||
if [ ! -e "${DESTDIR}/$(dirname "${1}")" ]; then
|
|
||||||
mkdir -p "${DESTDIR}/$(dirname "${1}")"
|
|
||||||
fi
|
|
||||||
target="${1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "${DESTDIR}/${target}" ]; then
|
|
||||||
destination="${target}/$(basename "${source}")"
|
|
||||||
else
|
|
||||||
destination="${target}"
|
|
||||||
fi
|
|
||||||
final_destination="${DESTDIR}/${destination}"
|
|
||||||
|
|
||||||
if [ -L "$final_destination" ]; then
|
|
||||||
if [ $(readlink "${final_destination}") != "${source}" ]; then
|
|
||||||
echo "W:copy_exec: Not copying ${source} to \$DESTDIR${destination}, which is already a copy of $(readlink ${final_destination})" >&2
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
ln -s ${source} ${DESTDIR}/${destination}
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Adding binary ${source}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy the dependant libraries
|
|
||||||
for x in $(ldd ${source} 2>/dev/null | sed -e '
|
|
||||||
/\//!d;
|
|
||||||
/linux-gate/d;
|
|
||||||
/=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
|
|
||||||
s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do
|
|
||||||
|
|
||||||
# Try to use non-optimised libraries where possible.
|
|
||||||
# We assume that all HWCAP libraries will be in tls,
|
|
||||||
# sse2, vfp or neon
|
|
||||||
nonoptlib=$(echo "${x}" | sed -e 's#/lib/\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#/lib/\2#')
|
|
||||||
|
|
||||||
if [ -e "${nonoptlib}" ]; then
|
|
||||||
x="${nonoptlib}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
libname=$(basename "${x}")
|
|
||||||
dirname=$(dirname "${x}")
|
|
||||||
|
|
||||||
mkdir -p "${DESTDIR}/${dirname}"
|
|
||||||
if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then
|
|
||||||
ln -s "${x}" "${DESTDIR}/${dirname}"
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Adding library ${x}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Copy entire subtrees to the initramfs
|
|
||||||
copy_modules_dir()
|
|
||||||
{
|
|
||||||
local x_mod
|
|
||||||
|
|
||||||
if ! [ -d "${MODULESDIR}/${1}" ]; then
|
|
||||||
return;
|
|
||||||
fi
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Copying module directory ${1}"
|
|
||||||
fi
|
|
||||||
for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do
|
|
||||||
manual_add_modules $(basename ${x_mod} .ko)
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# walk /sys for relevant modules
|
|
||||||
sys_walk_mod_add()
|
|
||||||
{
|
|
||||||
local driver_path module
|
|
||||||
device_path="$1"
|
|
||||||
|
|
||||||
while [ "${device_path}" != "/sys" ]; do
|
|
||||||
driver_path="$(readlink -f ${device_path}/driver)"
|
|
||||||
if [ -e "$driver_path" ]; then
|
|
||||||
module="$(basename $(readlink -f $driver_path))"
|
|
||||||
if [ -n "${module}" ]; then
|
|
||||||
force_load "${module}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
device_path="$(dirname ${device_path})"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# walk /sys for relevant modalias
|
|
||||||
sys_walk_modalias()
|
|
||||||
{
|
|
||||||
local device_path modalias
|
|
||||||
|
|
||||||
device_path="$(dirname "${1}")"
|
|
||||||
device_path="$(dirname "${device_path}")"
|
|
||||||
if [ -e "${device_path}/modalias" ]; then
|
|
||||||
modalias=$(cat "${device_path}/modalias")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${modalias}" ]; then
|
|
||||||
force_load "${modalias}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# find and only copy root relevant modules
|
|
||||||
dep_add_modules()
|
|
||||||
{
|
|
||||||
local block minor root FSTYPE root_dev_path x
|
|
||||||
|
|
||||||
# findout root block device + fstype
|
|
||||||
eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')"
|
|
||||||
if [ "${root}" = "/dev/root" ] ; then
|
|
||||||
root="/dev/disk/by-uuid/"$(/sbin/blkid -s UUID -o value ${root}) 2>/dev/null
|
|
||||||
fi
|
|
||||||
root="$(readlink -f ${root})"
|
|
||||||
|
|
||||||
# find out real rootfs on auto type
|
|
||||||
if [ "${FSTYPE}" = "auto" ]; then
|
|
||||||
eval "$(/usr/lib/klibc/bin/fstype ${root})"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check that fstype rootfs recognition
|
|
||||||
if [ "${FSTYPE}" = "unknown" ]; then
|
|
||||||
echo "mkinitramfs: unknown fstype on root ${root}"
|
|
||||||
echo "mkinitramfs: workaround is MODULES=most"
|
|
||||||
echo "mkinitramfs: Error please report bug on initramfs-tools"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add rootfs
|
|
||||||
manual_add_modules "${FSTYPE}"
|
|
||||||
|
|
||||||
# lvm luks root
|
|
||||||
if [ "${root#/dev/mapper/}" != "${root}" ]; then
|
|
||||||
minor=$((0x$(stat --format "%T" ${root}) % 256))
|
|
||||||
block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1)
|
|
||||||
if [ "${block#dm-}" != "${block}" ]; then
|
|
||||||
block=$(ls -1 /sys/block/${block}/slaves | head -n 1)
|
|
||||||
fi
|
|
||||||
block=${block%%[0-9]*}
|
|
||||||
# md root new naming scheme /dev/md/X
|
|
||||||
elif [ "${root#/dev/md/}" != "${root}" ]; then
|
|
||||||
root=${root#/dev/md/}
|
|
||||||
block=$(awk "/^md${root}/{print substr(\$5, 1, 3); exit}" \
|
|
||||||
/proc/mdstat)
|
|
||||||
# md root /dev/mdX
|
|
||||||
elif [ "${root#/dev/md}" != "${root}" ]; then
|
|
||||||
root=${root#/dev/}
|
|
||||||
block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \
|
|
||||||
/proc/mdstat)
|
|
||||||
# mmc always uses numbering in the devicename (mmcblk[0-9])
|
|
||||||
elif [ "${root#/dev/mmc}" != "${root}" ]; then
|
|
||||||
block=${root#/dev/}
|
|
||||||
block=${block%%p[0-9]*}
|
|
||||||
# classical root device
|
|
||||||
else
|
|
||||||
block=${root#/dev/}
|
|
||||||
block=${block%%[0-9]*}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Error out if /sys lack block dev
|
|
||||||
if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then
|
|
||||||
echo "mkinitramfs: missing ${block} root ${root} /sys entry"
|
|
||||||
echo "mkinitramfs: workaround is MODULES=most"
|
|
||||||
echo "mkinitramfs: Error please report the bug"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# sys walk ATA
|
|
||||||
root_dev_path=$(readlink -f /sys/block/${block}/device)
|
|
||||||
sys_walk_mod_add ${root_dev_path}
|
|
||||||
|
|
||||||
# catch old-style IDE
|
|
||||||
if [ -e /sys/bus/ide/devices/ ]; then
|
|
||||||
sys_walk_modalias ${root_dev_path}
|
|
||||||
manual_add_modules ide-disk
|
|
||||||
manual_add_modules ide-cd
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /sys/bus/scsi/devices/ ]; then
|
|
||||||
manual_add_modules sd_mod
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /sys/bus/i2o/devices/ ]; then
|
|
||||||
force_load i2o_block
|
|
||||||
force_load i2o_config
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /sys/bus/ps3_system_bus/ ]; then
|
|
||||||
for x in ps3disk ps3rom ps3-gelic ps3_sys_manager; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /sys/bus/vio/ ]; then
|
|
||||||
for x in sunvnet sunvdc; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# The modules "most" classes added per default to the initramfs
|
|
||||||
auto_add_modules()
|
|
||||||
{
|
|
||||||
case "$1" in
|
|
||||||
base)
|
|
||||||
for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid_a4tech \
|
|
||||||
hid_apple hid_belkin hid_bright hid_cherry hid_chicony \
|
|
||||||
hid_cypress hid_dell hid_ezkey hid_gyration hid_logitech \
|
|
||||||
hid_microsoft hid_monterey hid_petalynx hid_pl hid_samsung \
|
|
||||||
hid_sony hid_sunplus hid_tmff hid_zpff usb-storage ext2 \
|
|
||||||
ext3 ext4 isofs jfs nfs reiserfs udf xfs af_packet atkbd i8042 \
|
|
||||||
virtio_pci vfat nls_cp437 nls_iso8859-1; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
net)
|
|
||||||
for x in 3c59x 8139cp 8139too 8390 atl1 atl1e b44 bmac \
|
|
||||||
cxgb3 defxx dl2k e100 e1000 e1000e ehea epic100 \
|
|
||||||
ep93xx_eth eql fealnx famachi forcedeth gelic_net \
|
|
||||||
hp100 igb ipg mace mv643xx_eth myri10ge \
|
|
||||||
natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \
|
|
||||||
r8169 s2io sis900 skge sky2 slhc smc911x starfire \
|
|
||||||
sundance sungem sungem_phy sunhme sunvnet tg3 tlan de2104x \
|
|
||||||
de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \
|
|
||||||
typhon via-rhine via-velocity virtio_net yellowfin; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
ide)
|
|
||||||
copy_modules_dir kernel/drivers/ide
|
|
||||||
;;
|
|
||||||
scsi)
|
|
||||||
copy_modules_dir kernel/drivers/scsi
|
|
||||||
for x in mptfc mptsas mptscsih mptspi; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
ata)
|
|
||||||
copy_modules_dir kernel/drivers/ata
|
|
||||||
;;
|
|
||||||
block)
|
|
||||||
copy_modules_dir kernel/drivers/block
|
|
||||||
copy_modules_dir kernel/drivers/usb/storage
|
|
||||||
;;
|
|
||||||
# FIXME: can be removed after Lenny release
|
|
||||||
ieee1394)
|
|
||||||
for x in ohci1394 sbp2; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
firewire)
|
|
||||||
for x in firewire-ohci firewire-sbp2; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
i2o)
|
|
||||||
for x in i2o_block; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
dasd)
|
|
||||||
for x in dasd_eckd_mod dasd_fba_mod; do
|
|
||||||
manual_add_modules "${x}"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
auto_add_modules base
|
|
||||||
auto_add_modules net
|
|
||||||
auto_add_modules ide
|
|
||||||
auto_add_modules scsi
|
|
||||||
auto_add_modules block
|
|
||||||
auto_add_modules ata
|
|
||||||
auto_add_modules i2o
|
|
||||||
auto_add_modules dasd
|
|
||||||
auto_add_modules ieee1394
|
|
||||||
auto_add_modules firewire
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
usage()
|
|
||||||
{
|
|
||||||
cat >&2 << EOF
|
|
||||||
|
|
||||||
Usage: ${0} [OPTION]... <-o outfile> [version]
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-d confdir Specify an alternative configuration directory.
|
|
||||||
-k Keep temporary directory used to make the image.
|
|
||||||
-o outfile Write to outfile.
|
|
||||||
-r root Override ROOT setting in mkinitrd.conf.
|
|
||||||
|
|
||||||
See mkinitramfs(8) for further details.
|
|
||||||
EOF
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# minimal supported kernel version
|
|
||||||
check_minkver()
|
|
||||||
{
|
|
||||||
local curversion initdir DPKG_ARCH minversion cm_x tmp
|
|
||||||
|
|
||||||
curversion="${1}"
|
|
||||||
initdir="${2}"
|
|
||||||
if [ -z "${initdir}" ]; then
|
|
||||||
DPKG_ARCH=$(dpkg --print-architecture)
|
|
||||||
case ${DPKG_ARCH} in
|
|
||||||
ia64|hppa)
|
|
||||||
minversion="2.6.15"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
minversion="2.6.12"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if dpkg --compare-versions "${curversion}" lt "${minversion}"; then
|
|
||||||
echo "W: kernel ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2
|
|
||||||
echo "W: not generating requested initramfs for kernel ${curversion}" >&2
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
set_initlist
|
|
||||||
for cm_x in ${initlist}; do
|
|
||||||
# sed: keep last line starting with MINKVER=,
|
|
||||||
# remove MINKVER= and trailing space
|
|
||||||
minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}")
|
|
||||||
if [ -z "${tmp}" ]; then
|
|
||||||
continue
|
|
||||||
elif dpkg --compare-versions "${curversion}" lt "${minver}"; then
|
|
||||||
echo "W: ${cm_x} hook script requires at least kernel version ${minver}" >&2
|
|
||||||
echo "W: not generating requested initramfs for kernel ${curversion}" >&2
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
|
@ -1,95 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ "$1" = prereqs ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
number=
|
|
||||||
suffix=
|
|
||||||
eval $(printf "%s" "$COMPCACHE_SIZE" | \
|
|
||||||
sed -nre 's/^ *([1-9][0-9]*) *([%KMGT]) *$/number="\1"; suffix="\2";/p')
|
|
||||||
|
|
||||||
if [ -z "$number" ] || [ -z "$suffix" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if have_module ramzswap; then
|
|
||||||
name=ramzswap
|
|
||||||
manual_add_modules ramzswap
|
|
||||||
elif have_module compcache; then
|
|
||||||
name=compcache
|
|
||||||
manual_add_modules compcache
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
copy_exec /sbin/swapon
|
|
||||||
|
|
||||||
mkdir -p "$DESTDIR"/etc/udev/rules.d
|
|
||||||
cat >"$DESTDIR"/etc/udev/rules.d/80-compcache.rules <<EOF
|
|
||||||
KERNEL=="ramzswap0", ACTION=="add", \\
|
|
||||||
RUN+="/sbin/swapon -p 100 /dev/ramzswap0 2>/dev/null"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
mem_total="\$(sed -nre 's/^MemTotal:\\s*([0-9]+) kB\$/\\1/p' /proc/meminfo)"
|
|
||||||
|
|
||||||
case "$suffix" in
|
|
||||||
%) kbytes="\$(($mem_total * $number / 100))" ;;
|
|
||||||
K) kbytes=$(($number)) ;;
|
|
||||||
M) kbytes=$(($number * 1024)) ;;
|
|
||||||
G) kbytes=$(($number * 1024 * 1024)) ;;
|
|
||||||
T) kbytes=$(($number * 1024 * 1024 * 1024)) ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cat >"$DESTDIR"/scripts/init-top/compcache <<EOF
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "\$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case \$1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# find total amount of available ram
|
|
||||||
TOTAL_RAM=\$( grep MemTotal /proc/meminfo |tr -d ': [A-Z][a-z]')
|
|
||||||
|
|
||||||
# Do not use compcache on the liveCD if we have more than 512M
|
|
||||||
if [ "\${BOOT}" = "casper" ]; then
|
|
||||||
if [ "\${TOTAL_RAM}" -gt 524288 ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
for x in \$(cat /proc/cmdline); do
|
|
||||||
case \${x} in
|
|
||||||
nocompcache)
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
if [ "$name" = ramzswap ]; then
|
|
||||||
cat >>"$DESTDIR"/scripts/init-top/compcache <<EOF
|
|
||||||
modprobe -q --ignore-install ramzswap disksize_kb="$kbytes"
|
|
||||||
EOF
|
|
||||||
else
|
|
||||||
cat >>"$DESTDIR"/scripts/init-top/compcache <<EOF
|
|
||||||
modprobe -q --ignore-install compcache compcache_size_kbytes="$kbytes"
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
chmod 0755 "$DESTDIR"/scripts/init-top/compcache
|
|
||||||
|
|
||||||
# vim:set et sw=2 sts=2:
|
|
|
@ -1,50 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
PREREQ="kbd|console_tools"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
. /etc/default/console-setup
|
|
||||||
|
|
||||||
# Copy console-setup configuration
|
|
||||||
mkdir -p "$DESTDIR/etc/default"
|
|
||||||
cp -p /etc/default/console-setup "$DESTDIR/etc/default"
|
|
||||||
|
|
||||||
# Assume setupcon --save has been run
|
|
||||||
if [ -f "$FONT" ]; then
|
|
||||||
FONT="/etc/console-setup/${FONT##*/}"
|
|
||||||
FONT="${FONT%.gz}"
|
|
||||||
else
|
|
||||||
FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
|
|
||||||
fi
|
|
||||||
if [ -f "$FONT" ]; then
|
|
||||||
mkdir -p "$DESTDIR${FONT%/*}"
|
|
||||||
cp -p "$FONT" "$DESTDIR$FONT"
|
|
||||||
fi
|
|
||||||
if [ -f "$ACM" ]; then
|
|
||||||
ACM="/etc/console-setup/${ACM##*/}"
|
|
||||||
ACM="${ACM%.gz}"
|
|
||||||
else
|
|
||||||
ACM="/etc/console-setup/$CHARMAP.acm"
|
|
||||||
fi
|
|
||||||
if [ -f "$ACM" ]; then
|
|
||||||
mkdir -p "$DESTDIR${ACM%/*}"
|
|
||||||
cp -p "$ACM" "$DESTDIR$ACM"
|
|
||||||
fi
|
|
||||||
if [ -f /etc/console-setup/cached.kmap.gz ]; then
|
|
||||||
mkdir -p "$DESTDIR/etc/console-setup"
|
|
||||||
cp -p /etc/console-setup/cached.kmap.gz \
|
|
||||||
"$DESTDIR/etc/console-setup/cached.kmap.gz"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
echo "udev"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
mkdir -p $DESTDIR/lib/udev/rules.d/
|
|
||||||
for rules in 55-dm.rules 60-persistent-storage-dm.rules; do
|
|
||||||
if [ -e /etc/udev/rules.d/$rules ]; then
|
|
||||||
cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
|
|
||||||
elif [ -e /lib/udev/rules.d/$rules ]; then
|
|
||||||
cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
copy_exec /sbin/dmsetup
|
|
||||||
|
|
||||||
manual_add_modules dm_mod
|
|
|
@ -1,26 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs hook for fixing broken rtc clock
|
|
||||||
# without battery
|
|
||||||
|
|
||||||
MINKVER="2.6.24"
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
# We use date, hwclock and dumpe2fs
|
|
||||||
copy_exec /bin/date /bin
|
|
||||||
copy_exec /sbin/hwclock /sbin
|
|
||||||
copy_exec /sbin/dumpe2fs /sbin
|
|
|
@ -1,41 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
copy_modules_dir kernel/drivers/char/agp
|
|
||||||
copy_modules_dir kernel/drivers/gpu
|
|
||||||
|
|
||||||
manual_add_modules fbcon
|
|
||||||
manual_add_modules vesafb
|
|
||||||
manual_add_modules vga16fb
|
|
||||||
|
|
||||||
for x in ${MODULESDIR}/initrd/*; do
|
|
||||||
x=${x##*/}
|
|
||||||
x=${x%.*}
|
|
||||||
case ${x} in
|
|
||||||
'*')
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*fb)
|
|
||||||
fbcon=y
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
manual_add_modules ${x}
|
|
||||||
done
|
|
|
@ -1,15 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
copy_exec /sbin/mount.fuse /sbin
|
|
||||||
|
|
||||||
manual_add_modules fuse
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,23 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
PREREQ="kernelextras"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
# Console utilities needed for console-setup
|
|
||||||
copy_exec /bin/setfont /bin
|
|
||||||
copy_exec /bin/kbd_mode /bin
|
|
||||||
copy_exec /bin/loadkeys /bin
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,43 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ="udev"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ ! -x /sbin/lvm ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
if [ -e /etc/lvm/lvm.conf ]; then
|
|
||||||
mkdir -p ${DESTDIR}/etc/lvm
|
|
||||||
cp /etc/lvm/lvm.conf ${DESTDIR}/etc/lvm/
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p $DESTDIR/lib/udev/rules.d/
|
|
||||||
for rules in 56-lvm.rules 60-persistent-storage-lvm.rules 85-lvm2.rules; do
|
|
||||||
if [ -e /etc/udev/rules.d/$rules ]; then
|
|
||||||
cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
|
|
||||||
elif [ -e /lib/udev/rules.d/$rules ]; then
|
|
||||||
cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
copy_exec /sbin/dmsetup
|
|
||||||
copy_exec /sbin/lvm
|
|
||||||
ln -s lvm ${DESTDIR}/sbin/vgchange
|
|
||||||
|
|
||||||
for x in dm_mod dm_snapshot dm_mirror; do
|
|
||||||
manual_add_modules ${x}
|
|
||||||
done
|
|
|
@ -1,22 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
PREREQ="fuse_utils"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
copy_exec /bin/ntfs-3g /bin
|
|
||||||
ln -s /bin/ntfs-3g "$DESTDIR/sbin/mount.ntfs-3g"
|
|
||||||
ln -s /bin/ntfs-3g "$DESTDIR/sbin/mount.ntfs"
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,69 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="framebuffer"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ -x /sbin/plymouthd ] || exit 0
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
mkdir -p ${DESTDIR}/lib/plymouth
|
|
||||||
mkdir -p ${DESTDIR}/lib/plymouth/renderers
|
|
||||||
mkdir -p ${DESTDIR}/lib/plymouth/themes
|
|
||||||
|
|
||||||
copy_exec /sbin/plymouthd /sbin
|
|
||||||
copy_exec /bin/plymouth /bin
|
|
||||||
|
|
||||||
# plugin that is always required
|
|
||||||
copy_exec /lib/plymouth/details.so /lib/plymouth/
|
|
||||||
|
|
||||||
# copy the default themes
|
|
||||||
cp -a /lib/plymouth/themes/details ${DESTDIR}/lib/plymouth/themes/
|
|
||||||
TEXT_THEME=$(readlink -f /lib/plymouth/themes/text.plymouth)
|
|
||||||
if [ -e "$TEXT_THEME" ]; then
|
|
||||||
ln -s $TEXT_THEME ${DESTDIR}/lib/plymouth/themes/text.plymouth
|
|
||||||
cp -a $(dirname $TEXT_THEME) ${DESTDIR}/lib/plymouth/themes/
|
|
||||||
MODULE=$(grep "ModuleName *= *" ${TEXT_THEME} | sed 's/ModuleName *= *//')
|
|
||||||
copy_exec /lib/plymouth/$MODULE.so /lib/plymouth/
|
|
||||||
fi
|
|
||||||
THEME=$(readlink -f /lib/plymouth/themes/default.plymouth)
|
|
||||||
if [ -e "$THEME" ]; then
|
|
||||||
ln -s $THEME ${DESTDIR}/lib/plymouth/themes/default.plymouth
|
|
||||||
cp -a $(dirname $THEME) ${DESTDIR}/lib/plymouth/themes/
|
|
||||||
MODULE=$(grep "ModuleName *= *" ${THEME} | sed 's/ModuleName *= *//')
|
|
||||||
copy_exec /lib/plymouth/$MODULE.so /lib/plymouth/
|
|
||||||
|
|
||||||
# if we have a non-text theme, make sure we copy all the support libs
|
|
||||||
copy_exec /lib/plymouth/label.so /lib/plymouth/
|
|
||||||
|
|
||||||
# output renderers
|
|
||||||
copy_exec /lib/plymouth/renderers/frame-buffer.so /lib/plymouth/renderers/
|
|
||||||
copy_exec /lib/plymouth/renderers/drm.so /lib/plymouth/renderers/
|
|
||||||
copy_exec /lib/plymouth/renderers/vga16fb.so /lib/plymouth/renderers/
|
|
||||||
|
|
||||||
cp /lib/plymouth/ubuntu-logo.png ${DESTDIR}/lib/plymouth
|
|
||||||
|
|
||||||
# and copy the font support files needed in order to actually display
|
|
||||||
# any text
|
|
||||||
mkdir -p ${DESTDIR}/usr/share/fonts/truetype/ttf-dejavu
|
|
||||||
mkdir -p ${DESTDIR}/etc/fonts/conf.d
|
|
||||||
mkdir -p ${DESTDIR}/usr/lib/pango/1.6.0/module-files.d
|
|
||||||
mkdir -p ${DESTDIR}/usr/lib/pango/1.6.0/modules
|
|
||||||
cp /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf ${DESTDIR}/usr/share/fonts/truetype/ttf-dejavu/
|
|
||||||
cp /etc/fonts/fonts.conf ${DESTDIR}/etc/fonts/fonts.conf
|
|
||||||
cp -L /etc/fonts/conf.d/60-latin.conf ${DESTDIR}/etc/fonts/conf.d
|
|
||||||
cp /usr/lib/pango/1.6.0/module-files.d/libpango1.0-0.modules ${DESTDIR}/usr/lib/pango/1.6.0/module-files.d/
|
|
||||||
cp /usr/lib/pango/1.6.0/modules/pango-basic-fc.so ${DESTDIR}/usr/lib/pango/1.6.0/modules/pango-basic-fc.so
|
|
||||||
fi
|
|
|
@ -1,46 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Hooks for loading thermal bits into the initramfs
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
case "$DPKG_ARCH" in
|
|
||||||
# copy the right modules
|
|
||||||
powerpc|ppc64)
|
|
||||||
# Add thermal control of Macintosh if the system is not a PS3
|
|
||||||
if [ ! -e /sys/bus/ps3_system_bus/ ]; then
|
|
||||||
force_load therm_pm72
|
|
||||||
force_load windfarm_core
|
|
||||||
force_load windfarm_cpufreq_clamp
|
|
||||||
force_load windfarm_lm75_sensor
|
|
||||||
force_load windfarm_max6690_sensor
|
|
||||||
force_load windfarm_pid
|
|
||||||
force_load windfarm_pm112
|
|
||||||
force_load windfarm_pm81
|
|
||||||
force_load windfarm_pm91
|
|
||||||
force_load windfarm_smu_controls
|
|
||||||
force_load windfarm_smu_sat
|
|
||||||
force_load windfarm_smu_sensors
|
|
||||||
force_load i2c-powermac
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
i386|amd64|ia64|lpia)
|
|
||||||
manual_add_modules fan
|
|
||||||
manual_add_modules thermal
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,52 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs hook for udev
|
|
||||||
|
|
||||||
MINKVER="2.6.24"
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
# We use pkill
|
|
||||||
copy_exec /usr/bin/pkill /sbin
|
|
||||||
|
|
||||||
# Copy across the udev binaries
|
|
||||||
copy_exec /sbin/udevd /sbin
|
|
||||||
copy_exec /sbin/udevadm /sbin
|
|
||||||
|
|
||||||
# Copy udev configuration
|
|
||||||
mkdir -p ${DESTDIR}/etc/udev
|
|
||||||
cp -p /etc/udev/udev.conf ${DESTDIR}/etc/udev
|
|
||||||
|
|
||||||
# Only copy across relevant rules
|
|
||||||
mkdir -p ${DESTDIR}/lib/udev/rules.d
|
|
||||||
for rules in 50-udev-default.rules 50-firmware.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 64-device-mapper.rules 80-drivers.rules 95-udev-late.rules; do
|
|
||||||
cp -p /lib/udev/rules.d/$rules ${DESTDIR}/lib/udev/rules.d
|
|
||||||
done
|
|
||||||
|
|
||||||
# Copy across helpers the rules need
|
|
||||||
mkdir -p ${DESTDIR}/lib/udev
|
|
||||||
# 50-udev-default.rules
|
|
||||||
# 50-firmware.rules
|
|
||||||
copy_exec /lib/udev/firmware /lib/udev
|
|
||||||
# 60-persistent-storage.rules
|
|
||||||
copy_exec /lib/udev/ata_id /lib/udev
|
|
||||||
copy_exec /lib/udev/usb_id /lib/udev
|
|
||||||
copy_exec /sbin/blkid /lib/udev
|
|
||||||
copy_exec /lib/udev/scsi_id /lib/udev
|
|
||||||
copy_exec /lib/udev/path_id /lib/udev
|
|
||||||
# 61-persistent-storage-edd.rules
|
|
||||||
copy_exec /lib/udev/edd_id /lib/udev
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs hook for watershed
|
|
||||||
|
|
||||||
PREREQ="udev"
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
|
||||||
|
|
||||||
# default statedir
|
|
||||||
mkdir -p ${DESTDIR}/var/run/watershed
|
|
||||||
|
|
||||||
copy_exec /lib/udev/watershed /lib/udev
|
|
|
@ -1,272 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
[ -d /dev ] || mkdir -m 0755 /dev
|
|
||||||
[ -d /root ] || mkdir -m 0700 /root
|
|
||||||
[ -d /sys ] || mkdir /sys
|
|
||||||
[ -d /proc ] || mkdir /proc
|
|
||||||
[ -d /tmp ] || mkdir /tmp
|
|
||||||
mkdir -p /var/lock
|
|
||||||
mount -t sysfs -o nodev,noexec,nosuid none /sys
|
|
||||||
mount -t proc -o nodev,noexec,nosuid none /proc
|
|
||||||
|
|
||||||
grep -q '\<quiet\>' /proc/cmdline || echo "Loading, please wait..."
|
|
||||||
|
|
||||||
# Note that this only becomes /dev on the real filesystem if udev's scripts
|
|
||||||
# are used; which they will be, but it's worth pointing out
|
|
||||||
if ! mount -t devtmpfs -o mode=0755 none /dev; then
|
|
||||||
mount -t tmpfs -o mode=0755 none /dev
|
|
||||||
mknod -m 0600 /dev/console c 5 1
|
|
||||||
mknod /dev/null c 1 3
|
|
||||||
fi
|
|
||||||
mkdir /dev/pts
|
|
||||||
mount -t devpts -o noexec,nosuid,gid=5,mode=0620 none /dev/pts || true
|
|
||||||
> /dev/.initramfs-tools
|
|
||||||
mkdir /dev/.initramfs
|
|
||||||
|
|
||||||
# Export the dpkg architecture
|
|
||||||
export DPKG_ARCH=
|
|
||||||
. /conf/arch.conf
|
|
||||||
|
|
||||||
# Set modprobe env
|
|
||||||
export MODPROBE_OPTIONS="-qb"
|
|
||||||
|
|
||||||
# Export relevant variables
|
|
||||||
export ROOT=
|
|
||||||
export ROOTDELAY=
|
|
||||||
export ROOTFLAGS=
|
|
||||||
export ROOTFSTYPE=
|
|
||||||
export IPOPTS=
|
|
||||||
export HWADDR=
|
|
||||||
export break=
|
|
||||||
export init=/sbin/init
|
|
||||||
export quiet=n
|
|
||||||
export readonly=y
|
|
||||||
export rootmnt=/root
|
|
||||||
export debug=
|
|
||||||
export panic=
|
|
||||||
export blacklist=
|
|
||||||
export resume_offset=
|
|
||||||
|
|
||||||
# Bring in the main config
|
|
||||||
. /conf/initramfs.conf
|
|
||||||
for conf in conf/conf.d/*; do
|
|
||||||
[ -f ${conf} ] && . ${conf}
|
|
||||||
done
|
|
||||||
. /scripts/functions
|
|
||||||
|
|
||||||
# Parse command line options
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case $x in
|
|
||||||
init=*)
|
|
||||||
init=${x#init=}
|
|
||||||
;;
|
|
||||||
root=*)
|
|
||||||
ROOT=${x#root=}
|
|
||||||
case $ROOT in
|
|
||||||
LABEL=*)
|
|
||||||
ROOT="${ROOT#LABEL=}"
|
|
||||||
|
|
||||||
# support / in LABEL= paths (escape to \x2f)
|
|
||||||
case "${ROOT}" in
|
|
||||||
*[/]*)
|
|
||||||
if [ -x "$(command -v sed)" ]; then
|
|
||||||
ROOT="$(echo ${ROOT} | sed 's,/,\\x2f,g')"
|
|
||||||
else
|
|
||||||
if [ "${ROOT}" != "${ROOT#/}" ]; then
|
|
||||||
ROOT="\x2f${ROOT#/}"
|
|
||||||
fi
|
|
||||||
if [ "${ROOT}" != "${ROOT%/}" ]; then
|
|
||||||
ROOT="${ROOT%/}\x2f"
|
|
||||||
fi
|
|
||||||
IFS='/'
|
|
||||||
newroot=
|
|
||||||
for s in $ROOT; do
|
|
||||||
if [ -z "${newroot}" ]; then
|
|
||||||
newroot="${s}"
|
|
||||||
else
|
|
||||||
newroot="${newroot}\\x2f${s}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
unset IFS
|
|
||||||
ROOT="${newroot}"
|
|
||||||
fi
|
|
||||||
esac
|
|
||||||
ROOT="/dev/disk/by-label/${ROOT}"
|
|
||||||
;;
|
|
||||||
UUID=*)
|
|
||||||
ROOT="/dev/disk/by-uuid/${ROOT#UUID=}"
|
|
||||||
;;
|
|
||||||
/dev/nfs)
|
|
||||||
[ -z "${BOOT}" ] && BOOT=nfs
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
rootflags=*)
|
|
||||||
ROOTFLAGS="-o ${x#rootflags=}"
|
|
||||||
;;
|
|
||||||
rootfstype=*)
|
|
||||||
ROOTFSTYPE="${x#rootfstype=}"
|
|
||||||
;;
|
|
||||||
rootdelay=*)
|
|
||||||
ROOTDELAY="${x#rootdelay=}"
|
|
||||||
case ${ROOTDELAY} in
|
|
||||||
*[![:digit:].]*)
|
|
||||||
ROOTDELAY=
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
resumedelay=*)
|
|
||||||
RESUMEDELAY="${x#resumedelay=}"
|
|
||||||
;;
|
|
||||||
loop=*)
|
|
||||||
LOOP="${x#loop=}"
|
|
||||||
;;
|
|
||||||
loopflags=*)
|
|
||||||
LOOPFLAGS="-o ${x#loopflags=}"
|
|
||||||
;;
|
|
||||||
loopfstype=*)
|
|
||||||
LOOPFSTYPE="${x#loopfstype=}"
|
|
||||||
;;
|
|
||||||
cryptopts=*)
|
|
||||||
cryptopts="${x#cryptopts=}"
|
|
||||||
;;
|
|
||||||
nfsroot=*)
|
|
||||||
NFSROOT="${x#nfsroot=}"
|
|
||||||
;;
|
|
||||||
netboot=*)
|
|
||||||
NETBOOT="${x#netboot=}"
|
|
||||||
;;
|
|
||||||
ip=*)
|
|
||||||
IPOPTS="${x#ip=}"
|
|
||||||
;;
|
|
||||||
hwaddr=*)
|
|
||||||
HWADDR="${x#hwaddr=}"
|
|
||||||
;;
|
|
||||||
boot=*)
|
|
||||||
BOOT=${x#boot=}
|
|
||||||
;;
|
|
||||||
resume=*)
|
|
||||||
RESUME="${x#resume=}"
|
|
||||||
;;
|
|
||||||
resume_offset=*)
|
|
||||||
resume_offset="${x#resume_offset=}"
|
|
||||||
;;
|
|
||||||
noresume)
|
|
||||||
noresume=y
|
|
||||||
;;
|
|
||||||
panic=*)
|
|
||||||
panic="${x#panic=}"
|
|
||||||
case ${panic} in
|
|
||||||
*[![:digit:].]*)
|
|
||||||
panic=
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
quiet)
|
|
||||||
quiet=y
|
|
||||||
;;
|
|
||||||
ro)
|
|
||||||
readonly=y
|
|
||||||
;;
|
|
||||||
rw)
|
|
||||||
readonly=n
|
|
||||||
;;
|
|
||||||
debug)
|
|
||||||
debug=y
|
|
||||||
quiet=n
|
|
||||||
exec >/dev/.initramfs/initramfs.debug 2>&1
|
|
||||||
set -x
|
|
||||||
;;
|
|
||||||
debug=*)
|
|
||||||
debug=y
|
|
||||||
quiet=n
|
|
||||||
set -x
|
|
||||||
;;
|
|
||||||
break=*)
|
|
||||||
break=${x#break=}
|
|
||||||
;;
|
|
||||||
break)
|
|
||||||
break=premount
|
|
||||||
;;
|
|
||||||
blacklist=*)
|
|
||||||
blacklist=${x#blacklist=}
|
|
||||||
;;
|
|
||||||
netconsole=*)
|
|
||||||
netconsole=${x#netconsole=}
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "${noresume}" ]; then
|
|
||||||
export resume=${RESUME}
|
|
||||||
else
|
|
||||||
export noresume
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -n "${netconsole}" ] && modprobe netconsole netconsole=${netconsole}
|
|
||||||
|
|
||||||
maybe_break top
|
|
||||||
|
|
||||||
# export BOOT variable value for compcache,
|
|
||||||
# so we know if we run from casper
|
|
||||||
export BOOT
|
|
||||||
|
|
||||||
# Don't do log messages here to avoid confusing usplash
|
|
||||||
run_scripts /scripts/init-top
|
|
||||||
|
|
||||||
maybe_break modules
|
|
||||||
log_begin_msg "Loading essential drivers..."
|
|
||||||
load_modules
|
|
||||||
log_end_msg
|
|
||||||
|
|
||||||
maybe_break premount
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount"
|
|
||||||
run_scripts /scripts/init-premount
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
maybe_break mount
|
|
||||||
log_begin_msg "Mounting root file system..."
|
|
||||||
. /scripts/${BOOT}
|
|
||||||
parse_numeric ${ROOT}
|
|
||||||
mountroot
|
|
||||||
log_end_msg
|
|
||||||
|
|
||||||
maybe_break bottom
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
|
|
||||||
run_scripts /scripts/init-bottom
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
# Move virtual filesystems over to the real filesystem
|
|
||||||
mount -n -o move /sys ${rootmnt}/sys
|
|
||||||
mount -n -o move /proc ${rootmnt}/proc
|
|
||||||
|
|
||||||
# Check init bootarg
|
|
||||||
if [ -n "${init}" ] && [ ! -x "${rootmnt}${init}" ]; then
|
|
||||||
echo "Target filesystem doesn't have ${init}."
|
|
||||||
init=
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Search for valid init
|
|
||||||
if [ -z "${init}" ] ; then
|
|
||||||
for init in /sbin/init /etc/init /bin/init /bin/sh; do
|
|
||||||
if [ ! -x "${rootmnt}${init}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
break
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# No init on rootmount
|
|
||||||
if [ ! -x "${rootmnt}${init}" ]; then
|
|
||||||
panic "No init found. Try passing init= bootarg."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Confuses /etc/init.d/rc
|
|
||||||
if [ -n ${debug} ]; then
|
|
||||||
unset debug
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Chain to real filesystem
|
|
||||||
maybe_break init
|
|
||||||
exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
|
|
||||||
panic "Could not execute run-init."
|
|
|
@ -1,10 +0,0 @@
|
||||||
# List of modules that you want to include in your initramfs.
|
|
||||||
#
|
|
||||||
# Syntax: module_name [args ...]
|
|
||||||
#
|
|
||||||
# You must run update-initramfs(8) to effect this change.
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
#
|
|
||||||
# raid1
|
|
||||||
# sd_mod
|
|
|
@ -1,420 +0,0 @@
|
||||||
# -*- shell-script -*-
|
|
||||||
|
|
||||||
_log_msg()
|
|
||||||
{
|
|
||||||
if [ "$quiet" = "y" ]; then return; fi
|
|
||||||
echo "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_success_msg()
|
|
||||||
{
|
|
||||||
_log_msg "Success: $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_failure_msg()
|
|
||||||
{
|
|
||||||
_log_msg "Failure: $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_warning_msg()
|
|
||||||
{
|
|
||||||
_log_msg "Warning: $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_begin_msg()
|
|
||||||
{
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "TEXT $@"
|
|
||||||
fi
|
|
||||||
_log_msg "Begin: $@ ..."
|
|
||||||
}
|
|
||||||
|
|
||||||
log_end_msg()
|
|
||||||
{
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "SUCCESS ok"
|
|
||||||
fi
|
|
||||||
_log_msg "Done."
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add failure hook
|
|
||||||
add_mountroot_fail_hook()
|
|
||||||
{
|
|
||||||
mkdir -p /tmp/mountroot-fail-hooks.d
|
|
||||||
ln -s "$0" /tmp/mountroot-fail-hooks.d/"$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Run failure hooks.
|
|
||||||
# When a failure hook exits "1", it has not done anything to correct the
|
|
||||||
# system. Exiting "0" means that something has been attempted to resolve
|
|
||||||
# the lack of a root filesystem.
|
|
||||||
# Hooks are run in lexigraphical order, and are responsible for removing
|
|
||||||
# themselves if they should not re-run in a later cycle. When one exits
|
|
||||||
# "0", the stack is stopped, so the caller can return to the main rootfs
|
|
||||||
# wait loop.
|
|
||||||
try_failure_hooks()
|
|
||||||
{
|
|
||||||
local hook
|
|
||||||
|
|
||||||
# Disable usplash so text from hooks can be seen
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "QUIT"
|
|
||||||
fi
|
|
||||||
chvt 1
|
|
||||||
|
|
||||||
for hook in /tmp/mountroot-fail-hooks.d/*; do
|
|
||||||
if [ -x ${hook} ] && ${hook} mountfail; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
panic()
|
|
||||||
{
|
|
||||||
if [ -x /sbin/usplash_write ]; then
|
|
||||||
/sbin/usplash_write "QUIT"
|
|
||||||
fi
|
|
||||||
chvt 1
|
|
||||||
|
|
||||||
# Disallow console access
|
|
||||||
if [ -n "${panic}" ]; then
|
|
||||||
sleep ${panic}
|
|
||||||
reboot
|
|
||||||
fi
|
|
||||||
|
|
||||||
modprobe i8042
|
|
||||||
modprobe atkbd
|
|
||||||
|
|
||||||
run_scripts /scripts/panic
|
|
||||||
|
|
||||||
echo $@
|
|
||||||
PS1='(initramfs) ' /bin/sh -i </dev/console >/dev/console 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
maybe_break()
|
|
||||||
{
|
|
||||||
if echo "${break}" | egrep -q "(,|^)$1(,|$)"; then
|
|
||||||
panic "Spawning shell within the initramfs"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
render()
|
|
||||||
{
|
|
||||||
eval "echo -n \${$@}"
|
|
||||||
}
|
|
||||||
|
|
||||||
set_initlist()
|
|
||||||
{
|
|
||||||
unset initlist
|
|
||||||
for si_x in ${initdir}/*; do
|
|
||||||
# skip empty dirs without warning
|
|
||||||
[ "${si_x}" = "${initdir}/*" ] && return
|
|
||||||
|
|
||||||
# only allow variable name chars
|
|
||||||
case ${si_x#${initdir}/} in
|
|
||||||
*[![:alnum:]_]*)
|
|
||||||
[ "${verbose}" = "y" ] \
|
|
||||||
&& echo "$si_x ignored: not alphanumeric or '_' file"
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# skip non executable scripts
|
|
||||||
if [ ! -x ${si_x} ]; then
|
|
||||||
[ "${verbose}" = "y" ] \
|
|
||||||
&& echo "$si_x ignored: not executable"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# skip directories
|
|
||||||
if [ -d ${si_x} ]; then
|
|
||||||
[ "${verbose}" = "y" ] \
|
|
||||||
&& echo "$si_x ignored: a directory"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
initlist="${initlist} ${si_x#${initdir}/}"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce_satisfied()
|
|
||||||
{
|
|
||||||
deplist="$(render array_${1})"
|
|
||||||
unset tmpdeplist
|
|
||||||
for rs_y in ${deplist}; do
|
|
||||||
# check if there are alternatives
|
|
||||||
case ${rs_y} in
|
|
||||||
*\|*)
|
|
||||||
OLD_IFS="$IFS"
|
|
||||||
IFS="|"
|
|
||||||
for rs_z in ${rs_y}; do
|
|
||||||
IFS="$OLD_IFS"
|
|
||||||
# only allow variable name chars
|
|
||||||
case ${rs_z} in
|
|
||||||
*[![:alnum:]_]*)
|
|
||||||
IFS="|"
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
# skip non executable scripts
|
|
||||||
if [ ! -x ${initdir}/${rs_z} ]; then
|
|
||||||
IFS="|"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# skip directories
|
|
||||||
if [ -d ${initdir}/${rs_z} ]; then
|
|
||||||
IFS="|"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
tmpdeplist="${tmpdeplist} ${rs_z}"
|
|
||||||
break
|
|
||||||
done
|
|
||||||
IFS="$OLD_IFS"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
case ${rs_y} in
|
|
||||||
*[![:alnum:]_]*)
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if [ ! -x ${initdir}/${rs_y} ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
if [ -d ${initdir}/${rs_y} ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
tmpdeplist="${tmpdeplist} ${rs_y}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
deplist=${tmpdeplist}
|
|
||||||
for rs_x in ${runlist}; do
|
|
||||||
pop_list_item ${rs_x} ${deplist}
|
|
||||||
deplist=${tmppop}
|
|
||||||
done
|
|
||||||
eval array_${1}=\"${deplist}\"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_prereqs()
|
|
||||||
{
|
|
||||||
set_initlist
|
|
||||||
for gp_x in ${initlist}; do
|
|
||||||
tmp=$(${initdir}/${gp_x} prereqs)
|
|
||||||
eval array_${gp_x}=\"${tmp}\"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
count_unsatisfied()
|
|
||||||
{
|
|
||||||
set -- ${@}
|
|
||||||
return ${#}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Removes $1 from initlist
|
|
||||||
pop_list_item()
|
|
||||||
{
|
|
||||||
item=${1}
|
|
||||||
shift
|
|
||||||
set -- ${@}
|
|
||||||
unset tmppop
|
|
||||||
# Iterate
|
|
||||||
for pop in ${@}; do
|
|
||||||
if [ ${pop} = ${item} ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
tmppop="${tmppop} ${pop}"
|
|
||||||
done
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# This function generates the runlist, so we clear it first.
|
|
||||||
reduce_prereqs()
|
|
||||||
{
|
|
||||||
unset runlist
|
|
||||||
set -- ${initlist}
|
|
||||||
i=$#
|
|
||||||
# Loop until there's no more in the queue to loop through
|
|
||||||
while [ ${i} -ne 0 ]; do
|
|
||||||
oldi=${i}
|
|
||||||
for rp_x in ${initlist}; do
|
|
||||||
reduce_satisfied ${rp_x}
|
|
||||||
count_unsatisfied $(render array_${rp_x})
|
|
||||||
cnt=${?}
|
|
||||||
if [ ${cnt} -eq 0 ]; then
|
|
||||||
runlist="${runlist} ${rp_x}"
|
|
||||||
pop_list_item ${rp_x} ${initlist}
|
|
||||||
initlist=${tmppop}
|
|
||||||
i=$((${i} - 1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ ${i} -eq ${oldi} ]; then
|
|
||||||
panic "PANIC: Circular dependancy. Exiting."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
get_prereq_pairs()
|
|
||||||
{
|
|
||||||
set_initlist
|
|
||||||
for gp_x in ${initlist}; do
|
|
||||||
echo ${gp_x} ${gp_x}
|
|
||||||
prereqs=$(${initdir}/${gp_x} prereqs)
|
|
||||||
for prereq in ${prereqs}; do
|
|
||||||
echo ${prereq} ${gp_x}
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
call_scripts()
|
|
||||||
{
|
|
||||||
for cs_x in ${runlist}; do
|
|
||||||
[ -f ${initdir}/${cs_x} ] || continue
|
|
||||||
if [ x"$1" = "xoptional" ]; then
|
|
||||||
option=$(sed '/^OPTION=/!d;$d;s/^OPTION=//;s/[[:space:]]*$//' "${initdir}/${cs_x}")
|
|
||||||
[ -z "${option}" ] || eval test -n \"\${$option}\" -a \"\${$option}\" != \"n\" || continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# mkinitramfs verbose output
|
|
||||||
if [ "${verbose}" = "y" ]; then
|
|
||||||
echo "Calling hook ${cs_x}"
|
|
||||||
fi
|
|
||||||
${initdir}/${cs_x}
|
|
||||||
# allow boot scripts to modify exported boot paramaters
|
|
||||||
if [ -e /conf/param.conf ]; then
|
|
||||||
. /conf/param.conf
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
run_scripts()
|
|
||||||
{
|
|
||||||
initdir=${1}
|
|
||||||
[ ! -d ${initdir} ] && return
|
|
||||||
|
|
||||||
if [ -f ${initdir}/ORDER ]; then
|
|
||||||
. ${initdir}/ORDER
|
|
||||||
elif [ -x /usr/bin/tsort ]; then
|
|
||||||
runlist=$(get_prereq_pairs | tsort)
|
|
||||||
call_scripts $2
|
|
||||||
else
|
|
||||||
get_prereqs
|
|
||||||
reduce_prereqs
|
|
||||||
call_scripts $2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
cache_run_scripts()
|
|
||||||
{
|
|
||||||
DESTDIR=${1}
|
|
||||||
scriptdir=${2}
|
|
||||||
initdir=${DESTDIR}${scriptdir}
|
|
||||||
[ ! -d ${initdir} ] && return
|
|
||||||
|
|
||||||
runlist=$(get_prereq_pairs | tsort)
|
|
||||||
for crs_x in ${runlist}; do
|
|
||||||
[ -f ${initdir}/${crs_x} ] || continue
|
|
||||||
echo "${scriptdir}/${crs_x}" >> ${initdir}/ORDER
|
|
||||||
echo "[ -e /conf/param.conf ] && . /conf/param.conf" >> ${initdir}/ORDER
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Load custom modules first
|
|
||||||
load_modules()
|
|
||||||
{
|
|
||||||
if [ -e /conf/modules ]; then
|
|
||||||
cat /conf/modules | while read m; do
|
|
||||||
# Skip empty lines
|
|
||||||
if [ -z "$m" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# Skip comments - d?ash removes whitespace prefix
|
|
||||||
com=$(printf "%.1s" "${m}")
|
|
||||||
if [ "$com" = "#" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
modprobe $m
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# lilo compatibility
|
|
||||||
parse_numeric() {
|
|
||||||
case $1 in
|
|
||||||
"")
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
/*)
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
*:*)
|
|
||||||
minor=${1#*:}
|
|
||||||
major=${1%:*}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
value=$(( 0x${1} ))
|
|
||||||
minor=$(( ${value} % 256 ))
|
|
||||||
major=$(( ${value} / 256 ))
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
mknod -m 600 /dev/root b ${major} ${minor}
|
|
||||||
ROOT=/dev/root
|
|
||||||
}
|
|
||||||
|
|
||||||
configure_networking()
|
|
||||||
{
|
|
||||||
# networking already configured thus bail out
|
|
||||||
[ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0
|
|
||||||
|
|
||||||
if [ "${HWADDR}" ]; then
|
|
||||||
# select interface by MAC address
|
|
||||||
HWADDR="$(echo "${HWADDR}" | tr A-Z- a-z:)"
|
|
||||||
local iface
|
|
||||||
for iface in /sys/class/net/*; do
|
|
||||||
[ -f "$iface/address" ] || continue
|
|
||||||
if [ "$(cat "$iface/address")" = "${HWADDR}" ]; then
|
|
||||||
DEVICE="${iface#/sys/class/net/}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# support ip options see linux sources
|
|
||||||
# Documentation/filesystems/nfsroot.txt
|
|
||||||
case ${IPOPTS} in
|
|
||||||
none|off)
|
|
||||||
# Do nothing
|
|
||||||
;;
|
|
||||||
""|on|any)
|
|
||||||
# Bring up device
|
|
||||||
ipconfig -t 60 ${DEVICE}
|
|
||||||
;;
|
|
||||||
dhcp|bootp|rarp|both)
|
|
||||||
ipconfig -t 60 -c ${IPOPTS} -d ${DEVICE}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
ipconfig -t 60 -d $IPOPTS
|
|
||||||
|
|
||||||
# grab device entry from ip option
|
|
||||||
NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
|
|
||||||
if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then
|
|
||||||
NEW_DEVICE=${NEW_DEVICE%:*}
|
|
||||||
else
|
|
||||||
# wrong parse, possibly only a partial string
|
|
||||||
NEW_DEVICE=
|
|
||||||
fi
|
|
||||||
if [ -n "${NEW_DEVICE}" ]; then
|
|
||||||
DEVICE="${NEW_DEVICE}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# source ipconfig output
|
|
||||||
if [ -n "${DEVICE}" ]; then
|
|
||||||
# source specific bootdevice
|
|
||||||
. /tmp/net-${DEVICE}.conf
|
|
||||||
else
|
|
||||||
# source any interface as not exaclty specified
|
|
||||||
. /tmp/net-*.conf
|
|
||||||
fi
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="udev"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -f ${rootmnt}/dev/.initramfs/plymouth.pid ]
|
|
||||||
then
|
|
||||||
/bin/plymouth update-root-fs --new-root-dir=${rootmnt}
|
|
||||||
fi
|
|
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs init-bottom script for udev
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# Stop udevd, we'll miss a few events while we run init, but we catch up
|
|
||||||
pkill udevd
|
|
||||||
|
|
||||||
# Move /dev to the real filesystem
|
|
||||||
mount -n -o move /dev ${rootmnt}/dev
|
|
|
@ -1,41 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# init-premount script for lvm2.
|
|
||||||
|
|
||||||
PREREQS="udev mdadm"
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo $PREREQS
|
|
||||||
}
|
|
||||||
|
|
||||||
mountroot_fail()
|
|
||||||
{
|
|
||||||
if ! /sbin/lvm vgscan >/dev/null 2>&1 ; then
|
|
||||||
cat <<EOF
|
|
||||||
There appears to be one or more degraded LVM volumes, and your root device may
|
|
||||||
depend on the LVM volumes being online. One or more of the following LVM volumes
|
|
||||||
are degraded:
|
|
||||||
EOF
|
|
||||||
/sbin/lvm vgscan
|
|
||||||
fi
|
|
||||||
# Nothing has been fixed on the system, so "fail" our recovery attempt.
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
mountfail)
|
|
||||||
mountroot_fail
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /scripts/functions
|
|
||||||
|
|
||||||
add_mountroot_fail_hook "20-lvm2"
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if grep all_generic_ide /proc/cmdline 2>/dev/null; then
|
|
||||||
modprobe ata_generic all_generic_ide=1
|
|
||||||
fi
|
|
|
@ -1,34 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQ=""
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# blacklist vga16fb when vga= or video= given
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case ${x} in
|
|
||||||
vga=*|video=*)
|
|
||||||
echo "blacklist vga16fb" >> /etc/modprobe.d/initramfs
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# sanity check
|
|
||||||
[ -z "${blacklist}" ] && exit 0
|
|
||||||
|
|
||||||
# write blacklist to modprobe.d
|
|
||||||
IFS=','
|
|
||||||
for b in ${blacklist}; do
|
|
||||||
echo "blacklist $b" >> /etc/modprobe.d/initramfs
|
|
||||||
done
|
|
|
@ -1,83 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
# A crude much-simplified clone of setupcon for use in the initramfs.
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="framebuffer"
|
|
||||||
|
|
||||||
prereqs () {
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /etc/default/console-setup
|
|
||||||
|
|
||||||
[ "$ACTIVE_CONSOLES" ] || exit 0
|
|
||||||
|
|
||||||
if [ "$VERBOSE_OUTPUT" = yes ]; then
|
|
||||||
verbose=
|
|
||||||
else
|
|
||||||
verbose='>/dev/null 2>&1'
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in 1 2 3 4 5 6; do
|
|
||||||
[ -c /dev/tty$i ] || mknod /dev/tty$i c 4 $i
|
|
||||||
done
|
|
||||||
|
|
||||||
for console in $ACTIVE_CONSOLES; do
|
|
||||||
[ -w $console ] || continue
|
|
||||||
|
|
||||||
if [ "$CHARMAP" = UTF-8 ] || [ -z "$ACM$CHARMAP" ]; then
|
|
||||||
printf '\033%%G' >$console
|
|
||||||
else
|
|
||||||
printf '\033%%@' >$console
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$FONT" ]; then
|
|
||||||
FONT="/etc/console-setup/${FONT##*/}"
|
|
||||||
FONT="${FONT%.gz}"
|
|
||||||
else
|
|
||||||
FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
|
|
||||||
fi
|
|
||||||
if [ -f "$FONT" ]; then
|
|
||||||
if type consolechars >/dev/null 2>&1; then
|
|
||||||
eval consolechars -v --tty=$console -f "$FONT" $verbose
|
|
||||||
elif type setfont >/dev/null 2>&1; then
|
|
||||||
eval setfont -v -C $console "$FONT" $verbose
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ACM" ]; then
|
|
||||||
ACM="/etc/console-setup/${ACM##*/}"
|
|
||||||
ACM="${ACM%.gz}"
|
|
||||||
else
|
|
||||||
ACM="/etc/console-setup/$CHARMAP.acm"
|
|
||||||
fi
|
|
||||||
if [ -f "$ACM" ]; then
|
|
||||||
if type consolechars >/dev/null 2>&1; then
|
|
||||||
eval consolechars -v --tty=$console --acm "$ACM" \
|
|
||||||
$verbose
|
|
||||||
elif type setfont >/dev/null 2>&1; then
|
|
||||||
eval setfont -v -C "$console" -m "$ACM" $verbose
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if type kbd_mode >/dev/null 2>&1; then
|
|
||||||
if [ "$CHARMAP" = UTF-8 ] || [ -z "$ACM" ]; then
|
|
||||||
kbd_mode -u <$console
|
|
||||||
else
|
|
||||||
kbd_mode -a <$console
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -f /etc/console-setup/cached.kmap.gz ] && type loadkeys >/dev/null; then
|
|
||||||
eval loadkeys /etc/console-setup/cached.kmap.gz $verbose
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,104 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="udev"
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# The options part of the kernel "video=" argument (i.e. everyting
|
|
||||||
# after "video=<fbdriver>:") has very inconsistent rules.
|
|
||||||
#
|
|
||||||
# Generally the following applies:
|
|
||||||
# 1) options are comma-separated
|
|
||||||
# 2) options can be in either of these three forms:
|
|
||||||
# <arg>=<value>, <arg>:<value>, <boolean-arg>.
|
|
||||||
# 3) the "mode" option has the form <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m]
|
|
||||||
# and may or may not start with "mode="
|
|
||||||
#
|
|
||||||
# When the options are used with modules, they need to be space-separated
|
|
||||||
# and the following conversions are needed:
|
|
||||||
# <arg>:<value> -> <arg>=<value>
|
|
||||||
# <boolean-arg> -> <boolean-arg>=1
|
|
||||||
# <modevalue> -> mode=<modevalue>
|
|
||||||
parse_video_opts()
|
|
||||||
{
|
|
||||||
local OPTS="$1"
|
|
||||||
local IFS=","
|
|
||||||
|
|
||||||
# Must be a line like video=<fbdriver>:<opt1>,[opt2]...
|
|
||||||
if [ "${OPTS}" = "${OPTS%%:*}" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
OPTS="${OPTS#*:}"
|
|
||||||
for opt in ${OPTS}; do
|
|
||||||
# Already in the "<arg>=<value>" form
|
|
||||||
if [ "${opt}" != "${opt#*=}" ]; then
|
|
||||||
echo -n "$opt "
|
|
||||||
# In the "<arg>:<value>" form
|
|
||||||
elif [ "${opt}" != "${opt#*:}" ]; then
|
|
||||||
echo -n "${opt%:*}=${opt#*:} "
|
|
||||||
# Presumably a modevalue without the "mode=" prefix
|
|
||||||
elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then
|
|
||||||
echo -n "mode=$opt "
|
|
||||||
# Presumably a boolean
|
|
||||||
else
|
|
||||||
echo -n "${opt}=1 "
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
FB=""
|
|
||||||
OPTS=""
|
|
||||||
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case ${x} in
|
|
||||||
vga=*)
|
|
||||||
FB="vesafb";
|
|
||||||
OPTS="";
|
|
||||||
;;
|
|
||||||
video=*)
|
|
||||||
FB=${x#*=}
|
|
||||||
FB="${FB%%:*}"
|
|
||||||
OPTS="$(parse_video_opts "${x}")"
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Map command line name to module name
|
|
||||||
case ${FB} in
|
|
||||||
matroxfb)
|
|
||||||
FB=matroxfb_base
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -n "${FB}" ]; then
|
|
||||||
# Some framebuffer devices need character devices :-/
|
|
||||||
udevadm settle
|
|
||||||
MODPROBE_OPTIONS=-q modprobe ${FB} ${OPTS}
|
|
||||||
# Wait for the framebuffer devices to be ready
|
|
||||||
udevadm settle
|
|
||||||
else
|
|
||||||
# If we have no graphics devices yet, wait for udev to settle
|
|
||||||
[ -d /sys/class/graphics/fbcon ] || udevadm settle
|
|
||||||
[ -d /sys/class/graphics/fb0 ] || udevadm settle
|
|
||||||
[ -d /sys/class/drm/card0 ] || udevadm settle
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Force fb mode via /sys interface
|
|
||||||
for x in $(cat /proc/cmdline); do
|
|
||||||
case ${x} in
|
|
||||||
fbmode=*)
|
|
||||||
MODE=${x#*=}
|
|
||||||
echo "$MODE" > /sys/class/graphics/fb0/mode
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ=""
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
case $1 in
|
|
||||||
# get pre-requisites
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
OPTS="-q"
|
|
||||||
|
|
||||||
# Should terminal be in UTF8 mode?
|
|
||||||
if [ -x /bin/kbd_mode ]; then
|
|
||||||
/bin/kbd_mode -u
|
|
||||||
OPTS="${OPTS} -u"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Load custom keymap
|
|
||||||
if [ -x /bin/loadkeys -a -r /etc/boottime.kmap.gz ]; then
|
|
||||||
loadkeys ${OPTS} /etc/boottime.kmap.gz
|
|
||||||
fi
|
|
|
@ -1,20 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
OPTION=FRAMEBUFFER
|
|
||||||
PREREQ="framebuffer console_setup brltty"
|
|
||||||
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
printf '\033[?25l' > /dev/tty7
|
|
||||||
/sbin/plymouthd --mode=boot --attach-to-session --pid-file=/dev/.initramfs/plymouth.pid
|
|
||||||
/bin/plymouth show-splash
|
|
|
@ -1,30 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
# initramfs init-top script for udev
|
|
||||||
|
|
||||||
PREREQ="all_generic_ide blacklist"
|
|
||||||
|
|
||||||
# Output pre-requisites
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
# It's all over netlink now
|
|
||||||
echo "" > /proc/sys/kernel/hotplug
|
|
||||||
|
|
||||||
# Start the udev daemon to process events
|
|
||||||
/sbin/udevd --daemon --resolve-names=never
|
|
||||||
|
|
||||||
# Iterate sysfs and fire off everything; if we include a rule for it then
|
|
||||||
# it'll get handled; otherwise it'll get handled later when we do this again
|
|
||||||
# in the main boot sequence.
|
|
||||||
( /sbin/udevadm trigger --subsystem-match=block; \
|
|
||||||
/sbin/udevadm trigger --subsystem-nomatch=block; ) &
|
|
|
@ -1,131 +0,0 @@
|
||||||
# Local filesystem mounting -*- shell-script -*-
|
|
||||||
|
|
||||||
# Parameter: Where to mount the filesystem
|
|
||||||
mountroot ()
|
|
||||||
{
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top"
|
|
||||||
run_scripts /scripts/local-top
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
while [ -z "${FSTYPE}" ]; do
|
|
||||||
FSTYPE=$(wait-for-root "${ROOT}" ${ROOTDELAY:-30})
|
|
||||||
|
|
||||||
# Run failure hooks, hoping one of them can fix up the system
|
|
||||||
# and we can restart the wait loop. If they all fail, abort
|
|
||||||
# and move on to the panic handler and shell.
|
|
||||||
if [ -z "${FSTYPE}" ] && ! try_failure_hooks; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# We've given up, but we'll let the user fix matters if they can
|
|
||||||
while [ -z "${FSTYPE}" -a ! -e "${ROOT}" ]; do
|
|
||||||
# give hint about renamed root
|
|
||||||
case "${ROOT}" in
|
|
||||||
/dev/hd*)
|
|
||||||
suffix="${ROOT#/dev/hd}"
|
|
||||||
major="${suffix%[[:digit:]]}"
|
|
||||||
major="${major%[[:digit:]]}"
|
|
||||||
if [ -d "/sys/block/sd${major}" ]; then
|
|
||||||
echo "WARNING bootdevice may be renamed. Try root=/dev/sd${suffix}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
/dev/sd*)
|
|
||||||
suffix="${ROOT#/dev/sd}"
|
|
||||||
major="${suffix%[[:digit:]]}"
|
|
||||||
major="${major%[[:digit:]]}"
|
|
||||||
if [ -d "/sys/block/hd${major}" ]; then
|
|
||||||
echo "WARNING bootdevice may be renamed. Try root=/dev/hd${suffix}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo "Gave up waiting for root device. Common problems:"
|
|
||||||
echo " - Boot args (cat /proc/cmdline)"
|
|
||||||
echo " - Check rootdelay= (did the system wait long enough?)"
|
|
||||||
echo " - Check root= (did the system wait for the right device?)"
|
|
||||||
echo " - Missing modules (cat /proc/modules; ls /dev)"
|
|
||||||
panic "ALERT! ${ROOT} does not exist. Dropping to a shell!"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Get the root filesystem type if not set
|
|
||||||
if [ -z "${ROOTFSTYPE}" ]; then
|
|
||||||
[ -n "${FSTYPE}" ] || FSTYPE=$(/sbin/blkid -s TYPE -o value "${ROOT}")
|
|
||||||
ROOTFSTYPE="${FSTYPE}"
|
|
||||||
else
|
|
||||||
FSTYPE="${ROOTFSTYPE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount"
|
|
||||||
run_scripts /scripts/local-premount
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
|
|
||||||
if [ ${readonly} = y ] && \
|
|
||||||
[ -z "$LOOP" ]; then
|
|
||||||
roflag=-r
|
|
||||||
else
|
|
||||||
roflag=-w
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXME This has no error checking
|
|
||||||
[ -n "${FSTYPE}" ] && modprobe ${FSTYPE}
|
|
||||||
|
|
||||||
# FIXME This has no error checking
|
|
||||||
# Mount root
|
|
||||||
mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
|
|
||||||
mountroot_status="$?"
|
|
||||||
if [ "$LOOP" ]; then
|
|
||||||
if [ "$mountroot_status" != 0 ]; then
|
|
||||||
if [ ${FSTYPE} = ntfs ] || [ ${FSTYPE} = vfat ]; then
|
|
||||||
panic "
|
|
||||||
Could not mount the partition ${ROOT}.
|
|
||||||
This could also happen if the file system is not clean because of an operating
|
|
||||||
system crash, an interrupted boot process, an improper shutdown, or unplugging
|
|
||||||
of a removable device without first unmounting or ejecting it. To fix this,
|
|
||||||
simply reboot into Windows, let it fully start, log in, run 'chkdsk /r', then
|
|
||||||
gracefully shut down and reboot back into Windows. After this you should be
|
|
||||||
able to reboot again and resume the installation.
|
|
||||||
(filesystem = ${FSTYPE}, error code = $mountroot_status)
|
|
||||||
"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p /host
|
|
||||||
mount -o move ${rootmnt} /host
|
|
||||||
|
|
||||||
while [ ! -e "/host/${LOOP#/}" ]; do
|
|
||||||
panic "ALERT! /host/${LOOP#/} does not exist. Dropping to a shell!"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Get the loop filesystem type if not set
|
|
||||||
if [ -z "${LOOPFSTYPE}" ]; then
|
|
||||||
eval $(fstype < "/host/${LOOP#/}")
|
|
||||||
else
|
|
||||||
FSTYPE="${LOOPFSTYPE}"
|
|
||||||
fi
|
|
||||||
if [ "$FSTYPE" = "unknown" ] && [ -x /sbin/blkid ]; then
|
|
||||||
FSTYPE=$(/sbin/blkid -s TYPE -o value "/host/${LOOP#/}")
|
|
||||||
[ -z "$FSTYPE" ] && FSTYPE="unknown"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ${readonly} = y ]; then
|
|
||||||
roflag=-r
|
|
||||||
else
|
|
||||||
roflag=-w
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXME This has no error checking
|
|
||||||
modprobe loop
|
|
||||||
modprobe ${FSTYPE}
|
|
||||||
|
|
||||||
# FIXME This has no error checking
|
|
||||||
mount ${roflag} -o loop -t ${FSTYPE} ${LOOPFLAGS} "/host/${LOOP#/}" ${rootmnt}
|
|
||||||
|
|
||||||
if [ -d ${rootmnt}/host ]; then
|
|
||||||
mount -o move /host ${rootmnt}/host
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-bottom"
|
|
||||||
run_scripts /scripts/local-bottom
|
|
||||||
[ "$quiet" != "y" ] && log_end_msg
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue