Skip to content

Commit 7a7eef2

Browse files
committed
revert to MBR
Signed-off-by: Michel-FK <[email protected]>
1 parent 7688c3f commit 7a7eef2

File tree

15 files changed

+68
-88
lines changed

15 files changed

+68
-88
lines changed

FunKey/board/funkey/linux.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ CONFIG_PERF_EVENTS=y
1111
CONFIG_MODULES=y
1212
CONFIG_MODULE_UNLOAD=y
1313
CONFIG_PARTITION_ADVANCED=y
14-
# CONFIG_MSDOS_PARTITION is not set
1514
CONFIG_ARCH_SUNXI=y
1615
# CONFIG_MACH_SUN4I is not set
1716
# CONFIG_MACH_SUN5I is not set

FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ case "$1" in
66
start)
77

88
# Check is SWAP partition already created
9-
sgdisk -p /dev/mmcblk0 | grep swap > /dev/null
9+
fdisk -l /dev/mmcblk0 | grep "Linux swap" > /dev/null
1010
if [ $? -ne 0 ]; then
11-
first_boot
12-
exit $?
11+
first_boot
12+
exit $?
1313
fi
1414

1515
# Check is share partition already created
16-
sgdisk -p /dev/mmcblk0 | grep share > /dev/null
16+
fdisk -l /dev/mmcblk0 | grep "W95 FAT32" > /dev/null
1717
if [ $? -ne 0 ]; then
1818
first_boot
1919
exit $?

FunKey/board/funkey/rootfs-overlay/etc/issue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
|___| |_____|__|__||__|\__||_____|___ |
66
FUN ON A KEYCHAIN |_____|
77
-----------------------------------------------------
8-
Version 1.0.1
8+
Version 1.1.0
99
-----------------------------------------------------
1010

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
NAME="FunKey-OS"
2-
VERSION="1.0.1 (Funky Fish)"
2+
VERSION="1.1.0 (Quacking Quagga)"
33
ID=funkey
44
ID_LIKE=buildroot
5-
PRETTY_NAME="FunKey-OS 1.0.1"
6-
VERSION_ID="1.0.1"
5+
PRETTY_NAME="FunKey-OS 1.1.0"
6+
VERSION_ID="1.1.0"
77
HOME_URL="https://www.funkey-project.com/"
88
SUPPORT_URL="https://www.funkey-project.com/"
99
BUG_REPORT_URL="https://www.funkey-project.com/"
1010
PRIVACY_POLICY_URL="https://www.funkey-project.com"
11-
VERSION_CODENAME=Funky
12-
UBUNTU_CODENAME=Funky
11+
VERSION_CODENAME=Quacking
12+
UBUNTU_CODENAME=Quacking
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootfs 1.0.1
1+
rootfs 1.1.0

FunKey/board/funkey/rootfs-overlay/usr/local/sbin/first_boot

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Uncomment the following line to get debug info
44
#set -x
55

6+
# This is to avoid expanding '*' in fdisk results
7+
set -f
8+
69
source /usr/local/lib/utils
710

811
SELF=$(basename $0)
@@ -22,11 +25,6 @@ swap_part=/dev/mmcblk0p${swap_part_num}
2225
let share_part_num=${swap_part_num}+1
2326
share_part=/dev/mmcblk0p${share_part_num}
2427

