vote up 0 vote down star
1

I know it's for the linux program patch, but if I try to use it, I get the following error:

missing header for unified diff at line 4 of patch

malformed patch at line 5: quit

Instead, I'd like to just cut out the middleman and edit it by hand, but I don't know what any of the symbols mean.

a/com.ibm.celldt.simulator.profile.default_3.1.0.200809010950/simulator_init.tcl

+ b/com.ibm.celldt.simulator.profile.default_3.1.0.200809010950/simulator_init.tcl
@@ -701,9 +701,9 @@ proc CellDT_ShutdownComplete { args } {
quit
}

-mysim trigger set console "The system is going down for system halt NOW!" CellDT_ShutdownNotified
-mysim trigger set console "INIT: Switching to runlevel: 0" CellDT_ShutdownStarted
-mysim trigger set console "INIT: no more processes left in this runlevel" CellDT_ShutdownComplete
+mysim trigger set console "init: rcS main" CellDT_ShutdownNotified
+mysim trigger set console "Sending all processes the TERM signal" CellDT_ShutdownStarted
+mysim trigger set console "md: stopping all md devices." CellDT_ShutdownComplete

proc writeConsole { t } {
mysim console create console_id in string $t
@@ -740,8 +740,8 @@ proc CellDT_BootNearlyReady { args } {
}

mysim trigger set console "Starting Linux" CellDT_BootedBios
-mysim trigger set console "Welcome to Fedora Core" CellDT_BootedLinux
-mysim trigger set console "INIT: Entering runlevel: 2" CellDT_BootNearlyReady
+mysim trigger set console "Welcome to Fedora" CellDT_BootedLinux
+mysim trigger set console "Starting login process" CellDT_BootNearlyReady

# # CONFIGURATION:
flag

3 Answers

vote up 3 vote down

Your output indicates the patch program is not properly interpreting the line starting with 'quit'. Each line added needs to start with '+'

Where did you get this file? These tools will assume and operate on "unix-style" newlines. That means all files that you're diffing and patching must have LF newlines only, and not the Windows/DOS standard CRLF newlines. Try:

dos2unix -d filename
link|flag
vote up 2 vote down

Unified diff format: basically '-' means removed line, '+' means added line. So you can manually apply the patch if you want. But the best thing would be to resolve the underlying problem. Is the file segment you provide the complete file? If it is - it indicates that the diff header information is corrupt/missing, and you need to go back to the source/tools/process that created this patch.

link|flag
vote up 0 vote down

A fairly common problem is applying a patch for version x.yy.zzz to version x.yy.zza. That is, patch files are highly specific to particular versions of the source. I would strongly suggest that you post the actual program you're patching and the exact source of the patch.

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.