[Help] "removableonly" option

Post there if you plan to contribute to this SystemCd
Dukers
Posts: 36
Joined: 16 Jun 2008, 16:55

[Help] "removableonly" option

Postby Dukers » 24 Jul 2013, 19:21

Hi, i'm trying to implement a "removableonly" boot option that tells init script to only search for the .dat file on removable devices.

So far I'm here:

Code: Select all

--- init.orig   2013-07-23 17:52:24.000000000 -0300
+++ init   2013-07-23 21:48:07.540944160 -0300
@@ -890,10 +890,18 @@
     # search for sysrcd.dat on block devices
     good_msg "Searching for ${SUBDIR}/${LOOPDAT} on devices..."
     filefound=''
+
+    if [ -n "${RMDEVONLY}" ]
+    then
+        LOOPDAT_DEVTYPE='rmdev'
+    else
+        LOOPDAT_DEVTYPE='auto'
+    fi
+
     for attempts in 1 2 3 4 5
     do
         [ ${attempts} -gt 1 ] && sleep 3 && bad_msg "Cannot find device with ${SUBDIR}/${LOOPDAT}. Retrying..."
-        if sysresccd_find_file 'auto' ${SUBDIR}/${LOOPDAT} ${BOOTPATH} 'ro'
+        if sysresccd_find_file ${LOOPDAT_DEVTYPE} ${SUBDIR}/${LOOPDAT} ${BOOTPATH} 'ro'
         then
             if [ "${DOCHECK}" = '1' ] # dont run checksum by default on slow medias (cdrom, usb, ...)
             then
@@ -1550,6 +1558,9 @@
         nosrm)
             LOADSRM=''
             ;;
+        removableonly)
+            RMDEVONLY='1'
+            ;;
         subdir\=*)
             SUBDIR=`parse_opt "${x}"`
             ;;
@@ -1722,6 +1733,7 @@
 BACKSTORE_DAT='sysrcd.bs'
 LOOPDAT='sysrcd.dat'
 LOOPMD5='sysrcd.md5'
+RMDEVONLY=''
 INITPROG='/sbin/init'
 CONSOLE='/dev/console'
 CACHEDIR='/cache'


But for some reason, when I rebuild the initramfs, I get a kernel panic. Any help will be appreciated.
Last edited by Dukers on 24 Jul 2013, 19:55, edited 1 time in total.

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: [Help] "removableonly" option

Postby gernot » 24 Jul 2013, 19:48

How make you the initrd?
Make sure that you use no FAT filesystem as working storage.
Check that the new sysrcd.md5 match the sum from sysrcd.dat on your bootdevice.
Check that sysliux load kernel and initrd.

used you:
cd /usr/src/initramfs
find . | cpio -H newc -o | xz --check=crc32 --x86 --lzma2 > /usr/src/initram.igz
md5sum /usr/src/initram.igz > /usr/src/initram.md5

Gernot

Dukers
Posts: 36
Joined: 16 Jun 2008, 16:55

Re: [Help] "removableonly" option

Postby Dukers » 24 Jul 2013, 20:06

I was using "xz --check=crc32" (without --x86 --lzma2). That wouldn't make difference I think, as LZMA2 is the default and "--x86" is just an optimization.

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: [Help] "removableonly" option

Postby gernot » 24 Jul 2013, 20:11

What is the kernel message?
If he don't find init then unpack your file and list the filenames with cpio -t.
"init" must be in the root directory of the archive.

Gernot

Dukers
Posts: 36
Joined: 16 Jun 2008, 16:55

Re: [Help] "removableonly" option

Postby Dukers » 24 Jul 2013, 20:37

It actually boots, but stays some time at "Freeing unused kernel memory: ...". Maybe it's hiding that message that show the sysrcd.dat copy progress (I use docache).

What's odd is that if I use "minishell" then yes, I get a kernel panic with no useful messages, just blinking keyboard leds. I suck at shell script anyway. Will try to figure out what's going on.

Dukers
Posts: 36
Joined: 16 Jun 2008, 16:55

Re: [Help] "removableonly" option

Postby Dukers » 24 Jul 2013, 21:01

My bad! I was extracting and creating it with a normar user account. With root it's all working!

Now I'll test the patch a little more. Sorry for the noise.


Return to “Contributions”

Who is online

Users browsing this forum: No registered users and 2 guests