usbinstall.sh: create EFI boot partition (preliminary work); set boot flags for openmamba_live partition
This commit is contained in:
parent
b0a5bd0c29
commit
9a46459efc
@ -230,7 +230,7 @@ if [ "$CONFIRM" = "1" ]; then
|
|||||||
echo $"Warning: You are going to format this device ($1). Are you sure to continue? [yes/no]"
|
echo $"Warning: You are going to format this device ($1). Are you sure to continue? [yes/no]"
|
||||||
read KEY
|
read KEY
|
||||||
case "$KEY" in
|
case "$KEY" in
|
||||||
$yes)
|
$"yes"|"Y"|"y")
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
errorAndExit $"Installation aborted"
|
errorAndExit $"Installation aborted"
|
||||||
@ -240,11 +240,23 @@ fi
|
|||||||
|
|
||||||
set_status $"Partitioning $SELECT_USB..."
|
set_status $"Partitioning $SELECT_USB..."
|
||||||
echo $"Partitioning $SELECT_USB..."
|
echo $"Partitioning $SELECT_USB..."
|
||||||
sudo parted $SELECT_USB mktable msdos -s &>>$LOGFILE
|
# Start from a new partition table
|
||||||
|
sudo parted -s $SELECT_USB mktable msdos &>>$LOGFILE
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
errorAndExit $"Error:"" \"parted\" "$"exit with error (see $LOGFILE)"
|
errorAndExit $"Error:"" \"parted\" "$"exit with error (see $LOGFILE)"
|
||||||
fi
|
fi
|
||||||
sudo parted -s -- $SELECT_USB mkpart primary ext4 0 -1 &>>$LOGFILE
|
# EFI partition
|
||||||
|
sudo parted -s -- $SELECT_USB mkpart primary fat32 0 20M &>>$LOGFILE
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
errorAndExit $"Error:"" \"parted\" "$"exit with error (see $LOGFILE)"
|
||||||
|
fi
|
||||||
|
# openmamba partition
|
||||||
|
sudo parted -s -- $SELECT_USB mkpart primary ext4 20M -1 &>>$LOGFILE
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
errorAndExit $"Error:"" \"parted\" "$"exit with error (see $LOGFILE)"
|
||||||
|
fi
|
||||||
|
# boot flag on openmamba partition
|
||||||
|
sudo parted -s -- $SELECT_USB set 2 boot on &>>$LOGFILE
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
errorAndExit $"Error:"" \"parted\" "$"exit with error (see $LOGFILE)"
|
errorAndExit $"Error:"" \"parted\" "$"exit with error (see $LOGFILE)"
|
||||||
fi
|
fi
|
||||||
@ -253,21 +265,24 @@ set_pbar 5
|
|||||||
|
|
||||||
set_status $"Formatting $SELECT_USB..."
|
set_status $"Formatting $SELECT_USB..."
|
||||||
echo $"Formatting $SELECT_USB..."
|
echo $"Formatting $SELECT_USB..."
|
||||||
sudo mkfs.ext4 ${SELECT_USB}1 -L openmamba_live &>>$LOGFILE
|
sudo mkfs.vfat ${SELECT_USB}1 -n EFI &>>$LOGFILE
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
errorAndExit $"Error:"" \"mkfs.vfat\" "$"exit with error (see $LOGFILE)"
|
||||||
|
fi
|
||||||
|
sudo mkfs.ext4 ${SELECT_USB}2 -L openmamba_live &>>$LOGFILE
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
errorAndExit $"Error:"" \"mkfs.ext4\" "$"exit with error (see $LOGFILE)"
|
errorAndExit $"Error:"" \"mkfs.ext4\" "$"exit with error (see $LOGFILE)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
LANG=C udisks --mount ${SELECT_USB}1 &>>$LOGFILE
|
LANG=C udisks --mount ${SELECT_USB}2 &>>$LOGFILE
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
errorAndExit $"Error:"" \"udisks --mount\" "$"exit with error (see $LOGFILE)"
|
errorAndExit $"Error:"" \"udisks --mount\" "$"exit with error (see $LOGFILE)"
|
||||||
fi
|
fi
|
||||||
set_pbar 30
|
set_pbar 30
|
||||||
|
|
||||||
|
|
||||||
# Riceve la mountdir della chiavetta da dbus
|
# Riceve la mountdir della chiavetta da dbus
|
||||||
MOUNTDIR=`dbus_properties_get_stringlist org.freedesktop.UDisks /org/freedesktop/UDisks/devices/${SELECT_USB/*\/}1 \
|
MOUNTDIR=`dbus_properties_get_stringlist org.freedesktop.UDisks /org/freedesktop/UDisks/devices/${SELECT_USB/*\/}2 \
|
||||||
org.freedesktop.UDisks.Device DeviceMountPaths`
|
org.freedesktop.UDisks.Device DeviceMountPaths`
|
||||||
|
|
||||||
if [ ! -d "$MOUNTDIR" ]; then
|
if [ ! -d "$MOUNTDIR" ]; then
|
||||||
@ -316,8 +331,8 @@ set_pbar 98
|
|||||||
|
|
||||||
set_status $"Unmount usb device"
|
set_status $"Unmount usb device"
|
||||||
echo $"Unmount usb device"
|
echo $"Unmount usb device"
|
||||||
LANG=C udisks --unmount ${SELECT_USB}1 | grep failed && {
|
LANG=C udisks --unmount ${SELECT_USB}2 | grep failed && {
|
||||||
errorAndExit $"Error: fail to umount the usb key (${SELECT_USB}1)"
|
errorAndExit $"Error: fail to umount the usb key (${SELECT_USB}2)"
|
||||||
}
|
}
|
||||||
set_pbar 100
|
set_pbar 100
|
||||||
exit_frontend ""
|
exit_frontend ""
|
||||||
|
Loading…
Reference in New Issue
Block a user