[SOLVED] Check Point L-50 kwboot problem

Ok so I finally managed to install OpenWRT on the Check Point 600 L-50 without kwboot.

If anyone is interested, here are the steps that made this possible:

1. Connect to the Appliance via serial console with BAUD 115200.

I have used picocom for this, but any other serial terminal will work as well:

picocom -b 115200 /dev/ttyS0

Restart the appliance, wait until you see ************ Hit 'Ctrl + C' for boot menu ************ in the serial output.
Press Ctrl+C in order to get to the Check Point boot menu.

2. Prepre TFTP server

In the meantime, prepare a TFTP server on your PC. I used dnsmasq for this:

mkdir /tmp/cp
cd /tmp/cp
wget http://downloads.openwrt.org/snapshots/targets/kirkwood/generic/u-boot-l-50/u-boot.kwb
cp u-boot.kwb u-boot.bin
sudo ip addr add 192.168.1.234/24 dev enp39s0
sudo dnsmasq -d --port=0 --enable-tftp --tftp-root=/tmp/cp/

Make sure to download the latest u-boot image. Also set a static IP to the network interface of your PC, make sure that the Check Point appliance is connected to this ethernet interface.

3. Backup old u-boot environment

In the serial terminal, you should see the boot menu. Something like:

Welcome to Gaia Embedded Boot Menu:

        1. Start in normal Mode
        2. Start in debug Mode
        3. Start in maintenance Mode
        4. Restore to Factory Defaults (local)
        5. Install/Update Image/Boot-Loader from Network
        6. Install/Update Image from USB
        7. Install/Update Boot-Loader from USB
        8. Restart Boot-Loader
        9. Install DSL Firmware / Upload preset configuration file

        Please enter your selection : 

Choose Option 3 to start into maintenance mode. Once you are in maintenance mode, execute fw_printenv:

[Expert@MAINTENANCE_MODE]# fw_printenv 
baudrate=115200
loads_echo=0
ipaddr=192.168.1.1
serverip=192.168.1.10
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
run_diag=yes
...

Copy the WHOLE output to a textfile on your PC and make sure to save it!

Once you have done that, reboot the appliance and enter the bootmenu (Ctrl+C) again.

4. Flash the new u-boot version

In the boot menu, choose option 5 to install Image/Boot-Loader from Network. Then use option 2 to start a manual tftp installation.

Keep the default local IP of 192.168.1.1. The server IP should be 192.168.1.123. And the file name must be u-boot.bin.

The result should look like this:

Are you sure? (y/n) 

Enabling network ports...
Done.
Using egiga1 device
TFTP from server 192.168.1.123; our IP address is 192.168.1.1
Filename 'u-boot.bin'.
Load address: 0x2000000
Loading: T #################################################################
         ############################################################
done
Bytes transferred = 637808 (9bb70 hex)



WARNING:                BURNING OF NEW UBOOT STARTED


                        PLEASE DO NOT PULL OUT THE POWER CORD 



Resetting uboot environment variables

Erase Env parameters offset 0xa0000... done
Warning: Default Environment Variables will take effect Only after RESET 

Erase 0 - 655360 ... 
Copy to Nand Flash... 
done
Disabling network ports...
Done.
Burning new uboot succeeded
Done.

Install/Update Boot-Loader from Network succeeded.
Press any key to continue...

The appliance will now reboot into the new u-boot console:

ERROR: can't get kernel image!
=>

5. restore u-boot environment

Next we need to restore the MAC addresses.
Call the following commands, replace the mac addresses with the one from your backup.

setenv eth1addr 00:1C:XX:XX:XX:6C
setenv ethaddr 00:1C:XX:XX:XX:6B
setenv lan1_mac_addr 00:1C:XX:XX:XX:6C
setenv lan2_mac_addr 00:1C:XX:XX:XX:6D
setenv lan3_mac_addr 00:1C:XX:XX:XX:6E
setenv lan4_mac_addr 00:1C:XX:XX:XX:6F
setenv lan5_mac_addr 00:1C:XX:XX:XX:70
setenv lan6_mac_addr 00:1C:XX:XX:XX:71
setenv lan7_mac_addr 00:1C:XX:XX:XX:72
setenv lan8_mac_addr 00:1C:XX:XX:XX:73
setenv dmz_mac_addr 00:1C:XX:XX:XX:74
setenv dsl_mac_addr 00:1C:XX:XX:XX:75
saveenv

Restart the appliance and execute printenv to check that everything was saved correctly.

6. Install OpenWRT from a USB pendrive

Copy the initramfs-uImage to a FAT32 USB stick.

wget http://downloads.openwrt.org/snapshots/targets/kirkwood/generic/openwrt-kirkwood-checkpoint_l-50-initramfs-uImage
cp openwrt-kirkwood-checkpoint_l-50-initramfs-uImage /mnt/usbstick/

Plug that USB stick into the Check Point appliance.

In the u-boot console, execute the following commands to start the initramfs:

usb start
fatload usb 0 0x0800000 openwrt-kirkwood-checkpoint_l-50-initramfs-uImage
bootm 0x800000

Wait until OpenWRT has started up.
Now you can connect via SSH to OpenWRT (ssh root@192.168.1.1).

Next copy the squashfs-sysupgrade file to OpenWRT.

wget http://downloads.openwrt.org/snapshots/targets/kirkwood/generic/openwrt-kirkwood-checkpoint_l-50-squashfs-sysupgrade.bin
scp openwrt-kirkwood-checkpoint_l-50-squashfs-sysupgrade.bin root@192.168.1.1:/tmp

On the Check Point appliance, execute the following command to flash the image and make everything persistent:

sysupgrade /tmp/openwrt-kirkwood-checkpoint_l-50-squashfs-sysupgrade.bin

Wait for the process to finish.
Restart the appliance in order to check that everything worked.

Now you should have a working OpenWRT on the Check Point L-50 appliance.