cleanup
This commit is contained in:
@@ -1,152 +0,0 @@
|
||||
From f01e862b38b3219252ee76f7a20179a20a97a0fb Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Dahl <ua_bugz_gentoo@mortal-soul.de>
|
||||
Date: Fri, 27 Aug 2010 17:26:52 +0200
|
||||
Subject: [PATCH] use mdadm instead of bundled stripped down mdassemble (v2)
|
||||
|
||||
mdassemble can't handle newer metadata formats and fails for partitioned
|
||||
arrays, among other things.
|
||||
|
||||
This...
|
||||
|
||||
- replaces the bundled mdassemble with proper support for mdadm
|
||||
- fixes raid autodetection/assemble when no mdadm.conf is available
|
||||
- fixes a compilation failure for newer mdadm versions
|
||||
|
||||
Tested w/ genkernel 3.4.10.907 and mdadm 3.1.3.
|
||||
---
|
||||
defaults/initrd.scripts | 5 +++--
|
||||
gen_compile.sh | 35 +++++++++++++++++++++++++++++++++++
|
||||
gen_determineargs.sh | 2 ++
|
||||
gen_initramfs.sh | 12 ++++++++++++
|
||||
genkernel.conf | 5 +++++
|
||||
5 files changed, 57 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
|
||||
index e0710c4..531d2bd 100755
|
||||
--- a/defaults/initrd.scripts
|
||||
+++ b/defaults/initrd.scripts
|
||||
@@ -608,9 +608,10 @@ startVolumes() {
|
||||
then
|
||||
if [ ! -e '/etc/mdadm.conf' ]
|
||||
then
|
||||
- /sbin/mdadm --examine > /etc/mdadm.conf
|
||||
+ echo "DEVICE /dev/sd[a-z]* /dev/hd[a-z]*" >/etc/mdadm.conf
|
||||
+ /sbin/mdadm --examine --scan >>/etc/mdadm.conf
|
||||
fi
|
||||
- /sbin/mdadm --assemble
|
||||
+ /sbin/mdadm -A --scan
|
||||
fi
|
||||
|
||||
if [ "${USE_DMRAID_NORMAL}" = '1' ]
|
||||
diff --git a/gen_compile.sh b/gen_compile.sh
|
||||
index 7bab9e1..ec5df4b 100755
|
||||
--- a/gen_compile.sh
|
||||
+++ b/gen_compile.sh
|
||||
@@ -444,6 +444,41 @@ compile_lvm() {
|
||||
fi
|
||||
}
|
||||
|
||||
+compile_mdadm() {
|
||||
+ if [ ! -f "${MDADM_BINCACHE}" ]
|
||||
+ then
|
||||
+ [ -f "${MDADM_SRCTAR}" ] ||
|
||||
+ gen_die "Could not find MDADM source tarball: ${MDADM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
|
||||
+ cd "${TEMP}"
|
||||
+ rm -rf "${MDADM_DIR}" > /dev/null
|
||||
+ /bin/tar -jxpf "${MDADM_SRCTAR}" ||
|
||||
+ gen_die 'Could not extract MDADM source tarball!'
|
||||
+ [ -d "${MDADM_DIR}" ] ||
|
||||
+ gen_die 'MDADM directory ${MDADM_DIR} is invalid!'
|
||||
+
|
||||
+ cd "${MDADM_DIR}"
|
||||
+ sed -i "/^CFLAGS = /s:^CFLAGS = \(.*\)$:CFLAGS = -Os:" Makefile
|
||||
+ sed -i "/^CXFLAGS = /s:^CXFLAGS = \(.*\)$:CXFLAGS = -Os:" Makefile
|
||||
+ sed -i "/^CWFLAGS = /s:^CWFLAGS = \(.*\)$:CWFLAGS = -Wall:" Makefile
|
||||
+ sed -i "s/^# LDFLAGS = -static/LDFLAGS = -static/" Makefile
|
||||
+
|
||||
+ print_info 1 'mdadm: >> Compiling...'
|
||||
+ compile_generic 'mdadm' utils
|
||||
+
|
||||
+ mkdir -p "${TEMP}/mdadm/sbin"
|
||||
+ install -m 0755 -s mdadm "${TEMP}/mdadm/sbin/mdadm"
|
||||
+ print_info 1 ' >> Copying to bincache...'
|
||||
+ cd "${TEMP}/mdadm"
|
||||
+ strip "sbin/mdadm" ||
|
||||
+ gen_die 'Could not strip mdadm!'
|
||||
+ /bin/tar -cjf "${MDADM_BINCACHE}" sbin/mdadm ||
|
||||
+ gen_die 'Could not create binary cache'
|
||||
+
|
||||
+ cd "${TEMP}"
|
||||
+ rm -rf "${MDADM_DIR}" mdadm
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
compile_dmraid() {
|
||||
compile_device_mapper
|
||||
if [ ! -f "${DMRAID_BINCACHE}" ]
|
||||
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
|
||||
index d911f07..b4b31fb 100755
|
||||
--- a/gen_determineargs.sh
|
||||
+++ b/gen_determineargs.sh
|
||||
@@ -128,6 +128,7 @@ determine_real_args() {
|
||||
BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
|
||||
DEVICE_MAPPER_BINCACHE=`cache_replace "${DEVICE_MAPPER_BINCACHE}"`
|
||||
LVM_BINCACHE=`cache_replace "${LVM_BINCACHE}"`
|
||||
+ MDADM_BINCACHE=`cache_replace "${MDADM_BINCACHE}"`
|
||||
DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"`
|
||||
ISCSI_BINCACHE=`cache_replace "${ISCSI_BINCACHE}"`
|
||||
BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
|
||||
@@ -139,6 +140,7 @@ determine_real_args() {
|
||||
BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"`
|
||||
DEVICE_MAPPER_BINCACHE=`arch_replace "${DEVICE_MAPPER_BINCACHE}"`
|
||||
LVM_BINCACHE=`arch_replace "${LVM_BINCACHE}"`
|
||||
+ MDADM_BINCACHE=`arch_replace "${MDADM_BINCACHE}"`
|
||||
DMRAID_BINCACHE=`arch_replace "${DMRAID_BINCACHE}"`
|
||||
ISCSI_BINCACHE=`arch_replace "${ISCSI_BINCACHE}"`
|
||||
BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
|
||||
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
|
||||
index 231411e..2400b75 100755
|
||||
--- a/gen_initramfs.sh
|
||||
+++ b/gen_initramfs.sh
|
||||
@@ -328,10 +328,22 @@ append_mdadm(){
|
||||
fi
|
||||
cd ${TEMP}
|
||||
mkdir -p "${TEMP}/initramfs-mdadm-temp/etc/"
|
||||
+ mkdir -p "${TEMP}/initramfs-mdadm-temp/sbin/"
|
||||
if [ "${MDADM}" -eq '1' ]
|
||||
then
|
||||
cp -a /etc/mdadm.conf "${TEMP}/initramfs-mdadm-temp/etc" \
|
||||
|| gen_die "Could not copy mdadm.conf!"
|
||||
+ if [ -e '/sbin/mdadm' ] && LC_ALL="C" ldd /sbin/mdadm|grep -q 'not a dynamic executable'
|
||||
+ then
|
||||
+ print_info 1 ' MDADM: Adding support (using local static binaries)...'
|
||||
+ cp /sbin/mdadm "${TEMP}/initramfs-mdadm-temp/sbin/mdadm" ||
|
||||
+ gen_die 'Could not copy over mdadm!'
|
||||
+ else
|
||||
+ print_info 1 ' MDADM: Adding support (compiling binaries)...'
|
||||
+ compile_mdadm
|
||||
+ /bin/tar -jxpf "${MDADM_BINCACHE}" -C "${TEMP}/initramfs-mdadm-temp" ||
|
||||
+ gen_die "Could not extract mdadm binary cache!";
|
||||
+ fi
|
||||
fi
|
||||
cd "${TEMP}/initramfs-mdadm-temp/"
|
||||
find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
|
||||
diff --git a/genkernel.conf b/genkernel.conf
|
||||
index a71ce69..62b7801 100644
|
||||
--- a/genkernel.conf
|
||||
+++ b/genkernel.conf
|
||||
@@ -162,6 +162,11 @@ LVM_DIR="LVM2.${LVM_VER}"
|
||||
LVM_SRCTAR="${DISTDIR}/LVM2.${LVM_VER}.tgz"
|
||||
LVM_BINCACHE="%%CACHE%%/LVM2.${LVM_VER}-%%ARCH%%.tar.bz2"
|
||||
|
||||
+MDADM_VER="VERSION_MDADM"
|
||||
+MDADM_DIR="mdadm-${MDADM_VER}"
|
||||
+MDADM_SRCTAR="${DISTDIR}/mdadm-${MDADM_VER}.tar.bz2"
|
||||
+MDADM_BINCACHE="%%CACHE%%/mdadm-${MDADM_VER}-%%ARCH%%.tar.bz2"
|
||||
+
|
||||
DMRAID_VER="VERSION_DMRAID"
|
||||
DMRAID_DIR="dmraid/${DMRAID_VER}"
|
||||
DMRAID_SRCTAR="${DISTDIR}/dmraid-${DMRAID_VER}.tar.bz2"
|
||||
--
|
||||
1.7.2.2
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
diff --git a/gen_cmdline.sh b/gen_cmdline.sh
|
||||
index 20380ac..cec496e 100755
|
||||
--- a/gen_cmdline.sh
|
||||
+++ b/gen_cmdline.sh
|
||||
@@ -133,6 +133,11 @@ longusage() {
|
||||
echo " --integrated-initramfs"
|
||||
echo " Build the generated initramfs into the kernel instead of"
|
||||
echo " keeping it as a separate file"
|
||||
+ echo " --strip=(all|kernel|modules|none)"
|
||||
+ echo " Strip debug symbols from the installed kernel, modules,"
|
||||
+ echo " all (default) or none"
|
||||
+ echo " --no-strip"
|
||||
+ echo " Don't strip installed kernel or modules (alias for --strip=none)"
|
||||
}
|
||||
|
||||
usage() {
|
||||
@@ -536,6 +541,14 @@ parse_cmdline() {
|
||||
--config=*)
|
||||
print_info 2 "CMD_GK_CONFIG: `parse_opt "$*"`"
|
||||
;;
|
||||
+ --strip=*)
|
||||
+ CMD_STRIP_TYPE=`parse_opt "$*"`
|
||||
+ print_info 2 "CMD_STRIP_TYPE: ${CMD_STRIP_TYPE}"
|
||||
+ ;;
|
||||
+ --no-strip)
|
||||
+ CMD_STRIP_TYPE=none
|
||||
+ print_info 2 "CMD_STRIP_TYPE: ${CMD_STRIP_TYPE}"
|
||||
+ ;;
|
||||
all)
|
||||
BUILD_KERNEL=1
|
||||
BUILD_MODULES=1
|
||||
diff --git a/gen_compile.sh b/gen_compile.sh
|
||||
index d87d2f4..e7c3d41 100755
|
||||
--- a/gen_compile.sh
|
||||
+++ b/gen_compile.sh
|
||||
@@ -284,7 +284,16 @@ compile_modules() {
|
||||
compile_generic modules kernel
|
||||
export UNAME_MACHINE="${ARCH}"
|
||||
[ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH
|
||||
+ if [ "${CMD_STRIP_TYPE}" == "all" -o "${CMD_STRIP_TYPE}" == "modules" ]
|
||||
+ then
|
||||
+ print_info 1 " >> Installing ${KV} modules (and stripping)"
|
||||
+ INSTALL_MOD_STRIP=1
|
||||
+ export INSTALL_MOD_STRIP
|
||||
+ else
|
||||
+ print_info 1 " >> Installing ${KV} modules"
|
||||
+ fi
|
||||
compile_generic "modules_install" kernel
|
||||
+ unset INSTALL_MOD_STRIP
|
||||
unset UNAME_MACHINE
|
||||
}
|
||||
|
||||
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
|
||||
index ed84798..7fb8a66 100755
|
||||
--- a/gen_determineargs.sh
|
||||
+++ b/gen_determineargs.sh
|
||||
@@ -119,6 +119,7 @@ determine_real_args() {
|
||||
set_config_with_override 1 KEYMAP CMD_KEYMAP "yes"
|
||||
set_config_with_override 1 DOKEYMAPAUTO CMD_DOKEYMAPAUTO
|
||||
set_config_with_override 2 BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG
|
||||
+ set_config_with_override 1 STRIP_TYPE CMD_STRIP_TYPE "all"
|
||||
|
||||
BOOTDIR=`arch_replace "${BOOTDIR}"`
|
||||
BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
|
||||
diff --git a/gen_funcs.sh b/gen_funcs.sh
|
||||
index 07a7f5f..010f5bd 100755
|
||||
--- a/gen_funcs.sh
|
||||
+++ b/gen_funcs.sh
|
||||
@@ -393,7 +393,13 @@ copy_image_with_preserve() {
|
||||
print_info 5 " Copying ${symlinkName}: ${newSrceImage}"
|
||||
print_info 5 " to ${BOOTDIR}/${currDestImage}"
|
||||
cp "${newSrceImage}" "${BOOTDIR}/${currDestImage}" ||
|
||||
- gen_die "Could not copy the ${symlinkName} image to ${BOOTDIR}!"
|
||||
+ gen_die "Could not copy the ${symlinkName} image to ${BOOTDIR}!"
|
||||
+
|
||||
+ if [ "${CMD_STRIP_TYPE}" = "all" -o "${CMD_STRIP_TYPE}" = "kernel" ]
|
||||
+ then
|
||||
+ print_info 5 " Stripping ${BOOTDIR}/${currDestImage}"
|
||||
+ strip --strip-debug "${BOOTDIR}/${currDestImage}" >/dev/null 2>&1
|
||||
+ fi
|
||||
|
||||
if [ "${SYMLINK}" -eq '1' ]
|
||||
then
|
||||
diff --git a/genkernel.8 b/genkernel.8
|
||||
index 4dba331..2c498a8 100644
|
||||
--- a/genkernel.8
|
||||
+++ b/genkernel.8
|
||||
@@ -243,6 +243,13 @@ against a kernel source tree.
|
||||
\fB\-\-initramfs\-overlay=\fR<dir>
|
||||
Directory structure to include in the initramfs,
|
||||
only available on 2.6 kernels
|
||||
+.TP
|
||||
+\fB\-\-strip=\fR<all|kernel|modules|none>
|
||||
+Strip debug symbols from the installed kernel, modules, all (default)
|
||||
+or none.
|
||||
+.TP
|
||||
+\fB\-\-no\-\fBstrip
|
||||
+Alias for \fB\-\-strip=none\fR
|
||||
.SH RAMDISK OPTIONS
|
||||
The following options can be passed as kernel parameters from the
|
||||
bootloader, which the ramdisk scripts would recognize.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,109 +0,0 @@
|
||||
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
|
||||
Date: 2010-10-30
|
||||
Initial Package Version: 3.4.10.907
|
||||
Origin: gentoo busybox mdev-start.sh and me
|
||||
Upstream Status: unknown
|
||||
Description: add a new boot command 'nashack' that creates the missing dev entries
|
||||
|
||||
diff -Naur genkernel-3.4.10.907.orig/defaults/initrd.scripts genkernel-3.4.10.907/defaults/initrd.scripts
|
||||
--- genkernel-3.4.10.907.orig/defaults/initrd.scripts 2010-10-29 16:11:03.765695917 +0000
|
||||
+++ genkernel-3.4.10.907/defaults/initrd.scripts 2010-10-29 21:14:39.022515391 +0000
|
||||
@@ -284,9 +284,60 @@
|
||||
/bin/ash
|
||||
}
|
||||
|
||||
+seed_chroot_dev()
|
||||
+{
|
||||
+ # Seed /dev with some things that we know we need
|
||||
+
|
||||
+ # Create problematic directories
|
||||
+ mkdir -p ${CHROOT}/dev/pts ${CHROOT}/dev/shm
|
||||
+
|
||||
+ # creating /dev/console and /dev/tty1 to be able to write
|
||||
+ # to $CONSOLE with/without bootsplash before mdev creates it
|
||||
+ [ -c ${CHROOT}/dev/console ] || mknod ${CHROOT}/dev/console c 5 1
|
||||
+ [ -c ${CHROOT}/dev/tty1 ] || mknod ${CHROOT}/dev/tty1 c 4 1
|
||||
+
|
||||
+ # udevd will dup its stdin/stdout/stderr to /dev/null
|
||||
+ # and we do not want a file which gets buffered in ram
|
||||
+ [ -c ${CHROOT}/dev/null ] || mknod ${CHROOT}/dev/null c 1 3
|
||||
+
|
||||
+ # creating /dev/initctl to be able to switch init
|
||||
+ [ -c ${CHROOT}/dev/initctl ] || mknod ${CHROOT}/dev/initctl p
|
||||
+}
|
||||
+
|
||||
+seed_dev()
|
||||
+{
|
||||
+ # Seed /dev with some things that we know we need
|
||||
+
|
||||
+ # creating /dev/console and /dev/tty1 to be able to write
|
||||
+ # to $CONSOLE with/without bootsplash before mdev creates it
|
||||
+ [ -c /dev/console ] || mknod /dev/console c 5 1
|
||||
+ [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
|
||||
+
|
||||
+ # udevd will dup its stdin/stdout/stderr to /dev/null
|
||||
+ # and we do not want a file which gets buffered in ram
|
||||
+ [ -c /dev/null ] || mknod /dev/null c 1 3
|
||||
+
|
||||
+ # copy over any persistant things
|
||||
+ if [ -d /lib/mdev/devices ] ; then
|
||||
+ cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
|
||||
+ fi
|
||||
+
|
||||
+ # Not provided by sysfs but needed
|
||||
+ ln -snf /proc/self/fd /dev/fd
|
||||
+ ln -snf fd/0 /dev/stdin
|
||||
+ ln -snf fd/1 /dev/stdout
|
||||
+ ln -snf fd/2 /dev/stderr
|
||||
+ [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
|
||||
+
|
||||
+ # Create problematic directories
|
||||
+ mkdir -p /dev/pts /dev/shm
|
||||
+}
|
||||
+
|
||||
runmdev() {
|
||||
# busybox udev replacement
|
||||
mdev -s
|
||||
+ # add missing dev entrys for nas devices without console
|
||||
+ seed_dev
|
||||
}
|
||||
|
||||
test_success() {
|
||||
@@ -1093,3 +1144,5 @@
|
||||
USE_UNIONFS_NORMAL=0
|
||||
fi
|
||||
}
|
||||
+
|
||||
+
|
||||
diff -Naur genkernel-3.4.10.907.orig/defaults/linuxrc genkernel-3.4.10.907/defaults/linuxrc
|
||||
--- genkernel-3.4.10.907.orig/defaults/linuxrc 2010-10-29 16:11:03.762695924 +0000
|
||||
+++ genkernel-3.4.10.907/defaults/linuxrc 2010-10-30 07:31:00.700222780 +0000
|
||||
@@ -62,6 +62,10 @@
|
||||
init_opts\=*)
|
||||
INIT_OPTS=`parse_opt "${x}"`
|
||||
;;
|
||||
+ # remount chroot rw and create missing files
|
||||
+ nashack)
|
||||
+ NASHACK=1
|
||||
+ ;;
|
||||
# Livecd options
|
||||
cdroot)
|
||||
CDROOT=1
|
||||
@@ -731,6 +735,17 @@
|
||||
|
||||
verbose_kmsg
|
||||
|
||||
+# create the missing dev entrys for the nas boxes if the don't exist
|
||||
+if [ "${NASHACK}" = '1' ]
|
||||
+then
|
||||
+ if [ ! -e "${CHROOT}/dev/console" ] || [ ! -e "${CHROOT}/dev/null" ]
|
||||
+ then
|
||||
+ mount -o remount,rw ${CHROOT} >/dev/null 2>&1
|
||||
+ seed_chroot_dev
|
||||
+ mount -o remount,ro ${CHROOT} >/dev/null 2>&1
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)${NORMAL}"
|
||||
if [ ! -e "${CHROOT}/dev/console" ] || [ ! -e "${CHROOT}/dev/null" ]
|
||||
then
|
||||
@@ -1,126 +0,0 @@
|
||||
diff -Nurp genkernel-3.4.10.906.orig/defaults/initrd.scripts genkernel-3.4.10.906/defaults/initrd.scripts
|
||||
--- genkernel-3.4.10.906.orig/defaults/initrd.scripts 2009-08-11 18:42:31.669397498 +0200
|
||||
+++ genkernel-3.4.10.906/defaults/initrd.scripts 2009-08-11 19:16:22.161397604 +0200
|
||||
@@ -195,6 +195,13 @@ mount_sysfs() {
|
||||
[ "$ret" -eq '0' ] || bad_msg "Failed to mount /sys!"
|
||||
}
|
||||
|
||||
+aufs_setup_dir() {
|
||||
+ mount -t aufs -o "br:$OVERLAY=rw:$2=ro" -- aufs $1
|
||||
+ if [ "$?" -eq '0' ]; then
|
||||
+ good_msg "Addition of $2 to $OVERLAY merged into $1"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
findnfsmount() {
|
||||
if [ "${IP}" != '' ] || busybox udhcpc -n -T 15 -q
|
||||
then
|
||||
@@ -378,9 +385,10 @@ setup_hotplug() {
|
||||
|
||||
check_slowusb() {
|
||||
[ "${DO_slowusb}" ] || \
|
||||
- for dir in /sys/bus/usb/drivers/usb-storage/*
|
||||
+ for x in /sys/bus/usb/drivers/usb-storage/*
|
||||
do
|
||||
- [ -d "${dir}" ] && FORCE_slowusb="1"
|
||||
+ [ -d "${x}" ] && [ "${x}" != "/sys/bus/usb/drivers/usb-storage/module" ] \
|
||||
+ && FORCE_slowusb="1"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -388,9 +396,7 @@ start_dev_mgr() {
|
||||
if [ "${KV_2_6_OR_GREATER}" ]
|
||||
then
|
||||
cd /sys
|
||||
- [ "${DO_slowusb}" ] && sdelay
|
||||
check_slowusb
|
||||
- [ "${FORCE_slowusb}" ] && sdelay
|
||||
good_msg 'Activating mdev'
|
||||
runmdev
|
||||
[ "${DO_slowusb}" ] || \
|
||||
@@ -928,6 +934,34 @@ getdvhoff() {
|
||||
echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512))
|
||||
}
|
||||
|
||||
+setup_aufs() {
|
||||
+
|
||||
+ # Directory used for rw changes in union mount filesystem
|
||||
+ UNION=/aufs
|
||||
+ OVERLAY=/overlay
|
||||
+
|
||||
+ mkdir -p "${UNION}"
|
||||
+ mkdir -p "${OVERLAY}"
|
||||
+ mount -t tmpfs none "${OVERLAY}"
|
||||
+ good_msg "Loading aufs module (if module)"
|
||||
+ modprobe aufs > /dev/null 2>&1
|
||||
+
|
||||
+ aufs_setup_dir "${UNION}" "${NEW_ROOT}/${FS_LOCATION}"
|
||||
+
|
||||
+ # setup internal mounts
|
||||
+ mkdir -p "${UNION}/mnt/livecd"
|
||||
+ if [ ! -e "${UNION}/mnt/cdrom" ]; then
|
||||
+ mkdir "${UNION}/mnt/cdrom" -p
|
||||
+ fi
|
||||
+ mount --bind "${NEW_ROOT}/${FS_LOCATION}" "${UNION}/mnt/livecd"
|
||||
+ mount --bind "${NEW_ROOT}/mnt/cdrom" "${UNION}/mnt/cdrom"
|
||||
+
|
||||
+ # Make sure fstab notes livecd is mounted ro. Makes system skip remount which fails on aufs $
|
||||
+ sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|' "/${UNION}/etc/fstab" > "/${UNION}/etc/fstab.new"
|
||||
+ mv "/${UNION}/etc/fstab.new" "/${UNION}/etc/fstab"
|
||||
+
|
||||
+}
|
||||
+
|
||||
setup_unionfs() {
|
||||
local rw_dir=$1
|
||||
local ro_dir=$2
|
||||
diff -Nurp genkernel-3.4.10.906.orig/defaults/linuxrc genkernel-3.4.10.906/defaults/linuxrc
|
||||
--- genkernel-3.4.10.906.orig/defaults/linuxrc 2009-02-04 14:30:48.000000000 +0100
|
||||
+++ genkernel-3.4.10.906/defaults/linuxrc 2009-08-11 19:19:48.949397441 +0200
|
||||
@@ -191,6 +191,9 @@ do
|
||||
USE_UNIONFS_NORMAL=1
|
||||
fi
|
||||
;;
|
||||
+ aufs)
|
||||
+ USE_AUFS_NORMAL=1
|
||||
+ ;;
|
||||
nounionfs)
|
||||
USE_UNIONFS_NORMAL=0
|
||||
;;
|
||||
@@ -587,7 +588,13 @@ then
|
||||
fi
|
||||
|
||||
|
||||
- if [ "${USE_UNIONFS_NORMAL}" = '1' ]
|
||||
+ if [ "${USE_AUFS_NORMAL}" -eq '1' ]
|
||||
+ then
|
||||
+ good_msg 'Setting up aufs mounts'
|
||||
+ setup_aufs
|
||||
+ CHROOT="${UNION}"
|
||||
+
|
||||
+ elif [ "${USE_UNIONFS_NORMAL}" = '1' ]
|
||||
then
|
||||
setup_unionfs ${NEW_ROOT} ${NEW_ROOT}/${FS_LOCATION}
|
||||
CHROOT=/union
|
||||
@@ -636,10 +643,6 @@ then
|
||||
fi
|
||||
done
|
||||
|
||||
- if [ "${DO_slowusb}" ] || [ "${FORCE_slowusb}" ]
|
||||
- then
|
||||
- sleep 10
|
||||
- fi
|
||||
mkdir initramfs proc tmp sys 2>/dev/null
|
||||
chmod 1777 tmp
|
||||
|
||||
@@ -668,6 +671,11 @@ else
|
||||
setup_unionfs /union_changes ${NEW_ROOT}
|
||||
mkdir -p ${UNION}/tmp/.initrd
|
||||
fi
|
||||
+ if [ "${USE_AUFS_NORMAL}" -eq '1' ]
|
||||
+ then
|
||||
+ setup_aufs
|
||||
+ mkdir -p ${UNION}/tmp/.initrd
|
||||
+ fi
|
||||
fi
|
||||
|
||||
# Execute script on the cdrom just before boot to update things if necessary
|
||||
@@ -1,68 +0,0 @@
|
||||
diff -Nurp genkernel-3.4.10.906.orig/gen_bootloader.sh genkernel-3.4.10.906/gen_bootloader.sh
|
||||
--- genkernel-3.4.10.906.orig/gen_bootloader.sh 2009-08-05 15:19:47.000000000 +0200
|
||||
+++ genkernel-3.4.10.906/gen_bootloader.sh 2009-08-11 18:40:03.292176371 +0200
|
||||
@@ -62,7 +62,7 @@ set_bootloader_grub() {
|
||||
|
||||
# Add grub configuration to grub.conf
|
||||
echo "# Genkernel generated entry, see GRUB documentation for details" >> ${GRUB_CONF}
|
||||
- echo "title=Gentoo Linux ($KV)" >> ${GRUB_CONF}
|
||||
+ echo "title=Genlink Linux ($KV)" >> ${GRUB_CONF}
|
||||
if [ "${BUILD_INITRD}" -eq '0' ]
|
||||
then
|
||||
echo -e "\tkernel /kernel-${KNAME}-${ARCH}-${KV} root=${GRUB_ROOTFS}" >> ${GRUB_CONF}
|
||||
@@ -139,7 +139,7 @@ set_bootloader_grub_duplicate_default()
|
||||
sed -n 1,$((${startline}-1))p "${GRUB_CONF}" > "${GRUB_CONF_TMP}"
|
||||
|
||||
# Put in our title
|
||||
- echo "title=Gentoo Linux (${KV})" >> "${GRUB_CONF_TMP}"
|
||||
+ echo "title=Genlink Linux (${KV})" >> "${GRUB_CONF_TMP}"
|
||||
|
||||
# Pass the default entry (minus the title) through to the replacement function and pipe the output to GRUB_CONF_TMP
|
||||
sed -n $((${startline}+1)),$((${stopline}-1))p "${GRUB_CONF}" | set_bootloader_grub_duplicate_default_replace_kernel_initrd >> "${GRUB_CONF_TMP}"
|
||||
diff -Nurp genkernel-3.4.10.906.orig/gen_cmdline.sh genkernel-3.4.10.906/gen_cmdline.sh
|
||||
--- genkernel-3.4.10.906.orig/gen_cmdline.sh 2009-08-05 15:19:47.000000000 +0200
|
||||
+++ genkernel-3.4.10.906/gen_cmdline.sh 2009-08-11 18:40:03.292176371 +0200
|
||||
@@ -2,7 +2,7 @@
|
||||
# $Id: 20380ac6f16d8c9be4dcfbfd6bc1e0b0ba1979b3 $
|
||||
|
||||
longusage() {
|
||||
- echo "Gentoo Linux Genkernel ${GK_V}"
|
||||
+ echo "Genlink/Gentoo Linux Genkernel ${GK_V}"
|
||||
echo "Usage: "
|
||||
echo " genkernel [options] action"
|
||||
echo
|
||||
@@ -136,7 +136,7 @@ longusage() {
|
||||
}
|
||||
|
||||
usage() {
|
||||
- echo "Gentoo Linux Genkernel ${GK_V}"
|
||||
+ echo "Genlink/Gentoo Linux Genkernel ${GK_V}"
|
||||
echo "Usage: "
|
||||
echo " genkernel [options] all"
|
||||
echo
|
||||
diff -Nurp genkernel-3.4.10.906.orig/genkernel genkernel-3.4.10.906/genkernel
|
||||
--- genkernel-3.4.10.906.orig/genkernel 2009-08-05 15:22:28.000000000 +0200
|
||||
+++ genkernel-3.4.10.906/genkernel 2009-08-11 18:40:03.292176371 +0200
|
||||
@@ -93,7 +93,7 @@ then
|
||||
fi
|
||||
|
||||
clear_log
|
||||
-NORMAL=${GOOD} print_info 1 "Gentoo Linux Genkernel; Version ${GK_V}${NORMAL}"
|
||||
+NORMAL=${GOOD} print_info 1 "Genlink/Gentoo Linux Genkernel; Version ${GK_V}${NORMAL}"
|
||||
print_info 1 "Running with options: ${Options}"
|
||||
echo
|
||||
|
||||
diff -Nurp genkernel-3.4.10.906.orig/netboot/linuxrc.x genkernel-3.4.10.906/netboot/linuxrc.x
|
||||
--- genkernel-3.4.10.906.orig/netboot/linuxrc.x 2008-12-24 17:17:49.000000000 +0100
|
||||
+++ genkernel-3.4.10.906/netboot/linuxrc.x 2009-08-11 18:40:03.293490689 +0200
|
||||
@@ -249,8 +249,8 @@ SubGenius() {
|
||||
GenMotd() {
|
||||
echo -e "" > /etc/motd
|
||||
echo -e "" >> /etc/motd
|
||||
- echo -e "Gentoo Linux; http://www.gentoo.org/" >> /etc/motd
|
||||
- echo -e " Copyright 2001-${CPYYEAR} Gentoo Foundation; Distributed under the GPL" >> /etc/motd
|
||||
+ echo -e "Genlink Linux; http://linamh.disconnected-by-peer.at/wiki/Genlink/" >> /etc/motd
|
||||
+ echo -e " Copyright 2004-${CPYYEAR} Genlink Linux; Distributed under the GPL" >> /etc/motd
|
||||
echo -e "" >> /etc/motd
|
||||
echo -e " Gentoo/${MYARCH} Netboot for ${MACHTYPE} Systems" >> /etc/motd
|
||||
echo -e " ${BUILDDATE}" >> /etc/motd
|
||||
@@ -1,12 +0,0 @@
|
||||
--- genkernel-3.4.10.906.orig/defaults/linuxrc
|
||||
+++ genkernel-3.4.10.906/defaults/linuxrc
|
||||
@@ -229,6 +229,9 @@
|
||||
# Start device manager
|
||||
start_dev_mgr
|
||||
|
||||
+# start BTRFS volume detection
|
||||
+[ -x /sbin/btrfsctl ] && /sbin/btrfsctl -a
|
||||
+
|
||||
# Setup md device nodes if they dont exist
|
||||
setup_md_device
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
diff -Nurp genkernel-3.4.10.906.orig/defaults/linuxrc genkernel-3.4.10.906/defaults/linuxrc
|
||||
--- genkernel-3.4.10.906.orig/defaults/linuxrc 2009-08-12 14:28:26.919151873 +0200
|
||||
+++ genkernel-3.4.10.906/defaults/linuxrc 2009-08-12 14:30:39.632271882 +0200
|
||||
@@ -132,6 +132,7 @@ do
|
||||
# Redirect output to a specific tty
|
||||
CONSOLE\=*|console\=*)
|
||||
CONSOLE=`parse_opt "${x}"`
|
||||
+ CONSOLE=`basename ${CONSOLE}`
|
||||
# exec >${CONSOLE} <${CONSOLE} 2>&1
|
||||
;;
|
||||
# /dev/md
|
||||
@@ -1,11 +0,0 @@
|
||||
--- genkernel-3.4.10.906.orig/defaults/initrd.scripts
|
||||
+++ genkernel-3.4.10.906/defaults/initrd.scripts
|
||||
@@ -794,6 +794,8 @@ sdelay() {
|
||||
if [ -n "${SDELAY}" ]
|
||||
then
|
||||
sleep ${SDELAY}
|
||||
+ elif grep cdroot /proc/cmdline > /dev/null 2>&1; then
|
||||
+ sleep 3
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
@@ -1,19 +0,0 @@
|
||||
diff -Nurp genkernel-3.4.10.907.orig/arch/x86/modules_load genkernel-3.4.10.907/arch/x86/modules_load
|
||||
--- genkernel-3.4.10.907.orig/arch/x86/modules_load 2009-12-17 05:21:37.000000000 +0100
|
||||
+++ genkernel-3.4.10.907/arch/x86/modules_load 2010-04-10 21:53:00.590161869 +0200
|
||||
@@ -28,3 +28,5 @@ MODULES_USB="ehci-hcd uhci usb-ohci hid
|
||||
# Filesystems
|
||||
MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs fuse"
|
||||
|
||||
+# Crypto stuff, required for Sabayon crypt installs
|
||||
+MODULES_CRYPT="aes sha1 sha256 sha512 xts"
|
||||
diff -Nurp genkernel-3.4.10.907.orig/arch/x86_64/modules_load genkernel-3.4.10.907/arch/x86_64/modules_load
|
||||
--- genkernel-3.4.10.907.orig/arch/x86_64/modules_load 2009-12-17 05:21:37.000000000 +0100
|
||||
+++ genkernel-3.4.10.907/arch/x86_64/modules_load 2010-04-10 21:53:12.358096340 +0200
|
||||
@@ -26,3 +26,6 @@ MODULES_USB="ehci-hcd uhci usb-ohci hid
|
||||
|
||||
# Filesystems
|
||||
MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs fuse"
|
||||
+
|
||||
+# Crypto stuff, required for Sabayon crypt installs
|
||||
+MODULES_CRYPT="aes sha1 sha256 sha512 xts"
|
||||
@@ -1,73 +0,0 @@
|
||||
# genkernel (8) completion
|
||||
# Copyright 2006 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# Written by Aron Griffis <agriffis@gentoo.org>
|
||||
|
||||
_genkernel()
|
||||
{
|
||||
declare cur prev genkernel_help actions params
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
# extract initial list of params/actions from genkernel --help
|
||||
genkernel_help=$(command genkernel --help)
|
||||
actions=( $(<<<"$genkernel_help" sed -n \
|
||||
'/^Available Actions:/,/^$/s/^[[:space:]]\+\([^[:space:]]\+\).*/\1/p') )
|
||||
params=( $(<<<"$genkernel_help" egrep -oe '--[^[:space:]]{2,}') )
|
||||
|
||||
# attempt to complete the current parameter based on the list
|
||||
COMPREPLY=($(compgen -W "${params[*]/=*/=} ${actions[*]}" -- "$cur"))
|
||||
|
||||
# if we don't have a rhs to complete
|
||||
if [[ ${#COMPREPLY[@]} -gt 1 ]]; then
|
||||
return
|
||||
elif [[ ${#COMPREPLY[@]} -eq 0 && $cur != --*=* ]]; then
|
||||
return
|
||||
elif [[ ${#COMPREPLY[@]} -eq 1 && $COMPREPLY != --*= ]]; then
|
||||
# using nospace completion, add an explicit space
|
||||
COMPREPLY="${COMPREPLY} "
|
||||
return
|
||||
fi
|
||||
|
||||
# we have a unique lhs and need to complete the rhs
|
||||
declare args lhs rhs
|
||||
if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
|
||||
lhs=$COMPREPLY
|
||||
else
|
||||
lhs=${cur%%=*}=
|
||||
rhs=${cur#*=}
|
||||
fi
|
||||
|
||||
# genkernel's help gives clues as to what belongs on the rhs.
|
||||
# extract the clue for the current parameter
|
||||
args=" ${params[*]} "
|
||||
args="${args##* $lhs}"
|
||||
args="${args%% *}"
|
||||
|
||||
# generate a list of completions for the argument; this replaces args with
|
||||
# an array of results
|
||||
args=( $(case $args in
|
||||
('<0-5>') compgen -W "$(echo {1..5})" -- "$rhs" ;;
|
||||
('<outfile>'|'<file>') compgen -A file -o plusdirs -- "$rhs" ;;
|
||||
('<dir>') compgen -A directory -S / -- "$rhs" ;;
|
||||
('<tbz2>') compgen -G '*.tbz2' -G '*.tar.bz2' -o plusdirs -- "$rhs" ;;
|
||||
(*) compgen -o bashdefault -- "$rhs" ;; # punt
|
||||
esac) )
|
||||
|
||||
# we're using nospace completion to prevent spaces after paths that aren't
|
||||
# "done" yet. So do some hacking to the args to add spaces after
|
||||
# non-directories.
|
||||
declare slash=/
|
||||
args=( "${args[@]/%/ }" ) # add space to all
|
||||
args=( "${args[@]/%$slash /$slash}" ) # remove space from dirs
|
||||
|
||||
# recreate COMPREPLY
|
||||
if [[ $cur == "$lhs"* ]]; then
|
||||
COMPREPLY=( "${args[@]}" )
|
||||
elif [[ ${#args[@]} -gt 0 ]]; then
|
||||
COMPREPLY=( "${args[@]/#/$lhs}" )
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o nospace -F _genkernel genkernel
|
||||
Reference in New Issue
Block a user