11 |
yes|y|true|1) use_sudo=sudo ;; |
yes|y|true|1) use_sudo=sudo ;; |
12 |
esac |
esac |
13 |
|
|
14 |
${use_sudo} /usr/sbin/hwinfo $@ |
LC_ALL=C ${use_sudo} /usr/sbin/hwinfo $@ |
15 |
} |
} |
16 |
|
|
17 |
# get_hwinfo $hw_item |
# get_hwinfo $hw_item |
187 |
return 1 |
return 1 |
188 |
fi |
fi |
189 |
|
|
190 |
${use_sudo} blkid -o value -s "${variable}" "${method}" "${partition}" |
LC_ALL=C ${use_sudo} blkid -o value -s "${variable}" "${method}" "${partition}" |
191 |
} |
} |
192 |
|
|
193 |
get_fstype() |
get_fstype() |
272 |
# convert to bytes |
# convert to bytes |
273 |
minimum_size=$(( ${minimum_size}*1024*1024 )) |
minimum_size=$(( ${minimum_size}*1024*1024 )) |
274 |
|
|
275 |
size=$(${use_sudo} fdisk -l ${device} | grep "Disk.*${device}" | sed 's:.*,\ \(.*\)\ byte.*:\1:') |
size=$(LC_ALL=C ${use_sudo} fdisk -l ${device} | grep "Disk.*${device}" | sed 's:.*,\ \(.*\)\ byte.*:\1:') |
276 |
[[ ${size} -ge ${minimum_size} ]] || return 1 |
[[ ${size} -ge ${minimum_size} ]] || return 1 |
277 |
|
|
278 |
return 0 |
return 0 |
291 |
is_mounted --location ${INSTALLROOT}/proc || mount -t proc proc ${INSTALLROOT}/proc |
is_mounted --location ${INSTALLROOT}/proc || mount -t proc proc ${INSTALLROOT}/proc |
292 |
is_mounted --location ${INSTALLROOT}/dev || mount -o bind /dev ${INSTALLROOT}/dev |
is_mounted --location ${INSTALLROOT}/dev || mount -o bind /dev ${INSTALLROOT}/dev |
293 |
|
|
294 |
${use_sudo} chroot ${INSTALLROOT} ${cmd} |
LC_ALL=C ${use_sudo} chroot ${INSTALLROOT} ${cmd} |
295 |
|
|
296 |
is_mounted --location ${INSTALLROOT}/dev && umount ${INSTALLROOT}/dev |
is_mounted --location ${INSTALLROOT}/dev && umount ${INSTALLROOT}/dev |
297 |
is_mounted --location ${INSTALLROOT}/proc && umount ${INSTALLROOT}/proc |
is_mounted --location ${INSTALLROOT}/proc && umount ${INSTALLROOT}/proc |