**** BEGIN LOGGING AT Thu Apr 25 02:59:59 2013 Apr 25 21:33:07 Hi, is it possible to boot a kernel on a differet drive with kexec? Apr 25 22:03:27 hi derric Apr 25 22:03:31 surely Apr 25 22:10:34 Can you elaborate or point me in the direction of some reading material that would help. I just found Kexecboot which looks promising. The goal here is to boot a USB drive that fails to get detected by bios before any kernel is loaded. Apr 25 22:11:14 So, I was thinking of booting a mininimal kernel, then kexecing to the kerner on the USB drive. Apr 25 22:11:18 see last line of Apr 25 22:11:20 http://kexecboot.org/documentation/how_to_write_config Apr 25 22:11:44 you can put your boot.cfg on any device then redirect boot Apr 25 22:11:59 Well, it seems like I was on the right track then. Grub2 and plpbt both failed to do the trick. Apr 25 22:12:47 I'm reading their page now, will carry on. Thanks. Apr 25 22:12:52 yw Apr 25 22:13:43 kexecboot is 'just' a wrapper around kexec, making easy to customize cmdline Apr 25 22:14:04 add gui as bonus :) Apr 25 22:15:30 note you have to compile the appropriate drivers in kernel to allow boot from that device Apr 25 22:15:40 (and filesystems ofc) Apr 25 22:16:23 The only thing I'm unsure about is changing the root from the CD booted kernel to the the new one on the USB drive. Apr 25 22:17:17 That's doable. I've built countless kernel. Apr 25 22:18:37 Would that would be the target kernel or the initial kernel? Apr 25 22:21:07 the initial kernel must be able to find a boot.cfg somewhere Apr 25 22:21:48 while the target kernel must be able to boot from the device specidied in boot.cfg item Apr 25 22:25:48 Once the target kernel is booted, will it chroot automatically to the new root on the USB drive? Apr 25 22:26:32 wait, don't mix switch-root and kexec Apr 25 22:26:41 those are two different things Apr 25 22:27:00 kexec doesn't switch root Apr 25 22:28:00 I know, I need, at least I think I do, to do two different things here. I need to boot a kernel loacated on a usb drive, and chroot to the root of that usb drive. Apr 25 22:28:52 I may be getting it mixed up a bit, although I want to boot a live-image on a USB drive. Apr 25 22:29:14 well, in this specific case one kernel should be enough...but you say it doesn't detect usb dongles Apr 25 22:30:05 to overcome bios/bootloader limitations you can just boot a kexecboot-enabled kernel Apr 25 22:30:13 from anywhere Apr 25 22:30:24 Well, I guess I omitted that. My bad, I've been asking in a few places. Apr 25 22:30:55 see, we developed kexecboot for that specific reason years ago:) Apr 25 22:31:27 sucky bootloader only allowed boot from MTD Apr 25 22:31:58 The machine boots fine off the CD, although I want to avoid wearing out my cdrw by running a live-disto on it continuously. Hence the motovation to move the OS to a usb drive. However my machine is making that difficult. Apr 25 22:32:31 It's seems so, and I'm glad. Apr 25 22:33:22 where does your grub reside? Apr 25 22:33:58 Maybe I lack any need to swap out kernels, I can use the same one, I just need to move the root to the USB drive. One problem with that is that rootfs is squashed. Apr 25 22:34:47 I have grub1 on a hdd in the system. I also have grub2 on cd. Apr 25 22:35:15 ok, the easy way would be to boot linux-kexecboot kernel from grub as second-stage bootloader Apr 25 22:35:31 or directly from usb stick Apr 25 22:35:48 ..but this seems impossible in yoiur case Apr 25 22:36:07 Yes. Apr 25 22:36:39 Lemme ask the live-debian guys about just chrooting to the usb drive. Apr 25 22:37:01 After booting from a live-cd. Apr 25 22:37:24 ok, for that you don't need kexec Apr 25 22:38:20 just one of the many switch-root variants Apr 25 22:38:29 I was originally thinking if I could just jump start the boot process to the usb drive. Apr 25 22:39:10 Although I just thought that might be unnecessary. Apr 25 22:40:01 if you use kexec you forcedly need 2 kernels Apr 25 22:40:52 Two kernels is fine. I just want to get my live-distro running off the usb drive before my cd burner wears out. Apr 25 22:43:09 does the live-distro contain a kernel in it? Apr 25 22:43:19 Yes. Apr 25 22:43:44 And it's kexec enabled and relocatable. Apr 25 22:43:59 all seems fine then Apr 25 22:44:23 It might have the required hardware drivers build as modules though. Apr 25 22:44:33 s/build/built Apr 25 22:45:05 Although that's easy enough to fix. It just takes time. Apr 25 22:45:09 you have to verify that Apr 25 22:45:48 but afais you should just try to kexec from CD to usb Apr 25 22:46:08 do that from console, don't care about unmounting if it's a CD Apr 25 22:46:28 A minimal set of driver are included in vmlinuz. Apr 25 22:47:08 Yeah, that's what I was fixing to just try. Boot the cd, mount the usb, and go from thre. Apr 25 22:49:31 see the notes about initramfs here https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt Apr 25 22:50:47 What's your point? Apr 25 22:51:03 iirc debian provides an initramfs to boot nowadays Apr 25 22:51:26 from there you can switch_root Apr 25 22:51:42 Yes, although debian mantains and runs everything in a ramdisk. Apr 25 22:51:56 So it's different then a regular debian system. Apr 25 22:52:11 I meant debian-live uses a ramdisk. Apr 25 22:55:56 ok, in our case kexecboot + kexec are packed in an initramfs ( cpio) Apr 25 22:56:44 atm we don't have any shell, kexecboot is the init process Apr 25 22:57:01 Yes, that's the current way with debian too. It's just the live version which is designed to be run from ROM does thing a little differently after the boot process is completed. Apr 25 22:57:10 but we have been requested to add the switch_root option (and NFS boot FWIW) Apr 25 22:57:49 I though the kexec boot material said it had a minimal shell. Apr 25 22:57:57 nope Apr 25 22:58:56 there are just three binaries atm Apr 25 22:59:06 "The kexec-loader shell is designed to closely mimic a traditional UNIX shell, except.." Apr 25 22:59:36 wait, that's not kexecboot :) Apr 25 23:00:00 we are on the minimalistic side Apr 25 23:00:20 (kernel + cpio size max 1MB) Apr 25 23:01:02 That's kind of small, what's that for embedded systems? Apr 25 23:01:34 Actually that's really small for both the kernel and cpio. Apr 25 23:03:32 Ha, I'm working with two different websites. Apr 25 23:04:12 I've been at this for freaking days from the time I get up till when I fall asleep. Apr 25 23:04:20 see, atm I have only arm toolchain Apr 25 23:04:37 on weekend I'll upload a cpio for x86 on kexecboot site Apr 25 23:04:51 Oh, it's for micro-controllers. Apr 25 23:04:51 I'll be around tomorrow, feel free to ping me Apr 25 23:05:02 Yep, thanks. Apr 25 23:05:23 kexecboot has been developed for handheld devices Apr 25 23:05:44 today is used on some tablets as well Apr 25 23:05:56 wow 1 o'clock here... Apr 25 23:06:03 I have to go... Apr 25 23:06:21 cu Apr 25 23:22:24 I have some interest in that too. **** ENDING LOGGING AT Fri Apr 26 02:59:58 2013