LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Cant create ramdisk in cblfs (https://www.linuxquestions.org/questions/linux-from-scratch-13/cant-create-ramdisk-in-cblfs-858791/)

grumpy.biatch 01-26-2011 10:21 AM

Cant create ramdisk in cblfs
 
Hi,

I am working with cblfs and stuck at ramdisk. I have built a monster kernel with 'make allyesconfig' for 2.6.37 and when I boot the kernel it hangs. I guess this has to do with no ramdisk. I've another kernel 2.6.35 that boots fine but I am unable to find 'block device' under device driver section in it (the menuconig has a very bad resolution and I cant really read it all too well).

This is what I get when I try to patch /etc/rc.d/init.d/modules -

Code:

root:/etc/rc.d/init.d$ patch -Np1 -i ~/mountfs-0.1-RAMDISKTMP-2.patch
patching file etc/rc.d/init.d/mountfs
Hunk #1 FAILED at 24.
1 out of 1 hunk FAILED -- saving rejects to file etc/rc.d/init.d/mountfs.rej

How do I resolve this as per the cblfs wiki or by other means.

Oliv' 01-31-2011 10:43 AM

Hi,

Could you please post the content of your mountfs.rej file. I think it contains useful info to understand the problem.

Kind regards,

Oliv'

grumpy.biatch 02-01-2011 03:17 AM

Quote:

Originally Posted by Oliv' (Post 4243584)
Hi,

Could you please post the content of your mountfs.rej file. I think it contains useful info to understand the problem.

Kind regards,

Oliv'

Oliv', I am at work atm. Will write back in 3-4 hrs. Best, dave

grumpy.biatch 02-01-2011 03:47 AM

Quote:

Originally Posted by Oliv' (Post 4243584)
Hi,

Could you please post the content of your mountfs.rej file. I think it contains useful info to understand the problem.

Kind regards,

Oliv'

Olivī, here is my mountfs under clfs /etc/rc.d/init.d

Quote:

#!/bin/bash
########################################################################
# Begin $rc_base/init.d/mountfs
#
# Description : File System Mount Script
#
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
#
# Version : 00.00
#
# Notes :
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

case "${1}" in
start)
boot_mesg "Remounting root file system in read-write mode..."
mount -n -o remount,rw / >/dev/null
evaluate_retval

# Remove fsck-related file system watermarks.
rm -f /fastboot /forcefsck

boot_mesg "Recording existing mounts in /etc/mtab..."
> /etc/mtab
mount -f / || failed=1
mount -f /proc || failed=1
mount -f /sys || failed=1
(exit ${failed})
evaluate_retval

# This will mount all filesystems that do not have _netdev in
# their option list. _netdev denotes a network filesystem.
boot_mesg "Mounting remaining file systems..."
mount -a -O no_netdev >/dev/null
evaluate_retval
;;

stop)
boot_mesg "Unmounting all other currently mounted file systems..."
umount -a -d -r >/dev/null
evaluate_retval
;;

*)
echo "Usage: ${0} {start|stop}"
exit 1
;;
esac

# End $rc_base/init.d/mountfs

Oliv' 02-01-2011 04:44 AM

But what I really need to understand the problem is the .rej file when you try to apply the patch. With that I hope I will be able to tell you wether that's a critical error or not.

Kind regards,

Oliv'

grumpy.biatch 02-01-2011 06:14 AM

Quote:

Originally Posted by Oliv' (Post 4244440)
But what I really need to understand the problem is the .rej file when you try to apply the patch. With that I hope I will be able to tell you wether that's a critical error or not.

Kind regards,

Oliv'

Duh, there is no /etc/rc.d/init.d/mountfs.rej

Not sure what happened to it, I followed everything off book as yet but I guess it didnt make any. I guess I need to try patching it again in order to generate .rej file, will report back later.

grumpy.biatch 02-01-2011 08:19 AM

Quote:

Originally Posted by grumpy.biatch (Post 4244493)
Duh, there is no /etc/rc.d/init.d/mountfs.rej

Not sure what happened to it, I followed everything off book as yet but I guess it didnt make any. I guess I need to try patching it again in order to generate .rej file, will report back later.


Here is the file

Quote:

--- mountfs.old 2009-09-28 07:11:13.855801600 +0000
+++ etc/rc.d/init.d/mountfs 2009-09-28 07:58:08.446464339 +0000
@@ -24,12 +24,18 @@
# Remove fsck-related file system watermarks.
rm -f /fastboot /forcefsck

+ boot_mesg "Creating, Formating Ramdisk tmp..."
+ mkfs.ext2 -q -m 0 /dev/ram0
+ evaluate_retval
+
boot_mesg "Recording existing mounts in /etc/mtab..."
> /etc/mtab
mount -f / || failed=1
mount -f /proc || failed=1
mount -f /sys || failed=1
(exit ${failed})
+ boot_mesg -n "Correct /tmp /var/tmp permtions"
+ chmod 1777 /tmp /var/tmp
evaluate_retval

# This will mount all filesystems that do not have _netdev in
The file is located in /etc/rc.d/init.d/etc/rc.d/init.d and it got me confused. The working directory is /etc/rc.d/init.d

grumpy.biatch 02-02-2011 12:05 AM

I wonder why the patch is creating ext2 fs. I have clfs on ext3, should i change ext2 to ext3 and give it a try.

Oliv' 02-02-2011 03:38 AM

Hello,

Sorry for the delay, but I have also have a work ;)
So about ext2 or ext3, that's not a problem. Indeed your rootfs is in ext3 format, but ramdisk is just a temporary RAM storage, so a kind of temporary partition. So ext2 for your ramdisk and ext3 for your rootfs is fine.
About the patch itself, I think that either the format is not OK or the command line is not OK. Here is below what I would modify:
Code:

--- etc/rc.d/init.d/mountfs.old        2009-09-28 07:11:13.855801600 +0000
+++ etc/rc.d/init.d/mountfs        2009-09-28 07:58:08.446464339 +0000
@@ -24,12 +24,18 @@
# Remove fsck-related file system watermarks.
rm -f /fastboot /forcefsck

+        boot_mesg "Creating, Formating Ramdisk tmp..."
+        mkfs.ext2 -q -m 0 /dev/ram0
+        evaluate_retval
+
boot_mesg "Recording existing mounts in /etc/mtab..."
> /etc/mtab
mount -f / || failed=1
mount -f /proc || failed=1
mount -f /sys || failed=1
(exit ${failed})
+ boot_mesg -n "Correct /tmp /var/tmp permtions"
+        chmod 1777 /tmp /var/tmp
evaluate_retval

# This will mount all filesystems that do not have _netdev in

About the command:
Code:

cd /etc/
patch -Np1 -i ~/mountfs-0.1-RAMDISKTMP-2.patch

And I think/hope it should apply correctly... If you are not in /etc directory you have to modify patch command to specify another strip level.

Kind regards,

Oliv'

grumpy.biatch 02-02-2011 07:39 AM

Oliv', thanks a bunch. I will try this in morning and report back. have a great evening.


All times are GMT -5. The time now is 02:00 PM.