标签:check 鼠标 text 驱动 content 释放 备份 ubi ref
完整自制尚不方便,还有许多改进的地方.
现在可以达到在单硬盘,无救援模式的情况下安装Winodws.
再也不需要强制要求内存大于镜像包大小了.
本例所给的wget后链接均可用,教程是完整的.
(原文链接:https://moeclub.org/2017/08/31/361/)
环境 DigitalOcean 512M Debian8 x64
目标 Windows Think PC (Windows 7 Embedded)
以下步骤在DigitalOcean上测试成功:
\sources\install.wim
gzip.exe -k9 D:\win.vhd
.等待压缩完成.
1
|
wget -qO /boot/mini.iso https://moeclub.org/get-deb-livecd
|
1
2
3
4
5
6
|
menuentry "Boot mini" {
set isoimage="/boot/mini.iso"
loopback loop (hd0,1)$isoimage
linux (loop)/linux auto=true LANG=en_US.UTF-8 KEYTABLE=us netcfg/dhcp_options="Configure network manually" netcfg/dhcp_failed=note netcfg/get_nameservers=8.8.8.8 hostname=MoeClub domain=MoeClub.org -- quiet
initrd (loop)/initrd.gz
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
DEFAULTNET="$(ip route show |grep -o ‘default via [0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.*‘ |head -n1 |sed ‘s/proto.*\|onlink.*//g‘ |awk ‘{print $NF}‘)"
[ -n "$DEFAULTNET" ] && IPSUB="$(ip addr |grep ‘‘${DEFAULTNET}‘‘ |grep ‘global‘ |grep ‘brd‘ |head -n1 |grep -o ‘[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}/[0-9]\{1,2\}‘)"
IPv4="$(echo -n "$IPSUB" |cut -d‘/‘ -f1)"
NETSUB="$(echo -n "$IPSUB" |grep -o ‘/[0-9]\{1,2\}‘)"
GATE="$(ip route show |grep -o ‘default via [0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}‘ |head -n1 |grep -o ‘[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}‘)"
[ -n "$NETSUB" ] && MASK="$(echo -n ‘128.0.0.0/1,192.0.0.0/2,224.0.0.0/3,240.0.0.0/4,248.0.0.0/5,252.0.0.0/6,254.0.0.0/7,255.0.0.0/8,255.128.0.0/9,255.192.0.0/10,255.224.0.0/11,255.240.0.0/12,255.248.0.0/13,255.252.0.0/14,255.254.0.0/15,255.255.0.0/16,255.255.128.0/17,255.255.192.0/18,255.255.224.0/19,255.255.240.0/20,255.255.248.0/21,255.255.252.0/22,255.255.254.0/23,255.255.255.0/24,255.255.255.128/25,255.255.255.192/26,255.255.255.224/27,255.255.255.240/28,255.255.255.248/29,255.255.255.252/30,255.255.255.254/31,255.255.255.255/32‘ |grep -o ‘[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}‘${NETSUB}‘‘ |cut -d‘/‘ -f1)"
[ -n "$GATE" ] && [ -n "$MASK" ] && [ -n "$IPv4" ] || {
ipNum() {
local IFS=‘.‘
read ip1 ip2 ip3 ip4 <<<"$1"
echo $((ip1*(1<<24)+ip2*(1<<16)+ip3*(1<<8)+ip4))
}
SelectMax(){
ii=0
for IPITEM in `route -n |awk -v OUT=$1 ‘{print $OUT}‘ |grep ‘[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}‘`
do
NumTMP="$(ipNum $IPITEM)"
eval "arrayNum[$ii]=‘$NumTMP,$IPITEM‘"
ii=$[$ii+1]
done
echo ${arrayNum[@]} |sed ‘s/\s/\n/g‘ |sort -n -k 1 -t ‘,‘ |tail -n1 |cut -d‘,‘ -f2
}
[[ -z $IPv4 ]] && IPv4="$(ifconfig |grep ‘Bcast‘ |head -n1 |grep -o ‘[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}‘ |head -n1)"
[[ -z $GATE ]] && GATE="$(SelectMax 2)"
[[ -z $MASK ]] && MASK="$(SelectMax 3)"
}
PubIPv4="$(wget -qO- checkip.amazonaws.com)"
[ -n "$IPv4" ] && [ -n "$PubIPv4" ] && {
[ "$IPv4" != "$PubIPv4" ] && IPv4="$(echo "$IPv4; $PubIPv4")"
}
[ -n "$GATE" ] && [ -n "$MASK" ] && [ -n "$IPv4" ] && {
echo -e "IPv4:\t\033[33m$IPv4\033[0m\nMASK:\t\033[33m$MASK\033[0m\nGATE:\t\033[33m$GATE\033[0m"
} || {
echo "Error! Not found network config. "
}
|
Download debconf preconfiguration file
Execute a shell
Configure the network
Download debconf preconfiguration file
Execute a shell
ls /dev
命令可查看硬盘状况
1
|
wget -qO- https://moeclub.org/get-win7embx86 |gunzip -dc |dd of=/dev/vda
|
提示:在安装步骤时鼠标位置不好找,可能不太适应.
请尝试使用空格键
回车键
Tab键
方向键
进行操作.
1
|
wget -qO- https://moeclub.org/get-win8.1embx86 |gunzip -dc |dd of=/dev/vda
|
[转]从零开始:在Linux上覆盖安装WINDOWS通用教程(dd)
标签:check 鼠标 text 驱动 content 释放 备份 ubi ref
原文地址:http://www.cnblogs.com/ccuc/p/7497489.html