253 |
chroot="chrooted" |
chroot="chrooted" |
254 |
fi |
fi |
255 |
|
|
256 |
# get various modules needed to boot |
if [[ -x ${INSTALL_ROOT}/sbin/dracut ]] |
|
modules="$(get_driver_modules disk)" |
|
|
modules+=" $(get_driver_modules scsi)" |
|
|
modules+=" $(get_driver_modules cdrom)" |
|
|
|
|
|
# check for special ide_disk drivers (ata support) |
|
|
if [[ ! -z $(echo ${modules} | grep ide_disk) ]] |
|
257 |
then |
then |
258 |
modules+=" $(grep ide_disk /proc/modules | cut -d' ' -f4 | sed '/-/d;s:,:\ :g')" |
# simply run dracut |
259 |
fi |
${chroot} dracut -v -f ${initrd} ${kernel} |
260 |
|
else |
261 |
|
# get various modules needed to boot |
262 |
|
modules="$(get_driver_modules disk)" |
263 |
|
modules+=" $(get_driver_modules scsi)" |
264 |
|
modules+=" $(get_driver_modules cdrom)" |
265 |
|
|
266 |
# check for usb-storage and add usb host drivers |
# check for special ide_disk drivers (ata support) |
267 |
if [[ ! -z $(echo ${modules} | grep usb[_-]storage) ]] |
if [[ ! -z $(echo ${modules} | grep ide_disk) ]] |
268 |
then |
then |
269 |
# add usb1, usb1.1, usb2 and ubs3 hosts |
modules+=" $(grep ide_disk /proc/modules | cut -d' ' -f4 | sed '/-/d;s:,:\ :g')" |
270 |
modules+=" uhci-hcd ohci-hcd ehci-hcd xhci-hcd" |
fi |
271 |
fi |
|
272 |
|
# check for usb-storage and add usb host drivers |
273 |
|
if [[ ! -z $(echo ${modules} | grep usb[_-]storage) ]] |
274 |
|
then |
275 |
|
# add usb1, usb1.1, usb2 and ubs3 hosts |
276 |
|
modules+=" uhci-hcd ohci-hcd ehci-hcd xhci-hcd" |
277 |
|
fi |
278 |
|
|
279 |
# add some generic modules |
# add some generic modules |
280 |
modules+=" sg_mod sg loop sr_mod sd_mod ide-cd ide-cd_mod ide-disk" |
modules+=" sg_mod sg loop sr_mod sd_mod ide-cd ide-cd_mod ide-disk" |
281 |
|
|
282 |
# add generic framebuffer modules |
# add generic framebuffer modules |
283 |
if [[ ${framebuffer} = 1 ]] |
if [[ ${framebuffer} = 1 ]] |
284 |
then |
then |
285 |
modules+=" uvesafb" |
modules+=" uvesafb" |
286 |
|
|
287 |
# setup modprobe conf too |
# setup modprobe conf too |
288 |
[[ ! -d $(dirname ${uvesafb_config}) ]] && install -d $(dirname ${uvesafb_config}) |
[[ ! -d $(dirname ${uvesafb_config}) ]] && install -d $(dirname ${uvesafb_config}) |
289 |
cat > ${uvesafb_config} << EOF |
cat > ${uvesafb_config} << EOF |
290 |
# This file sets the parameters for uvesafb module. |
# This file sets the parameters for uvesafb module. |
291 |
# The following format should be used: |
# The following format should be used: |
292 |
# options uvesafb mode_option=<xres>x<yres>[-<bpp>][@<refresh>] scroll=<ywrap|ypan|redraw> ... |
# options uvesafb mode_option=<xres>x<yres>[-<bpp>][@<refresh>] scroll=<ywrap|ypan|redraw> ... |
295 |
# http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/fb/uvesafb.txt |
# http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/fb/uvesafb.txt |
296 |
# |
# |
297 |
EOF |
EOF |
298 |
# fix a issues with virtualbox and 'ywrap' |
# fix a issues with virtualbox and 'ywrap' |
299 |
if [[ ! -z $(hwinfo --bios | grep -i virtualbox) ]] |
if [[ ! -z $(hwinfo --bios | grep -i virtualbox) ]] |
300 |
then |
then |
301 |
# use redraw on virtualbox |
# use redraw on virtualbox |
302 |
echo "options uvesafb mode_option=1024x768-32@60 scroll=redraw" >> ${uvesafb_config} |
echo "options uvesafb mode_option=1024x768-32@60 scroll=redraw" >> ${uvesafb_config} |
303 |
else |
else |
304 |
# default config 1024x768 and 60 HZ |
# default config 1024x768 and 60 HZ |
305 |
echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" >> ${uvesafb_config} |
echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" >> ${uvesafb_config} |
306 |
|
fi |
307 |
fi |
fi |
|
fi |
|
308 |
|
|
309 |
# remove all duplicate modules |
# remove all duplicate modules |
310 |
modules="$(remove_duplicates ${modules})" |
modules="$(remove_duplicates ${modules})" |
311 |
|
|
312 |
# create the config and an initrd |
# create the config and an initrd |
313 |
echo "# autogenerated config file" > ${config} |
echo "# autogenerated config file" > ${config} |
314 |
echo "MODULES=\"${modules}\"" >> ${config} |
echo "MODULES=\"${modules}\"" >> ${config} |
315 |
echo "IMAGE_TYPE=\"initramfs\"" >> ${config} |
echo "IMAGE_TYPE=\"initramfs\"" >> ${config} |
316 |
|
|
317 |
${chroot} mkinitrd -f ${initrd} ${kernel} |
${chroot} mkinitrd -f ${initrd} ${kernel} |
318 |
|
fi |
319 |
} |
} |
320 |
|
|
321 |
chrooted() |
chrooted() |