diff --git a/ChangeLog b/ChangeLog index e4127a2..5cdcaca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,18 @@ # Distributed under the GPL v2 # $Id$ + 24 Mar 2011; Peter Hjalmarsson defaults/linuxrc, initrd.scripts: + Rescue /proc and /sys over into chroot + Apply mount options noexec,nosuid,nodev to /proc and /sys + + 22 Mar 2011; Fabio Erculiani gen_compile.sh, patches/iscsi/*: + Fix compilation of iSCSI + + 23 Mar 2011; Peter Hjalmarsson doc/genkernel.8.txt, + gen_cmdline.sh, gen_initramfs.sh: + Remove "--slowusb" as it is enabled by default now. Also document "noslowusb" + ramdisk option that skips it. + 22 Mar 2011; Peter Hjalmarsson defaults/initrd.defaults, defaults/initrd.scripts: Set DO_slowusb as default, and make setup_slowusb unset it if it cannot find diff --git a/HACKING b/HACKING index b379bf4..2626963 100644 --- a/HACKING +++ b/HACKING @@ -19,4 +19,4 @@ Rolling a release: - make dist - upload genkernel-${PV}.tar.bz2 to the hosting: scp genkernel-${PV}.tar.bz2 ${USER}@dev.gentoo.org:/space/distfiles-local/ -- check open bugs with keyword "InSVN" for closability +- check open bugs with keyword "InSVN" or "InVCS" for closability diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 4a12b73..b228a77 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -210,7 +210,7 @@ cache_cd_contents() { } mount_sysfs() { - mount -t sysfs /sys /sys >/dev/null 2>&1 + mount -t sysfs sysfs /sys -o noexec,nosuid,nodev >/dev/null 2>&1 ret=$? [ ${ret} -eq 0 ] || bad_msg "Failed to mount /sys!" } diff --git a/defaults/linuxrc b/defaults/linuxrc index 61efc95..1819d9f 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -20,7 +20,7 @@ then exit 1 fi -mount -t proc proc /proc >/dev/null 2>&1 +mount -t proc -o noexec,nosuid,nodev proc /proc >/dev/null 2>&1 mount -o remount,rw / >/dev/null 2>&1 # Set up symlinks @@ -733,16 +733,17 @@ echo -ne "${BOLD}.${NORMAL}" # If devtmpfs is mounted, try move it to the new root # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise -if grep -qs "/dev " /proc/mounts -then - if ! mount --move /dev "${CHROOT}"/dev +for fs in /dev /sys /proc +do + if grep -qs "$fs" /proc/mounts then - umount /dev || echo '*: Failed to move and unmount the ramdisk /dev!' + if ! mount --move $fs "${CHROOT}"$fs + then + umount $fs || echo '*: Failed to move and unmount the ramdisk $fs!' + fi fi -fi +done -umount /sys || echo '*: Failed to unmount the ramdisk /sys!' -umount /proc || echo '*: Failed to unmount the ramdisk /proc!' echo -e "${BOLD}.${NORMAL}" exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}" diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index a74df82..9091d95 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -130,7 +130,7 @@ KERNEL COMPILATION to the second most recently built image, if one exists. Similar symlinks (both * and *.old) are managed for initramfs and System.map. The corresponding work products (i.e., the actual kernel - and initamfs images, and System.map) are also managed accordingly. + and initramfs images, and System.map) are also managed accordingly. NOTE: Specifying *--symlink* does nothing unless *--install* is also specified. @@ -263,9 +263,6 @@ INITIALIZATION *--iscsi*:: Include iSCSI support -*--slowusb*:: - Enables extra pauses for slow USB CD boots. - *--bootloader*=*grub*:: Add new kernel to GRUB configuration. @@ -427,6 +424,11 @@ which the ramdisk scripts would recognize. Activate SCSI devices on bootup, necessary when SCSI support is compiled as modules and you're using SCSI or SATA devices. +*noslowusb*:: + By default genkernel pause for 10 seconds if it finds a attached + usb-storage device to give them time to initiate. + This option skips that pause. + *keymap*='MAP':: Set keymap to 'MAP', e.g. *keymap*=de. For valid values of 'MAP' please see diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 506ca3f..9e4009e 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -84,7 +84,6 @@ longusage() { echo " --dmraid Include DMRAID support" echo " --multipath Include Multipath support" echo " --iscsi Include iSCSI support" - echo " --slowusb Enables extra pauses for slow USB CD boots" echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --linuxrc= Specifies a user created linuxrc" echo " --busybox-config= Specifies a user created busybox config" @@ -269,10 +268,6 @@ parse_cmdline() { CMD_REAL_ROOT=`parse_opt "$*"` print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}" ;; - --slowusb) - CMD_SLOWUSB=1 - print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}" - ;; --dmraid) if [ ! -e /usr/include/libdevmapper.h ] then diff --git a/gen_compile.sh b/gen_compile.sh index b60b921..ec752ce 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -685,10 +685,18 @@ compile_iscsi() { gen_die "ISCSI directory ${ISCSI_DIR} invalid" print_info 1 'iSCSI: >> Compiling...' cd "${TEMP}/${ISCSI_DIR}" + apply_patches iscsi ${ISCSI_VER} # Only build userspace + print_info 1 'iSCSI: >> Configuring userspace...' + cd utils/open-isns || gen_die 'Could not enter open-isns dir' + # we currently have a patch that changes configure.ac + # once given patch is dropped, drop autoconf too + autoconf || gen_die 'Could not tweak open-iscsi configuration' + ./configure --without-slp >> ${LOGFILE} 2>&1 || gen_die 'Could not configure userspace' + cd ../.. || gen_die 'wtf?' MAKE=${UTILS_MAKE} compile_generic "user" "" - + # if kernel modules exist, copy them to initramfs, otherwise it will be compiled into the kernel mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/" for modname in iscsi_tcp libiscsi scsi_transport_iscsi diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 2d017fd..543f484 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -349,7 +349,7 @@ append_mdadm(){ cp -a "${MDADM_CONFIG}" "${TEMP}/initramfs-mdadm-temp/etc/mdadm.conf" \ || gen_die "Could not copy mdadm.conf!" else - gen_die '${MDADM_CONFIG} does not exist!' + gen_die 'sl${MDADM_CONFIG} does not exist!' fi else print_info 1 ' MDADM: Skipping inclusion of mdadm.conf' @@ -629,10 +629,6 @@ append_auxilary() { mkdir -p "${TEMP}/initramfs-aux-temp/lib/keymaps" /bin/tar -C "${TEMP}/initramfs-aux-temp/lib/keymaps" -zxf "${GK_SHARE}/defaults/keymaps.tar.gz" fi - if isTrue $CMD_SLOWUSB - then - echo 'MY_HWOPTS="${MY_HWOPTS} slowusb"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults - fi cd ${TEMP}/initramfs-aux-temp/sbin && ln -s ../init init cd ${TEMP} diff --git a/patches/iscsi/2.0-872/open-iscsi-2.0.872-omg-calling-configure.patch b/patches/iscsi/2.0-872/open-iscsi-2.0.872-omg-calling-configure.patch new file mode 100644 index 0000000..185f1ac --- /dev/null +++ b/patches/iscsi/2.0-872/open-iscsi-2.0.872-omg-calling-configure.patch @@ -0,0 +1,11 @@ +--- open-iscsi-2.0-872.orig/Makefile ++++ open-iscsi-2.0-872/Makefile +@@ -27,7 +27,7 @@ IFACEFILES = etc/iface.example + all: user kernel + + user: ; +- cd utils/open-isns; ./configure; $(MAKE) ++ cd utils/open-isns; $(MAKE) + $(MAKE) -C utils/sysdeps + $(MAKE) -C utils/fwparam_ibft + $(MAKE) -C usr diff --git a/patches/iscsi/2.0-872/open-iscsi-2.0.872-slp.patch b/patches/iscsi/2.0-872/open-iscsi-2.0.872-slp.patch new file mode 100644 index 0000000..51ca3e5 --- /dev/null +++ b/patches/iscsi/2.0-872/open-iscsi-2.0.872-slp.patch @@ -0,0 +1,11 @@ +--- a/utils/open-isns/configure.ac ++++ b/utils/open-isns/configure.ac +@@ -80,7 +80,7 @@ AC_ARG_WITH(slp, + else + WITH_SLP=yes + CPPFLAGS="$CPPFLAGS -I${withval}" +- LDFLAGS="$LDFLAGS -L${withval}" ++ LDFLAGS="$LDFLAGS -L${withval} -lslp" + fi + ] + )