diff --git a/FunKey/board/funkey/linux.config b/FunKey/board/funkey/linux.config index d08ffb1..8ff92a7 100644 --- a/FunKey/board/funkey/linux.config +++ b/FunKey/board/funkey/linux.config @@ -11,7 +11,6 @@ CONFIG_PERF_EVENTS=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_PARTITION_ADVANCED=y -# CONFIG_MSDOS_PARTITION is not set CONFIG_ARCH_SUNXI=y # CONFIG_MACH_SUN4I is not set # CONFIG_MACH_SUN5I is not set diff --git a/FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot b/FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot index 51f1eb2..a04a285 100755 --- a/FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot +++ b/FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot @@ -6,14 +6,14 @@ case "$1" in start) # Check is SWAP partition already created - sgdisk -p /dev/mmcblk0 | grep swap > /dev/null + fdisk -l /dev/mmcblk0 | grep "Linux swap" > /dev/null if [ $? -ne 0 ]; then - first_boot - exit $? + first_boot + exit $? fi # Check is share partition already created - sgdisk -p /dev/mmcblk0 | grep share > /dev/null + fdisk -l /dev/mmcblk0 | grep "W95 FAT32" > /dev/null if [ $? -ne 0 ]; then first_boot exit $? diff --git a/FunKey/board/funkey/rootfs-overlay/etc/issue b/FunKey/board/funkey/rootfs-overlay/etc/issue index eebb9ce..c3d1cfd 100644 --- a/FunKey/board/funkey/rootfs-overlay/etc/issue +++ b/FunKey/board/funkey/rootfs-overlay/etc/issue @@ -5,6 +5,6 @@ |___| |_____|__|__||__|\__||_____|___ | FUN ON A KEYCHAIN |_____| ----------------------------------------------------- - Version 1.0.1 + Version 1.1.0 ----------------------------------------------------- diff --git a/FunKey/board/funkey/rootfs-overlay/etc/os-release b/FunKey/board/funkey/rootfs-overlay/etc/os-release index dd8ba4f..5e259a6 100644 --- a/FunKey/board/funkey/rootfs-overlay/etc/os-release +++ b/FunKey/board/funkey/rootfs-overlay/etc/os-release @@ -1,12 +1,12 @@ NAME="FunKey-OS" -VERSION="1.0.1 (Funky Fish)" +VERSION="1.1.0 (Quacking Quagga)" ID=funkey ID_LIKE=buildroot -PRETTY_NAME="FunKey-OS 1.0.1" -VERSION_ID="1.0.1" +PRETTY_NAME="FunKey-OS 1.1.0" +VERSION_ID="1.1.0" HOME_URL="https://www.funkey-project.com/" SUPPORT_URL="https://www.funkey-project.com/" BUG_REPORT_URL="https://www.funkey-project.com/" PRIVACY_POLICY_URL="https://www.funkey-project.com" -VERSION_CODENAME=Funky -UBUNTU_CODENAME=Funky +VERSION_CODENAME=Quacking +UBUNTU_CODENAME=Quacking diff --git a/FunKey/board/funkey/rootfs-overlay/etc/sw-versions b/FunKey/board/funkey/rootfs-overlay/etc/sw-versions index 5de61e5..fc6545a 100644 --- a/FunKey/board/funkey/rootfs-overlay/etc/sw-versions +++ b/FunKey/board/funkey/rootfs-overlay/etc/sw-versions @@ -1 +1 @@ -rootfs 1.0.1 +rootfs 1.1.0 diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot index 4e44152..2ab0721 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot @@ -3,6 +3,9 @@ # Uncomment the following line to get debug info #set -x +# This is to avoid expanding '*' in fdisk results +set -f + source /usr/local/lib/utils SELF=$(basename $0) @@ -22,11 +25,6 @@ swap_part=/dev/mmcblk0p${swap_part_num} let share_part_num=${swap_part_num}+1 share_part=/dev/mmcblk0p${share_part_num} -check_first_boot () { - [ -f /.first_boot ] && die 0 "nothing to do" - return 0 -} - check_root_id () { [ $(id -u) -ne 0 ] && die 3 "this script must be run as root, aborting" return 0 @@ -35,25 +33,30 @@ check_root_id () { resize_rootfs_partition () { # Check that the last partition is the rootfs partition - local last_part_line=$(sgdisk -p /dev/mmcblk0 | tail -n 1) + local last_part_line=$(fdisk -l /dev/mmcblk0 2>/dev/null | tail -n 1) set ${last_part_line} - local last_part=${1} - if [ "${last_part}" != "${root_part_num}" ]; then + local last_part_num=${1#/dev/mmcblk0p} + local part_start=${3} + if [ "${last_part_num}" != "${root_part_num}" ]; then die 4 "rootfs is not the last partition. Don't know how to expand, aborting" fi # Remove (temporarily) the rootfs partition - sgdisk -d ${root_part_num} /dev/mmcblk0 >/dev/null 2>&1 || die 5 "cannot remove the rootfs partition, aborting" - # Re-create the rootfs partition with a 1GB size - sgdisk -n ${root_part_num}:0:+1G -c ${root_part_num}:rootfs /dev/mmcblk0 >/dev/null 2>&1 || die 6 "cannot resize the rootfs partition, aborting" + fdisk /dev/mmcblk0 >/dev/null 2>&1 </dev/null 2>&1 || die 7 "cannot make the rootfs partition bootable, aborting" + sfdisk -A /dev/mmcblk0 ${root_part_num} >/dev/null 2>&1 || die 7 "cannot make the rootfs partition bootable, aborting" - # Copy the primary GPT to the end of the disk - sgdisk -e /dev/mmcblk0 >/dev/null 2>&1 || die 8 "cannot move the GPT to the end of the disk" - sync return 0 } @@ -74,9 +77,9 @@ create_swap () { if [ $? -ne 0 ]; then # Check that the last partition is the rootfs partition - local last_part_line=$(sgdisk -p /dev/mmcblk0 2>/dev/null | tail -n 1) + local last_part_line=$(fdisk -l /dev/mmcblk0 2>/dev/null | tail -n 1) set ${last_part_line} - local last_part_num=${1} + local last_part_num=${1#/dev/mmcblk0p} if [ "$last_part_num" != "$root_part_num" ]; then die 11 "rootfs is not the last partition. Don't know how to create the backing store partition" fi @@ -84,9 +87,17 @@ create_swap () { # Create an additional linux swap partition let swap_part_num=${last_part_num}+1 swap_part=/dev/mmcblk0p${swap_part_num} - sgdisk -n ${swap_part_num}:0:+128M -c ${swap_part_num}:swap -t ${swap_part_num}:8200 /dev/mmcblk0 >/dev/null 2>&1 || die 12 "cannot create the swap partition, aborting" - sync - partprobe /dev/mmcblk0 >/dev/null 2>&1 || die 13 "cannot reload the partition table, aborting" + fdisk /dev/mmcblk0 >/dev/null 2>&1 </dev/null 2>&1 if [ $? -ne 0 ]; then die 14 "cannot create swap file, aborting" @@ -105,17 +116,27 @@ create_backing_store_partition () { if [ $? -ne 0 ]; then # Check that the last partition is the swap partition - local last_part_line=$(sgdisk -p /dev/mmcblk0 2>/dev/null | tail -n 1) + local last_part_line=$(fdisk -l /dev/mmcblk0 2>/dev/null | tail -n 1) set ${last_part_line} - local last_part_num=${1} + local last_part_num=${1#/dev/mmcblk0p} if [ "${last_part_num}" != "${swap_part_num}" ]; then die 15 "rootfs is not the last partition. Don't know how to create the backing store partition" fi - # Create an additional Microsoft basic data partition share partition that fills the disk + # Create an additional FAT32 share partition that fills the disk let share_part_num=${last_part_num}+1 share_part=/dev/mmcblk0p${share_part_num} - sgdisk -n ${share_part_num}:0:-0 -c ${share_part_num}:share -t ${share_part_num}:0700 /dev/mmcblk0 >/dev/null 2>&1 || die 16 "cannot create the backing store partition, aborting" + fdisk /dev/mmcblk0 >/dev/null 2>&1 </dev/null 2>&1 -recovery=$(sgdisk -A 1:get:2 /dev/mmcblk0 | cut -d : -f3) -if [ ${recovery} -eq 1 ]; then - echo "Next boot will be in recovery mode" -else - echo "Next boot will be in normal mode" -fi +sfdisk -A /dev/mmcblk0 1 >/dev/null 2>&1 +echo "Next boot will be in recovery mode" reboot diff --git a/FunKey/board/funkey/sw-description b/FunKey/board/funkey/sw-description index 7b0601b..dd72e7c 100644 --- a/FunKey/board/funkey/sw-description +++ b/FunKey/board/funkey/sw-description @@ -1,6 +1,6 @@ software = { - version = "1.0.1"; + version = "1.1.0"; hardware-compatibility = [ "#RE:^Rev\.[D-E]$" ]; diff --git a/Recovery/board/funkey/linux.config b/Recovery/board/funkey/linux.config index 7b5907d..20f59df 100644 --- a/Recovery/board/funkey/linux.config +++ b/Recovery/board/funkey/linux.config @@ -11,7 +11,6 @@ CONFIG_PERF_EVENTS=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_PARTITION_ADVANCED=y -# CONFIG_MSDOS_PARTITION is not set CONFIG_ARCH_SUNXI=y # CONFIG_MACH_SUN4I is not set # CONFIG_MACH_SUN5I is not set diff --git a/Recovery/board/funkey/rootfs-overlay/etc/issue b/Recovery/board/funkey/rootfs-overlay/etc/issue index 332120a..afbd169 100644 --- a/Recovery/board/funkey/rootfs-overlay/etc/issue +++ b/Recovery/board/funkey/rootfs-overlay/etc/issue @@ -5,6 +5,6 @@ |___| |_____|__|__||__|\__||_____|___ | FUN ON A KEYCHAIN |_____| ----------------------------------------------------- - Version 1.0.1 (Recovery) + Version 1.1.0 (Recovery) ----------------------------------------------------- diff --git a/Recovery/board/funkey/rootfs-overlay/etc/os-release b/Recovery/board/funkey/rootfs-overlay/etc/os-release index 9c98031..2483f0b 100644 --- a/Recovery/board/funkey/rootfs-overlay/etc/os-release +++ b/Recovery/board/funkey/rootfs-overlay/etc/os-release @@ -1,12 +1,12 @@ NAME="FunKey-OS Recovery" -VERSION="1.0.1 (Funky Fish)" +VERSION="1.1.0 (Quacking Quagga)" ID=funkey-recovery ID_LIKE=buildroot -PRETTY_NAME="FunKey-OS Recovery 1.0.1" -VERSION_ID="1.0.1" +PRETTY_NAME="FunKey-OS Recovery 1.1.0" +VERSION_ID="1.1.0" HOME_URL="https://www.funkey-project.com/" SUPPORT_URL="https://www.funkey-project.com/" BUG_REPORT_URL="https://www.funkey-project.com/" PRIVACY_POLICY_URL="https://www.funkey-project.com" -VERSION_CODENAME=Funky -UBUNTU_CODENAME=Funky +VERSION_CODENAME=Quacking +UBUNTU_CODENAME=Quacking diff --git a/Recovery/board/funkey/rootfs-overlay/etc/sw-versions b/Recovery/board/funkey/rootfs-overlay/etc/sw-versions index 74a2465..6019c23 100644 --- a/Recovery/board/funkey/rootfs-overlay/etc/sw-versions +++ b/Recovery/board/funkey/rootfs-overlay/etc/sw-versions @@ -1 +1 @@ -Recovery 1.0.1 +Recovery 1.1.0 diff --git a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/normal_mode b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/normal_mode index e5a41e0..85e9b2c 100755 --- a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/normal_mode +++ b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/normal_mode @@ -1,9 +1,4 @@ #!/bin/sh -sgdisk -A 1:clear:2 -A 2:set:2 /dev/mmcblk0 >/dev/null 2>&1 -recovery=$(sgdisk -A 1:get:2 /dev/mmcblk0 | cut -d : -f3) -if [ ${recovery} -eq 1 ]; then - echo "Next boot will be in recovery mode" -else - echo "Next boot will be in normal mode" -fi +sfdisk -A /dev/mmcblk0 2 >/dev/null 2>&1 +echo "Next boot will be in normal mode" reboot diff --git a/genimage-prod.cfg b/genimage-prod.cfg index 07ea9e0..b2c85d1 100644 --- a/genimage-prod.cfg +++ b/genimage-prod.cfg @@ -3,16 +3,8 @@ config { image sdcard-prod.img { hdimage { - gpt = true - gpt-location = 800K } -# partition gpt-header { -# in-partition-table = "no" -# offset = 1K -# size = 512 -# } - partition u-boot { in-partition-table = "no" image = "Recovery/output/images/u-boot-sunxi-with-spl.bin" @@ -27,12 +19,6 @@ image sdcard-prod.img { image = "Recovery/output/images/u-boot-env-prod.img" } -# partition gpt-table { -# in-partition-table = "no" -# offset = 800K -# size = 16K -# } - partition Recovery { offset = 1M partition-type = 0x83 diff --git a/genimage.cfg b/genimage.cfg index cba6a6f..5570864 100644 --- a/genimage.cfg +++ b/genimage.cfg @@ -3,16 +3,8 @@ config { image sdcard.img { hdimage { - gpt = true - gpt-location = 800K } -# partition gpt-header { -# in-partition-table = "no" -# offset = 1K -# size = 512 -# } - partition u-boot { in-partition-table = "no" image = "Recovery/output/images/u-boot-sunxi-with-spl.bin" @@ -27,12 +19,6 @@ image sdcard.img { image = "Recovery/output/images/u-boot-env.img" } -# partition gpt-table { -# in-partition-table = "no" -# offset = 800K -# size = 16K -# } - partition Recovery { offset = 1M partition-type = 0x83