Skip to content

Commit

Permalink
Should update osids to be able to use Windows 11 and Windows Server
Browse files Browse the repository at this point in the history
  • Loading branch information
mastacontrola committed Jun 20, 2024
1 parent c7f35d7 commit cfdfe82
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.download
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ preparePartitions() {
done
fi
;;
[5-7]|9)
[5-7]|[9-11])
[[ ! -d $imagePath && ! -f $imagePath/sys.img.000 ]] && handleError "Unable to locate image store ($0)\n Args Passed: $*"
sfdiskOriginalPartitionFileName "$imagePath" "1"
sfdiskLegacyOriginalPartitionFileName "$imagePath" "1"
Expand Down Expand Up @@ -245,7 +245,7 @@ putDataBack() {
[1-2])
[[ ! -f $imagePath && ! -d $imagePath ]] && handleError "Fatal Error: Could not locate file ($0)\n Args Passed: $*"
;;
[5-7]|9)
[5-7]|[9-11])
[[ ! -d $imagePath && ! -f $imagePath/sys.img.000 ]] && handleError "Fatal Error: Could not locate file ($0)\n Args Passed: $*"
;;
4|50|51)
Expand Down
4 changes: 2 additions & 2 deletions Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.upload
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ beginUpload() {
parts=""
getPartitions "$hd"
[[ ${#parts} -lt 1 ]] && handleError "No partitions found ($0)\n Args Passed: $*"
[[ $osid == @([1-2]|[4-7]|9) ]] && win7partcnt=$(echo $parts | wc -w)
[[ $osid == @([1-2]|[4-7]|[9-11]) ]] && win7partcnt=$(echo $parts | wc -w)
dots "Checking for fixed partitions"
part_number=0
for part in $parts; do
Expand Down Expand Up @@ -83,7 +83,7 @@ beginUpload() {
echo " * Total Partition count of: $partscnt"
debugPause
case $osid in
[4-7]|9|50|51)
[4-7]|[9-11]|50|51)
echo " * Setting up any additional fixed parts"
part_number=0
for part in $parts; do
Expand Down
26 changes: 17 additions & 9 deletions Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ verifyNetworkConnection() {
}
# Verifies that the OS is valid for resizing
validResizeOS() {
[[ $osid != @([1-2]|4|[5-7]|9|50|51) ]] && handleError " * Invalid operating system id: $osname ($osid) (${FUNCNAME[0]})\n Args Passed: $*"
[[ $osid != @([1-2]|4|[5-7]|[9-11]|50|51) ]] && handleError " * Invalid operating system id: $osname ($osid) (${FUNCNAME[0]})\n Args Passed: $*"
}
# Gets the information from the system for inventory
doInventory() {
Expand Down Expand Up @@ -665,7 +665,7 @@ shrinkPartition() {
resizePartition "$part" "$(calculate "$sizentfsresize*1024")" "$imagePath"
[[ $osid -eq 2 ]] && correctVistaMBR "$disk"
;;
[5-7]|9)
[5-7]|[9-11])
[[ $part_number -eq $win7partcnt ]] && part_start=$(blkid -po udev $part 2>/dev/null | awk -F= '/PART_ENTRY_OFFSET=/{printf("%.0f\n",$2*'$part_block_size'/1000)}') || part_start=1048576
if [[ -z $part_start || $part_start -lt 1 ]]; then
echo "Failed"
Expand Down Expand Up @@ -921,7 +921,7 @@ getValidRestorePartitions() {
[1-2])
[[ ! -f $imagePath ]] && imgpart="$imagePath/d${disk_number}p${part_number}.img${split}" || imgpart="$imagePath"
;;
4|[5-7]|9)
4|[5-7]|[9-11])
[[ ! -f $imagePath/sys.img.000 ]] && imgpart="$imagePath/d${disk_number}p${part_number}.img${split}"
if [[ -z $imgpart ]]; then
case $win7partcnt in
Expand Down Expand Up @@ -1051,7 +1051,7 @@ changeHostname() {
1)
regfile="$REG_LOCAL_MACHINE_XP"
;;
2|4|[5-7]|9)
2|4|[5-7]|[9-11])
regfile="$REG_LOCAL_MACHINE_7"
;;
esac
Expand Down Expand Up @@ -1208,7 +1208,7 @@ clearMountedDevices() {
esac
fi
case $osid in
4|[5-7]|9)
4|[5-7]|[9-11])
local fstype=""
fsTypeSetting "$part"
REG_HOSTNAME_MOUNTED_DEVICES_7="\MountedDevices"
Expand Down Expand Up @@ -1268,7 +1268,7 @@ removePageFile() {
fsTypeSetting "$part"
[[ ! $ignorepg -eq 1 ]] && return
case $osid in
[1-2]|4|[5-7]|[9]|50|51)
[1-2]|4|[5-7]|[9-11]|50|51)
case $fstype in
ntfs)
dots "Mounting partition ($part)"
Expand Down Expand Up @@ -1381,6 +1381,14 @@ determineOS() {
osname="Windows 10"
mbrfile=""
;;
10)
osname="Windows 11"
mbrfile=""
;;
11)
osname="Windows Server"
mbrfile=""
;;
50)
osname="Linux"
mbrfile=""
Expand Down Expand Up @@ -1589,7 +1597,7 @@ completeTasking() {
. ${postdownpath}fog.postdownload
fi
[[ $capone -eq 1 ]] && exit 0
if [[ $osid == +([1-2]|4|[5-7]|9) ]]; then
if [[ $osid == +([1-2]|4|[5-7]|[9-11]) ]]; then
for disk in $disks; do
getPartitions "$disk"
for part in $parts; do
Expand Down Expand Up @@ -1716,7 +1724,7 @@ handleError() {
# Linux:
if [[ -n $2 ]]; then
case $osid in
[1-2]|4|[5-7]|9|50|51)
[1-2]|4|[5-7]|[9-11]|50|51)
if [[ -n "$hd" ]]; then
getPartitions "$hd"
for part in $parts; do
Expand Down Expand Up @@ -2367,7 +2375,7 @@ restorePartition() {
4|8|50|51|99)
imgpart="$imagePath/d${disk_number}p${part_number}.img${split}"
;;
[5-7]|9)
[5-7]|[9-11])
[[ ! -f $imagePath/sys.img.000 ]] && imgpart="$imagePath/d${disk_number}p${part_number}.img${split}"
if [[ -z $imgpart ]] ;then
[[ -r $imagePath/sys.img.000 ]] && win7partcnt=1
Expand Down

0 comments on commit cfdfe82

Please sign in to comment.