95 |
fsck.minix fsfreeze fstrim mkfs mkfs.bfs mkfs.cramfs raw sfdisk swaplabel wipefs || die |
fsck.minix fsfreeze fstrim mkfs mkfs.bfs mkfs.cramfs raw sfdisk swaplabel wipefs || die |
96 |
zapmost ${BINDIR}/usr/sbin addpart delpart fdformat ldattach partx rtcwake tunelp uuidd || die |
zapmost ${BINDIR}/usr/sbin addpart delpart fdformat ldattach partx rtcwake tunelp uuidd || die |
97 |
} |
} |
98 |
|
|
99 |
|
postinstall() |
100 |
|
{ |
101 |
|
# upgrade fstab to use UUIDs |
102 |
|
if [[ -z $(grep UUID /etc/fstab) ]] |
103 |
|
then |
104 |
|
echo "Upgrading '/etc/fstab' to use UUIDs" |
105 |
|
|
106 |
|
# backup fstab and clear it |
107 |
|
cp -f /etc/fstab{,.alx-backup} |
108 |
|
:> /etc/fstab |
109 |
|
|
110 |
|
# update fstab to use UUIDS |
111 |
|
while read device mountpoint filesystem options check |
112 |
|
do |
113 |
|
case "${mountpoint}" in |
114 |
|
"/"|"/boot") |
115 |
|
# reset |
116 |
|
UUID="" |
117 |
|
# get uuid |
118 |
|
eval $(blkid "${device}" | grep "${device}:" | sed 's/.*:.*UUID=\(.*\).*TYPE.*/UUID="\1"/;s:\ ::g') |
119 |
|
echo " '${device}' ==> UUID='${UUID}'" |
120 |
|
echo "UUID=${UUID} ${mountpoint} ${filesystem} ${options} ${check}" >> /etc/fstab |
121 |
|
;; |
122 |
|
*) |
123 |
|
echo "${device} ${mountpoint} ${filesystem} ${options} ${check}" >> /etc/fstab |
124 |
|
;; |
125 |
|
esac |
126 |
|
done < /etc/fstab.alx-backup |
127 |
|
else |
128 |
|
echo "No fstab upgrade required, '/etc/fstab' is already using UUIDs" |
129 |
|
fi |
130 |
|
} |