Skip to content

Commit

Permalink
chore(builder): only update-grub at first boot (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihexon authored Dec 18, 2024
1 parent afd2f47 commit 8f39ab3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
11 changes: 9 additions & 2 deletions layers/macos_arm64/etc/init.d/ovmservice
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@ umount_efi() {
umount /boot/efi/
}

start() {
update-grub
# Update grub only running at first boot
update_grub(){
if [[ -f /.first_boot ]];then
update-grub && rm /.first_boot
sync
fi
}

start() {
umount_efi
update_grub
# Format /dev/vdb with $uuid first
format_and_mount_var
# Mount /tmp/initfs(virtioFS), and exec $ign_sh
Expand Down
13 changes: 13 additions & 0 deletions target_builder/macos_arm64
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,19 @@ copy_layer() {
}
} && cd $workspace

cd $output && {
sudo -E proot $qemu_flag --rootfs=./target_rootfs \
-b /dev:/dev \
-b /sys:/sys \
-b /proc:/proc \
-b /etc/resolv.conf:/etc/resolv.conf \
-w /root \
-0 /bin/su -c "touch /.first_boot" || {
echo "Error: enable rc_parallel failed"
exit 100
}
} && cd $workspace

set +x
sync # must do sync !
}
Expand Down

0 comments on commit 8f39ab3

Please sign in to comment.