mirror of
https://github.com/suikan4github/kaiten-yaki.git
synced 2025-12-20 02:21:17 -03:00
Refactored code again
This commit is contained in:
parent
488c998048
commit
53c4426a98
3 changed files with 20 additions and 17 deletions
|
|
@ -2,9 +2,6 @@
|
||||||
# Common part of para-install
|
# Common part of para-install
|
||||||
# *******************************************************************************
|
# *******************************************************************************
|
||||||
|
|
||||||
# Record the PID of the installer.
|
|
||||||
installer_pid=$!
|
|
||||||
|
|
||||||
# While the /etc/default/grub in the install target is NOT existing, keep sleeping.
|
# While the /etc/default/grub in the install target is NOT existing, keep sleeping.
|
||||||
# If installer terminated without file copy, this script also terminates.
|
# If installer terminated without file copy, this script also terminates.
|
||||||
while [ ! -e ${TARGETMOUNTPOINT}/etc/default/grub ]
|
while [ ! -e ${TARGETMOUNTPOINT}/etc/default/grub ]
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,9 @@ read dummy_var
|
||||||
# Start Ubiquity installer
|
# Start Ubiquity installer
|
||||||
ubiquity &
|
ubiquity &
|
||||||
|
|
||||||
|
# Record the PID of the installer.
|
||||||
|
installer_pid=$!
|
||||||
|
|
||||||
# Common part of the para-install.
|
# Common part of the para-install.
|
||||||
# Record the install PID, modify the /etc/default/grub of the target,
|
# Record the install PID, modify the /etc/default/grub of the target,
|
||||||
# and then, wait for the end of sintaller.
|
# and then, wait for the end of sintaller.
|
||||||
|
|
@ -88,17 +91,17 @@ source _parainstall.sh
|
||||||
# *******************************************************************************
|
# *******************************************************************************
|
||||||
|
|
||||||
## Mount the target file system
|
## Mount the target file system
|
||||||
# /target is created by the Ubiquity installer
|
# ${TARGETMOUNTPOINT} is created by the GUI/TUI installer
|
||||||
echo "...Mount /dev/mapper/${VGNAME}-${LVROOTNAME} on /target."
|
echo "...Mount /dev/mapper/${VGNAME}-${LVROOTNAME} on ${TARGETMOUNTPOINT}."
|
||||||
mount /dev/mapper/${VGNAME}-${LVROOTNAME} /target
|
mount /dev/mapper/${VGNAME}-${LVROOTNAME} ${TARGETMOUNTPOINT}
|
||||||
|
|
||||||
# And mount other directories
|
# And mount other directories
|
||||||
echo "...Mount all other dirs."
|
echo "...Mount all other dirs."
|
||||||
for n in proc sys dev etc/resolv.conf; do mount --rbind "/$n" "/target/$n"; done
|
for n in proc sys dev etc/resolv.conf; do mount --rbind "/$n" "${TARGETMOUNTPOINT}/$n"; done
|
||||||
|
|
||||||
# Change root and create the keyfile and ramfs image for Linux kernel.
|
# Change root and create the keyfile and ramfs image for Linux kernel.
|
||||||
echo "...Chroot to /target."
|
echo "...Chroot to ${TARGETMOUNTPOINT}."
|
||||||
cat <<HEREDOC | chroot /target /bin/bash
|
cat <<HEREDOC | chroot ${TARGETMOUNTPOINT} /bin/bash
|
||||||
# Mount the rest of partitions by target /etc/fstab
|
# Mount the rest of partitions by target /etc/fstab
|
||||||
mount -a
|
mount -a
|
||||||
|
|
||||||
|
|
@ -133,7 +136,7 @@ HEREDOC
|
||||||
|
|
||||||
# Unmount all
|
# Unmount all
|
||||||
echo "...Unmount all."
|
echo "...Unmount all."
|
||||||
umount -R /mnt/target
|
umount -R ${TARGETMOUNTPOINT}
|
||||||
|
|
||||||
# Finishing message
|
# Finishing message
|
||||||
cat <<HEREDOC
|
cat <<HEREDOC
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,9 @@ else
|
||||||
void-installer &
|
void-installer &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Record the PID of the installer.
|
||||||
|
installer_pid=$!
|
||||||
|
|
||||||
# Common part of the para-install.
|
# Common part of the para-install.
|
||||||
# Record the install PID, modify the /etc/default/grub of the target,
|
# Record the install PID, modify the /etc/default/grub of the target,
|
||||||
# and then, wait for the end of sintaller.
|
# and then, wait for the end of sintaller.
|
||||||
|
|
@ -99,17 +102,17 @@ source _parainstall.sh
|
||||||
# *******************************************************************************
|
# *******************************************************************************
|
||||||
|
|
||||||
## Mount the target file system
|
## Mount the target file system
|
||||||
# /mnt/target is created by the void-installer
|
# ${TARGETMOUNTPOINT} is created by the GUI/TUI installer
|
||||||
echo "...Mount /dev/mapper/${VGNAME}-${LVROOTNAME} on /mnt/target."
|
echo "...Mount /dev/mapper/${VGNAME}-${LVROOTNAME} on ${TARGETMOUNTPOINT}."
|
||||||
mount /dev/mapper/${VGNAME}-${LVROOTNAME} /mnt/target
|
mount /dev/mapper/${VGNAME}-${LVROOTNAME} ${TARGETMOUNTPOINT}
|
||||||
|
|
||||||
# And mount other directories
|
# And mount other directories
|
||||||
echo "...Mount all other dirs."
|
echo "...Mount all other dirs."
|
||||||
for n in proc sys dev etc/resolv.conf; do mount --rbind "/$n" "/mnt/target/$n"; done
|
for n in proc sys dev etc/resolv.conf; do mount --rbind "/$n" "${TARGETMOUNTPOINT}/$n"; done
|
||||||
|
|
||||||
# Change root and create the keyfile and ramfs image for Linux kernel.
|
# Change root and create the keyfile and ramfs image for Linux kernel.
|
||||||
echo "...Chroot to /target."
|
echo "...Chroot to ${TARGETMOUNTPOINT}."
|
||||||
cat <<HEREDOC | chroot /mnt/target /bin/bash
|
cat <<HEREDOC | chroot ${TARGETMOUNTPOINT} /bin/bash
|
||||||
# Mount the rest of partitions by target /etc/fstab
|
# Mount the rest of partitions by target /etc/fstab
|
||||||
mount -a
|
mount -a
|
||||||
|
|
||||||
|
|
@ -148,7 +151,7 @@ HEREDOC
|
||||||
|
|
||||||
# Unmount all
|
# Unmount all
|
||||||
echo "...Unmount all."
|
echo "...Unmount all."
|
||||||
umount -R /mnt/target
|
umount -R ${TARGETMOUNTPOINT}
|
||||||
|
|
||||||
# Finishing message
|
# Finishing message
|
||||||
cat <<HEREDOC
|
cat <<HEREDOC
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue