diff --git a/cdrom.c b/cdrom.c index e70c7c6..5b112a5 100644 --- a/cdrom.c +++ b/cdrom.c @@ -19,6 +19,8 @@ * */ +#include +#include #include #include #include @@ -57,7 +59,9 @@ static enum return_type try_with_device(char * dev_name, char * dev_model); static enum return_type do_with_device(char * dev_name, char * dev_model) { + struct stat st; char msg[256]; + char * ramdisk_path; if (test_that_cd()) { enum return_type results; umount(IMAGE_LOCATION); @@ -76,8 +80,14 @@ static enum return_type do_with_device(char * dev_name, char * dev_model) umount(IMAGE_LOCATION); } - do_losetup(LIVE_DEVICE,get_ramdisk_path(NULL)); - my_mount(LIVE_DEVICE, STAGE2_LOCATION, (IS_LIVE) ? LIVEFS : STAGE2FS, 0); + ramdisk_path = get_ramdisk_path(NULL); + stat(ramdisk_path, &st); + if (S_ISDIR(st.st_mode)) { + mount(ramdisk_path, STAGE2_LOCATION, NULL, MS_BIND, NULL); + } else { + do_losetup(LIVE_DEVICE,ramdisk_path); + my_mount(LIVE_DEVICE, STAGE2_LOCATION, (IS_LIVE) ? LIVEFS : STAGE2FS, 0); + } method_name = strdup("cdrom"); add_to_env("METHOD", method_name); diff --git a/propagator.spec b/propagator.spec index 1ad182d..40513ce 100644 --- a/propagator.spec +++ b/propagator.spec @@ -3,7 +3,7 @@ Name: propagator Version: 20080301 -Release: alt3 +Release: alt3.1 Summary: 'Early userspace' set of binaries License: GPL @@ -33,6 +33,9 @@ make %{?_with_shell:WITH_SHELL=t} %{?_with_splash:WITH_SPLASH=t} libdir=%_libdir %_libdir/%name %changelog +* Thu Apr 10 2008 Andriy Stepanov 20080301-alt3.1 +- Add capability to boot directily from cd (folder with root fs) + * Tue Mar 18 2008 Sergey Bolshakov 20080301-alt3 - iso-on-nfs, iso-on-disk: stop trying to pass initial mountpoint with iso image to 2nd stage, there's no point for this