Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 301 additions and 314 deletions
......@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=turris-nor-update
PKG_VERSION:=1.0
PKG_VERSION:=1.1.0
PKG_RELEASE:=1
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
......@@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/turris-nor-update
TITLE:=NOR update for Turris routers
DEPENDS:=+mtd +turris-nor-update-firmware
DEPENDS:=+mtd +turris-nor-update-firmware +uboot-envtools
endef
define Package/turris-nor-update/description
......
......@@ -3,6 +3,7 @@ set -eu
DEVEL=""
VERBOSE=""
BACKUP_UBOOT_ENV="/usr/share/nor-update/uboot-env.backup"
SECURE_FIRMWARE="secure-firmware.bin"
SECURE_FIRMWARE_PART=""
......@@ -29,6 +30,10 @@ board_post_hook() {
:
}
board_ubootenv_hook() {
:
}
# Note: die and v_echo might be used by board configuration so they are defined early
die() {
......@@ -62,16 +67,18 @@ print_help() {
flash() {
local flashing="$1"
local part="$2"
local preupdate_hook="$3"
local postupdate_hook="$4"
[ -n "$part" ] || return 0
shift 2
while [ -n "${1:+x}" ] && [ ! -r "$1" ]; do
while [ "$#" -gt 0 ] && [ ! -r "$1" ]; do
shift
done
if [ -z "${1:+x}" ]; then
if [ "$#" -eq 0 ]; then
echo "Can't find anything to flash to '$flashing' partition"
return 0
fi
......@@ -81,18 +88,50 @@ flash() {
fi
v_echo "Checking and flashing '$flashing' partition: $1 -> /dev/$part"
return 0 # TODO remove
if mtd verify "$1" "/dev/$part"; then
v_echo "Partition with $flashing was up to date already."
else
"$preupdate_hook"
mtd -e "/dev/$part" write "$1" "/dev/$part" || \
die "Flashing '$flashing' partition (/dev/$part) failed!"
"$postupdate_hook"
fi
}
boot_scr_cleanup() {
umount -fl "$tmpdir"
rmdir "$tmpdir"
uboot_preupdate() {
BACKUP_UBOOT_ENV="/usr/share/nor-update/uboot-env.backup"
v_echo "Storing old U-boot environment to be preserved"
fw_printenv >"$BACKUP_UBOOT_ENV" || {
# Let's assume that there is a default environment if we can't read it.
rm -f "$BACKUP_UBOOT_ENV"
return 0
}
board_ubootenv_hook # to perform any possible migrations
}
uboot_postupdate() {
[ -f "$BACKUP_UBOOT_ENV" ] || return 0
if ! fw_printenv >/dev/null 2>&1; then
echo "Updating configuration for U-Boot environment access."
rm -f /etc/config/ubootenv
fw_env-config-init.sh
fi
if [ "$(fw_printenv 2>/dev/null)" = "$(cat "$BACKUP_UBOOT_ENV")" ]; then
# The environment is the same so no migration is needed
rm "$BACKUP_UBOOT_ENV"
return 0
fi
if fw_setenv -s "$BACKUP_UBOOT_ENV"; then
echo "Your U-Boot environment was migrated to new U-Boot"
echo "You can find it in $BACKUP_UBOOT_ENV"
echo "You can reset it via 'fw_setenv bootcmd \"env default -f -a; saveenv; reset\"'"
else
echo "Migration of your U-Boot environment failed."
echo "You can find it in $BACKUP_UBOOT_ENV"
echo "Set whatever you need manually via 'fw_setenv'"
fi
}
# We need boot.scr in root of Btrfs partition to be symlink to @ subvolume to
......@@ -100,10 +139,10 @@ boot_scr_cleanup() {
fix_boot_scr() (
local dev="$(sed -n 's|^\(/dev/[a-z0-9]*\) / btrfs .*|\1|p' /proc/mounts)"
# Fix is required only for BTRFS. No need to continue if root filesystem is not BTRFS.
[ -n "$dev" ] || return
[ -n "$dev" ] || return 0
tmpdir="$(mktemp -d)"
[ -n "$tmpdir" ] || die "Can't create a temp directory!"
trap boot_scr_cleanup EXIT
trap 'umount -fl "$tmpdir" && rmdir "$tmpdir"' EXIT
mount "$dev" "$tmpdir" || die "Can't mount root filesystem"
[ -e "$tmpdir"/boot.scr ] || \
ln -sf @/boot/boot.scr "$tmpdir"/boot.scr || \
......@@ -140,7 +179,7 @@ fix_boot_scr
# To simplify the configuration so we can use relative paths for parts of the firmware
cd "/usr/share/nor-update/"
if [ -n "$DEVEL" ]; then
if [ -z "$DEVEL" ]; then
SECURE_FIRMWARE_DEVEL=""
UBOOT_DEVEL=""
RESCUE_DEVEL=""
......@@ -148,8 +187,8 @@ if [ -n "$DEVEL" ]; then
fi
board_pre_hook
flash "secure firmware" "$SECURE_FIRMWARE_PART" "$SECURE_FIRMWARE_DEVEL" "$SECURE_FIRMWARE"
flash "U-Boot" "$UBOOT_PART" "$UBOOT_DEVEL" "$UBOOT"
flash "rescue system" "$RESCUE_PART" "$RESCUE_DEVEL" "$RESCUE"
flash "dtb" "$DTB_PART" "$DTB_DEVEL" "$DTB"
flash "secure firmware" "$SECURE_FIRMWARE_PART" true true "$SECURE_FIRMWARE_DEVEL" "$SECURE_FIRMWARE"
flash "U-Boot" "$UBOOT_PART" uboot_preupdate uboot_postupdate "$UBOOT_DEVEL" "$UBOOT"
flash "rescue system" "$RESCUE_PART" true true "$RESCUE_DEVEL" "$RESCUE"
flash "dtb" "$DTB_PART" true true "$DTB_DEVEL" "$DTB"
board_post_hook
......@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=turris1x-btrfs
PKG_VERSION:=2.1
PKG_VERSION:=3.1.0
PKG_RELEASE:=1
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
......@@ -33,7 +33,7 @@ endef
define Package/turris1x-btrfs-migrate
$(call Package/Common)
TITLE:=Btrfs migration tool for Turris 1.x routers
DEPENDS+=+turris1x-btrfs +btrfs-progs +uboot-envtools +fdisk +dosfstools
DEPENDS+=+turris1x-btrfs +btrfs-progs +uboot-envtools +fdisk +dosfstools +kmod-usb-storage +wget
PROVIDES:=turris-btrfs-migrate
endef
......
......@@ -16,47 +16,52 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -e
SDCARD="/dev/mmcblk0"
SDCARD="$(blkid | sed -n 's|\(/dev/sd[a-z]\).*LABEL="turris-destroy".*|\1|p')"
if [ -n "$SDCARD" ]; then
SDCARDP="$SDCARD"
else
SDCARD="/dev/mmcblk0"
SDCARDP="/dev/mmcblk0p"
fi
die() {
echo "$1" >&2
exit 1
echo "$1" >&2
exit 1
}
# Verify that it makes sense to migrate to SD card
verify() {
[ -b "$SDCARD" ] || die "No MicroSD card present!"
grep -q " / ubi " < /proc/mounts || die "1.1 firmware required!"
[ -b "$SDCARD" ] || die "No MicroSD card present!"
grep -q " / ubifs " < /proc/mounts || die "1.1 firmware required!"
}
are_you_sure() {
local answer
local question="Are you sure you want to lose everything on $SDCARD? (yes/No): "
read -r -p "$question" answer
case "$(echo "$answer" | awk '{ print tolower($0) }')" in
y|yes)
return 0
;;
""|n|no)
echo "No change was performed. Exiting." >&2
exit 0
;;
*)
die "Unknown answer: $answer"
;;
esac
local answer
local question="Are you sure you want to lose everything on $SDCARD? (yes/No): "
read -r -p "$question" answer
case "$(echo "$answer" | awk '{ print tolower($0) }')" in
y|yes)
return 0
;;
""|n|no)
echo "No change was performed. Exiting." >&2
exit 0
;;
*)
die "Unknown answer: $answer"
;;
esac
}
# Set chnapps to manage specified device
configure_schnapps() {
mkdir -p /etc/schnapps
echo "ROOT_DEV='${SDCARD}p2'" > /etc/schnapps/config
mkdir -p /etc/schnapps
echo "ROOT_DEV='${SDCARDP}2'" > /etc/schnapps/config
}
# This sets u-boot environment to boot from SD card
setup_uboot() {
fw_setenv -s - <<EOF
fw_setenv -s - <<EOF
baudrate 115200
bootargsnor root=/dev/mtdblock2 rw rootfstype=jffs2 console=ttyS0,115200
bootargsubi root=ubi0:rootfs rootfstype=ubifs ubi.mtd=9,2048 rootflags=chk_data_crc rw console=ttyS0,115200
......@@ -76,33 +81,30 @@ mtdparts mtdparts=ef000000.nor:128k(dtb-image),1664k(kernel),1536k(root),11264k(
nandbootaddr 2100000
nandfdtaddr 2000000
netdev eth0
nfsboot setenv bootargs root=/dev/nfs rw nfsroot=\$serverip:\$rootpath ip=\$ipaddr:\$serverip:\$gatewayip:\$netmask:\$hostname:\$netdev:off console=\$consoledev,\$baudrate \$othbootargs;tftp \$loadaddr \$bootfile;tftp \$fdtaddr \$fdtfile;bootm \$loadaddr - \$fdtaddr
norbootaddr ef080000
norfdtaddr ef040000
ramboot setenv bootargs root=/dev/ram rw console=\$consoledev,\$baudrate \$othbootargs ramdisk_size=\$ramdisk_size;tftp \$ramdiskaddr \$ramdiskfile;tftp \$loadaddr \$bootfile;tftp \$fdtaddr \$fdtfile;bootm \$loadaddr \$ramdiskaddr \$fdtaddr
ramdisk_size 120000
ramdiskaddr 2000000
ramdiskfile rootfs.ext2.gz.uboot
reflash_timeout 40
rootpath /opt/nfsroot
stderr serial
stdin serial
stdout serial
tftpflash tftpboot \$loadaddr \$uboot; protect off 0xeff40000 +\$filesize; erase 0xeff40000 +\$filesize; cp.b \$loadaddr 0xeff40000 \$filesize; protect on 0xeff40000 +\$filesize; cmp.b \$loadaddr 0xeff40000 \$filesize
hwconfig usb1:dr_mode=host,phy_type=ulpi
ubiboot max6370_wdt_off; setenv bootargs \$bootargsubi; ubi part rootfs; ubifsmount ubi0:rootfs; ubifsload \$nandfdtaddr /boot/fdt; ubifsload \$nandbootaddr /boot/zImage; bootm \$nandbootaddr - \$nandfdtaddr
uboot u-boot.bin
backbootcmd setexpr.b reflash *0xFFA0001F;if test \$reflash -ge \$reflash_timeout; then echo BOOT NOR; run norboot; else echo BOOT NAND; run ubiboot; fi
bootcmd setexpr.b reflash *0xFFA0001F;if test \$reflash -ge \$reflash_timeout; then echo BOOT NOR; run norboot; else echo BOOT NAND; mmc rescan; if fatload mmc 0:1 \$nandbootaddr zImage; then run mmcboot; else run ubiboot; fi; fi
norboot max6370_wdt_off; env default -a; saveenv; setenv bootargs \$bootargsnor; bootm 0xef020000 - 0xef000000
bootargsmmc root=/dev/mmcblk0p2 rootwait rw rootfstype=btrfs rootflags=subvol=@,commit=5 console=ttyS0,115200
mmcboot max6370_wdt_off; fatload mmc 0:1 \$nandfdtaddr fdt; setenv bootargs \$bootargsmmc; bootm \$nandbootaddr - \$nandfdtaddr
bootcmd setexpr.b reflash *0xFFA0001F; if test \$reflash -ge \$reflash_timeout; then echo BOOT NOR; run norboot; else echo NORMAL BOOT; run turris_boot; fi
norboot max6370_wdt_off; setenv bootargs \$bootargsnor; bootm 0xef020000 - 0xef000000
root_uuid=$ROOT_UUID
bootargsbtrfs root=PARTUUID=\$root_uuid rootwait rw rootfstype=btrfs rootflags=subvol=@,commit=5 console=ttyS0,115200
mmcboot fatload mmc 0:1 \$nandfdtaddr fdt; setenv bootargs \$bootargsbtrfs; bootm \$nandbootaddr - \$nandfdtaddr
usbboot fatload usb \$devnum:1 \$nandfdtaddr fdt; setenv bootargs \$bootargsbtrfs; bootm \$nandbootaddr - \$nandfdtaddr
mmctry mmc rescan; if fatload mmc 0:1 \$nandbootaddr zImage; then run mmcboot; fi
usbtry usb start; for devnum in 0 1 2 3 4 5 6 7 8; do if fatload usb \$devnum:1 \$nandbootaddr zImage; then run usbboot; fi; done
turris_boot max6370_wdt_off; run mmctry; run usbtry; run ubiboot;
EOF
}
# Setup partitions on SD card
format_sdcard() {
dd if=/dev/zero of="$SDCARD" bs=10M count=11
fdisk "$SDCARD" <<EOF
dd if=/dev/zero of="$SDCARD" bs=10M count=11
fdisk "$SDCARD" <<EOF
o
n
p
......@@ -116,76 +118,81 @@ p
w
EOF
mkfs.vfat "${SDCARD}p1" || die "Can't create fat!"
mkfs.btrfs -f "${SDCARD}p2" || die "Can't format btrfs partition!"
mkfs.fat -n turris-boot "${SDCARDP}1" || die "Can't create fat!"
mkfs.btrfs -L turris-rootfs -f "${SDCARDP}2" || die "Can't format btrfs partition!"
ROOT_UUID="$(blkid "${SDCARDP}2" | sed -n 's|^/dev/.*UUID="\([0-9a-fA-F-]*\)".*|\1|p')"
}
clean() (
# Note: we use here rmdir to not recursivelly remove mounted FS if umount fails.
set +e # just to continue if unmount fails with another umount
local tmp="$1"
umount -R "$tmp/target"
rmdir "$tmp/target"
umount "$tmp/src"
rmdir "$tmp/src"
rmdir "$tmp"
# Note: we use here rmdir to not recursivelly remove mounted FS if umount fails.
set +e # just to continue if unmount fails with another umount
umount "$TMPDIR/target/@/boot/tefi"
umount "$TMPDIR/target"
rmdir "$TMPDIR/target"
umount "$TMPDIR/src"
rmdir "$TMPDIR/src"
rmdir "$TMPDIR"
)
# Copy current root to SD card
migrate_to_sdcard() {
local tmp="$(mktemp -d)"
trap 'clean "$tmp"' EXIT
mkdir -p "$tmp/target"
mkdir -p "$tmp/src"
# Mount and migrate root filesystem
mount "${SDCARD}p2" "$tmp/target" || die "Can't mount mmclbk0p2"
btrfs subvolume create "$tmp/target/@" || die "Can't create subvolume!"
mount -o bind / "$tmp/src" || die "Can't bind btrfs mount."
tar -C "$tmp/src" -cf - . | tar -C "$tmp/target/@" -xf - || die "Filesystem copy failed!"
# import factory image
schnapps import -f https://repo.turris.cz/hbs/medkit/turris1x-medkit-latest.tar.gz
# Copy kernel image and DTB to FAT partition
mkdir -p "$tmp/@/boot/tefi"
mount "${SDCARD}p1" "$tmp/target/@/boot/tefi" || die "Can't mount fat"
cp /boot/zImage /boot/fdt "$tmp/target/@/boot/tefi" || die "Can't copy kernel"
trap "" EXIT
clean
TMPDIR="$(mktemp -d)"
trap clean EXIT
mkdir -p "$TMPDIR/target"
mkdir -p "$TMPDIR/src"
# Mount and migrate root filesystem
mount "${SDCARDP}2" "$TMPDIR/target" || die "Can't mount mmclbk0p2"
btrfs subvolume create "$TMPDIR/target/@" || die "Can't create subvolume!"
mount -o bind / "$TMPDIR/src" || die "Can't bind btrfs mount."
tar -C "$TMPDIR/src" -cf - . | tar -C "$TMPDIR/target/@" -xf - || die "Filesystem copy failed!"
# import factory image - best effort, proceed even if it fails
btrfs subvolume create "$TMPDIR/target/@factory" || die "Can't create factory subvolume!"
cd /tmp
wget https://repo.turris.cz/hbs/medkit/turris1x-medkit-latest.tar.gz || die "Can't download medkit"
wget -O - https://repo.turris.cz/hbs/medkit/turris1x-medkit-latest.tar.gz.sha256 | sha256sum -c - || die "Can't verify medkit integrity"
tar -C "$TMPDIR/target/@factory" -xzf /tmp/turris1x-medkit-latest.tar.gz || echo "Creating factory snapshot failed" >&2
# Copy kernel image and DTB to FAT partition
mkdir -p "$TMPDIR/target/@/boot/tefi"
mount "${SDCARDP}1" "$TMPDIR/target/@/boot/tefi" || die "Can't mount fat"
cp /boot/zImage /boot/fdt "$TMPDIR/target/@/boot/tefi" || die "Can't copy kernel"
trap "" EXIT
clean
}
##################################################################################
print_usage() {
echo "Usage: $0 [restore]" >&2
echo "Usage: $0 [restore]" >&2
}
print_help() {
print_usage
{
echo
echo "restore: do not format SD card but only set appropriate u-boot environment"
} >&2
print_usage
{
echo
echo "restore: do not format SD card but only set appropriate u-boot environment"
} >&2
}
RESTORE="no"
for ARG in "$@"; do
case "$ARG" in
-h|-\?|--help)
print_help
exit 0
;;
restore)
RESTORE="yes"
;;
*)
echo "Unknown argument: $ARG" >&2
print_usage
exit 1
;;
esac
case "$ARG" in
-h|-\?|--help)
print_help
exit 0
;;
restore)
RESTORE="yes"
;;
*)
echo "Unknown argument: $ARG" >&2
print_usage
exit 1
;;
esac
done
verify
......@@ -194,8 +201,8 @@ are_you_sure
configure_schnapps
if [ "$RESTORE" = "no" ]; then
format_sdcard
migrate_to_sdcard
format_sdcard
migrate_to_sdcard
fi
setup_uboot
......
......@@ -5,7 +5,11 @@ TARGET_ROOT="${1:-}"
MNT="$(mktemp -d)"
trap 'rmdir "$MNT"' EXIT
mount -t vfat /dev/mmcblk0p1 "$MNT"
# sd[a-z] with label turris-boot is a first choice, mmcblk0 is a backup
BOOTPART="$(blkid | sed -n 's|^\(/dev/[^:]*\):.*LABEL="turris-boot".*|\1|p')"
[ -n "$BOOTPART" ] || BOOTPART="/dev/mmcblk0p1"
mount -t vfat "$BOOTPART" "$MNT"
trap 'umount "$MNT" && rmdir "$MNT"' EXIT
deploy() {
......@@ -15,3 +19,5 @@ deploy() {
deploy zImage
deploy fdt
deploy turris1x.dtb
deploy boot.scr
......@@ -16,7 +16,7 @@ PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
include $(INCLUDE_DIR)/package.mk
define Package/turris-1x-firmware
TITLE:=Firmware for Turris MOX
TITLE:=Firmware for Turris 1.x
DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_turris1x
PROVIDES:=turris-nor-update-firmware
endef
......
......@@ -2,8 +2,8 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=turris1x-support
PKG_VERSION:=1.2
PKG_RELEASE:=2
PKG_VERSION:=1.3
PKG_RELEASE:=1
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
......@@ -34,7 +34,8 @@ endef
define Package/turris1x-support/install
$(INSTALL_DIR) $(1)/boot
$(INSTALL_DATA) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/turris1x.dtb "$(1)"/boot/fdt
$(INSTALL_DATA) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/turris1x.dtb "$(1)"/boot/
ln -sf turris1x.dtb "$(1)"/boot/fdt
mkimage -T script -C none -n boot -d files/boot.txt "$(1)"/boot.scr
endef
......
setenv bootargsubi 'root=ubi0:rootfs rootfstype=ubifs ubi.mtd=9,2048 rootflags=chk_data_crc rw console=ttyS0,115200'
setenv ubiboot 'max6370_wdt_off; setenv bootargs $bootargsubi; ubi part rootfs; ubifsmount ubi0:rootfs; ubifsload $nandfdtaddr /boot/fdt; ubifsload $nandbootaddr /boot/zImage; bootm $nandbootaddr - $nandfdtaddr'
run ubiboot
if test "${bootfstype}" = "btrfs"; then
subvol="/@"
else
subvol=""
fi
loaded=0
for bootdir in ${prefix} ${boot_prefixes}; do
if test "${loaded}" != "1"; then
if test -e ${devtype} ${devnum}:${distro_bootpart} ${subvol}${bootdir}zImage && test -e ${devtype} ${devnum}:${distro_bootpart} ${subvol}${bootdir}${fdtfile}; then
echo "Found Kernel image ${subvol}${bootdir}zImage"
if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${subvol}${bootdir}zImage; then
echo "Found Device Tree file ${subvol}${bootdir}${fdtfile}"
if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${subvol}${bootdir}${fdtfile}; then
loaded=1
fi
fi
fi
fi
done
if test "${loaded}" = "1"; then
# Kernel may be stored on first FAT partition and rootfs on second btrfs partition
if test "${bootfstype}" = "fat"; then
setexpr bootpart2 ${distro_bootpart} + 1
if part size ${devtype} ${devnum} ${bootpart2} fssize; then
if fstype ${devtype} ${devnum}:${bootpart2} fstype; then else
# U-Boot does not have to support btrfs, so check for btrfs superblock
part start ${devtype} ${devnum} ${bootpart2} fsstart
setexpr superblock ${fsstart} + 0x80
${devtype} read ${loadaddr} ${superblock} 1
setexpr loadaddr4 ${loadaddr} + 0x4
setexpr loadaddr40 ${loadaddr} + 0x40
mw ${loadaddr} 0x5f424852 # _BHR
mw ${loadaddr4} 0x66535f4d # fS_M
if cmp ${loadaddr} ${loadaddr40} 2; then
setenv fstype "btrfs"
else
setenv fstype
fi
setenv fsstart
setenv superblock
setenv loadaddr4
setenv loadaddr40
fi
if test ${fstype} = "btrfs"; then
setenv bootfstype "btrfs"
setenv distro_bootpart ${bootpart2}
fi
setenv fstype
fi
setenv bootpart2
setenv fssize
fi
if test "${devtype}" = "ubi"; then
rootflags="chk_data_crc"
elif test "${bootfstype}" = "btrfs"; then
rootflags="subvol=@,commit=5"
elif test "${bootfstype}" = "ext4"; then
rootflags="commit=5"
else
rootflags=""
fi
if test "${devtype}" = "ubi"; then
# old fdt files have rootfs mtd named "rootfs-ubifs" and new just "rootfs"
# read mtd label from loaded fdt file, it may be on two different locations
fdt addr ${fdt_addr_r}
fdt get value rootfsmtd /localbus@ffe05000/nand@1,0/partitions/partition@0 label || fdt get value rootfsmtd /localbus@ffe05000/nand@1,0/partition@00 label || setenv rootfsmtd rootfs
setenv bootfstype "ubifs"
setenv bootargs root=ubi0:${bootubivol} ubi.mtd=${rootfsmtd},2048
setenv rootfsmtd
else
part uuid ${devtype} ${devnum}:${distro_bootpart} partuuid
setenv bootargs root=PARTUUID=${partuuid}
fi
setenv bootargs ${bootargs} rootfstype=${bootfstype} rootflags=${rootflags} rootwait rw cfg80211.freg=${regdomain} console=ttyS0,115200 ${quirks}
# Disable watchdog
mw.b 0xffa00002 0x03
# In reality kernel image is in uImage format and not in zImage format
bootm ${kernel_addr_r} - ${fdt_addr_r}
fi
#
## Copyright (C) 2018-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/)
#
## This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# #
#
include $(TOPDIR)/rules.mk
PKG_NAME:=turris1x-uboot
PKG_VERSION:=2022.04
PKG_RELEASE:=1
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
include $(INCLUDE_DIR)/package.mk
define Package/turris1x-uboot
TITLE:=Turris 1.x U-boot
DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_turris1x
PROVIDES:=u-boot-turris1x
endef
define Package/turris1x-uboot/description
New development u-boot version for Turris 1.x
endef
Build/Compile:=:
define Package/turris1x-uboot/install
$(INSTALL_DIR) $(1)/usr/share/turris1x
$(INSTALL_BIN) ./files/u-boot-nor.bin $(1)/usr/share/turris1x/
endef
$(eval $(call BuildPackage,turris1x-uboot))
File added
File added
include $(TOPDIR)/rules.mk
PKG_NAME:=cython
PKG_VERSION:=0.29.21
PKG_VERSION:=0.29.23
PKG_RELEASE:=1
PYPI_NAME:=Cython
PKG_HASH:=e57acb89bd55943c8d8bf813763d20b9099cc7165c0f16b707631a7654be9cad
PKG_HASH:=6a0d31452f0245daacb14c979c77e093eb1a546c760816b5eed0047686baad8e
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
PKG_LICENSE:=Apache-2.0
......
include $(TOPDIR)/rules.mk
PKG_NAME:=luajit
PKG_VERSION:=2.2.0
PKG_RELEASE:=1
PKG_SOURCE:=moonjit-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/moonjit/moonjit/tar.gz/$(PKG_VERSION)?
PKG_HASH:=83deb2c880488dfe7dd8ebf09e3b1e7613ef4b8420de53de6f712f01aabca2b6
PKG_BUILD_DIR:=$(BUILD_DIR)/moonjit-$(PKG_VERSION)
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYRIGHT
PKG_USE_MIPS16:=0
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/luajit
SUBMENU:=Lua
SECTION:=lang
CATEGORY:=Languages
TITLE:=LuaJIT (MoonJIT)
URL:=https://github.com/moonjit/moonjit
DEPENDS:=@(i386||x86_64||arm||armeb||aarch64||mips||mipsel)
ALTERNATIVES:=300:/usr/bin/luajit:/usr/bin/moonjit
endef
define Package/luajit/description
LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. *** Requires GCC Multilib on host system to build! ***
endef
ifeq ($(HOST_ARCH),x86_64)
ifeq ($(CONFIG_ARCH_64BIT),)
HOST_BITS := -m32
endif
endif
MAKE_VARS =
MAKE_FLAGS = \
DPREFIX=$(PKG_INSTALL_DIR)/usr \
PREFIX=/usr \
CROSS="$(TARGET_CROSS)" \
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
TARGET_SYS=Linux \
HOST_CC="$(HOSTCC)" \
HOST_CFLAGS="$(HOST_CFLAGS) $(HOST_BITS)" \
HOST_LDFLAGS="$(HOST_LDFLAGS) $(HOST_BITS)"
MAKE_INSTALL_FLAGS = \
DPREFIX=$(PKG_INSTALL_DIR)/usr \
PREFIX=/usr \
TARGET_SYS=Linux \
HOST_MAKE_FLAGS = \
DPREFIX=$(STAGING_DIR_HOSTPKG) \
TARGET_CFLAGS="$(HOST_CFLAGS)" \
TARGET_LDFLAGS="$(HOST_LDFLAGS)"
define Package/luajit/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/moonjit-2.2
$(CP) $(PKG_INSTALL_DIR)/usr/include/moonjit-2.2/*.{h,hpp} $(1)/usr/include/moonjit-2.2
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/moonjit-$(PKG_VERSION) $(1)/usr/bin/moonjit
endef
$(eval $(call HostBuild,luajit))
$(eval $(call BuildPackage,luajit))
diff --git a/src/luaconf.h b/src/luaconf.h
index 6c6f1131..c1374911 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -35,8 +35,8 @@
#ifndef LUA_LMULTILIB
#define LUA_LMULTILIB "lib"
#endif
-#define LUA_LROOT "/usr/local"
-#define LUA_LUADIR "/lua/5.1/"
+#define LUA_LROOT "/usr"
+#define LUA_LUADIR "/lua/"
#define LUA_LJDIR "/moonjit-2.2.0/"
#ifdef LUA_ROOT
#
# Copyright (C) 2018-2020 CZ.NIC z.s.p.o. (https://www.nic.cz/)
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python-libsass
PKG_VERSION:=0.20.0
PKG_RELEASE:=1
PYPI_NAME:=libsass
PKG_HASH:=b7452f1df274b166dc22ee2e9154c4adca619bcbbdf8041a7aa05f372a1dacbc
include $(TOPDIR)/feeds/packages/lang/python/pypi.mk
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
define Package/python3-libsass
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=Sass/SCSS for Python
URL:=https://github.com/sass/libsass-python
DEPENDS:=+libstdcpp +python3-light
VARIANT:=python3
endef
define Package/python3-libsass/description
A straightforward binding of libsass for Python.
endef
$(eval $(call Py3Package,python3-libsass))
$(eval $(call BuildPackage,python3-libsass))
$(eval $(call BuildPackage,python3-libsass-src))
......@@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-periphery
PKG_VERSION:=2.1.0
PKG_VERSION:=2.3.0
PKG_RELEASE:=1
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PYPI_NAME:=python-periphery
PKG_HASH:=57baa82e6bc59b67747317d16ad0cf9626826e8d43233af13bce924660500bd6
PKG_HASH:=8a8ec019d9b330a6a6f69a7de61d14b4c98b102d76359047c5ce0263e12246a6
include $(TOPDIR)/feeds/packages/lang/python/pypi.mk
include $(INCLUDE_DIR)/package.mk
......
#
# Copyright (C) 2017-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python-usb
PKG_VERSION:=1.1.0
PKG_RELEASE:=1
PYPI_NAME:=pyusb
PKG_HASH:=d69ed64bff0e2102da11b3f49567256867853b861178689671a163d30865c298
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(TOPDIR)/feeds/packages/lang/python/pypi.mk
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
define Package/python3-usb
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=USB access for Python
URL:=https://pyusb.github.io/pyusb/
DEPENDS:=+python3-light +libusb-1.0
VARIANT:=python3
endef
define Package/python3-usb/description
The PyUSB module provides for Python easy access to the host machine's Universal
Serial Bus (USB) system.
endef
$(eval $(call Py3Package,python3-usb))
$(eval $(call BuildPackage,python3-usb))
$(eval $(call BuildPackage,python3-usb-src))
#
# Copyright (C) 2018-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
# Copyright (C) 2018-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
......@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-websockets
PKG_VERSION:=8.1
PKG_VERSION:=9.1
PKG_RELEASE:=1
PYPI_NAME:=websockets
PKG_HASH=5c65d2da8c6bce0fca2528f69f44b2f977e06954c8512a952222cea50dad430f
PKG_HASH:=276d2339ebf0df4f45df453923ebd2270b87900eda5dfd4a6b0cfa15f82111c3
PKG_MAINTAINER:=
PKG_LICENSE:=BSD-3-Clause
......
#
## Copyright (C) 2020 CZ.NIC z.s.p.o. (https://www.nic.cz/)
## Copyright (C) 2020-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/)
#
## This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
......@@ -8,13 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=base64c
PKG_VERSION:=0.2.0
PKG_VERSION:=0.2.1
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/base64c.git
PKG_MIRROR_HASH:=d5ea65414eeec880da154bd3eb7bcb6c49da09193342398aff4b3eccf8d77e88
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_SOURCE:=base64c-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://gitlab.nic.cz/api/v4/projects/973/packages/generic/base64c/$(PKG_VERSION)
PKG_HASH:=ebc12ecdb66a9261ba3d5cd06e87588764ac53aea2c64bd4c226f13cc2bf77d4
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
PKG_LICENSE:=MIT
......@@ -37,10 +36,6 @@ define Package/base64c/description
Base64 encoding/decoding library for C
endef
CONFIGURE_ARGS += \
--disable-tests \
--disable-linters
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
......
......@@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libhtp
PKG_VERSION:=0.5.33
PKG_VERSION:=0.5.37
PKG_RELEASE=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/OISF/libhtp/tar.gz/$(PKG_VERSION)?
PKG_HASH:=953651fdfe828805bb82dc1aa8b56187b0e2f80781727343e68ccf8afd6a9122
PKG_HASH:=0f8296ce9db815bbedc1c8a0b738dd25146fdaf910995a8c5f8e147799902b7e
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
......