From: Anthony Liguori <aliguori@us.ibm.com>
To: Jared Rhine <jared@wordzoo.com>
Cc: xen-devel@lists.sourceforge.net, Ian Pratt <Ian.Pratt@cl.cam.ac.uk>
Subject: Re: [Fwd: Installing from distribution CDs]
Date: Wed, 02 Feb 2005 13:40:11 -0600 [thread overview]
Message-ID: <1107373210.17156.12.camel@localhost> (raw)
In-Reply-To: <878y66erhr.wl@badger.wordzoo.com>
[-- Attachment #1: Type: text/plain, Size: 1742 bytes --]
On Wed, 2005-02-02 at 12:39, Jared Rhine wrote:
> I don't think so; the bottom of my /linuxrc execs /sbin/init. This
> marks the end of the standard initrd process of doing a pivot-root and
> getting on with life. It doesn't have to be an either/or between
> linuxrc and init.
This is likely to support older kernels as initrd does a pivot for you.
> As mentioned, I can't speak to the innards, but I can offer solid
> proof that I need an init=/linuxrc on my boot line, and that this
> snippet would not be needed if I wasn't using a Xen'ed kernel. On a
> regular kernel, the /linuxrc is found and used automatically in
> preference to /sbin/init, if it is present.
Now here's something for you to do which should be confusing as the
solution. Add a root=/dev/hdc or whatever to your command line and I
bet it will work without the init=/linuxrc.
Apparently what's happening is that at some point during the domain boot
process, Xen decides that the root device is /dev/ram0 if there is no
root= command line on the kernel. In
init/do_mounts_rd.c:rd_load_image() if the ramdisk loads to what it
thinks is the root device, the initrd actions are never taken.
Of course, patching that function to remove that check results in the
same behavior. I've not yet tracked down what's going on but that's the
problem.
I've also included a new patch against a recent xen-unstable. It's
another proof-of-concept one. This time, I can actually start a rescue
CD properly (which means initrd is working with SLES-9). The distro
install doesn't work though. However, another 2.6-based distro might
have more luck.
Regards,
--
Anthony Liguori
Linux Technology Center (LTC) - IBM Austin
E-mail: aliguori@us.ibm.com
Phone: (512) 838-1208
[-- Attachment #2: sles-install.diff --]
[-- Type: text/x-patch, Size: 5989 bytes --]
--- linux-2.6.10-xen-sparse/arch/xen/configs/xenU_defconfig 2005-01-25 22:29:15.000000000 -0600
+++ linux-2.6.10-xenU/.config 2005-02-02 11:25:34.000000000 -0600
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.10-xenU
-# Mon Dec 27 10:15:03 2004
+# Wed Feb 2 11:25:34 2005
#
CONFIG_XEN=y
CONFIG_ARCH_XEN=y
@@ -12,17 +12,15 @@
#
# CONFIG_XEN_PRIVILEGED_GUEST is not set
# CONFIG_XEN_PHYSDEV_ACCESS is not set
-# CONFIG_XEN_BLKDEV_BACKEND is not set
-# CONFIG_XEN_NETDEV_BACKEND is not set
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_NETDEV_FRONTEND=y
# CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
# CONFIG_XEN_BLKDEV_TAP is not set
CONFIG_XEN_WRITABLE_PAGETABLES=y
CONFIG_XEN_SCRUB_PAGES=y
-CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
CONFIG_X86=y
# CONFIG_X86_64 is not set
+CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
#
# Code maturity level options
@@ -48,7 +46,6 @@
# CONFIG_IKCONFIG is not set
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
@@ -156,7 +153,6 @@
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
-# CONFIG_DEBUG_DRIVER is not set
#
# Block devices
@@ -167,7 +163,7 @@
CONFIG_BLK_DEV_NBD=m
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_SIZE=65536
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_LBD is not set
@@ -341,7 +337,7 @@
# CONFIG_REISERFS_FS_XATTR is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
+CONFIG_MINIX_FS=y
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
--- ../xen-unstable-orig/linux-2.6.10-xen-sparse/drivers/xen/blkfront/blkfront.c 2005-01-25 22:29:15.000000000 -0600
+++ linux-2.6.10-xenU/drivers/xen/blkfront/blkfront.c 2005-02-02 11:50:57.000000000 -0600
@@ -219,6 +219,7 @@
unsigned command, unsigned long argument)
{
/* struct gendisk *gd = inode->i_bdev->bd_disk; */
+ int i;
DPRINTK_IOCTL("command: 0x%x, argument: 0x%lx, dev: 0x%04x\n",
command, (long)argument, inode->i_rdev);
@@ -229,6 +230,12 @@
/* return ENOSYS to use defaults */
return -ENOSYS;
+ case CDROMMULTISESSION:
+ DPRINTK("FIXME: support multisession CDs later\n");
+ for ( i = 0; i < sizeof(struct cdrom_multisession); i++ )
+ if ( put_user(0, (byte *)(argument + i)) ) return -EFAULT;
+ return 0;
+
default:
printk(KERN_ALERT "ioctl %08x not supported by Xen blkdev\n",
command);
--- ../xen-unstable-orig/linux-2.6.10-xen-sparse/drivers/xen/blkfront/vbd.c 2005-01-25 22:29:17.000000000 -0600
+++ linux-2.6.10-xenU/drivers/xen/blkfront/vbd.c 2005-02-02 11:49:49.000000000 -0600
@@ -31,6 +31,8 @@
#include "block.h"
#include <linux/blkdev.h>
+#include <linux/sysctl.h>
+#include <linux/proc_fs.h>
/*
* For convenience we distinguish between ide, scsi and 'other' (i.e.
@@ -280,6 +282,98 @@
return NULL;
}
+#define CDROM_STR_SIZE 1000
+static char info[CDROM_STR_SIZE];
+
+int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+ int pos;
+
+ if (!*lenp || (*ppos && !write)) {
+ *lenp = 0;
+ return 0;
+ }
+
+ pos = sprintf(info,
+ "CD-ROM information, Id: cdrom.c 3.20 2003/12/17\n"
+ "\ndrive name:\t\thdc1\n"
+ "drive speed:\t\t40\n"
+ "drive # of slots:\t1\n"
+ "Can close tray:\t\t0\n"
+ "Can open tray:\t\t0\n"
+ "Can lock tray:\t\t0\n"
+ "Can change speed:\t0\n"
+ "Can select disk:\t0\n"
+ "Can read multisession:\t0\n"
+ "Can read MCN:\t\t0\n"
+ "Reports media changed:\t0\n"
+ "Can play audio:\t\t0\n"
+ "Can write CD-R:\t\t0\n"
+ "Can write CD-RW:\t0\n"
+ "Can read DVD:\t\t0\n"
+ "Can write DVD-R:\t0\n"
+ "Can write DVD-RAM:\t0\n"
+ "Can read MRW:\t\t0\n"
+ "Can write MRW:\t\t0\n"
+ "Can write RAM:\t\t0\n"
+ "\n");
+
+ return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
+}
+
+/* Place files in /proc/sys/dev/cdrom */
+static ctl_table cdrom_table[] = {
+ {
+ .ctl_name= DEV_CDROM_INFO,
+ .procname= "info",
+ .data= &info,
+ .maxlen= CDROM_STR_SIZE,
+ .mode= 0444,
+ .proc_handler= &cdrom_sysctl_info,
+ },
+ { .ctl_name = 0 }
+};
+
+static ctl_table cdrom_cdrom_table[] = {
+ {
+ .ctl_name= DEV_CDROM,
+ .procname= "cdrom",
+ .maxlen= 0,
+ .mode= 0555,
+ .child= cdrom_table,
+ },
+ { .ctl_name = 0 }
+};
+
+static ctl_table cdrom_root_table[] = {
+#ifdef CONFIG_PROC_FS
+ {
+ .ctl_name= CTL_DEV,
+ .procname= "dev",
+ .maxlen= 0,
+ .mode= 0555,
+ .child= cdrom_cdrom_table,
+ },
+#endif /* CONFIG_PROC_FS */
+ { .ctl_name = 0 }
+};
+static struct ctl_table_header *cdrom_sysctl_header;
+
+static void cdrom_sysctl_register(void)
+{
+ static int initialized;
+
+ if (initialized == 1)
+ return;
+
+ cdrom_sysctl_header = register_sysctl_table(cdrom_root_table, 1);
+ if (cdrom_root_table->ctl_name && cdrom_root_table->child->de)
+ cdrom_root_table->child->de->owner = THIS_MODULE;
+
+ initialized = 1;
+}
+
/*
* xlvbd_init_device - initialise a VBD device
* @disk: a vdisk_t describing the VBD
@@ -322,13 +416,20 @@
goto out;
}
+ printk(KERN_ALERT "XenLinux: init of %d %s\n", device, gd->disk_name);
+
if (VDISK_READONLY(xd->info))
set_disk_ro(gd, 1);
+ if (!strcmp(gd->disk_name, "hdc1")) {
+ xd->info = VDISK_TYPE_CDROM;
+ }
+
/* Some final fix-ups depending on the device type */
switch (VDISK_TYPE(xd->info)) {
case VDISK_TYPE_CDROM:
gd->flags |= GENHD_FL_REMOVABLE | GENHD_FL_CD;
+ cdrom_sysctl_register();
/* FALLTHROUGH */
case VDISK_TYPE_FLOPPY:
case VDISK_TYPE_TAPE:
next prev parent reply other threads:[~2005-02-02 19:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-02 8:51 [Fwd: Installing from distribution CDs] Ian Pratt
2005-02-02 11:31 ` Jared Rhine
2005-02-02 15:03 ` Anthony Liguori
2005-02-02 18:39 ` Jared Rhine
2005-02-02 19:40 ` Anthony Liguori [this message]
2005-02-02 20:04 ` Anthony Liguori
2005-02-02 14:57 ` Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2005-02-09 1:47 Ian Pratt
2005-02-09 2:11 ` Anthony Liguori
2005-02-09 0:11 Ian Pratt
2005-02-09 1:00 ` Anthony Liguori
2005-02-09 22:56 ` Jared Rhine
2005-02-02 22:26 Ian Pratt
2005-02-03 2:16 ` Anthony Liguori
2005-02-03 4:07 ` Christian Limpach
2005-02-03 4:52 ` Anthony Liguori
2005-02-03 10:54 ` Christian Limpach
2005-01-11 20:48 Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1107373210.17156.12.camel@localhost \
--to=aliguori@us.ibm.com \
--cc=Ian.Pratt@cl.cam.ac.uk \
--cc=jared@wordzoo.com \
--cc=xen-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.