From c9dc25bb55abb9ab410ddec8aa95ff383fe63c38 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 16 Mar 2011 15:55:15 +0100 Subject: [PATCH 1/8] docs: mention keyword InVCS in HACKING --- HACKING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From c579bd11949a48c4757b64b561163951f829a4a6 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 22 Mar 2011 13:02:05 +0100 Subject: [PATCH 2/8] open-iscsi: fix compilation when openslp is installed. Two main issues: 1. open-iscsi build system, inside Makefile, user target, calls ./configure (which is very bad itself) without letting to choose configure options. Fixed in: open-iscsi-2.0.872-omg-calling-configure.patch 2. when openslp support is automagically enabled, -lslp didn't get added to compiler arguments. Fixed in: open-iscsi-2.0.872-slp.patch Peace. --- gen_compile.sh | 7 ++++++- .../open-iscsi-2.0.872-omg-calling-configure.patch | 11 +++++++++++ patches/iscsi/2.0-872/open-iscsi-2.0.872-slp.patch | 11 +++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 patches/iscsi/2.0-872/open-iscsi-2.0.872-omg-calling-configure.patch create mode 100644 patches/iscsi/2.0-872/open-iscsi-2.0.872-slp.patch diff --git a/gen_compile.sh b/gen_compile.sh index b60b921..00b5de9 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -685,10 +685,15 @@ 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' + ./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/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..16658f3 --- /dev/null +++ b/patches/iscsi/2.0-872/open-iscsi-2.0.872-slp.patch @@ -0,0 +1,11 @@ +--- open-iscsi-2.0-872.orig/utils/open-isns/configure.ac ++++ open-iscsi-2.0-872/utils/open-isns/configure.ac +@@ -79,7 +79,7 @@ AC_ARG_WITH(slp, + WITH_SLP=$withval + else + WITH_SLP=yes +- CPPFLAGS="$CPPFLAGS -I${withval}" ++ CPPFLAGS="$CPPFLAGS -I${withval} -lslp" + LDFLAGS="$LDFLAGS -L${withval}" + fi + ] From ad2842f6701c0eea0666a4b2e510f1cd078de6fe Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 22 Mar 2011 19:23:59 +0100 Subject: [PATCH 3/8] iSCSI: open-iscsi patchwork: add -lslp to LDFLAGS, and properly call autoconf --- gen_compile.sh | 3 +++ patches/iscsi/2.0-872/open-iscsi-2.0.872-slp.patch | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gen_compile.sh b/gen_compile.sh index 00b5de9..ec752ce 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -690,6 +690,9 @@ compile_iscsi() { # 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" "" 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 index 16658f3..51ca3e5 100644 --- 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 @@ -1,11 +1,11 @@ ---- open-iscsi-2.0-872.orig/utils/open-isns/configure.ac -+++ open-iscsi-2.0-872/utils/open-isns/configure.ac -@@ -79,7 +79,7 @@ AC_ARG_WITH(slp, - WITH_SLP=$withval +--- 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}" -+ CPPFLAGS="$CPPFLAGS -I${withval} -lslp" - LDFLAGS="$LDFLAGS -L${withval}" + CPPFLAGS="$CPPFLAGS -I${withval}" +- LDFLAGS="$LDFLAGS -L${withval}" ++ LDFLAGS="$LDFLAGS -L${withval} -lslp" fi ] + ) From f3d1fe4a46885d138ad79924691d1b4de8131321 Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 24 Mar 2011 21:05:07 +0100 Subject: [PATCH 4/8] Fix typo "initamfs" --- doc/genkernel.8.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index a74df82..a78da11 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. From 1cf3de853a23946c8233ace771461353b3a354af Mon Sep 17 00:00:00 2001 From: Peter Hjalmarsson Date: Wed, 23 Mar 2011 20:32:45 +0100 Subject: [PATCH 5/8] Remove "--slowusb" as it is enabled by default. Also document "noslowusb". --- ChangeLog | 5 +++++ doc/genkernel.8.txt | 8 +++++--- gen_cmdline.sh | 5 ----- gen_initramfs.sh | 6 +----- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e4127a2..f2b5113 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ # Distributed under the GPL v2 # $Id$ + 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/doc/genkernel.8.txt b/doc/genkernel.8.txt index a78da11..9091d95 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -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_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} From b312056622a1973328ed43864b3ce9419a068c70 Mon Sep 17 00:00:00 2001 From: Peter Hjalmarsson Date: Thu, 24 Mar 2011 13:33:03 +0100 Subject: [PATCH 6/8] Use the same options for proc and sysfs as Gentoo/OpenRC uses --- defaults/initrd.scripts | 2 +- defaults/linuxrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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..115f1f5 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 From f927ef9b4282ceeaa869dc69fa3a971b1ae1bbf9 Mon Sep 17 00:00:00 2001 From: Peter Hjalmarsson Date: Thu, 24 Mar 2011 13:36:56 +0100 Subject: [PATCH 7/8] Try to move /sys and /proc to the newroot first instead of just unmounting. --- defaults/linuxrc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/defaults/linuxrc b/defaults/linuxrc index 115f1f5..1819d9f 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -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}" From 9ee6216b31731ff169696faa5fbe2f49f638c58d Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 28 Mar 2011 19:46:08 +0200 Subject: [PATCH 8/8] Extend change log --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index f2b5113..5cdcaca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,13 @@ # 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"