sending works

Szymon Karpiński 7 years ago
parent 248c1f033b
commit f2df1ca2b8
  1. 3
      linux/Makefile
  2. 9
      linux/src/scripts/menu.sh
  3. 4
      linux/src/scripts/pause.sh
  4. 3
      linux/src/scripts/reboot.sh
  5. 8
      linux/src/scripts/recv_dd.sh
  6. 8
      linux/src/scripts/recv_pc.sh
  7. 8
      linux/src/scripts/recv_sfd.sh
  8. 2
      linux/src/scripts/send_pc.sh
  9. 4
      send.sh

@ -18,7 +18,8 @@ menu:
images: images:
$(CHROOT_CMD) "apt install -y udpcast" $(CHROOT_CMD) "apt install -y udpcast"
$(CHROOT_CMD) "apt install -y partclone" $(CHROOT_CMD) "apt install -y partclone"
$(CHROOT_CMD) "apt install -y lzop" $(CHROOT_CMD) "apt install -y lzop strace"
$(CHROOT_CMD) "touch /etc/mtab"
build/rootfs/initrd.img: $(FILES) build/rootfs/initrd.img: $(FILES)
chmod +x build/rootfs/etc/initramfs-tools/scripts/local-top/download.sh chmod +x build/rootfs/etc/initramfs-tools/scripts/local-top/download.sh

@ -3,10 +3,15 @@
sleep 1 sleep 1
dialog --menu " " 20 80 10 \ dialog --menu " " 20 80 10 \
send_pc "Send /dev/sda1 image (partclone)" \ recv_pc "Receive image for /dev/sda1 (partclone+lzop)" \
recv_sfd "Receive partition table for /dev/sdaa (sfdisk)" \
recv_dd "Receive MBR for /dev/sda (dd)" \
send_pc "Send /dev/sda1 image (partclone+lzop)" \
send_sfd "Send /dev/sda partition table (sfdisk)" \ send_sfd "Send /dev/sda partition table (sfdisk)" \
send_dd "Send /dev/sda MBR (dd)" \ send_dd "Send /dev/sda MBR (dd)" \
shell "Run root shell" 2>/tmp/menu shell "Run root shell" \
reboot "Reboot system" \
2>/tmp/menu
if [ "$?" != "0" ]; then CHOICE="shell"; else CHOICE=$(cat /tmp/menu); fi if [ "$?" != "0" ]; then CHOICE="shell"; else CHOICE=$(cat /tmp/menu); fi

@ -0,0 +1,4 @@
#!/bin/bash
read -p "Press [Enter] to continue..."
clear

@ -0,0 +1,3 @@
#!/bin/bash
reboot

@ -0,0 +1,8 @@
#!/bin/bash
DISK=/dev/sda
INTERFACE=eth0
udp-receiver --interface $INTERFACE | dd of=$DISK bs=512 count=1
. $(dirname $0)/pause.sh

@ -0,0 +1,8 @@
#!/bin/bash
DISK=/dev/sda1
INTERFACE=eth0
udp-receiver --interface $INTERFACE | lzop -d | partclone.extfs -r -s - -o $DISK --logfile /tmp/partclone.log
. $(dirname $0)/pause.sh

@ -0,0 +1,8 @@
#!/bin/bash
DISK=/dev/sda
INTERFACE=eth0
udp-receiver --interface $INTERFACE | sfdisk $DISK
. $(dirname $0)/pause.sh

@ -3,4 +3,4 @@
DISK=/dev/sda1 DISK=/dev/sda1
INTERFACE=eth0 INTERFACE=eth0
partclone.extfs -s /dev/sda1 -c --logfile /tmp/partclone.log 2>/dev/null| lzop | udp-sender --interface $INTERFACE partclone.extfs -s /dev/sda1 -c --logfile /tmp/partclone.log 2>/dev/null | lzop | udp-sender --interface $INTERFACE

@ -0,0 +1,4 @@
#!/bin/bash
INTERFACE=$1
udp-sender --interface $INTERFACE
Loading…
Cancel
Save