summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xexport-image/03-set-partuuid/00-run.sh12
-rwxr-xr-xexport-image/04-finalise/01-run.sh (renamed from export-image/03-finalise/01-run.sh)0
-rw-r--r--export-image/04-finalise/files/LICENSE.oracle (renamed from export-image/03-finalise/files/LICENSE.oracle)0
-rw-r--r--export-noobs/00-release/files/partition_setup.sh2
-rw-r--r--export-noobs/00-release/files/release_notes.txt2
-rw-r--r--stage1/00-boot-files/files/cmdline.txt2
-rw-r--r--stage1/01-sys-tweaks/files/fstab4
-rw-r--r--stage2/01-sys-tweaks/00-patches/07-resize-init.diff4
-rw-r--r--stage2/01-sys-tweaks/files/resize2fs_once2
9 files changed, 20 insertions, 8 deletions
diff --git a/export-image/03-set-partuuid/00-run.sh b/export-image/03-set-partuuid/00-run.sh
new file mode 100755
index 0000000..f19884e
--- /dev/null
+++ b/export-image/03-set-partuuid/00-run.sh
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
+
+IMGID="$(fdisk -l ${IMG_FILE} | sed -n 's/Disk identifier: 0x\([^ ]*\)/\1/p')"
+
+BOOT_PARTUUID="${IMGID}-01"
+ROOT_PARTUUID="${IMGID}-02"
+
+sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" ${ROOTFS_DIR}/etc/fstab
+sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" ${ROOTFS_DIR}/etc/fstab
+
+sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" ${ROOTFS_DIR}/boot/cmdline.txt
diff --git a/export-image/03-finalise/01-run.sh b/export-image/04-finalise/01-run.sh
index c64c92b..c64c92b 100755
--- a/export-image/03-finalise/01-run.sh
+++ b/export-image/04-finalise/01-run.sh
diff --git a/export-image/03-finalise/files/LICENSE.oracle b/export-image/04-finalise/files/LICENSE.oracle
index 00898ca..00898ca 100644
--- a/export-image/03-finalise/files/LICENSE.oracle
+++ b/export-image/04-finalise/files/LICENSE.oracle
diff --git a/export-noobs/00-release/files/partition_setup.sh b/export-noobs/00-release/files/partition_setup.sh
index 3a99342..81cef4d 100644
--- a/export-noobs/00-release/files/partition_setup.sh
+++ b/export-noobs/00-release/files/partition_setup.sh
@@ -12,7 +12,7 @@ mkdir -p /tmp/1 /tmp/2
mount "$part1" /tmp/1
mount "$part2" /tmp/2
-sed /tmp/1/cmdline.txt -i -e "s|root=/dev/[^ ]*|root=${part2}|"
+sed /tmp/1/cmdline.txt -i -e "s|root=[^ ]*|root=${part2}|"
sed /tmp/2/etc/fstab -i -e "s|^.* / |${part2} / |"
sed /tmp/2/etc/fstab -i -e "s|^.* /boot |${part1} /boot |"
diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt
index 2b0ae31..223bcca 100644
--- a/export-noobs/00-release/files/release_notes.txt
+++ b/export-noobs/00-release/files/release_notes.txt
@@ -1,5 +1,5 @@
UNRELEASED:
- *
+ * Use PARTUUID to support USB boot
2017-03-02:
* Updated kernel and firmware (final Pi Zero W support)
* Wolfram Mathematica updated to version 11
diff --git a/stage1/00-boot-files/files/cmdline.txt b/stage1/00-boot-files/files/cmdline.txt
index 45c7f58..2b0634b 100644
--- a/stage1/00-boot-files/files/cmdline.txt
+++ b/stage1/00-boot-files/files/cmdline.txt
@@ -1 +1 @@
-dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
+dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
diff --git a/stage1/01-sys-tweaks/files/fstab b/stage1/01-sys-tweaks/files/fstab
index 68e5816..f16e3fb 100644
--- a/stage1/01-sys-tweaks/files/fstab
+++ b/stage1/01-sys-tweaks/files/fstab
@@ -1,3 +1,3 @@
proc /proc proc defaults 0 0
-/dev/mmcblk0p1 /boot vfat defaults 0 2
-/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
+BOOTDEV /boot vfat defaults 0 2
+ROOTDEV / ext4 defaults,noatime 0 1
diff --git a/stage2/01-sys-tweaks/00-patches/07-resize-init.diff b/stage2/01-sys-tweaks/00-patches/07-resize-init.diff
index 97f7c19..0701641 100644
--- a/stage2/01-sys-tweaks/00-patches/07-resize-init.diff
+++ b/stage2/01-sys-tweaks/00-patches/07-resize-init.diff
@@ -1,5 +1,5 @@
--- a/rootfs/boot/cmdline.txt
+++ b/rootfs/boot/cmdline.txt
@@ -1 +1 @@
--dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
-+dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
+-dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
++dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
diff --git a/stage2/01-sys-tweaks/files/resize2fs_once b/stage2/01-sys-tweaks/files/resize2fs_once
index 7236921..38a4d47 100644
--- a/stage2/01-sys-tweaks/files/resize2fs_once
+++ b/stage2/01-sys-tweaks/files/resize2fs_once
@@ -12,7 +12,7 @@
case "$1" in
start)
log_daemon_msg "Starting resize2fs_once"
- ROOT_DEV=`grep -Eo 'root=[[:graph:]]+' /proc/cmdline | cut -d '=' -f 2-` &&
+ ROOT_DEV=$(findmnt / -o source -n) &&
resize2fs $ROOT_DEV &&
update-rc.d resize2fs_once remove &&
rm /etc/init.d/resize2fs_once &&