More info about how images are created
This commit is contained in:
@ -1,14 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
let fs = require("fs")
|
||||
let bootargs = "mem=${memsize} initrd=${filesysaddr},${filesyssize} root=/dev/ram0 rw rootfstype=cramfs console=${console} ip=${ipaddr} lpj=747520 quiet"
|
||||
let bootnews = "mem=64M initrd=0xC1180000,10M root=/dev/ram0 rw rootfstype=cramfs console=${console} lpj=747520 quiet musb_hdrc.debug=2"
|
||||
let piggy = true
|
||||
|
||||
function build() {
|
||||
if (bootnews.length > bootargs.length) {
|
||||
console.log("args too long")
|
||||
return
|
||||
}
|
||||
|
||||
while (bootnews.length < bootargs.length)
|
||||
bootnews += " "
|
||||
|
||||
let cr = fs.readFileSync("cram.bin")
|
||||
if (cr.length > 10878976) {
|
||||
console.log("too big")
|
||||
return
|
||||
}
|
||||
let img = fs.readFileSync("boot.bin")
|
||||
let img = fs.readFileSync("EV3 Firmware V1.09D.bin")
|
||||
|
||||
for (let i = 0; i < bootnews.length; ++i) {
|
||||
if (img[0x21DDA + i] != bootargs.charCodeAt(i)) {
|
||||
console.log("boot args mismatch")
|
||||
return
|
||||
}
|
||||
img[0x21DDA + i] = bootnews.charCodeAt(i)
|
||||
}
|
||||
|
||||
let off = 0x250000
|
||||
if (img[off] != 0x45 || img[off + 1] != 0x3d) {
|
||||
console.log("bad magic: " + img[off] + " / " + img[off+1])
|
||||
@ -17,8 +37,8 @@ function build() {
|
||||
|
||||
cr.copy(img, off)
|
||||
|
||||
let kern = fs.readFileSync("piggy-patched.gzip")
|
||||
off = 0x0005540f
|
||||
let kern = fs.readFileSync(piggy ? "piggy-patched.gzip" : "linux/arch/arm/boot/uImage")
|
||||
off = piggy ? 0x0005540f : 0x00050000
|
||||
|
||||
if (img[off] != kern[0] || img[off+1] != kern[1]) {
|
||||
console.log("bad kernel magic: " + img[off] + " / " + img[off+1])
|
||||
|
Reference in New Issue
Block a user