25-
check_first_boot () {
26-
[ -f /.first_boot ] && die 0 "nothing to do"
27-
return 0
28-
}
29-
3028
check_root_id () {
3129
[ $(id -u) -ne 0 ] && die 3 "this script must be run as root, aborting"
3230
return 0
@@ -35,25 +33,30 @@ check_root_id () {
3533
resize_rootfs_partition () {
3634

3735
# Check that the last partition is the rootfs partition
38-
local last_part_line=$(sgdisk -p /dev/mmcblk0 | tail -n 1)
36+
local last_part_line=$(fdisk -l /dev/mmcblk0 2>/dev/null | tail -n 1)
3937
set ${last_part_line}
40-
local last_part=${1}
41-
if [ "${last_part}" != "${root_part_num}" ]; then
38+
local last_part_num=${1#/dev/mmcblk0p}
39+
local part_start=${3}
40+
if [ "${last_part_num}" != "${root_part_num}" ]; then
4241
die 4 "rootfs is not the last partition. Don't know how to expand, aborting"
4342
fi
4443

4544
# Remove (temporarily) the rootfs partition
46-
sgdisk -d ${root_part_num} /dev/mmcblk0 >/dev/null 2>&1 || die 5 "cannot remove the rootfs partition, aborting"
47-
4845
# Re-create the rootfs partition with a 1GB size
49-
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"
46+
fdisk /dev/mmcblk0 >/dev/null 2>&1 <<EOF
47+
d
48+
${root_part_num}
49+
n
50+
p
51+
${root_part_num}
52+
${part_start}
53+
+1G
54+
w
55+
EOF
5056

5157
# Mark the rootfs partition as bootable
52-
sgdisk -A ${root_part_num}:set:2 /dev/mmcblk0 >/dev/null 2>&1 || die 7 "cannot make the rootfs partition bootable, aborting"
58+
sfdisk -A /dev/mmcblk0 ${root_part_num} >/dev/null 2>&1 || die 7 "cannot make the rootfs partition bootable, aborting"
5359

54-
# Copy the primary GPT to the end of the disk
55-
sgdisk -e /dev/mmcblk0 >/dev/null 2>&1 || die 8 "cannot move the GPT to the end of the disk"
56-
sync
5760
return 0
5861
}
5962

@@ -74,19 +77,27 @@ create_swap () {
7477
if [ $? -ne 0 ]; then
7578

7679
# Check that the last partition is the rootfs partition
77-
local last_part_line=$(sgdisk -p /dev/mmcblk0 2>/dev/null | tail -n 1)
80+
local last_part_line=$(fdisk -l /dev/mmcblk0 2>/dev/null | tail -n 1)
7881
set ${last_part_line}
79-
local last_part_num=${1}
82+
local last_part_num=${1#/dev/mmcblk0p}
8083
if [ "$last_part_num" != "$root_part_num" ]; then
8184
die 11 "rootfs is not the last partition. Don't know how to create the backing store partition"
8285
fi
8386

8487
# Create an additional linux swap partition
8588
let swap_part_num=${last_part_num}+1
8689
swap_part=/dev/mmcblk0p${swap_part_num}
87-
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"
88-
sync
89-
partprobe /dev/mmcblk0 >/dev/null 2>&1 || die 13 "cannot reload the partition table, aborting"
90+
fdisk /dev/mmcblk0 >/dev/null 2>&1 <<EOF
91+
n
92+
p
93+
${swap_part_num}
94+
95+
+128M
96+
t
97+
${wap_part_num}
98+
82
99+
w
100+
EOF
90101
mkswap ${swap_part} >/dev/null 2>&1
91102
if [ $? -ne 0 ]; then
92103
die 14 "cannot create swap file, aborting"
@@ -105,17 +116,27 @@ create_backing_store_partition () {
105116
if [ $? -ne 0 ]; then
106117

107118
# Check that the last partition is the swap partition
108-
local last_part_line=$(sgdisk -p /dev/mmcblk0 2>/dev/null | tail -n 1)
119+
local last_part_line=$(fdisk -l /dev/mmcblk0 2>/dev/null | tail -n 1)
109120
set ${last_part_line}
110-
local last_part_num=${1}
121+
local last_part_num=${1#/dev/mmcblk0p}
111122
if [ "${last_part_num}" != "${swap_part_num}" ]; then
112123
die 15 "rootfs is not the last partition. Don't know how to create the backing store partition"
113124
fi
114125

115-
# Create an additional Microsoft basic data partition share partition that fills the disk
126+
# Create an additional FAT32 share partition that fills the disk
116127
let share_part_num=${last_part_num}+1
117128
share_part=/dev/mmcblk0p${share_part_num}
118-
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"
129+
fdisk /dev/mmcblk0 >/dev/null 2>&1 <<EOF
130+
n
131+
p
132+
${share_part_num}
133+
134+
135+
t
136+
${share_part_num}
137+
c
138+
w
139+
EOF
119140
sync
120141
fi
121142
return 0
@@ -139,7 +160,6 @@ copy_files_to_store_partition () {
139160
}
140161

141162
check_root_id
142-
check_first_boot
143163
notif " FIRST BOOT DETECTED"
144164

145165
notif " 1/9 RESIZE ROOT PARTITION"
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#!/bin/sh
2-
sgdisk -A 1:set:2 -A 2:clear:2 /dev/mmcblk0 >/dev/null 2>&1
3-
recovery=$(sgdisk -A 1:get:2 /dev/mmcblk0 | cut -d : -f3)
4-
if [ ${recovery} -eq 1 ]; then
5-
echo "Next boot will be in recovery mode"
6-
else
7-
echo "Next boot will be in normal mode"
8-
fi
2+
sfdisk -A /dev/mmcblk0 1 >/dev/null 2>&1
3+
echo "Next boot will be in recovery mode"
94
reboot

FunKey/board/funkey/sw-description

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
software =
22
{
3-
version = "1.0.1";
3+
version = "1.1.0";
44

55
hardware-compatibility = [ "#RE:^Rev\.[D-E]$" ];
66

Recovery/board/funkey/linux.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ CONFIG_PERF_EVENTS=y
1111
CONFIG_MODULES=y
1212
CONFIG_MODULE_UNLOAD=y
1313
CONFIG_PARTITION_ADVANCED=y
14-
# CONFIG_MSDOS_PARTITION is not set
1514
CONFIG_ARCH_SUNXI=y
1615
# CONFIG_MACH_SUN4I is not set
1716
# CONFIG_MACH_SUN5I is not set

Recovery/board/funkey/rootfs-overlay/etc/issue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
|___| |_____|__|__||__|\__||_____|___ |
66
FUN ON A KEYCHAIN |_____|
77
-----------------------------------------------------
8-
Version 1.0.1 (Recovery)
8+
Version 1.1.0 (Recovery)
99
-----------------------------------------------------
1010

0 commit comments

Comments
 (0)