splashdialog/0000755000000000001440000000000010170271514013653 5ustar rootusers00000000000000splashdialog/genkernel0000755000000000000000000002144710170170370015372 0ustar rootroot00000000000000#!/bin/bash # Genkernel v3 GK_V='3.1.0c' TEMP='/var/tmp/genkernel' TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified. small_die() { echo $1 exit 1 } source /etc/genkernel.conf || small_die "Could not read /etc/genkernel.conf" source ${GK_BIN}/gen_funcs.sh || small_die "Could not read ${GK_BIN}/gen_funcs.sh" source ${GK_BIN}/gen_cmdline.sh || gen_die "Could not read ${GK_BIN}/gen_cmdline.sh" source ${GK_BIN}/gen_arch.sh || gen_die "Could not read ${GK_BIN}/gen_arch.sh" source ${GK_BIN}/gen_determineargs.sh || gen_die "Could not read ${GK_BIN}/gen_determineargs.sh" source ${GK_BIN}/gen_compile.sh || gen_die "Could not read ${GK_BIN}/gen_compile.sh" source ${GK_BIN}/gen_configkernel.sh || gen_die "Could not read ${GK_BIN}/gen_configkernel.sh" source ${GK_BIN}/gen_initrd.sh || gen_die "Could not read ${GK_BIN}/gen_initrd.sh" source ${GK_BIN}/gen_moddeps.sh || gen_die "Could not read ${GK_BIN}/gen_moddeps.sh" source ${GK_BIN}/gen_package.sh || gen_die "Could not read ${GK_BIN}/gen_package.sh" source ${GK_BIN}/gen_bootloader.sh || gen_die "Could not read ${GK_BIN}/gen_bootloader.sh" BUILD_KERNEL=0 BUILD_INITRD=0 # Parse all command line options... while [ $# -gt 0 ] do Option=$1; shift parse_cmdline $Option done # Check if no action is specified... if [ "${BUILD_KERNEL}" -eq 0 -a "${BUILD_INITRD}" -eq 0 ] then usage exit 1 fi clear_log NORMAL=${GOOD} print_info 1 "Gentoo Linux Genkernel; Version ${GK_V}${NORMAL}" # Set ${ARCH} get_official_arch # Read arch-specific config source ${ARCH_CONFIG} || gen_die "Could not read ${ARCH_CONFIG}" source ${GK_SHARE}/${ARCH}/modules_load || gen_die "Could not read ${GK_SHARE}/${ARCH}/modules_load" [ ! -f "${TEMP}" ] && mkdir -p "${TEMP}" [ ! -f "${CACHE_DIR}" ] && mkdir -p "${CACHE_DIR}" # Based on genkernel.conf, arch-specific configs, and commandline options, # get the real arguments for usage... determine_real_args dump_debugcache NORMAL=${BOLD} print_info 1 "Compiling Linux Kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..." echo if [ "${BUILD_INITRD}" -ne '0' ] then if ! has_loop then modprobe loop 2>/dev/null if ! has_loop then print_error 1 'Your kernel does not appear to have loop device support.' print_error 1 'Please load loop support before running genkernel!' gen_die 'Load loop support!' else print_info 1 'loop: "loop" module loaded successfully...' fi fi fi # Check /boot is mounted if isTrue ${CMD_NOINSTALL} then isTrue ${MOUNTBOOT} && print_info 2 'Skipping automatic mount of boot' else if ! egrep -q ' /boot ' /proc/mounts then if egrep -q '^[^#].+ /boot ' /etc/fstab then if isTrue ${MOUNTBOOT} then if ! mount /boot then print_warning 1 "${BOLD}WARNING${NORMAL}: Failed to mount /boot!" echo else print_info 1 'mount: /boot mounted successfully!' fi else print_warning 1 "${BOLD}WARNING${NORMAL}: No mounted /boot partition detected!" print_warning 1 ' Run ``mount /boot`` to mount it!' echo fi fi elif isBootRO then if isTrue ${MOUNTBOOT} then if ! mount -o remount,rw /boot then print_warning 1 "${BOLD}WARNING${NORMAL}: Failed to remount /boot RW!" echo else print_info 1 "mount: /boot remounted read/write successfully!" BOOTRW=1 fi fi fi fi # Check whether another Genkernel is running GENPIDS="`ps -C genkernel --no-headers -o pid | wc -l`" if [ "${GENPIDS}" -gt '3' ] then [ "${GENPIDS}" -gt '4' ] && EX='s' print_warning 1 "${BOLD}WARNING${NORMAL}: Another Genkernel instance is running under" print_warning 1 " process ID${EX} " 0 GENPIDS=`ps -C genkernel --no-headers -o pid` echo -n "${GENPIDS}" | sed -e "s/$$//; s/ /, /g" echo 'halting...' echo print_warning 1 'Running multiple genkernels on the same source tree will cause data loss!' print_info 1 "Press ^C to halt; ^D to continue [ ${BOLD}if${NORMAL} you know what you're doing! ]" cat echo CTEMP="${TEMP}" TEMP="/var/tmp/genkernel-`dd if=/dev/random count=1 2>/dev/null | md5sum | cut -d\ -f1`" print_info 1 'thread: Running multiple genkernels may cause problems!' print_info 1 "thread: Temporary files reallocated to ${TEMP}..." echo fi if [ ${BUILD_KERNEL} -eq 1 ] then # Configure kernel config_kernel # Make deps compile_dep # Make prepare [2.6] [ "${VER}" -gt '2' ] || [ "${VER}" -eq '2' -a "${PAT}" -ge '6' ] && compile_generic prepare kernel # Run postconf if [ "${CMD_POSTCONF}" != '' ] then print_info 1 '' 1 0 print_info 1 "Preparing to run postconf: \"${CMD_POSTCONF}\"" 0 CALLBACK_ESCAPE=0 CALLBACK_COUNT=0 trap "CALLBACK_ESCAPE=1" TERM KILL INT QUIT ABRT while [[ ${CALLBACK_ESCAPE} -eq 0 && ${CALLBACK_COUNT} -lt 5 ]] do sleep 1; echo -n '.'; let CALLBACK_COUNT=${CALLBACK_COUNT}+1 done if [ "${CALLBACK_ESCAPE}" -eq 0 ] then echo echo eval ${CMD_POSTCONF} | tee -a ${DEBUGFILE} echo print_info 1 "<<< Postconf callback exit status: ${PIPESTATUS[0]}" else echo print_info 1 '>>> Postconf cancelled...' fi trap - TERM KILL INT QUIT ABRT print_info 1 '' 1 0 fi # if [ "${GENSPLASH}" -eq '1' ] # then # if [ -x /sbin/splash ] # then # [ -z "${GENSPLASH_THEME}" ] && [ -e /etc/conf.d/splash ] && source /etc/conf.d/splash # [ -z "${GENSPLASH_THEME}" ] && GENSPLASH_THEME=default # print_info 1 " >> Installing gensplash [ using the ${GENSPLASH_THEME} theme ]..." # sed -i -e 's:$(obj)/gen_init_cpio $(initramfs-y) FORCE:$(if $(shell [ ! -f $(obj)/initramfs_data.cpio ] \&\& echo 1 ), $(obj)/gen_init_cpio $(initramfs-y)):' ${KERNEL_DIR}/usr/Makefile # splash_geninitramfs -g ${KERNEL_DIR}/usr/initramfs_data.cpio.gz ${GENSPLASH_THEME} # else # print_warning 1 ' >> No splash detected; skipping!' # fi # fi # Compile kernel compile_kernel # Compile modules compile_modules if [ ${SAVE_CONFIG} -eq 1 ] then print_info 1 "Copying config for successful build to /etc/kernels/kernel-config-${ARCH}-${KV}" [ ! -e '/etc/kernels' ] && mkdir -p /etc/kernels cp "${KERNEL_DIR}/.config" "/etc/kernels/kernel-config-${ARCH}-${KV}" fi fi # Run callback if [ "${CMD_CALLBACK}" != "" ] then print_info 1 "" 1 0 print_info 1 "Preparing to run callback: \"${CMD_CALLBACK}\"" 0 CALLBACK_ESCAPE=0 CALLBACK_COUNT=0 trap "CALLBACK_ESCAPE=1" TERM KILL INT QUIT ABRT while [[ ${CALLBACK_ESCAPE} -eq 0 && ${CALLBACK_COUNT} -lt 5 ]] do sleep 1; echo -n '.'; let CALLBACK_COUNT=${CALLBACK_COUNT}+1 done if [ "${CALLBACK_ESCAPE}" -eq 0 ] then echo echo eval ${CMD_CALLBACK} | tee -a ${DEBUGFILE} echo print_info 1 "<<< Callback exit status: ${PIPESTATUS[0]}" else echo print_info 1 ">>> Callback cancelled..." fi trap - TERM KILL INT QUIT ABRT print_info 1 "" 1 0 fi if [ "${BUILD_INITRD}" -eq '1' ] then # Compile dietlibc if [ "${USE_DIETLIBC}" = '1' ] then compile_dietlibc fi # Compile Busybox compile_busybox # Only compile insmod if we're installing modules onto the initrd if [ "${NOINITRDMODULES}" = '' ] then if [ "${PAT}" -gt '4' ] then # Compile module-init-tools compile_module_init_tools else compile_modutils fi fi compile_devfsd [ "${UDEV}" -eq '1' ] && compile_udev # Create initrd create_initrd else print_info 1 'initrd: Not building since only the kernel was requested...' fi [ "${MINKERNPACKAGE}" != "" ] && gen_minkernpackage # Clean up... [ -n "${CTEMP}" ] && rm -rf "${TEMP}" if [ "${BUILD_KERNEL}" -eq '1' ] then set_bootloader print_info 1 '' print_info 1 "Kernel compiled successfully!" print_info 1 '' print_info 1 'Required Kernel Parameters:' if [ "${BUILD_INITRD}" -eq '0' ] then print_info 1 ' root=/dev/$ROOT' print_info 1 ' [ And "vga=0x317 splash=verbose" if you use a framebuffer ]' print_info 1 '' print_info 1 ' Where $ROOT is the device node for your root partition as the' print_info 1 ' one specified in /etc/fstab' else print_info 1 ' root=/dev/ram0 real_root=/dev/$ROOT init=/linuxrc' [ "${INITRD_SIZE}" -ge 4096 ] && print_info 1 " ramdisk_size=8192" print_info 1 ' [ And "vga=0x317 splash=verbose" if you use a framebuffer ]' print_info 1 '' print_info 1 ' Where $ROOT is the device node for your root partition as the' print_info 1 ' one specified in /etc/fstab' print_info 1 '' print_info 1 "If you require Genkernel's hardware detection features; you MUST" print_info 1 'tell your bootloader to use the provided initrd file. Otherwise;' print_info 1 'substitute the root argument for the real_root argument if you are' print_info 1 'not planning to use the initrd...' fi else print_info 1 '' print_info 1 'initrd compiled successfully!' fi [ "${BOOTRW}" != '' ] && mount -o remount,ro /boot print_info 1 '' print_info 1 'Do NOT report kernel bugs as genkernel bugs unless your bug' print_info 1 'is about the default genkernel configuration...' print_info 1 '' print_info 1 'Make sure you have the latest genkernel before reporting bugs.' splashdialog/resolution.sh0000755000000000000000000000715510170271462016240 0ustar rootroot00000000000000#!/bin/sh # by maxadamo TEMP='/var/tmp/genkernel' choose_resolution="${TEMP}/choose_resolution" mall_die() { echo $1 exit 1 } source /etc/genkernel.conf || small_die "Could not read /etc/genkernel.conf" source ${GK_BIN}/gen_funcs.sh || small_die "Could not read ${GK_BIN}/gen_funcs.sh" source ${GK_BIN}/gen_cmdline.sh || gen_die "Could not read ${GK_BIN}/gen_cmdline.sh" source ${GK_BIN}/gen_arch.sh || gen_die "Could not read ${GK_BIN}/gen_arch.sh" source ${GK_BIN}/gen_determineargs.sh || gen_die "Could not read ${GK_BIN}/gen_determineargs.sh" source ${GK_BIN}/gen_compile.sh || gen_die "Could not read ${GK_BIN}/gen_compile.sh" source ${GK_BIN}/gen_configkernel.sh || gen_die "Could not read ${GK_BIN}/gen_configkernel.sh" source ${GK_BIN}/gen_initrd.sh || gen_die "Could not read ${GK_BIN}/gen_initrd.sh" source ${GK_BIN}/gen_moddeps.sh || gen_die "Could not read ${GK_BIN}/gen_moddeps.sh" source ${GK_BIN}/gen_package.sh || gen_die "Could not read ${GK_BIN}/gen_package.sh" source ${GK_BIN}/gen_bootloader.sh || gen_die "Could not read ${GK_BIN}/gen_boot" installed_resolutions () { ls /etc/splash/default/*.cfg|sed -e s,.*default\/,, -e s,\.cfg,,|sort -t x -nk 1|sort -t x -nk 2 } dialog_list () { installed_resolutions | sed -e s,^,\", -e s,$,\"\ \"\"\ \\\\, } cat >$choose_resolution <&1 resolution=\`\$DIALOG \\ --clear \\ --title "Gensplash Kernel Install Utility" \\ --menu \\ "\\nChoose between one of the resolutions \\ available for you theme:" 15 46 6 \\ EOF dialog_list >> $choose_resolution cat >>$choose_resolution <&1 1>&3\` retval=\$? exec 3>&- case \$retval in 0) find /etc/splash/default/ -type f | grep -v \$resolution | xargs rm splash_geninitramfs -g \${KERNEL_DIR}/usr/initramfs_data.cpio.gz -r \${resolution} default gunzip -f \${KERNEL_DIR}/usr/initramfs_data.cpio.gz splash_geninitramfs -g \${KERNEL_DIR}/usr/initramfs_data.cpio.gz -r \${resolution} default echo "Theme \$chosen_theme with resolution \${resolution} chosen." echo "Now you can run genkernel using the option --gensplash=default" echo "Don't forget to modify your boot loader configuration.";; 1) echo "Cancel pressed.";; 255) if test -n "\$resolution" ; then echo "\$resolution" else echo "ESC pressed." fi ;; esac EOF . $choose_resolution splashdialog/README_BEFORE.txt0000644000000000000000000000075710170271511016212 0ustar rootroot00000000000000Splash Utility Tools/README_file by maxadamo If you want to see Splash working at boot time you can use this script. To use the script: 1) Copy "resolution.sh" to /usr/share/genkernel 2) Copy "splashdialog" to a location on your $PATH 3) replace "gen_initrd.sh" already present in /usr/share/genkernel 4) replace "genkernel" already present in /usr/bin NOTE: In "gen_initrd.sh" I have added the row 33 In "genkernel" I commented out rows from 184 to 196 splashdialog/splashdialog0000755000000000000000000000632010170174264016071 0ustar rootroot00000000000000#!/bin/sh # by maxadamo TEMP='/var/tmp/genkernel' choose_theme="${TEMP}/choose_theme" small_die() { echo $1 exit 1 } source /etc/genkernel.conf || small_die "Could not read /etc/genkernel.conf" source ${GK_BIN}/gen_funcs.sh || small_die "Could not read ${GK_BIN}/gen_funcs.sh" source ${GK_BIN}/gen_cmdline.sh || gen_die "Could not read ${GK_BIN}/gen_cmdline.sh" source ${GK_BIN}/gen_arch.sh || gen_die "Could not read ${GK_BIN}/gen_arch.sh" source ${GK_BIN}/gen_determineargs.sh || gen_die "Could not read ${GK_BIN}/gen_determineargs.sh" source ${GK_BIN}/gen_compile.sh || gen_die "Could not read ${GK_BIN}/gen_compile.sh" source ${GK_BIN}/gen_configkernel.sh || gen_die "Could not read ${GK_BIN}/gen_configkernel.sh" source ${GK_BIN}/gen_initrd.sh || gen_die "Could not read ${GK_BIN}/gen_initrd.sh" source ${GK_BIN}/gen_moddeps.sh || gen_die "Could not read ${GK_BIN}/gen_moddeps.sh" source ${GK_BIN}/gen_package.sh || gen_die "Could not read ${GK_BIN}/gen_package.sh" source ${GK_BIN}/gen_bootloader.sh || gen_die "Could not read ${GK_BIN}/gen_bootloader.sh" installed_themes () { find /etc/splash/ -type d -maxdepth 1 | sed -e s,.*splash\/,, -e 1D | grep -vw default } dialog_list () { installed_themes| sed -e s,^,\", -e s,$,\"\ \"\"\ \\\\, } if [[ -z ${TEMP}/installed_themes ]]; then echo -e "\nI cannot find any Gensplash Theme installed\n" exit 1 fi cat >$choose_theme <&1 theme=\`\$DIALOG \\ --clear \\ --title "Gensplash Kernel Install Utility" \\ --menu \\ "\\nScroll up and down and press enter \\ to select your preferred theme:" 15 46 6 \\ EOF dialog_list >> $choose_theme cat >>$choose_theme <&1 1>&3\` retval=\$? exec 3>&- case \$retval in 0) echo "\$theme chosen." rm -fr /etc/splash/default cp -a "/etc/splash/\$theme" /etc/splash/default touch "/etc/splash/default/.\$theme";; 1) echo "Cancel pressed." exit 0;; 255) if test -n "\$theme" ; then echo "\$theme" else echo "ESC pressed." fi ;; esac \${GK_BIN}/resolution.sh EOF . $choose_theme splashdialog/gen_initrd.sh0000755000000000000000000002654510170174762016170 0ustar rootroot00000000000000#!/bin/bash # create_initrd_loop(size) create_initrd_loop() { local inodes [ "$#" -ne '1' ] && gen_die 'create_initrd_loop(): Not enough arguments!' mkdir -p ${TEMP}/initrd-mount || gen_die 'Could not create loopback mount directory!' dd if=/dev/zero of=${TEMP}/initrd-${KV} bs=1k count=${1} >> "${DEBUGFILE}" 2>&1 || gen_die "Could not zero initrd-${KV}" mke2fs -F -N500 -q "${TEMP}/initrd-${KV}" >> "${DEBUGFILE}" 2>&1 || gen_die "Could not format initrd-${KV}!" mount -t ext2 -o loop "${TEMP}/initrd-${KV}" "${TEMP}/initrd-mount" >> "${DEBUGFILE}" 2>&1 || gen_die 'Could not mount the initrd filesystem!' } create_initrd_unmount_loop() { cd ${TEMP} umount "${TEMP}/initrd-mount" || gen_die 'Could not unmount initrd system!' } move_initrd_to_loop() { cd "${TEMP}/initrd-temp" mv * "${TEMP}/initrd-mount" >> ${DEBUGFILE} 2>&1 } create_base_initrd_sys() { rm -rf "${TEMP}/initrd-temp" > /dev/null mkdir -p ${TEMP}/initrd-temp mkdir -p ${TEMP}/initrd-temp/dev mkdir -p ${TEMP}/initrd-temp/bin mkdir -p ${TEMP}/initrd-temp/etc mkdir -p ${TEMP}/initrd-temp/usr mkdir -p ${TEMP}/initrd-temp/proc mkdir -p ${TEMP}/initrd-temp/temp mkdir -p ${TEMP}/initrd-temp/sys mkdir -p ${TEMP}/initrd-temp/.initrd ln -s bin ${TEMP}/initrd-temp/sbin ln -s ../bin ${TEMP}/initrd-temp/usr/bin ln -s ../bin ${TEMP}/initrd-temp/usr/sbin (cd ${TEMP}/initrd-temp; cpio -i -u --quiet < ${KERNEL_DIR}/usr/initramfs_data.cpio) || gen_die 'Could not copy splash files' echo "/dev/ram0 / ext2 defaults" > ${TEMP}/initrd-temp/etc/fstab echo "proc /proc proc defaults 0 0" >> ${TEMP}/initrd-temp/etc/fstab echo "REGISTER .* MKOLDCOMPAT" > ${TEMP}/initrd-temp/etc/devfsd.conf echo "UNREGISTER .* RMOLDCOMPAT" >> ${TEMP}/initrd-temp/etc/devfsd.conf echo "REGISTER .* MKNEWCOMPAT" >> ${TEMP}/initrd-temp/etc/devfsd.conf echo "UNREGISTER .* RMNEWCOMPAT" >> ${TEMP}/initrd-temp/etc/devfsd.conf cd ${TEMP}/initrd-temp/dev MAKEDEV std MAKEDEV console cp "${BUSYBOX_BINCACHE}" "${TEMP}/initrd-temp/bin/busybox.bz2" || gen_die 'Could not copy busybox from bincache!' bunzip2 "${TEMP}/initrd-temp/bin/busybox.bz2" || gen_die 'Could not uncompress busybox!' chmod +x "${TEMP}/initrd-temp/bin/busybox" if [ "${NOINITRDMODULES}" = '' ] then if [ "${PAT}" -gt "4" ] then cp "${MODULE_INIT_TOOLS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die 'Could not copy insmod.static from bincache!' else cp "${MODUTILS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die 'Could not copy insmod.static from bincache' fi bunzip2 "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die 'Could not uncompress insmod.static!' mv "${TEMP}/initrd-temp/bin/insmod.static" "${TEMP}/initrd-temp/bin/insmod" chmod +x "${TEMP}/initrd-temp/bin/insmod" fi cp "${DEVFSD_BINCACHE}" "${TEMP}/initrd-temp/bin/devfsd.bz2" || gen_die "could not copy devfsd executable from bincache" bunzip2 "${TEMP}/initrd-temp/bin/devfsd.bz2" || gen_die "could not uncompress devfsd" chmod +x "${TEMP}/initrd-temp/bin/devfsd" [ "${UDEV}" -eq '1' ] && { tar -jxpf "${UDEV_BINCACHE}" -C "${TEMP}/initrd-temp" || gen_die "Could not extract udev binary cache!"; } ln -sf "./udev" "${TEMP}/initrd-temp/bin/udevstart" || gen_die 'Could not symlink udev -> udevstart!' # We make our own devfsd.conf these days, the default one doesn't work with the stripped # down devfsd we use with dietlibc # cp "${DEVFSD_CONF_BINCACHE}" "${TEMP}/initrd-temp/etc/devfsd.conf.bz2" || # gen_die "could not copy devfsd.conf from bincache" # bunzip2 "${TEMP}/initrd-temp/etc/devfsd.conf.bz2" || # gen_die "could not uncompress devfsd.conf" # LVM2 if [ "${LVM2}" -eq '1' ] then if [ -e '/sbin/lvm' ] && ldd /sbin/lvm|grep -q 'not a dynamic executable'; then print_info 1 'LVM2: Adding support (using local static binaries)...' cp /sbin/lvm "${TEMP}/initrd-temp/bin/lvm" || gen_die 'Could not copy over lvm!' ln -sf "${TEMP}/initrd-temp/bin/lvm" "${TEMP}/initrd-temp/bin/vgscan" || gen_die 'Could not symlink lvm -> vgscan!' ln -sf "${TEMP}/initrd-temp/bin/lvm" "${TEMP}/initrd-temp/bin/vgchange" || gen_die 'Could not symlink lvm -> vgchange!' else print_info 1 'LVM2: Adding support (compiling binaries)...' compile_lvm2 tar -jxpf "${LVM2_BINCACHE}" -C "${TEMP}/initrd-temp" || gen_die "Could not extract lvm2 binary cache!"; mv ${TEMP}/initrd-temp/bin/lvm.static ${TEMP}/initrd-temp/bin/lvm || gen_die 'LVM2 error: Could not move lvm.static to lvm!' for i in vgchange vgscan; do ln ${TEMP}/initrd-temp/bin/lvm ${TEMP}/initrd-temp/bin/$i || gen_die "LVM2 error: Could not link ${i}!" done fi else # Deprecation warning; remove in a few versions. if [ -e '/sbin/lvm' ] then if ldd /sbin/lvm|grep -q 'not a dynamic executable'; then print_warning 1 'LVM2: For support, use --lvm2!' fi fi fi # EVMS2 if [ -e '/sbin/evms_activate' ] then if [ "${CMD_NOEVMS2}" != '1' ] then print_info 1 'EVMS2: Adding support...' mkdir -p ${TEMP}/initrd-temp/lib cp -a /lib/ld-* "${TEMP}/initrd-temp/lib" || gen_die 'Could not copy files for EVMS2!' cp -a /lib/libc-* /lib/libc.* "${TEMP}/initrd-temp/lib" || gen_die 'Could not copy files for EVMS2!' cp -a /lib/libdl-* /lib/libdl.* "${TEMP}/initrd-temp/lib" || gen_die 'Could not copy files for EVMS2!' cp -a /lib/libpthread* "${TEMP}/initrd-temp/lib" || gen_die 'Could not copy files for EVMS2!' cp -a /lib/libuuid*so* "${TEMP}/initrd-temp/lib" || gen_die 'Could not copy files for EVMS2!' cp -a /lib/libevms*so* "${TEMP}/initrd-temp/lib" || gen_die 'Could not copy files for EVMS2!' cp -a /lib/evms "${TEMP}/initrd-temp/lib" || gen_die 'Could not copy files for EVMS2!' cp -a /lib/evms/* "${TEMP}/initrd-temp/lib/evms" || gen_die 'Could not copy files for EVMS2!' cp -a /etc/evms.conf "${TEMP}/initrd-temp/etc" || gen_die 'Could not copy files for EVMS2!' cp /sbin/evms_activate "${TEMP}/initrd-temp/bin/evms_activate" || gen_die 'Could not copy over vgscan!' fi fi for i in '[' ash basename cat chroot clear cp dirname echo env false find \ grep gunzip gzip ln ls loadkmap losetup lsmod mkdir mknod more mount mv \ pivot_root ps awk pwd rm rmdir rmmod sed sh sleep tar test touch true umount uname \ xargs yes zcat chmod chown cut kill killall; do rm -f ${TEMP}/initrd-temp/bin/$i > /dev/null ln ${TEMP}/initrd-temp/bin/busybox ${TEMP}/initrd-temp/bin/$i || gen_die "Busybox error: could not link ${i}!" done } print_list() { local x for x in ${*} do echo ${x} done } create_initrd_modules() { local group local group_modules if [ "${PAT}" -gt "4" ] then MOD_EXT=".ko" else MOD_EXT=".o" fi print_info 2 "initrd: >> Searching for modules..." if [ "${INSTALL_MOD_PATH}" != '' ] then cd ${INSTALL_MOD_PATH} else cd / fi for i in `gen_dep_list` do mymod=`find ./lib/modules/${KV} -name "${i}${MOD_EXT}" | head -n 1` if [ -z "${mymod}" ] then print_warning 2 "Warning :: ${i}${MOD_EXT} not found; skipping..." continue; fi print_info 2 "initrd: >> Copying ${i}${MOD_EXT}..." cp -ax --parents "${mymod}" "${TEMP}/initrd-temp" done cp -ax --parents ./lib/modules/${KV}/modules* ${TEMP}/initrd-temp mkdir -p "${TEMP}/initrd-temp/etc/modules" for group_modules in ${!MODULES_*}; do group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")" print_list ${!group_modules} > "${TEMP}/initrd-temp/etc/modules/${group}" done } create_initrd_aux() { if [ -f "${CMD_LINUXRC}" ] then cp "${CMD_LINUXRC}" "${TEMP}/initrd-temp/linuxrc" print_info 2 " >> Copying user specified linuxrc: ${CMD_LINUXRC}" else if [ -f "${GK_SHARE}/${ARCH}/linuxrc" ] then cp "${GK_SHARE}/${ARCH}/linuxrc" "${TEMP}/initrd-temp/linuxrc" else cp "${GK_SHARE}/generic/linuxrc" "${TEMP}/initrd-temp/linuxrc" fi fi if [ -f "${GK_SHARE}/${ARCH}/initrd.scripts" ] then cp "${GK_SHARE}/${ARCH}/initrd.scripts" "${TEMP}/initrd-temp/etc/initrd.scripts" else cp "${GK_SHARE}/generic/initrd.scripts" "${TEMP}/initrd-temp/etc/initrd.scripts" fi if [ -f "${GK_SHARE}/${ARCH}/initrd.defaults" ] then cp "${GK_SHARE}/${ARCH}/initrd.defaults" "${TEMP}/initrd-temp/etc/initrd.defaults" else cp "${GK_SHARE}/generic/initrd.defaults" "${TEMP}/initrd-temp/etc/initrd.defaults" fi echo -n 'HWOPTS="$HWOPTS ' >> "${TEMP}/initrd-temp/etc/initrd.defaults" for group_modules in ${!MODULES_*}; do group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")" echo -n "${group} " >> "${TEMP}/initrd-temp/etc/initrd.defaults" done echo '"' >> "${TEMP}/initrd-temp/etc/initrd.defaults" if [ -f "${GK_SHARE}/${ARCH}/modprobe" ] then cp "${GK_SHARE}/${ARCH}/modprobe" "${TEMP}/initrd-temp/sbin/modprobe" else cp "${GK_SHARE}/generic/modprobe" "${TEMP}/initrd-temp/sbin/modprobe" fi if isTrue $CMD_DOKEYMAPAUTO then echo 'MY_HWOPTS="${MY_HWOPTS} keymap"' >> ${TEMP}/initrd-temp/etc/initrd.defaults fi mkdir -p "${TEMP}/initrd-temp/lib/keymaps" tar -C "${TEMP}/initrd-temp/lib/keymaps" -zxf "${GK_SHARE}/generic/keymaps.tar.gz" cd ${TEMP}/initrd-temp/sbin && ln -s ../linuxrc init cd ${OLDPWD} chmod +x "${TEMP}/initrd-temp/linuxrc" chmod +x "${TEMP}/initrd-temp/etc/initrd.scripts" chmod +x "${TEMP}/initrd-temp/etc/initrd.defaults" chmod +x "${TEMP}/initrd-temp/sbin/modprobe" } calc_initrd_size() { local TEST cd ${TEMP}/initrd-temp/ TEST=`du -sk 2> /dev/null` echo $TEST | cut "-d " -f1 } create_initrd() { local MOD_EXT print_info 1 "initrd: >> Initializing..." create_base_initrd_sys if [ "${NOINITRDMODULES}" = '' ] then print_info 1 " >> Copying modules..." create_initrd_modules else print_info 1 "initrd: Not copying modules..." fi print_info 1 " >> Copying auxilary files..." create_initrd_aux INITRD_CALC_SIZE=`calc_initrd_size` INITRD_SIZE=`expr ${INITRD_CALC_SIZE} + 100` print_info 1 " :: Size is at ${INITRD_SIZE}K" print_info 1 " >> Creating loopback filesystem..." create_initrd_loop ${INITRD_SIZE} print_info 1 " >> Moving initrd files to the loopback..." move_initrd_to_loop print_info 1 " >> Cleaning up and compressing the initrd..." create_initrd_unmount_loop if [ "${COMPRESS_INITRD}" ] then gzip -f -9 ${TEMP}/initrd-${KV} mv ${TEMP}/initrd-${KV}.gz ${TEMP}/initrd-${KV} fi if [ "${BOOTSPLASH}" -eq "1" ] then if [ -x /sbin/splash ] then [ -z "${BOOTSPLASH_THEME}" ] && [ -e /etc/conf.d/bootsplash.conf ] && source /etc/conf.d/bootsplash.conf [ -z "${BOOTSPLASH_THEME}" ] && [ -e /etc/conf.d/bootsplash ] && source /etc/conf.d/bootsplash [ -z "${BOOTSPLASH_THEME}" ] && BOOTSPLASH_THEME=default print_info 1 " >> Installing bootsplash [ using the ${BOOTSPLASH_THEME} theme ]..." for bootRes in '800x600' '1024x768' '1280x1024' '1600x1200' do if [ -f "/etc/bootsplash/${BOOTSPLASH_THEME}/config/bootsplash-${bootRes}.cfg" ] then /sbin/splash -s -f /etc/bootsplash/${BOOTSPLASH_THEME}/config/bootsplash-${bootRes}.cfg >> ${TEMP}/initrd-${KV} || gen_die "Error: could not copy ${bootRes} bootsplash!" else print_warning 1 "splash: Did not find a bootsplash for the ${bootRes} resolution..." fi done else print_warning 1 ' >> No bootsplash detected; skipping!' fi fi if ! isTrue "${CMD_NOINSTALL}" then cp ${TEMP}/initrd-${KV} /boot/initrd-${KV} || gen_die 'Could not copy the initrd to /boot!' fi }